/*
 * Cuewell website: "Cue Card", the app's own look (src/styles/theme.css).
 *
 * The page is warm index-card paper with ink type, blue-grey ruled lines and
 * one red pencil, used only for marks: ticks, underlines, live dots, margin
 * notes and the one primary button. The demo stage and the download band are
 * charcoal, like the squircle of the app icon, and hold paper cards the way
 * the icon holds its card. Fraunces for display, Instrument Sans for text,
 * JetBrains Mono for labels, keys and code.
 *
 * Everything is local: fonts are SIL OFL 1.1 (assets/fonts/LICENSE-*.txt),
 * icons are Lucide, ISC (assets/icons/LICENSE-lucide.txt), drawn inline.
 */

/* ---------- Fonts ---------- */

@font-face {
  font-family: 'Fraunces Cue';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/fraunces-latin-opsz-normal.woff2') format('woff2-variations'),
       url('assets/fonts/fraunces-latin-opsz-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces Cue';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/fraunces-latin-opsz-italic.woff2') format('woff2-variations'),
       url('assets/fonts/fraunces-latin-opsz-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Sans Cue';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('assets/fonts/instrument-sans-latin-wght-normal.woff2') format('woff2-variations'),
       url('assets/fonts/instrument-sans-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono Cue';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('assets/fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2-variations'),
       url('assets/fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono Cue';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('assets/fonts/jetbrains-mono-latin-ext-wght-normal.woff2') format('woff2-variations'),
       url('assets/fonts/jetbrains-mono-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens (names and values follow src/styles/theme.css) ---------- */

:root {
  color-scheme: light;

  /* Paper */
  --paper: #f6f1e7;              /* the page, and the app's card */
  --paper-2: #efe8db;            /* tinted sections, chips, hover */
  --paper-3: #e6ddcc;            /* pressed */
  --card: #fbf8f2;               /* a fresh card on the page */

  /* Ink: contrast on --paper / --paper-2 / --card */
  --ink: #1d1b16;                /* 15.3 / 14.0 / 16.3 */
  --ink-2: #5b5448;              /*  6.7 /  6.1 /  7.1 */
  --ink-3: #6e675a;              /*  5.0 /  4.6 /  5.3 */

  /* Rules (decorative) and lines */
  --rule: #c9cfd6;
  --rule-2: #b3bcc6;
  --line: rgba(29, 27, 22, 0.15);
  --line-2: rgba(29, 27, 22, 0.24);
  --graphite: rgba(29, 27, 22, 0.55);
  --steel: #7f8790;              /* paperclip */

  /* Red pencil: marks only, plus the one primary button */
  --red: #d4402a;                /* marks, dots, caret (non-text) */
  --red-ink: #b3321f;            /* red text, 5.5:1 on paper */
  --red-fill: #b8361f;           /* primary button, paper text 5.2:1 */
  --red-fill-2: #a32e1a;
  --red-soft: rgba(212, 64, 42, 0.10);
  --red-ring: rgba(212, 64, 42, 0.28);

  /* Ink cards and the charcoal of the icon */
  --slate: #1d1b16;
  --slate-2: #2a2720;
  --slate-line: rgba(246, 241, 231, 0.16);
  --slate-line-2: rgba(246, 241, 231, 0.3);
  --on-slate: #f6f1e7;           /* 15.3 on slate */
  --on-slate-2: #b9b0a0;         /*  8.0 on slate, 6.9 on --slate-2 */
  --charcoal: linear-gradient(160deg, #2b2721 0%, #211e19 46%, #171411 100%);
  --syn-key: #f0a35e;
  --syn-fn: #e6c07b;
  --syn-num: #c8b6f0;

  /* Type */
  --font-display: 'Fraunces Cue', 'Iowan Old Style', Georgia, serif;
  --font-ui: 'Instrument Sans Cue', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono Cue', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  /* ⌘ ⇧ ⌥ ↕ are not in the bundled fonts; use the system's symbol glyphs. */
  --font-sym: -apple-system, BlinkMacSystemFont, 'Segoe UI Symbol', 'Segoe UI', sans-serif;
  --track-caps: 0.1em;
  --lh-rule: 28px;               /* ruled-line pitch */

  /* Radius */
  --r-1: 2px;
  --r-2: 4px;
  --r-3: 6px;
  --r-tab: 12px;
  --r-window: 10px;

  /* Shadows */
  --shadow-rest: 0 1px 1px rgba(29, 27, 22, 0.05), 0 8px 16px -12px rgba(29, 27, 22, 0.3);
  --shadow-card:
    0 1px 1px rgba(29, 27, 22, 0.06),
    0 4px 8px -2px rgba(29, 27, 22, 0.14),
    0 16px 32px -8px rgba(29, 27, 22, 0.28);
  --shadow-code: 0 2px 4px rgba(0, 0, 0, 0.18), 0 12px 24px -8px rgba(0, 0, 0, 0.4);
  --shadow-key: 0 1px 0 var(--line-2);

  /* Motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-draw: cubic-bezier(0.45, 0.05, 0.25, 1);
  --t-fast: 120ms;
  --t: 180ms;
  --t-swap: 160ms;
  --t-draw: 1800ms;
  --t-pulse: 1600ms;
  --t-blink: 1060ms;

  /* Layout */
  --gutter: 32px;
  --wrap: 1200px;

  /* Drawn marks, the same shapes as the app's assests/icons/ui/cue-*.svg */
  --img-tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M1.6 7.9c1.3.8 2.3 2 3 3.4C6.4 7.3 8.9 4.2 12.6 1.9' fill='none' stroke='%23d4402a' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --img-clip: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 48'%3E%3Cpath d='M5.5 33V9a3.5 3.5 0 0 1 7 0v27a6 6 0 0 1-12 0V13' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  --img-margin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 96' preserveAspectRatio='none'%3E%3Cpath d='M4.4 2C3.2 26 5.2 52 3.6 94' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
  --img-download: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15V3M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5'/%3E%3C/svg%3E");
  /* The hero underline: a red-pencil stroke that draws itself once. */
  --img-scribble: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14' preserveAspectRatio='none'%3E%3Cpath d='M2 8.4C30 6.4 62 9.6 100 7.7S162 5.7 198 7.1' fill='none' stroke='%23d4402a' stroke-width='2.3' stroke-linecap='round' pathLength='100' stroke-dasharray='100' stroke-dashoffset='100'%3E%3Canimate attributeName='stroke-dashoffset' from='100' to='0' begin='0.85s' dur='0.75s' fill='freeze' calcMode='spline' keyTimes='0;1' keySplines='0.45 0.05 0.25 1'/%3E%3C/path%3E%3C/svg%3E");
  --img-scribble-still: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14' preserveAspectRatio='none'%3E%3Cpath d='M2 8.4C30 6.4 62 9.6 100 7.7S162 5.7 198 7.1' fill='none' stroke='%23d4402a' stroke-width='2.3' stroke-linecap='round'/%3E%3C/svg%3E");
  /* One ruled line per 28 px, 5 px under the baseline of 14 px text. */
  --ruled: linear-gradient(to bottom, transparent 23px, var(--rule) 23px, var(--rule) 24px, transparent 24px);
}

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img,
svg { display: block; max-width: 100%; }

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; }

code,
kbd { font-family: var(--font-mono); font-variant-ligatures: none; }

::selection { background: rgba(212, 64, 42, 0.2); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Lucide icons from the inline sprite */
.ic {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 14px;
  font-weight: 600;
  color: var(--paper);
  background: var(--ink);
  border-radius: var(--r-2);
  transform: translateY(-160%);
  transition: transform var(--t) var(--ease);
}
.skip:focus { transform: none; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Brand marks ---------- */

/* The app icon in miniature: a charcoal squircle holding a tilted card with
   a serif C (the full icon is assets/cuewell-icon-poster.webp). */
.mark {
  --s: 28px;
  position: relative;
  display: inline-block;
  flex: none;
  width: var(--s);
  height: var(--s);
  border-radius: 24%;
  background: linear-gradient(135deg, #302c26, #2a2620 50%, #181411);
  box-shadow: 0 1px 2px rgba(29, 27, 22, 0.28);
}
.mark::before {
  content: '';
  position: absolute;
  inset: 24% 11%;
  background:
    linear-gradient(to right, transparent 17%, rgba(212, 64, 42, 0.75) 17%, rgba(212, 64, 42, 0.75) calc(17% + 1px), transparent calc(17% + 1px)),
    #f9f2e7;
  border-radius: 1.5px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
  transform: rotate(-5deg);
}
.mark::after {
  content: 'C';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 700 calc(var(--s) * 0.46) / 1 var(--font-display);
  font-variation-settings: 'opsz' 12;
  color: #1d1b16;
  transform: rotate(-5deg);
}

/* The app's in-window mark (.oc-mark): a paper keycap with a Fraunces C. */
.keycap {
  --s: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--s);
  height: var(--s);
  font: 600 calc(var(--s) * 0.62) / 1 var(--font-display);
  font-variation-settings: 'opsz' 14;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: max(2px, calc(var(--s) * 0.17));
  box-shadow: 0 max(1px, calc(var(--s) * 0.08)) 0 var(--line-2);
}

/* ---------- Type ---------- */

.eyebrow,
.card-label,
.stage-label,
.footer-h,
.ev-label,
.sc-scope,
.dl-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.h2 {
  max-width: 20ch;
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 450;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 550;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.lede {
  max-width: 44ch;
  font-size: 17px;
  color: var(--ink-2);
}

.footnote {
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}

/* Prose links: ink with a red-pencil underline, as in the app. */
.faq a,
.footer-fine a,
.dl-more a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.faq a:hover,
.footer-fine a:hover,
.dl-more a:hover { color: var(--red-ink); }

/* Keycaps: one key per shortcut, like the app's .oc-kbd-group ("⌘⇧S"). */
.kbd-group {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  height: 20px;
  min-width: 20px;
  padding: 0 5px;
  font: 500 12px / 1 var(--font-mono);
  letter-spacing: 0.02em;
  color: var(--ink-2);
  white-space: nowrap;
  vertical-align: 1px;
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 3px;
  box-shadow: var(--shadow-key);
}
.kbd-group kbd { font: inherit; }
.kbd-group kbd.sym { font-family: var(--font-sym); font-size: 12.5px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  font: 600 15px / 1 var(--font-ui);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: var(--r-2);
  cursor: pointer;
  transition:
    background var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn--lg { height: 52px; padding: 0 22px; font-size: 16px; border-radius: var(--r-3); }
.btn--lg .ic { width: 18px; height: 18px; }

/* The primary action: red fill, paper text (5.2:1), a key's front edge. */
.btn--primary {
  color: var(--paper);
  background: var(--red-fill);
  border-color: var(--red-fill-2);
  box-shadow: 0 2px 0 var(--red-fill-2);
}
.btn--primary:hover { background: var(--red-fill-2); }
.btn--primary:active { box-shadow: 0 1px 0 var(--red-fill-2); }

.btn--ink {
  color: var(--paper);
  background: var(--ink);
  box-shadow: 0 2px 0 #000;
}
.btn--ink:hover { background: var(--slate-2); }

.btn--outline {
  color: var(--ink);
  background: var(--card);
  border-color: var(--line-2);
  box-shadow: 0 2px 0 var(--line);
}
.btn--outline:hover { background: var(--paper-2); }

.btn--ghost { color: var(--ink-2); background: transparent; }
.btn--ghost:hover { color: var(--ink); background: var(--paper-2); }

.btn--dark-outline {
  color: var(--on-slate);
  background: transparent;
  border-color: var(--slate-line-2);
}
.btn--dark-outline:hover { background: rgba(246, 241, 231, 0.08); border-color: rgba(246, 241, 231, 0.45); }

/* ---------- Header ---------- */

/* Opaque paper closed by the app's double header rule. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 4px double var(--rule-2);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  font-variation-settings: 'opsz' 20;
  letter-spacing: -0.01em;
}
.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.nav a {
  padding: 8px 12px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 6px;
  transition: color var(--t-fast), text-decoration-color var(--t-fast);
}
.nav a:hover { color: var(--ink); text-decoration-color: var(--red); }
.header-cta {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Hero ---------- */

.hero { padding: 72px 0 104px; }

.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 64px;
}
.hero-copy {
  position: relative;
  isolation: isolate;
  max-width: 820px;
  grid-column: 1;
  grid-row: 1;
}
/* The card's red margin line, as on the icon. */
.hero-copy::before {
  content: '';
  position: absolute;
  top: -28px;
  bottom: -28px;
  left: -28px;
  width: 1.5px;
  background: linear-gradient(to bottom, transparent, rgba(212, 64, 42, 0.5) 56px, rgba(212, 64, 42, 0.5) calc(100% - 56px), transparent);
  pointer-events: none;
}
.hero-copy > * { animation: rise 700ms var(--ease) both; }
.hero-copy > :nth-child(2) { animation-delay: 60ms; }
.hero-copy > :nth-child(3) { animation-delay: 120ms; }
.hero-copy > :nth-child(4) { animation-delay: 180ms; }
.hero-copy > :nth-child(5) { animation-delay: 240ms; }
.demo { animation: rise 900ms 260ms var(--ease) both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.hero-eyebrow { color: var(--ink-2); margin-bottom: 26px; }
.eyebrow-tick {
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: -3px;
  background: var(--img-tick) center / contain no-repeat;
}

/* The headline is written on the card's ruled lines: one rule per line box,
   on the baseline (Fraunces: ascent 0.978em, descent 0.255em, so with a
   1.06em line the baseline sits 0.89em down each line). */
.hero-title {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(44px, 6.1vw, 88px);
  font-weight: 440;
  line-height: 1.06;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
.hero-title::before {
  content: '';
  position: absolute;
  /* Never wider than the gutters, so it can't cause sideways scrolling. */
  inset: 0 calc(-1 * min(24px, var(--gutter))) 0 calc(-1 * min(44px, var(--gutter)));
  z-index: -1;
  background: linear-gradient(to bottom, transparent calc(0.9em - 0.5px), var(--rule) calc(0.9em - 0.5px), var(--rule) calc(0.9em + 0.5px), transparent calc(0.9em + 0.5px)) 0 0 / 100% 1.06em;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 44px, #000 72%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 44px, #000 72%, transparent);
  pointer-events: none;
}
/* Hand-marked emphasis: a red-pencil underline on each line of the phrase. */
.hl {
  padding-bottom: 0.02em;
  background: var(--img-scribble) 0 100% / 100% 0.22em no-repeat;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.hero-sub {
  max-width: 52ch;
  margin-top: 28px;
  font-size: clamp(17px, 1.5vw, 19.5px);
  line-height: 1.6;
  color: var(--ink-2);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
  margin-top: 36px;
}
.hero-actions--center { justify-content: center; }
.cta-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.cta-note {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.01em;
  color: var(--ink-3);
}

/* Links to the other platforms under the primary button */
.cta-alt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}
.cta-alt a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 3px;
}
.cta-alt a:hover { color: var(--ink); text-decoration-color: var(--red); }
.cta-alt a + a::before {
  content: '';
  width: 1px;
  height: 11px;
  background: var(--rule-2);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 0;
  margin-top: 40px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}
/* Each item starts with a separator; the first one on every line sits
   outside the list's clipped box, so no line starts with a separator. */
.hero-meta li {
  display: inline-flex;
  align-items: center;
  margin-left: -15px;
  padding-right: 29px;
}
.hero-meta li::before {
  content: '';
  width: 1px;
  height: 12px;
  margin-right: 14px;
  background: var(--rule-2);
}

/* ---------- Animated app icon ---------- */

/* The video is a 720 px square cropped to the icon's squircle; the face
   clips it to that shape. The intro plays once and holds its last frame;
   the poster image under it is that frame. */
.app-icon {
  --s: 64px;
  position: relative;
  flex: none;
  width: var(--s);
  height: var(--s);
  border-radius: 22.4%;
  box-shadow:
    0 calc(var(--s) * 0.01) calc(var(--s) * 0.02) rgba(29, 27, 22, 0.14),
    0 calc(var(--s) * 0.05) calc(var(--s) * 0.1) calc(var(--s) * -0.02) rgba(29, 27, 22, 0.18),
    0 calc(var(--s) * 0.14) calc(var(--s) * 0.26) calc(var(--s) * -0.08) rgba(29, 27, 22, 0.4);
}
.app-icon-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  clip-path: inset(0 round 22.4%); /* Safari: clip the video layer too */
  background: #221f1b; /* the intro's first frame: an empty charcoal squircle */
}
.app-icon img,
.app-icon video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  pointer-events: none;
}
.app-icon.is-static video { display: none; }
/* While the intro can play, hide the finished-icon poster so the video starts
   from the empty squircle instead of flashing the end state first. */
.js .app-icon:not(.is-static) img { visibility: hidden; }
/* With scripting off, browsers draw native controls on every video; show the
   poster instead. */
@media (scripting: none) {
  .app-icon video { display: none; }
}

.app-icon--hero {
  --s: clamp(240px, 21vw, 296px);
  grid-column: 2;
  grid-row: 1;
  animation: rise 700ms 120ms var(--ease) both;
}

/* ---------- Demo stage ---------- */

.demo { margin-top: 88px; }

/* The screen: the icon's charcoal. The overlay hangs from its top edge. */
.stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 0 32px 72px;
  color: var(--on-slate);
  background: #211e19 var(--charcoal);
  border-radius: 20px;
  box-shadow: 0 0 0 1px rgba(29, 27, 22, 0.9), 0 40px 80px -40px rgba(29, 27, 22, 0.6);
}
.stage.is-paused,
.stage.is-paused *,
.stage.is-paused *::before,
.stage.is-paused *::after { animation-play-state: paused !important; }
.stage:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }

.stage-top {
  position: absolute;
  top: 20px;
  left: 28px;
  right: 28px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.stage-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--on-slate-2);
}
/* Live: the app's red-pencil dot with a ring that keeps pulsing out. */
.stage-live,
.live-dot,
.heard-dot {
  position: relative;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
}
.heard-dot { display: none; margin: 0 2px; }
.stage-live::after,
.live-dot::after,
.heard.is-live .heard-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border: 1.5px solid var(--red);
  border-radius: 50%;
  opacity: 0;
  animation: pulse var(--t-pulse) var(--ease) infinite;
}
@keyframes pulse {
  0% { transform: scale(0.5); opacity: 0.6; }
  70%, 100% { transform: scale(1); opacity: 0; }
}

/* A faint app window behind the overlay: your interview, not ours. */
.screen {
  position: absolute;
  inset: 52px 28px 28px;
  z-index: -1;
  border: 1px solid rgba(246, 241, 231, 0.07);
  border-radius: 12px;
  background: rgba(246, 241, 231, 0.012);
  pointer-events: none;
}
.screen-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(246, 241, 231, 0.06);
}
.screen-bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(246, 241, 231, 0.09);
}
.screen-body {
  position: absolute;
  inset: 32px 0 0;
  display: flex;
}
.screen-side {
  width: 16%;
  padding: 72px 16px 16px;
  border-right: 1px solid rgba(246, 241, 231, 0.05);
}
.screen-side b {
  display: block;
  height: 7px;
  margin-bottom: 14px;
  border-radius: 4px;
  background: rgba(246, 241, 231, 0.05);
}
.screen-side b:nth-child(odd) { width: 80%; }
.screen-side b:nth-child(even) { width: 58%; }
.screen-main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 72px 20px 20px;
}
.screen-tile {
  border: 1px solid rgba(246, 241, 231, 0.05);
  border-radius: 8px;
  background: rgba(246, 241, 231, 0.02);
}

.overlay {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Shared stacking cell: every child shares one grid cell, so the widest
   (or tallest) text sets the size and changing text never moves anything.
   main.js adds the .sizer copies for modes, languages and questions. */
.stack { display: inline-grid; }
.stack > * { grid-area: 1 / 1; }
.stack > .sizer { visibility: hidden; }

/* ----- Toolbar (src/styles/toolbar.css) ----- */

.tb {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  margin-bottom: 4px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--r-tab) var(--r-tab);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25), 0 12px 28px -12px rgba(0, 0, 0, 0.7);
  user-select: none;
}
.tb-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  margin: 0 8px;
  padding: 0 4px 0 8px;
  border-bottom: 1px solid var(--rule);
}
.tb-brand > .tb-item { padding: 0 6px; }
.tb-brand > .tb-sep { margin: 0 8px 0 4px; }
.tb-mark {
  --s: 24px;
  margin-top: -2px; /* level once the 2 px key edge is drawn */
  font-size: 15px;
  box-shadow: 0 2px 0 var(--line-2);
}
.tb-wordmark {
  font: 600 15px / 20px var(--font-display);
  font-variation-settings: 'opsz' 18;
  letter-spacing: -0.005em;
}
.tb-spacer { flex: 1; min-width: 24px; }
.tb-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 86px;
  font: 500 12px / 16px var(--font-ui);
  color: var(--ink);
  white-space: nowrap;
}
.tb-status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 3px rgba(29, 27, 22, 0.12);
}
.tb-controls {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 4px;
}
.tb-item {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 4px;
  height: 28px;
  padding: 0 8px;
  font: 500 12px / 1 var(--font-ui);
  color: var(--ink);
  white-space: nowrap;
  border-radius: var(--r-2);
}
.tb-item .ic { width: 12px; height: 12px; color: var(--ink-2); }
.tb-item > .kbd-group { margin-left: 4px; }
.tb-sep {
  flex: none;
  width: 1px;
  height: 16px;
  margin: 0 4px;
  background: var(--rule);
}
.tb .kbd-group {
  height: 16px;
  min-width: 16px;
  padding: 0 4px;
  font-size: 11px;
  border-radius: var(--r-1);
  vertical-align: 0;
}
.tb .kbd-group kbd.sym { font-size: 11px; }

/* Listen: icon and live dot share one slot, and "Listen" and "Listening"
   one cell, so the button keeps its width. */
.bar-mic .live-dot {
  display: none;
  width: 6px;
  height: 6px;
  margin: 0 3px;
}
.mic-labels { position: relative; }
.mic-scribble {
  display: none;
  position: absolute;
  left: -2px;
  bottom: -6px;
  width: calc(100% + 4px);
  height: 5px;
  overflow: visible;
}
.mic-scribble path {
  fill: none;
  stroke: var(--red);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 64;
  stroke-dashoffset: 64;
  animation: scribble 700ms var(--ease-draw) 200ms forwards;
}
@keyframes scribble { to { stroke-dashoffset: 0; } }

.bar-mic.is-live { color: var(--red-ink); background: var(--red-soft); }
.bar-mic.is-live .mic-ic { display: none; }
.bar-mic.is-live .live-dot { display: inline-block; }
.bar-mic.is-live .mic-scribble { display: block; }
.bar-mic.is-live .kbd-group {
  color: var(--red-ink);
  border-color: var(--red-ring);
  box-shadow: 0 1px 0 var(--red-ring);
}

.stack-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.bar-lang .stack-line { gap: 4px; }
.mode-key { color: var(--ink-2); }
/* Auto at work: the app's slow graphite sweep over the mode name. */
.bar-mode.is-auto .mode-text {
  color: transparent;
  background: linear-gradient(90deg, var(--ink-3) 0%, var(--ink) 45%, var(--ink-3) 90%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmer 1.8s linear infinite;
}
.bar-mode.is-flash { animation: flash 900ms var(--ease); }
@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}
@keyframes flash {
  from { background: var(--paper-3); }
  to { background: transparent; }
}
.bar-lang .chev { width: 10px; height: 10px; }

/* ----- Heard: the transcript, styled like the chat's "Heard" row ----- */

.heard {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: min(720px, 100%);
  padding: 10px 20px 10px 24px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-window);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25), 0 12px 28px -14px rgba(0, 0, 0, 0.7);
}
.heard-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 24px;
  font: 600 11px / 16px var(--font-ui);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--ink-3);
}
/* Dot and mic icon share one 12 px slot; the label cell fits "Listening". */
.heard-ic { width: 12px; height: 12px; }
.heard.is-live .heard-dot,
.heard.is-idle .heard-dot { display: block; }
.heard.is-live .heard-ic,
.heard.is-idle .heard-ic { display: none; }
.heard.is-idle .heard-dot { background: transparent; border: 1.5px dashed var(--ink-3); }
.heard-label { min-width: 76px; }
.heard.is-live .heard-head { color: var(--red-ink); }
.heard-body {
  flex: 1;
  min-width: 0;
  padding-left: 12px;
  font: italic 450 16px / 24px var(--font-display);
  color: var(--ink-2);
  border-left: 2px solid var(--rule-2);
}
.heard.is-live .heard-body { color: var(--ink); }
/* The red-pencil caret: no width, so typing never moves the words. */
.caret {
  display: none;
  width: 0;
  height: 1em;
  margin-right: -2px;
  vertical-align: -0.15em;
  border-left: 2px solid var(--red);
  border-radius: 1px;
  animation: blink var(--t-blink) steps(1, end) infinite;
}
.heard.is-typing .caret { display: inline-block; }
@keyframes blink {
  0%, 55% { opacity: 1; }
  56%, 100% { opacity: 0; }
}

/* ----- Answer window (src/styles/answer.css) ----- */

.panel {
  --panel-h: 400px;
  width: min(720px, 100%);
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-window);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25), 0 28px 56px -20px rgba(0, 0, 0, 0.75);
}
/* Header: keycap C, ANSWER, the live state, and the double rule. */
.panel-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 8px 0 24px;
  border-bottom: 4px double var(--rule-2);
}
.panel-title {
  flex: 1;
  font: 600 11px / 16px var(--font-ui);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--ink-3);
}
/* "Thinking" in pencil while drafting, "Writing" with a red dot while the
   answer streams, faded out otherwise. */
.panel-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 500 12px / 16px var(--font-ui);
  color: var(--red-ink);
  opacity: 0;
  transition: opacity var(--t-swap) var(--ease);
}
.panel-status[data-state="thinking"],
.panel-status[data-state="streaming"] { opacity: 1; }
.panel-status .st-pencil { display: none; width: 12px; height: 12px; }
.st-dot {
  width: 6px;
  height: 6px;
  margin: 0 3px;
  border-radius: 50%;
  background: var(--red);
}
.panel-status[data-state="streaming"] .st-dot { animation: live var(--t-pulse) var(--ease) infinite; }
@keyframes live {
  0% { box-shadow: 0 0 0 0 rgba(212, 64, 42, 0.45); }
  70%, 100% { box-shadow: 0 0 0 5px rgba(212, 64, 42, 0); }
}
.panel-status[data-state="thinking"] { color: var(--ink-3); }
.panel-status[data-state="thinking"] .st-pencil { display: block; }
.panel-status[data-state="thinking"] .st-dot { display: none; }
.panel-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--ink-2);
}
.panel-close .ic { width: 12px; height: 12px; }

/* Drafting and the answer share one cell and cross-fade, like the app's
   views, so switching never moves anything. */
.panel-views {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  height: var(--panel-h);
}
.panel-views > * {
  grid-area: 1 / 1;
  min-width: 0;
  min-height: 0;
}
.panel-loading,
.stage[data-state="thinking"] .panel-body {
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-swap) var(--ease), visibility 0s linear var(--t-swap);
}
.panel-body,
.stage[data-state="thinking"] .panel-loading {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--t-swap) var(--ease), visibility 0s;
}

.panel-loading {
  display: flex;
  flex-direction: column;
  padding: 16px 24px 8px;
  overflow: hidden;
}
.draft {
  container-type: inline-size;
  margin-bottom: 12px;
}
.draft-line { position: relative; height: 32px; }
.draft-svg {
  display: block;
  width: 568px;
  max-width: 100%;
  height: 32px;
  overflow: visible;
}
.draft-path {
  fill: none;
  stroke: var(--graphite);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  vector-effect: non-scaling-stroke;
}
.stage[data-state="thinking"] .draft-path { animation: draw var(--t-draw) var(--ease-draw) infinite; }
.stage[data-state="thinking"] .draft-line--short .draft-path { animation-delay: 260ms; }
/* The pencil tip follows the first line (drawn at its full 568 px). */
.draft-tip {
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
  offset-path: path('M2 25C64 23.5 118 26.5 182 24.8S302 23 366 25.2 480 26.4 548 24.4');
  offset-rotate: 0deg;
  opacity: 0;
}
.stage[data-state="thinking"] .draft-tip { animation: tip var(--t-draw) var(--ease-draw) infinite; }
@container (max-width: 567px) {
  .draft-tip { display: none; }
}
@keyframes draw {
  0% { stroke-dashoffset: 100; opacity: 1; }
  70%, 88% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes tip {
  0% { offset-distance: 0%; opacity: 1; }
  70% { offset-distance: 100%; opacity: 1; }
  80%, 100% { offset-distance: 100%; opacity: 0; }
}
.draft-rules {
  height: calc(2 * var(--lh-rule));
  margin: 0 -24px;
  background: var(--ruled) 0 0 / 100% var(--lh-rule) repeat-y;
}
.draft-foot {
  display: flex;
  align-items: center;
  height: 40px;
  font-size: 13px;
  line-height: 20px;
  color: var(--ink-2);
}

/* The answer. The panel never changes height; text only adds lines below,
   and the gutter is reserved so a scrollbar appearing never reflows it. */
.panel-body {
  position: relative;
  padding: 16px 24px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(29, 27, 22, 0.22) transparent;
  font-size: 14px;
  line-height: 24px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.panel-body p { margin: 0 0 12px; }
.panel-body > :last-child { margin-bottom: 0; }
.panel-body strong { font-weight: 600; }
.panel-body sup { font-size: 0.72em; line-height: 0; }
.panel-body :not(pre) > code {
  padding: 1px 4px;
  font-size: 0.88em;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
}

/* SAY THIS with the red-pencil tick, then the line to say first. */
.say-label {
  display: block;
  margin: 0 0 8px;
  padding-left: 20px;
  font: 700 11px / 16px var(--font-ui);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--red-ink);
  background: var(--img-tick) 0 0 / 14px 14px no-repeat;
}
.say-label--draft {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 0;
  color: var(--ink-3);
  background: none;
}
.say-label--draft .ic { width: 12px; height: 12px; }
.say { margin: 0 0 12px; }
.say p {
  margin: 0;
  font: 450 24px / 32px var(--font-display);
  letter-spacing: -0.012em;
  color: var(--ink);
}

/* Details on ruled lines that run to the card's edges: italic Fraunces
   numbers for steps, dashes otherwise. */
.panel-body ul,
.panel-body ol {
  margin: 0 -24px 12px;
  padding: 0 24px 0 48px;
  line-height: var(--lh-rule);
  background: var(--ruled) 0 0 / 100% var(--lh-rule) repeat-y;
}
.panel-body li { position: relative; }
.panel-body ol { counter-reset: step; }
.panel-body ol > li { counter-increment: step; }
.panel-body li::before {
  position: absolute;
  top: 0;
  right: calc(100% + 10px);
  color: var(--ink-2);
}
.panel-body ul > li::before { content: '\2013'; }
.panel-body ol > li::before {
  content: counter(step);
  right: calc(100% + 12px);
  font: italic 500 15px / var(--lh-rule) var(--font-display);
}

/* Context the answer used, as an app chip. */
.ctx-note {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  min-height: 24px;
  margin: 0 0 12px;
  padding: 2px 8px;
  font: 500 12px / 16px var(--font-ui);
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
}
.ctx-note .ic { width: 12px; height: 12px; }

/* Nothing asked yet: blank ruled paper, as in the app. */
.panel-idle {
  min-height: calc(var(--panel-h) - 40px);
  margin: 0 -24px;
  padding: 0 24px;
  background: var(--ruled) 0 0 / 100% var(--lh-rule) repeat-y;
}
.panel-body .panel-idle-title {
  margin: 0;
  font: italic 500 20px / var(--lh-rule) var(--font-display);
  color: var(--ink-2);
}
.panel-body .panel-idle-hint {
  margin: 0;
  font-size: 14px;
  line-height: var(--lh-rule);
  color: var(--ink-2);
}

/* Code: a dark card held by a paperclip. The 40 px bar never changes
   height; Copy appears when the answer is done, as in the app. */
.code {
  position: relative;
  margin: 28px 0 16px;
  color: var(--on-slate);
  background: var(--slate);
  border-radius: var(--r-3);
  box-shadow: 0 0 0 1px var(--slate-line), var(--shadow-code);
}
.code::before,
.terminal::before {
  content: '';
  position: absolute;
  top: -28px;
  left: 20px;
  z-index: 1;
  width: 16px;
  height: 48px;
  background-color: var(--steel);
  -webkit-mask: var(--img-clip) center / contain no-repeat;
  mask: var(--img-clip) center / contain no-repeat;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.5));
  pointer-events: none;
}
.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 40px;
  padding: 0 8px 0 48px;
  background: var(--slate-2);
  border-bottom: 1px solid var(--slate-line);
  border-radius: var(--r-3) var(--r-3) 0 0;
}
.code-lang {
  font: 600 12px / 16px var(--font-ui);
  color: var(--on-slate);
}
.code-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px 0 8px;
  font: 600 12px / 1 var(--font-ui);
  color: var(--on-slate);
  background: transparent;
  border: 1px solid var(--slate-line);
  border-radius: var(--r-2);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.code-copy:hover { background: rgba(246, 241, 231, 0.08); border-color: rgba(246, 241, 231, 0.32); }
.code-copy:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--slate-2), 0 0 0 4px var(--on-slate); }
.code-copy .ic { width: 12px; height: 12px; }
.code-copy.is-done { color: #a9c98a; }
.stage:not([data-state="done"]) .code-copy { visibility: hidden; }
.code pre {
  margin: 0;
  padding: 12px 16px 16px;
  overflow-x: auto;
  font: 400 12px / 20px var(--font-mono);
  font-variant-ligatures: none;
  color: var(--on-slate);
  tab-size: 4;
  scrollbar-width: thin;
  scrollbar-color: rgba(246, 241, 231, 0.2) transparent;
}
.code pre code { font: inherit; }
.t-k { color: var(--syn-key); }
.t-f { color: var(--syn-fn); }
.t-c { color: var(--syn-num); }
.t-p { color: var(--on-slate-2); }
.t-o { color: var(--on-slate); }

/* Streaming states (set by main.js). The caret follows the last word while
   the answer is written; it takes no width, so nothing moves. */
.tk-off { display: none; }
.blk-off { display: none !important; }
.stage[data-state="streaming"] .tk-last::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 1em;
  margin-right: -2px;
  vertical-align: -0.15em;
  border-left: 2px solid var(--red);
  border-radius: 1px;
  animation: blink var(--t-blink) steps(1, end) infinite;
}

.stage-noscript {
  margin-top: 16px;
  text-align: center;
  font: 500 12px / 1.4 var(--font-mono);
  color: var(--on-slate-2);
}

/* ----- Scenario tabs ----- */

.demo-controls {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 16px;
}
.demo-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 48px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--r-3);
  box-shadow: 0 1px 0 var(--line);
  cursor: pointer;
  transition: background var(--t-fast);
}
.demo-play:hover { background: var(--paper-2); }
.demo-play .ic-play { display: none; fill: currentColor; }
.demo-play[data-paused="true"] .ic-play { display: block; }
.demo-play[data-paused="true"] .ic-pause { display: none; }

.demo-tabs {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}
.demo-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  height: 52px;
  padding: 0 16px;
  overflow: hidden;
  font: 600 14px / 1 var(--font-ui);
  color: var(--ink-2);
  text-align: left;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}
.demo-tab:hover { color: var(--ink); background: var(--paper-2); }
.demo-tab[aria-selected="true"] {
  color: var(--ink);
  background: var(--card);
  border-color: var(--line-2);
  box-shadow: 0 1px 0 var(--line), 0 8px 16px -12px rgba(29, 27, 22, 0.45);
}
/* Numbered like the answer's details: italic Fraunces. */
.tab-n {
  flex: none;
  font: italic 500 17px / 1 var(--font-display);
  color: var(--ink-3);
}
.demo-tab[aria-selected="true"] .tab-n { color: var(--ink-2); }
.tab-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
}
.tab-bar i {
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}
.demo-tab[aria-selected="true"] .tab-bar { background: var(--rule); }

.demo-caption {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-3);
}

/* ---------- Sections ---------- */

.section {
  padding: 112px 0;
  border-top: 1px solid var(--line);
}
.section--tight { padding: 72px 0; }
.section--tint { background: var(--paper-2); }

.section-head { margin-bottom: 56px; }
.section-head .eyebrow { margin-bottom: 16px; }
.section-head--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  align-items: end;
  gap: 24px 64px;
}

/* Index cards: a header strip closed by the double rule, then the body. */
.card,
.ev-group,
.sc,
.step,
.table-wrap,
.notice {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-rest);
}

/* ---------- Features ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0 24px 28px;
  transition: translate 240ms var(--ease), box-shadow 240ms var(--ease);
}
.card:hover { translate: 0 -2px; box-shadow: var(--shadow-card); }
.card-label {
  display: flex;
  align-items: center;
  height: 48px;
  margin: 0 -24px 24px;
  padding: 0 56px 0 24px;
  border-bottom: 4px double var(--rule-2);
}
.card-ic {
  position: absolute;
  top: 14px;
  right: 20px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--ink-2);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card .h3 { margin-bottom: 10px; }
.card p { font-size: 15.5px; color: var(--ink-2); }
.card .card-label { font-size: 11.5px; color: var(--ink-3); }

.chips,
.ctx {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 20px;
}
.chips li,
.ctx li {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  font: 500 13px / 1 var(--font-ui);
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
}

/* The app's answer card, in miniature. */
.mini-say {
  margin-top: 20px;
  padding: 14px 18px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
}
.mini-say .say-label { margin-bottom: 6px; }
.card .mini-say p {
  font: 450 19px / 26px var(--font-display);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.card .mini-say p::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 1em;
  margin: 0 -2px 0 2px;
  vertical-align: -0.15em;
  border-left: 2px solid var(--red);
  border-radius: 1px;
  animation: blink var(--t-blink) steps(1, end) infinite;
}

/* ---------- Everything in Cuewell ---------- */

.ev-grid {
  columns: 3;
  column-gap: 20px;
}
.ev-group {
  display: block;
  width: 100%;
  margin-bottom: 20px;
  padding: 0 24px 12px;
  -webkit-column-break-inside: avoid;
  break-inside: avoid;
}
.ev-head {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  margin: 0 -24px 0;
  padding: 0 24px;
  border-bottom: 4px double var(--rule-2);
}
.ev-ic {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--ink-2);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ev-label { color: var(--ink-2); }
/* The feature list sits on the answer card's ruled lines. */
.ev-list {
  margin: 0 -24px;
  padding: 4px 24px 0 44px;
  background: var(--ruled) 0 4px / 100% var(--lh-rule) repeat-y;
}
.ev-list li {
  position: relative;
  font-size: 14.5px;
  line-height: var(--lh-rule);
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.ev-list li::before {
  content: '\2013';
  position: absolute;
  left: -20px;
  color: var(--ink-3);
}
.ev-list strong { font-weight: 600; color: var(--ink); }
.ev-keys {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  vertical-align: 0;
}
.ev-group .kbd-group,
.sc .kbd-group { height: 19px; font-size: 11.5px; }
.ev-chips { margin: 16px 0 8px; }

/* ---------- Keyboard shortcuts (like the toolbar's shortcuts card) ---------- */

.sc {
  margin-top: 40px;
  padding: 0 28px 24px;
}
.sc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-height: 64px;
  margin: 0 -28px 24px;
  padding: 12px 28px;
  border-bottom: 4px double var(--rule-2);
}
.sc-head .ev-ic { width: 18px; height: 18px; }
.sc-note {
  margin-left: auto;
  font: 500 12px / 1.5 var(--font-mono);
  color: var(--ink-3);
}
.sc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 48px;
}
.sc-scope {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--rule-2);
}
/* The toolbar's status dots: filled works anywhere, hollow needs focus. */
.sc-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 3px rgba(29, 27, 22, 0.12);
}
.sc-dot--focus { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.sc-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: 44px;
  padding: 8px 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
}
.sc-act { min-width: 0; }
.sc-keys {
  display: inline-flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px 6px;
}
.sc-or { font: 500 11.5px / 1 var(--font-mono); color: var(--ink-3); }
.sc-fine {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-3);
}

/* ---------- How it works: numbers in the card's margin ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.step {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px 28px 24px 88px;
}
.step::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 64px;
  width: 1.5px;
  background: rgba(212, 64, 42, 0.45);
}
.step-n {
  position: absolute;
  top: 24px;
  left: 0;
  width: 64px;
  text-align: center;
  font: italic 400 30px / 1 var(--font-display);
  color: var(--ink-2);
}
.step .h3 { margin-bottom: 8px; }
.step p { font-size: 15.5px; color: var(--ink-2); }
.step-keys {
  display: flex;
  flex-direction: column;
  margin-top: auto;
  padding-top: 24px;
}
.key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  border-top: 1px solid var(--rule);
}
.key-row .kbd-group { order: 2; }

/* ---------- Providers ---------- */

.providers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-rest);
}
.provider {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  min-height: 148px;
  padding: 24px;
  background: var(--card);
  transition: background 200ms var(--ease);
}
.provider:hover { background: var(--paper); }
.p-name {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.p-note {
  font: 500 12px / 1.5 var(--font-mono);
  color: var(--ink-3);
}
/* The key note is an ink card, like the app's code card. */
.provider--key,
.provider--key:hover {
  justify-content: flex-start;
  gap: 14px;
  color: var(--on-slate);
  background: var(--slate);
}
.provider--key .ic { width: 22px; height: 22px; color: var(--on-slate-2); stroke-width: 1.75; }
.provider--key .p-note {
  font: 400 14.5px / 1.55 var(--font-ui);
  color: var(--on-slate-2);
}

/* ---------- Where your data goes ---------- */

.table-wrap { overflow: hidden; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.data-table th,
.data-table td {
  padding: 18px 24px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table thead th {
  padding-top: 15px;
  padding-bottom: 14px;
  font: 500 11.5px / 1.4 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 4px double var(--rule-2);
}
.data-table tbody th { width: 34%; font-weight: 600; }
.data-table td { color: var(--ink-2); }
.data-table td:first-of-type { width: 28%; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  margin-right: 8px;
  padding: 0 7px;
  font: 600 10.5px / 1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 1px;
  border-radius: 3px;
}
.tag--sent { color: var(--paper); background: var(--ink); }
/* Stays on your computer: ticked off in red pencil. */
.tag--local {
  padding-left: 5px;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.tag--local::before {
  content: '';
  width: 11px;
  height: 11px;
  margin-top: -2px;
  background: var(--img-tick) center / contain no-repeat;
}
.data-table .kbd-group { height: 19px; font-size: 11.5px; }

/* ---------- Use it responsibly: a red-pencil margin note ---------- */

.notice {
  position: relative;
  padding: 30px 32px 30px 60px;
}
.notice-mark {
  position: absolute;
  top: 26px;
  bottom: 26px;
  left: 26px;
  width: 8px;
  background-color: var(--red);
  -webkit-mask: var(--img-margin) center / 100% 100% no-repeat;
  mask: var(--img-margin) center / 100% 100% no-repeat;
}
.notice .eyebrow { margin-bottom: 10px; }
.notice-title {
  max-width: 40ch;
  margin-bottom: 8px;
  font-size: 25px;
  font-style: italic;
  font-weight: 450;
  line-height: 1.3;
}
.notice p:last-child { max-width: 66ch; color: var(--ink-2); }

/* ---------- FAQ ---------- */

.faq-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 64px;
  align-items: start;
}
.faq-grid .section-head { position: sticky; top: 120px; margin: 0; }
.faq { border-top: 1px solid var(--rule-2); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  position: relative;
  display: block;
  padding: 22px 48px 22px 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.008em;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before,
.faq summary::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 6px;
  width: 14px;
  height: 1.5px;
  background: var(--ink-2);
  border-radius: 1px;
  transition: transform 220ms var(--ease);
}
.faq summary::after { transform: rotate(90deg); }
.faq details[open] summary::after { transform: rotate(0deg); }
.faq summary:hover { color: var(--ink-2); }
.faq summary:focus-visible { outline-offset: 4px; }
.faq details p {
  max-width: 62ch;
  padding: 0 48px 24px 0;
  color: var(--ink-2);
}
.faq details[open] p { animation: rise 320ms var(--ease) both; }
.faq strong { font-weight: 600; color: var(--ink); }
.faq code,
.dl-more code {
  padding: 0.1em 0.35em;
  font-size: 0.88em;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 3px;
}

/* ---------- Download band: paper cards on the icon's charcoal ---------- */

.cta-band {
  position: relative;
  isolation: isolate;
  padding: 120px 0;
  color: var(--on-slate);
  background: #211e19 var(--charcoal);
}
.cta-band :focus-visible { outline-color: var(--on-slate); }
.cta-band .dl-card :focus-visible { outline-color: var(--ink); }
.cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.cta-inner .app-icon--cta {
  --s: 104px;
  margin-bottom: 32px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), 0 16px 32px -12px rgba(0, 0, 0, 0.75);
}
.cta-title {
  max-width: 18ch;
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 450;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.cta-sub {
  max-width: 46ch;
  margin-top: 18px;
  font-size: 18px;
  color: var(--on-slate-2);
}
.cta-band .hero-actions { margin-top: 40px; }

.dl-soon {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 100%;
  margin-top: 28px;
  padding: 12px 16px;
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
  color: var(--on-slate);
  background: var(--slate-2);
  border: 1px solid var(--slate-line);
  border-radius: var(--r-3);
}
.dl-soon .ic { width: 18px; height: 18px; margin-top: 2px; color: var(--on-slate-2); }

.dl-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  width: 100%;
  margin-top: 48px;
  text-align: left;
}
.dl-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0 24px 24px;
  color: var(--ink);
  background: var(--paper);
  border-radius: var(--r-3);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3), 0 24px 48px -20px rgba(0, 0, 0, 0.75);
}
.dl-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
  margin: 0 -24px 20px;
  padding: 0 24px;
  border-bottom: 4px double var(--rule-2);
}
.dl-tag {
  padding: 3px 7px;
  font-size: 10.5px;
  color: var(--ink-2);
  border: 1px solid var(--line-2);
  border-radius: 3px;
}
.dl-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 550;
  line-height: 1.15;
  letter-spacing: -0.012em;
}
.dl-req {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2);
}
.dl-files {
  display: grid;
  gap: 8px;
  margin: 20px 0;
}
.dl-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 10px 14px;
  color: var(--ink);
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  box-shadow: 0 2px 0 var(--line);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.dl-file[href]:hover { background: var(--paper-2); border-color: rgba(29, 27, 22, 0.36); }
.dl-file--main[href] {
  color: var(--paper);
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: 0 2px 0 #000;
}
.dl-file--main[href]:hover { background: var(--slate-2); border-color: var(--slate-2); }
.dl-file[href]::after {
  content: '';
  flex: none;
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--img-download) center / contain no-repeat;
  mask: var(--img-download) center / contain no-repeat;
}
.dl-file-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.dl-file-name { font-size: 15px; font-weight: 600; line-height: 1.35; }
.dl-file-meta {
  font: 500 11.5px / 1.4 var(--font-mono);
  color: var(--ink-3);
  overflow-wrap: anywhere;
}
.dl-file--main[href] .dl-file-meta { color: var(--on-slate-2); }
.dl-file:not([href]) { cursor: default; border-style: dashed; box-shadow: none; }
.dl-more {
  margin: -8px 0 20px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}
.dl-note {
  position: relative;
  margin-top: auto; /* pinned to the bottom so the three notes line up */
  padding: 16px 0 0 20px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
  border-top: 1px solid var(--rule);
}
.dl-note::before {
  content: '';
  position: absolute;
  top: 18px;
  bottom: 2px;
  left: 0;
  width: 6px;
  background-color: var(--red);
  -webkit-mask: var(--img-margin) center / 100% 100% no-repeat;
  mask: var(--img-margin) center / 100% 100% no-repeat;
}
.dl-note strong { font-weight: 600; color: var(--ink); }

/* Build from source: the app's code card, clipped on. */
.terminal {
  position: relative;
  display: inline-grid;
  gap: 10px;
  max-width: 100%;
  margin-top: 56px;
  padding: 0 20px 18px;
  text-align: left;
  background: var(--slate);
  border-radius: var(--r-3);
  box-shadow: 0 0 0 1px var(--slate-line), var(--shadow-code);
}
.term-label {
  display: flex;
  align-items: center;
  height: 40px;
  margin: 0 -20px 6px;
  padding: 0 20px 0 48px;
  font: 600 12px / 16px var(--font-ui);
  color: var(--on-slate);
  background: var(--slate-2);
  border-bottom: 1px solid var(--slate-line);
  border-radius: var(--r-3) var(--r-3) 0 0;
}
.term-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 16px;
  min-width: 0;
}
.term-os {
  min-width: 96px;
  font: 500 12px / 1.5 var(--font-mono);
  color: var(--on-slate-2);
}
.terminal code {
  min-width: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--on-slate);
  overflow-wrap: anywhere;
}
.term-prompt { margin-right: 8px; color: var(--syn-key); }

/* ---------- Footer ---------- */

.site-footer {
  padding: 64px 0 28px;
  border-top: 4px double var(--rule-2);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 40px;
}
.footer-brand { max-width: 380px; }
.footer-brand .brand { margin-bottom: 16px; }
.footer-brand p { font-size: 15px; color: var(--ink-2); }
.footer-brand .footer-fine { margin-top: 6px; font-size: 14px; color: var(--ink-3); }
.footer-nav {
  display: flex;
  gap: 72px;
}
.footer-nav div {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-h { margin-bottom: 4px; }
.footer-nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  transition: color var(--t-fast), text-decoration-color var(--t-fast);
}
.footer-nav a:hover { color: var(--ink); text-decoration-color: var(--red); }
.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 56px;
  padding-top: 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  background: linear-gradient(var(--rule), var(--rule)) var(--gutter) 0 / calc(100% - 2 * var(--gutter)) 1px no-repeat;
}
.footer-base a { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.footer-base a:hover { color: var(--ink); text-decoration-color: var(--red); }

/* ---------- Scroll reveal (only when JS runs) ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 650ms var(--ease), transform 650ms var(--ease);
}
.js .reveal.is-in { opacity: 1; transform: none; }
.js .cards .reveal:nth-child(3n + 2),
.js .steps .reveal:nth-child(2) { transition-delay: 80ms; }
.js .cards .reveal:nth-child(3n + 3),
.js .steps .reveal:nth-child(3) { transition-delay: 160ms; }

/* ---------- Responsive ---------- */

/* Wide answer window: text and code side by side, as in the app. The code
   card is taken out of the flow, so its arrival never moves the text. */
@media (min-width: 760px) {
  .panel-body:has(> .code) {
    background: linear-gradient(to right, transparent 50%, var(--rule) 50%, var(--rule) calc(50% + 1px), var(--paper-2) calc(50% + 1px));
  }
  .panel-body:has(> .code) > :not(.code) { width: calc(50% - 24px); }
  .panel-body:has(> .code) > .code {
    position: absolute;
    top: 32px;
    left: calc(50% + 16px);
    right: 16px;
    margin: 0 0 24px;
  }
}

@media (max-width: 1100px) {
  .hero-copy::before { left: -18px; }
}

@media (max-width: 1040px) {
  .nav { display: none; }
  .header-cta { margin-left: auto; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .js .cards .reveal:nth-child(n) { transition-delay: 0ms; }
  .js .cards .reveal:nth-child(2n) { transition-delay: 80ms; }
  .providers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .screen-side { display: none; }
  .ev-grid { columns: 2; }
  .hero-top { grid-template-columns: minmax(0, 1fr); }
  .hero-top .hero-copy,
  .app-icon--hero { grid-column: 1; grid-row: auto; }
  .app-icon--hero { --s: clamp(96px, 14vw, 120px); margin-bottom: 36px; }
  .hero-title { font-size: clamp(44px, 8vw, 80px); }
  .hero-copy::before { top: -12px; }
}

@media (max-width: 960px) {
  .stage { padding-bottom: 64px; }
  .stage-top { top: auto; bottom: 22px; left: 22px; right: 22px; }
  .screen { inset: 20px 16px 52px; }
  .dl-grid { grid-template-columns: minmax(0, 1fr); max-width: 560px; margin-inline: auto; }
  .dl-note { margin-top: 0; }
}

@media (max-width: 860px) {
  .section-head--split { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .faq-grid { grid-template-columns: 1fr; gap: 28px; }
  .faq-grid .section-head { position: static; }
  .sc-grid { grid-template-columns: minmax(0, 1fr); }
  .sc-note { margin-left: 0; width: 100%; }
  .demo-tab { flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; height: 58px; padding: 0 12px; }
  .tab-l { font-size: 13px; max-width: 100%; }
  .stage { padding: 0 20px 64px; }

  /* Data table as stacked rows */
  .data-table thead { display: none; }
  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table th,
  .data-table td { display: block; width: auto !important; }
  .data-table tr { padding: 18px 20px; border-bottom: 1px solid var(--rule); }
  .data-table tbody tr:last-child { border-bottom: 0; }
  .data-table th,
  .data-table td { padding: 0; border: 0; }
  .data-table tbody th { margin-bottom: 10px; }
  .data-table td + td { margin-top: 10px; }
  .data-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    font: 500 11px / 1.4 var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
  }
}

@media (max-width: 720px) {
  /* The toolbar keeps its labels and drops what a phone has no room for. */
  .tb-info,
  .tb-settings .tb-label,
  .tb-settings .kbd-group,
  .tb-more .tb-label,
  .tb-status-keys,
  .bar-shot .kbd-group,
  .bar-mode .kbd-group { display: none; }
}

@media (max-width: 640px) {
  .hero { padding: 48px 0 72px; }
  .hero-copy::before { display: none; }
  .demo { margin-top: 48px; }
  .section { padding: 80px 0; }
  .section--tight { padding: 56px 0; }
  .section-head { margin-bottom: 36px; }
  .cards { grid-template-columns: 1fr; }
  .js .cards .reveal:nth-child(n) { transition-delay: 0ms; }
  .ev-grid { columns: 1; }
  .notice { padding: 24px 20px 24px 44px; }
  .notice-mark { left: 18px; top: 22px; bottom: 22px; }
  .footer-nav { gap: 48px; }
  .cta-band { padding: 88px 0; }
  .terminal { padding: 0 14px 14px; }
  .term-label { margin: 0 -14px 6px; padding-left: 44px; }
  .hide-sm { display: none; }
  .bar-lang,
  .tb-controls > .tb-sep { display: none; }
  .bar-shot .tb-label { display: none; }
  .panel { --panel-h: 420px; }
  .heard { padding: 10px 14px 10px 16px; gap: 12px; }
  .heard-label { min-width: 0; }
  .heard-body { font-size: 15px; }
}

@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn,
  .cta-stack { width: 100%; }
  .hero-actions--center { align-items: stretch; }
  .stage { padding: 0 8px 56px; border-radius: 16px; }
  .stage-top { left: 18px; right: 18px; bottom: 20px; }
  .screen { display: none; }
  .tb-brand { margin: 0 6px; padding: 0 2px 0 6px; }
  .heard { flex-direction: column; gap: 4px; padding: 10px 16px 12px; }
  .heard-head { height: 20px; }
  .panel-bar { padding-left: 16px; }
  .panel-loading { padding: 16px 16px 8px; }
  .draft-rules { margin: 0 -16px; }
  .panel-body { padding: 16px 16px 24px; }
  .panel-body ul,
  .panel-body ol { margin: 0 -16px 12px; padding: 0 16px 0 40px; }
  .panel-idle { margin: 0 -16px; padding: 0 16px; }
  .say p { font-size: 22px; line-height: 30px; }
  .providers { grid-template-columns: 1fr; }
  .ev-group { padding: 0 16px 12px; }
  .ev-head { margin: 0 -16px; padding: 0 16px; }
  .ev-list { margin: 0 -16px; padding: 4px 16px 0 36px; }
  .sc { padding: 0 16px 16px; }
  .sc-head { margin: 0 -16px 20px; padding: 12px 16px; }
  .sc-list li { flex-wrap: wrap; }
  .sc-keys { margin-left: auto; }
  .step { padding: 24px 20px 20px 72px; }
  .step::before { left: 52px; }
  .step-n { width: 52px; font-size: 26px; }
  .card { padding: 0 20px 24px; }
  .card-label { margin: 0 -20px 20px; padding: 0 52px 0 20px; }
  .provider { min-height: 0; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px; }
  .provider--key { align-items: flex-start; justify-content: flex-start; }
  .p-name { font-size: 22px; }
  .p-note { text-align: right; }
  .provider--key .p-note { text-align: left; }
  .demo-controls { gap: 6px; }
  .demo-play { width: 44px; }
  .demo-tabs { gap: 4px; }
  .demo-tab { padding: 0 8px; }
  .tab-l { font-size: 12px; }
}

@media (max-width: 420px) {
  .hide-xs { display: none; }
  .dl-card { padding: 0 16px 20px; }
  .dl-label { margin: 0 -16px 18px; padding: 0 16px; }
  .dl-file { padding: 10px 12px; }
  .term-os { min-width: 0; width: 100%; }
  /* Keep the label in the accessible name, hide it visually. */
  .tab-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .demo-tab { align-items: center; height: 46px; }
  .tab-n { font-size: 18px; }
  .tb-status { min-width: 0; }
  .tb-wordmark { font-size: 14px; }
  .mode-key { display: none; }
  .footer-nav { gap: 40px; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .hl { background-image: var(--img-scribble-still); }
  .draft-path { stroke-dashoffset: 0; }
  .draft-tip { display: none; }
  /* Poster only: the image under the video stays visible. */
  .app-icon video { display: none; }
  .js .app-icon:not(.is-static) img { visibility: visible; }
}
