/* =========================================================================
   InFlow live demo showcase — 5 feature tabs.

   ALL styles in this file are namespaced under .lx-* so nothing in the rest
   of the site can collide. Palette is HARDCODED (no CSS-var dependency) so
   the showcase looks the same whether the user is on light or dark mode —
   the macOS app itself doesn't switch palettes, so neither should this.

   Mobile-first responsive: single-column under 880px, tabs scroll
   horizontally with snap, all tap targets ≥ 44 px tall.
   ========================================================================= */

:root {
  --lx-bg:        #0E1020;
  --lx-bg-2:      #181B30;
  --lx-bg-3:      #232742;
  --lx-line:      rgba(255, 255, 255, 0.10);
  --lx-line-2:    rgba(255, 255, 255, 0.16);
  --lx-text:      #F4F4FA;
  --lx-mute:      #A8AAC0;
  --lx-dim:       #6E7090;
  --lx-accent:    #8B5CF6;
  --lx-accent-2:  #2563EB;
  --lx-grad:      linear-gradient(135deg, #2563EB 0%, #7C3AED 60%, #A78BFA 100%);
  --lx-tag-bg:    rgba(124, 58, 237, 0.20);
  --lx-tag-fg:    #C5B3FF;
}

/* -------------------------------------------------------------------------
   Section frame
   ------------------------------------------------------------------------- */
.lx-section {
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(124, 58, 237, 0.18), transparent 60%),
    radial-gradient(700px 400px at 95% 110%, rgba(37, 99, 235, 0.16), transparent 60%),
    linear-gradient(180deg, var(--lx-bg) 0%, var(--lx-bg-2) 100%);
  color: var(--lx-text);
  padding: 96px 24px;
}
@media (max-width: 720px) { .lx-section { padding: 64px 16px; } }

.lx-container {
  max-width: 1180px;
  margin: 0 auto;
  position: relative;
}

.lx-eyebrow {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--lx-tag-fg);
  background: var(--lx-tag-bg);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.lx-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  color: var(--lx-text);
  line-height: 1.15;
}
.lx-sub {
  font-size: 16px;
  color: var(--lx-mute);
  margin: 0 0 32px;
  max-width: 620px;
  line-height: 1.55;
}
.lx-demo-eu {
  font-size: 13px;
  color: var(--lx-mute);
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid rgba(124, 58, 237, 0.22);
  border-radius: 10px;
  padding: 10px 14px;
  margin: -12px 0 28px;
  max-width: 620px;
  line-height: 1.55;
}
.lx-demo-eu a {
  color: rgb(167, 139, 250);
  text-decoration: none;
  border-bottom: 1px solid rgba(124, 58, 237, 0.35);
}

/* -------------------------------------------------------------------------
   Tabs — horizontally scrollable on mobile with an edge-fade + chevron
   hint that surfaces only when there's content out of view to the right.
   The wrap is the positioning context; .lx-tabs is the scroller.
   ------------------------------------------------------------------------- */
.lx-tabs-wrap {
  position: relative;
  margin-bottom: 28px;
}
.lx-tabs {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--lx-line);
  border-radius: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
}
.lx-tabs::-webkit-scrollbar { display: none; }

/* Right-edge fade that visually says "there's more this way". Sits on
   top of the scroller, ignores pointer events so it doesn't eat taps. */
.lx-tabs-fade {
  position: absolute;
  top: 1px; right: 1px; bottom: 1px;
  width: 56px;
  pointer-events: none;
  border-top-right-radius: 13px;
  border-bottom-right-radius: 13px;
  background: linear-gradient(
    to right,
    rgba(14, 16, 32, 0) 0%,
    rgba(14, 16, 32, 0.85) 70%,
    rgba(14, 16, 32, 0.95) 100%
  );
  opacity: 1;
  transition: opacity 220ms ease;
}
.lx-tabs-wrap.is-end .lx-tabs-fade { opacity: 0; }

/* Chevron arrow on the right edge. Tappable on mobile (44 px target)
   so users who DO notice it can jump forward without swiping. Hidden
   on hover-capable wide screens because the cursor doesn't need a
   nudge there. */
.lx-tabs-arrow {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--lx-line-2);
  background: var(--lx-bg-3);
  color: var(--lx-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  opacity: 1;
  transition: opacity 220ms ease, transform 220ms ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.30);
}
.lx-tabs-arrow:hover { transform: translateY(-50%) scale(1.06); }
.lx-tabs-wrap.is-end .lx-tabs-arrow {
  opacity: 0;
  pointer-events: none;
}
/* Gentle nudge animation on first paint so the arrow grabs attention.
   Fires once via animation-iteration-count: 3, then settles. */
.lx-tabs-arrow {
  animation: lxNudge 1.6s ease-in-out 3;
}
@keyframes lxNudge {
  0%, 70%, 100% { transform: translateY(-50%) translateX(0); }
  80%           { transform: translateY(-50%) translateX(4px); }
  90%           { transform: translateY(-50%) translateX(0); }
}

/* On wide screens where everything fits at once, hide both hints. The
   JS will also hide them at runtime; this is a fallback for no-JS. */
@media (min-width: 900px) {
  .lx-tabs-fade,
  .lx-tabs-arrow { display: none; }
}

.lx-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--lx-mute);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  scroll-snap-align: start;
  transition: color 120ms ease, background 120ms ease, transform 120ms ease;
  min-height: 40px;
}
.lx-tab:hover { color: var(--lx-text); background: rgba(255, 255, 255, 0.04); }
.lx-tab.is-active {
  color: #fff;
  background: var(--lx-grad);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.30);
}
.lx-tab-emoji { font-size: 15px; line-height: 1; }

/* -------------------------------------------------------------------------
   Pane (one per feature)
   ------------------------------------------------------------------------- */
.lx-pane[hidden] { display: none !important; }

.lx-pane {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  gap: 28px;
  align-items: stretch;
  animation: lxFade 280ms ease;
}
@keyframes lxFade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (max-width: 880px) {
  .lx-pane { grid-template-columns: 1fr; }
}

/* -------------------------------------------------------------------------
   Mac window mockup (stage)
   ------------------------------------------------------------------------- */
.lx-mac {
  background: var(--lx-bg-2);
  border: 1px solid var(--lx-line-2);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.40),
    0 4px 12px rgba(0, 0, 0, 0.20);
  display: flex;
  flex-direction: column;
  min-height: 380px;
}
.lx-mac-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px;
  background: linear-gradient(180deg, #1F2237, #1A1D30);
  border-bottom: 1px solid var(--lx-line);
}
.lx-traffic {
  width: 12px; height: 12px; border-radius: 50%;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.20);
}
.lx-traffic-r { background: #FF5F57; }
.lx-traffic-y { background: #FEBC2E; }
.lx-traffic-g { background: #28C840; }
.lx-mac-title {
  flex: 1; text-align: center;
  font-size: 12px; color: var(--lx-mute); font-weight: 500;
  margin-right: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
}
.lx-mac-body {
  padding: 22px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* -------------------------------------------------------------------------
   Mail-style stage (used by Select & Translate)
   ------------------------------------------------------------------------- */
.lx-mail-meta {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--lx-dim);
}
.lx-mail-body {
  font-size: 15px; line-height: 1.6;
  color: var(--lx-text);
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}
.lx-mail-body p { margin: 0 0 12px; }
.lx-mail-body p:last-child { margin: 0; }
.lx-mail-body ::selection {
  background: rgba(167, 139, 250, 0.40);
  color: #fff;
}
.lx-mail-body ::-moz-selection {
  background: rgba(167, 139, 250, 0.40);
  color: #fff;
}

/* Text-input stage (used by Voice → Translate + Voice → Dictate) */
.lx-input-label {
  font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lx-dim);
}
.lx-input-field {
  background: var(--lx-bg-3);
  border: 1px solid var(--lx-line-2);
  border-radius: 10px;
  padding: 16px 18px;
  min-height: 100px;
  font-size: 15px; line-height: 1.55;
  color: var(--lx-text);
  white-space: pre-wrap;
  position: relative;
  flex: 1;
}
.lx-input-field.is-empty::before {
  content: attr(data-placeholder);
  color: var(--lx-dim);
  font-style: italic;
}
.lx-input-cursor {
  display: inline-block;
  width: 2px; height: 1.1em;
  background: var(--lx-accent);
  vertical-align: -3px;
  margin-left: 1px;
  animation: lxCaret 0.85s steps(1) infinite;
}
@keyframes lxCaret { 50% { opacity: 0; } }

/* Chat-style stage (used by Auto Reply + Guided Reply) */
.lx-chat-body { gap: 16px; }
.lx-bubble {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px; line-height: 1.5;
}
.lx-bubble-in {
  align-self: flex-start;
  background: var(--lx-bg-3);
  border: 1px solid var(--lx-line);
  border-bottom-left-radius: 4px;
  color: var(--lx-text);
}
.lx-bubble-out {
  align-self: flex-end;
  background: var(--lx-grad);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.30);
}
.lx-bubble-sender {
  font-size: 11px; font-weight: 700;
  color: var(--lx-tag-fg);
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

/* Result card (used by Select & Auto Reply outputs that aren't chat bubbles) */
.lx-result {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.18), rgba(37, 99, 235, 0.12));
  border-left: 3px solid var(--lx-accent);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 15px; line-height: 1.55;
  color: var(--lx-text);
  white-space: pre-wrap;
}
.lx-result-tag {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--lx-tag-fg);
  background: var(--lx-tag-bg);
  padding: 3px 8px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.lx-result.is-loading {
  background: rgba(255, 255, 255, 0.04);
  border-left-color: var(--lx-line-2);
}

/* Dot loader (shared) */
.lx-dots {
  display: inline-flex; gap: 4px;
  padding: 4px 0;
}
.lx-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--lx-accent);
  animation: lxDot 1.2s infinite ease-in-out;
}
.lx-dots span:nth-child(2) { animation-delay: 0.15s; }
.lx-dots span:nth-child(3) { animation-delay: 0.30s; }
@keyframes lxDot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* -------------------------------------------------------------------------
   Controls panel
   ------------------------------------------------------------------------- */
.lx-controls {
  background: var(--lx-bg-2);
  border: 1px solid var(--lx-line-2);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.lx-controls-title {
  font-size: 16px; font-weight: 700;
  color: var(--lx-text);
  margin: 0;
}
.lx-controls-desc {
  font-size: 13px; line-height: 1.55;
  color: var(--lx-mute);
  margin: 0;
}
.lx-controls-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.lx-label-tight {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lx-dim);
}

/* Native-looking select */
.lx-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--lx-bg-3);
  border: 1px solid var(--lx-line-2);
  border-radius: 8px;
  color: var(--lx-text);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 30px 8px 12px;
  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='%23A8AAC0' stroke-width='1.5' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-height: 36px;
}
.lx-select:focus { outline: 2px solid rgba(124, 58, 237, 0.45); outline-offset: 1px; }

/* Intent textarea */
.lx-textarea {
  width: 100%;
  background: var(--lx-bg-3);
  border: 1px solid var(--lx-line-2);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--lx-text);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.55;
  resize: vertical;
  min-height: 80px;
}
.lx-textarea:focus { outline: 2px solid rgba(124, 58, 237, 0.45); outline-offset: 1px; }
.lx-textarea::placeholder { color: var(--lx-dim); }

/* Chord display (visual indication of the desktop hotkey) */
.lx-chord {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.lx-chord kbd {
  font-family: "SF Pro Text", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  background: var(--lx-bg-3);
  border: 1px solid var(--lx-line-2);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--lx-text);
  min-width: 26px;
  text-align: center;
}

/* CTA button — gradient pill */
.lx-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--lx-grad);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  box-shadow: 0 8px 22px rgba(124, 58, 237, 0.34);
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}
.lx-cta:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(124, 58, 237, 0.45);
}
.lx-cta:active:not(:disabled) { transform: translateY(0); }
.lx-cta:disabled { opacity: 0.42; cursor: not-allowed; box-shadow: none; }
.lx-cta svg { flex-shrink: 0; }

/* Mic button — circular */
.lx-mic {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--lx-grad);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 26px rgba(124, 58, 237, 0.38);
  transition: transform 120ms ease, box-shadow 200ms ease;
  flex-shrink: 0;
}
.lx-mic:hover:not(:disabled) { transform: scale(1.05); }
.lx-mic:disabled { opacity: 0.6; cursor: not-allowed; }
.lx-mic.is-recording {
  background: #EF4444;
  animation: lxPulse 1.2s ease-in-out infinite;
}
@keyframes lxPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45), 0 10px 26px rgba(239, 68, 68, 0.38); }
  50%      { box-shadow: 0 0 0 14px rgba(239, 68, 68, 0), 0 10px 26px rgba(239, 68, 68, 0.38); }
}

.lx-hint {
  font-size: 12px;
  color: var(--lx-mute);
  line-height: 1.5;
}
.lx-foot {
  font-size: 12px;
  color: var(--lx-dim);
  line-height: 1.5;
  padding-top: 14px;
  border-top: 1px solid var(--lx-line);
}
.lx-foot strong { color: var(--lx-mute); }

/* Pill for "Recording…" status */
.lx-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.14);
  color: #FF8A8A;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
}
.lx-status::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #EF4444;
  animation: lxDot 1.2s infinite ease-in-out;
}
.lx-status.is-idle {
  background: rgba(255, 255, 255, 0.05);
  color: var(--lx-mute);
}
.lx-status.is-idle::before { background: var(--lx-mute); animation: none; }
.lx-status.is-thinking {
  background: rgba(124, 58, 237, 0.16);
  color: var(--lx-tag-fg);
}
.lx-status.is-thinking::before { background: var(--lx-accent); }
