/* InFlow demo — wisprflow-inspired voice translation widget. */

.demo {
  background: var(--bg-elev-1);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  padding: 36px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.demo::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 300px at 30% -10%, rgba(124, 58, 237, 0.18), transparent 60%),
    radial-gradient(500px 250px at 90% 100%, rgba(37, 99, 235, 0.14), transparent 60%);
  pointer-events: none;
}

.demo > * { position: relative; }

.demo-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 24px;
}
.demo-tag {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #B7A2FF;
  background: rgba(124, 58, 237, 0.18);
  padding: 6px 12px;
  border-radius: var(--r-full);
}
.demo-title {
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.01em;
}

/* Language picker row */
.demo-langs {
  display: flex; align-items: center; justify-content: center;
  gap: 18px; flex-wrap: wrap;
  margin-bottom: 28px;
  font-size: 14px;
  color: var(--text-muted);
}
.demo-langs label {
  display: inline-flex; align-items: center; gap: 10px;
}
.demo-lang-pill {
  /* Custom-styled native <select> — no extra JS, native-friendly,
     keyboard-accessible. Brand-purple focus ring + custom chevron. */
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-weight: 500;
  padding: 9px 32px 9px 14px;
  background-color: var(--bg-elev-2);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='none' stroke='%237C3AED' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
.demo-lang-pill:hover {
  border-color: rgba(124, 58, 237, 0.55);
  transform: translateY(-1px);
}
.demo-lang-pill:focus {
  outline: none;
  border-color: rgba(124, 58, 237, 0.85);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.22);
}
.demo-lang-arrow {
  color: var(--text-dim);
  font-size: 18px;
  font-weight: 400;
}

/* Output card */
.demo-output {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  min-height: 180px;
  margin-bottom: 24px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.demo-output.placeholder {
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
}
.demo-output-meta {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
}

/* Big record button */
.demo-record {
  display: flex; align-items: center; justify-content: center;
  margin: 28px 0;
}
.demo-record-btn {
  width: 84px; height: 84px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--accent-grad);
  color: white;
  display: flex; align-items: center; justify-content: center;
  box-shadow:
    0 12px 36px rgba(124, 58, 237, 0.45),
    0 0 0 0 rgba(124, 58, 237, 0.45);
  transition: transform .15s ease, box-shadow .25s ease;
  position: relative;
}
.demo-record-btn:hover { transform: scale(1.04); }
.demo-record-btn.recording {
  background: #ef4444;
  animation: pulse-red 1.4s infinite;
}
@keyframes pulse-red {
  0%   { box-shadow: 0 12px 36px rgba(239, 68, 68, 0.45), 0 0 0 0 rgba(239, 68, 68, 0.45); }
  70%  { box-shadow: 0 12px 36px rgba(239, 68, 68, 0.45), 0 0 0 22px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 12px 36px rgba(239, 68, 68, 0.45), 0 0 0 0 rgba(239, 68, 68, 0); }
}
.demo-record-btn svg {
  width: 30px; height: 30px;
  display: block;        /* removes inline-baseline whitespace */
}

.demo-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 12px;
}

/* Waveform / activity bars while recording */
.demo-waveform {
  display: none;
  align-items: end;
  justify-content: center;
  gap: 4px;
  height: 56px;
  margin: 18px 0 0;
}
.demo-waveform.recording { display: flex; }
.demo-waveform span {
  display: block;
  width: 4px;
  background: linear-gradient(to top, #2563EB, #8B5CF6);
  border-radius: 2px;
  animation: bar 1.0s ease-in-out infinite;
}
.demo-waveform span:nth-child(1)  { animation-delay: 0.00s; }
.demo-waveform span:nth-child(2)  { animation-delay: 0.08s; }
.demo-waveform span:nth-child(3)  { animation-delay: 0.16s; }
.demo-waveform span:nth-child(4)  { animation-delay: 0.24s; }
.demo-waveform span:nth-child(5)  { animation-delay: 0.32s; }
.demo-waveform span:nth-child(6)  { animation-delay: 0.40s; }
.demo-waveform span:nth-child(7)  { animation-delay: 0.48s; }
.demo-waveform span:nth-child(8)  { animation-delay: 0.40s; }
.demo-waveform span:nth-child(9)  { animation-delay: 0.32s; }
.demo-waveform span:nth-child(10) { animation-delay: 0.24s; }
.demo-waveform span:nth-child(11) { animation-delay: 0.16s; }
.demo-waveform span:nth-child(12) { animation-delay: 0.08s; }
@keyframes bar {
  0%, 100% { height: 6px; }
  50%      { height: 48px; }
}

/* Footer note */
.demo-footnote {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}
.demo-footnote a { color: #B7A2FF; }

/* In-flight dots while waiting on Whisper + Llama. */
.demo-dots {
  display: inline-flex; gap: 8px; align-items: center;
  margin: 0 auto;
}
.demo-dots span {
  width: 9px; height: 9px;
  background: linear-gradient(135deg, #2563EB, #7C3AED);
  border-radius: 50%;
  opacity: 0.35;
  animation: demoDots 1.1s ease-in-out infinite;
}
.demo-dots span:nth-child(2) { animation-delay: 0.18s; }
.demo-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes demoDots {
  0%, 100% { transform: translateY(0);   opacity: 0.35; }
  50%      { transform: translateY(-6px); opacity: 1.0;  }
}

/* Typewriter result — fading caret follows the last character. */
.demo-typed {
  font-size: 18px;
  line-height: 1.5;
  font-weight: 500;
}
.demo-typed::after {
  content: '';
  display: inline-block;
  width: 2px; height: 1.05em;
  background: #7C3AED;
  margin-left: 2px;
  vertical-align: -2px;
  animation: demoCaret 0.85s steps(1) infinite;
}
@keyframes demoCaret {
  50% { opacity: 0; }
}

/* =========================================================================
   Interactive text-mode demos (Select & Translate + Guided Reply).
   Built on top of .feat-mock / .feat-traffic chrome so the look matches
   the static feature mockups in the rest of the page. Native macOS feel:
   dark window, traffic lights, system fonts, proper kbd pills, gradient
   primary CTA.
   ========================================================================= */

.section-livedemo {
  padding: 96px 0;
  background:
    radial-gradient(720px 360px at 20% 0%, rgba(124, 58, 237, 0.10), transparent 60%),
    radial-gradient(540px 280px at 95% 100%, rgba(37, 99, 235, 0.08), transparent 60%);
}

.livedemo-header {
  text-align: center;
  margin-bottom: 40px;
}
.livedemo-header .section-eyebrow { color: #B7A2FF; }
.livedemo-header .section-title { margin-top: 8px; }
.livedemo-header .section-sub { max-width: 640px; margin: 14px auto 0; }

/* Two-column on desktop, stacked on narrow screens. */
.livedemo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr);
  gap: 36px;
  align-items: stretch;
}
@media (max-width: 920px) {
  .livedemo-grid { grid-template-columns: 1fr; }
}

/* ── Stage (left column): the Mac window with the source content ──── */
.livedemo-stage { display: flex; }
.livedemo-stage .feat-mock {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.livedemo-body {
  padding: 22px 26px 26px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 320px;
}

/* Selectable email content. Selection uses the brand gradient. */
.livedemo-email {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}
.livedemo-email p {
  margin: 0 0 12px;
}
.livedemo-email p:last-child {
  margin-bottom: 0;
}
.livedemo-email ::selection {
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.5), rgba(37, 99, 235, 0.5));
  color: #fff;
}
.livedemo-email ::-moz-selection {
  background: rgba(124, 58, 237, 0.5);
  color: #fff;
}

/* The translation result lands inside the Mac window, styled like
   the static .feat-email-translated card so the visual transition
   from "input email" to "translation" feels native. */
.livedemo-result {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  padding: 14px 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.16), rgba(37, 99, 235, 0.10));
  border-left: 3px solid #7C3AED;
  white-space: pre-wrap;
  position: relative;
}
.livedemo-result .livedemo-result-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #B7A2FF;
  background: rgba(124, 58, 237, 0.18);
  padding: 3px 8px;
  border-radius: var(--r-full);
  margin-bottom: 8px;
}
.livedemo-result.is-loading {
  background: rgba(255, 255, 255, 0.04);
  border-left-color: rgba(255, 255, 255, 0.16);
}

/* Loading dots reused from the voice demo. */
.livedemo-result .demo-dots { padding: 4px 0; }

/* Chat bubbles for the Guided Reply variant. */
.livedemo-body-chat {
  background:
    linear-gradient(180deg, rgba(124, 58, 237, 0.04), transparent 30%);
  gap: 18px;
}
.livedemo-bubble {
  max-width: 88%;
  font-size: 14px;
  line-height: 1.5;
  padding: 12px 14px;
  border-radius: 14px;
  position: relative;
}
.livedemo-bubble-in {
  align-self: flex-start;
  background: var(--bg-elev-2);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}
.livedemo-bubble-out {
  align-self: flex-end;
  background: linear-gradient(135deg, #2563EB, #7C3AED);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.livedemo-bubble-sender {
  font-size: 11px;
  font-weight: 700;
  color: #7C3AED;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}
.livedemo-bubble-result.is-loading {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
.livedemo-bubble-result .livedemo-result-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.18);
  padding: 3px 8px;
  border-radius: var(--r-full);
  margin-bottom: 6px;
}

/* ── Controls (right column): instructions + CTA ──────────────────── */
.livedemo-controls {
  background: var(--bg-elev-1);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.livedemo-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.livedemo-steps li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  align-items: start;
}
.livedemo-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563EB, #7C3AED);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.livedemo-steps strong {
  display: block;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}
.livedemo-steps p,
.livedemo-step-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}
.livedemo-steps strong + p {
  margin-top: 0;
}

/* Language picker — styled to look native. */
.livedemo-lang-row { margin-top: 10px; }
.livedemo-lang {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 32px 8px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%238E8FA3' stroke-width='1.5' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.livedemo-lang:focus {
  outline: 2px solid rgba(124, 58, 237, 0.45);
  outline-offset: 1px;
}

/* Intent textarea for the reply demo. */
.livedemo-textarea {
  width: 100%;
  margin-top: 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  font-family: inherit;
  resize: vertical;
  min-height: 70px;
}
.livedemo-textarea:focus {
  outline: 2px solid rgba(124, 58, 237, 0.45);
  outline-offset: 1px;
}

/* Chord pill + CTA row. The chord uses the same kbd styling as the
   feature sections' .feature-chord. The CTA is a proper gradient
   button with a clear label — no kbd-inside-button hybrid. */
.livedemo-action {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.livedemo-chord {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.livedemo-chord kbd {
  font-family: 'SF Pro Text', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--text);
  letter-spacing: 0.02em;
  min-width: 26px;
  text-align: center;
}

.livedemo-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #2563EB, #7C3AED);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(124, 58, 237, 0.34);
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}
.livedemo-cta:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(124, 58, 237, 0.45);
}
.livedemo-cta:active:not(:disabled) {
  transform: translateY(0);
}
.livedemo-cta:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.livedemo-cta svg { flex-shrink: 0; }

.livedemo-footnote {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
