/* Layout: a transcript's two columns carry every section — a narrow,
   right-aligned label gutter (where the app prints the speaker) and a reading
   column. Colour means who is speaking: cyan is the microphone, indigo is the
   call. The app window is drawn in the app's own dark palette in both themes. */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --sunken: #e9ecf1;
  --line: #d8dce4;
  --text: #12151a;
  --soft: #343b47;
  --muted: #566070;
  --mic: #07749a;        /* the two channel inks at text strength */
  --remote: #5a46d8;
  --ink-mic: #4cc9f0;    /* the app icon's inks, for fills only */
  --ink-remote: #8b7bf0;

  --display: "Iowan Old Style", Charter, "Sitka Heading", "Sitka Text", Cambria, "Noto Serif", Georgia, serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --gutter: 7.5rem;
  --wrap: 71rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d11;
    --surface: #14171c;
    --sunken: #07080b;
    --line: #262b35;
    --text: #e7e9ee;
    --soft: #c4c9d3;
    --muted: #939baa;
    --mic: #4cc9f0;
    --remote: #9d8ff5;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ol, ul, figure, pre { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 0.2em; }
a:hover { text-decoration-color: currentColor; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--remote); outline-offset: 3px; border-radius: 4px; }
code, kbd { font-family: var(--mono); font-size: 0.9em; }
p code, li code { background: var(--sunken); padding: 0.1em 0.35em; border-radius: 4px; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0.05em 0.4em; background: var(--surface); white-space: nowrap; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
  padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
}

/* ── top bar ─────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.top .wrap { display: flex; align-items: center; gap: 1.75rem; height: 3.75rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 650; letter-spacing: -0.01em; text-decoration: none; }
.tile {
  display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 29%;
  background: linear-gradient(#252b36, #0f1116);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.tile svg { width: 60%; display: block; }
.top nav { display: flex; gap: 1.5rem; margin-left: auto; font-size: 0.9375rem; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--text); }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--text); color: var(--bg);
  border-radius: 999px; padding: 0.7rem 1.35rem;
  font-weight: 600; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: color-mix(in srgb, var(--text) 86%, var(--remote)); }
.btn.small { padding: 0.4rem 0.95rem; font-size: 0.9375rem; }

/* ── hero ────────────────────────────────────────────────── */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3.5rem, 7vw, 6rem); overflow: clip; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: clamp(2rem, 4.5vw, 4.5rem); align-items: center; }
.quote { display: block; width: 3.75rem; aspect-ratio: 480 / 390; margin-bottom: 1.5rem; }
h1 {
  font: 400 clamp(2.4rem, 1.2rem + 2.7vw, 3.4rem)/1.06 var(--display);
  letter-spacing: -0.018em; text-wrap: balance;
}
h1 span { display: block; color: var(--muted); }
.lede { margin-top: 1.5rem; font-size: 1.1875rem; line-height: 1.55; color: var(--soft); max-width: 33rem; }
.cta { margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; }
.cta .more { font-weight: 550; }
.meta { margin-top: 1.25rem; font-size: 0.9375rem; color: var(--muted); }

.hero-demo { position: relative; isolation: isolate; min-width: 0; }
.hero-demo::before {
  /* the icon's two ink pools, one behind each side of the window */
  content: ""; position: absolute; inset: -14% -10%; z-index: -1; filter: blur(24px);
  background:
    radial-gradient(closest-side at 24% 62%, color-mix(in srgb, var(--ink-mic) 30%, transparent), transparent),
    radial-gradient(closest-side at 78% 58%, color-mix(in srgb, var(--ink-remote) 32%, transparent), transparent);
}
.demo-bar { margin-top: 1.1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.seg button { border: 0; background: none; border-radius: 999px; padding: 0.35rem 0.9rem; font-size: 0.875rem; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.demo-note { flex: 1 1 14rem; font-size: 0.875rem; line-height: 1.45; color: var(--muted); }

/* ── the app, drawn in its own palette (Theme.qml) ───────── */
.app {
  --a-bg: #101216; --a-surface: #191c22; --a-hi: #20242c; --a-control: #282d35; --a-line: #2a2f39;
  --a-text: #e7e9ee; --a-muted: #8b93a1; --a-dim: #7d8594;
  --a-mic: #4cc9f0; --a-remote: #8b7bf0; --a-rec: #ff5f56; --a-good: #3ddc84;
  --a-accent: #6aa2ff; --a-accent-text: #0d1117;
  background: var(--a-bg); color: var(--a-text);
  border: 1px solid var(--a-line); border-radius: 0.9rem; overflow: hidden;
  box-shadow: 0 32px 64px -28px rgba(10, 12, 16, 0.55), 0 10px 22px -12px rgba(10, 12, 16, 0.35);
  font-size: 0.9375rem; line-height: 1.4;
}
.app-title { display: flex; align-items: center; gap: 0.55rem; padding: 0.6rem 0.9rem; background: var(--a-surface); border-bottom: 1px solid var(--a-line); font-size: 0.8125rem; color: var(--a-muted); }
.app-title .tile { width: 1.1rem; height: 1.1rem; }
.app-head { display: flex; align-items: center; gap: 0.9rem; padding: 0.9rem 1.1rem 0.7rem; }
.phase { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 650; font-size: 0.8125rem; letter-spacing: 0.06em; }
.dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--a-rec); }
.app[data-state="done"] .dot { background: var(--a-good); }
.clock { font-family: var(--mono); font-size: 0.8125rem; color: var(--a-muted); font-variant-numeric: tabular-nums; }
.chips { margin-left: auto; display: flex; gap: 0.4rem; }
.chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.65rem; border-radius: 999px; background: var(--a-control); font-size: 0.8125rem; }
.chip::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: currentColor; }
.chip.mic, .who.mic { color: var(--a-mic); }
.chip.remote, .who.remote { color: var(--a-remote); }
.chip b { color: var(--a-text); font-weight: 500; }

.caps { display: grid; gap: 0.8rem; padding: 0.6rem 1.1rem 1.2rem; }
.caps li { display: grid; grid-template-columns: 4.4rem 2.5rem minmax(0, 1fr); column-gap: 0.8rem; align-items: baseline; }
.who { text-align: right; font-weight: 600; font-size: 0.8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.caps time { font-family: var(--mono); font-size: 0.75rem; color: var(--a-dim); font-variant-numeric: tabular-nums; }
.caps p { line-height: 1.38; }
/* The two lines the script types in start hidden, so they never flash before it runs. */
.anim .caps li[data-late] { visibility: hidden; }
.tail { color: var(--a-dim); }
.rest { visibility: hidden; }  /* words not spoken yet still hold their space, so nothing below moves */
.app-foot { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1.1rem; border-top: 1px solid var(--a-line); background: var(--a-surface); min-height: 3.4rem; }
.app-foot .path { flex: 1; min-width: 0; font-family: var(--mono); font-size: 0.75rem; color: var(--a-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.abtn { margin-left: auto; padding: 0.4rem 0.9rem; border-radius: 0.5rem; background: var(--a-control); font-size: 0.8125rem; white-space: nowrap; }
.abtn.primary { background: var(--a-accent); color: var(--a-accent-text); font-weight: 600; }
.app[data-state="live"] .when-done, .app[data-state="done"] .when-live { display: none; }

/* ── sections on the transcript grid ─────────────────────── */
.section { padding-block: clamp(3.5rem, 7vw, 6.5rem); }
.band { background: var(--surface); border-block: 1px solid var(--line); }
.g { display: grid; grid-template-columns: var(--gutter) minmax(0, 1fr); column-gap: 2.5rem; align-items: baseline; }
.label { font: 500 0.8125rem/1.4 var(--mono); color: var(--muted); text-align: right; }
h2 { font: 400 clamp(1.9rem, 1.2rem + 1.9vw, 2.75rem)/1.1 var(--display); letter-spacing: -0.014em; text-wrap: balance; max-width: 24ch; }
.intro { margin-top: 1.1rem; color: var(--soft); max-width: 38rem; }
h3 { font: 400 1.5rem/1.2 var(--display); letter-spacing: -0.008em; text-wrap: balance; }
.body > h3 + p { margin-top: 0.65rem; color: var(--soft); max-width: 36rem; }

.stack { display: grid; gap: clamp(2.75rem, 5vw, 4.25rem); margin-top: clamp(2.75rem, 5vw, 4rem); }
.reason { grid-template-columns: var(--gutter) minmax(0, 25.5rem) minmax(0, 1fr); }
.spec { align-self: start; min-width: 0; }
.spec figcaption { margin-top: 0.7rem; font-size: 0.875rem; line-height: 1.45; color: var(--muted); }

.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 0.75rem; }
.band .sheet { background: var(--bg); }
.folder { padding: 1rem 1.15rem 1.1rem; }
.folder .where { font: 0.75rem/1.5 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.folder ul { margin-top: 0.7rem; display: grid; gap: 0.4rem; }
.folder li { display: grid; grid-template-columns: 11.5rem minmax(0, 1fr); column-gap: 0.75rem; align-items: baseline; font-size: 0.875rem; color: var(--muted); }
.folder li code { background: none; padding: 0; color: var(--text); font-size: 0.8125rem; }

.app.card { box-shadow: 0 18px 36px -22px rgba(10, 12, 16, 0.5); }
.card-h { padding: 0.8rem 1.1rem 0.3rem; font-size: 0.75rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--a-muted); }
.voices { padding: 0.3rem 1.1rem 1rem; display: grid; gap: 0.75rem; }
.voices li { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto 1.9rem; column-gap: 0.75rem; align-items: center; }
.av { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; font-weight: 650; font-size: 0.8125rem; color: var(--a-bg); }
.av.mic { background: var(--a-mic); }
.av.remote { background: var(--a-remote); }
.nm { min-width: 0; display: grid; }
.nm b { font-weight: 600; }
.nm i { font-style: normal; font-size: 0.8125rem; color: var(--a-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field { justify-self: start; min-width: 9.5rem; padding: 0.2rem 0.6rem; border-radius: 0.4rem; border: 1px solid var(--a-accent); background: var(--a-hi); color: var(--a-dim); }
.dur { font-family: var(--mono); font-size: 0.75rem; color: var(--a-dim); }
.play { width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--a-control); display: grid; place-items: center; }
.play::before { content: ""; border-left: 0.5rem solid var(--a-text); border-block: 0.32rem solid transparent; margin-left: 0.14rem; }
.sources { padding: 1rem 1.1rem; display: grid; gap: 0.8rem; }
.sources li { display: grid; grid-template-columns: 5.6rem minmax(0, 1fr); column-gap: 0.9rem; align-items: baseline; font-size: 0.875rem; }
.sources .chip { justify-self: start; }

.oses li { grid-template-columns: 5.5rem minmax(0, 1fr); }
.term-col { display: grid; gap: 1rem; min-width: 0; }
.term pre { padding: 1rem 1.15rem; font: 0.8125rem/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.term .c { color: var(--a-dim); }
.term .p { color: var(--a-mic); }

.lines { padding: 1.05rem 1.2rem; display: grid; gap: 0.75rem; font-size: 0.9375rem; line-height: 1.5; }
.lines b { font-weight: 650; }
.lines .m { color: var(--mic); }
.lines .r { color: var(--remote); }
.ts { font-family: var(--mono); font-size: 0.8125em; color: var(--muted); }

/* ── steps ───────────────────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2.25rem, 4vw, 3.25rem) clamp(2rem, 5vw, 4.5rem); margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.steps .n { display: block; font: 500 0.8125rem/1.4 var(--mono); color: var(--muted); margin-bottom: 0.55rem; }
.steps h3 + p { margin-top: 0.65rem; color: var(--soft); max-width: 30rem; }
.aside { margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.aside p { color: var(--soft); max-width: 38rem; padding: 1rem 1.2rem; border-radius: 0.75rem; background: var(--sunken); }

/* ── files ───────────────────────────────────────────────── */
.files { display: grid; grid-template-columns: minmax(0, 21rem) minmax(0, 1fr); gap: clamp(1.75rem, 4vw, 3.5rem); align-items: start; margin-top: clamp(2rem, 4vw, 3rem); }
.points { display: grid; gap: 1.1rem; color: var(--soft); }
.points b { color: var(--text); font-weight: 600; }
.doc-col { min-width: 0; }
.cap { margin-top: 0.7rem; font-size: 0.875rem; line-height: 1.45; color: var(--muted); }
.tabs { display: none; gap: 0.25rem; padding: 0.4rem 0.4rem 0; border-bottom: 1px solid var(--line); }
.js .tabs { display: flex; }
.tabs button { border: 0; background: none; cursor: pointer; padding: 0.5rem 0.85rem; border-radius: 0.5rem 0.5rem 0 0; font-size: 0.875rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.doc .tabs button { font-family: var(--mono); font-size: 0.8125rem; }
.nojs-name { font: 500 0.8125rem/1.4 var(--mono); color: var(--muted); padding: 0.9rem 1.3rem 0; }
.js .nojs-name { display: none; }
.note-doc { padding: 1.2rem 1.3rem 1.3rem; font-size: 0.9375rem; line-height: 1.55; display: grid; gap: 0.7rem; }
.note-doc h4 { font: 400 1.35rem/1.2 var(--display); }
.note-doc h5 { margin: 0.5rem 0 0; font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.note-doc ul { display: grid; gap: 0.35rem; }
.note-doc li { padding-left: 1.4rem; position: relative; }
.note-doc li::before { content: ""; position: absolute; left: 0.25rem; top: 0.62em; width: 0.3rem; height: 0.3rem; border-radius: 50%; background: var(--muted); }
.note-doc li.todo::before { top: 0.3em; left: 0; width: 0.85rem; height: 0.85rem; border-radius: 0.2rem; background: none; border: 1.5px solid var(--muted); }
.note-doc .by { font-style: italic; color: var(--muted); font-size: 0.875rem; }

/* ── install ─────────────────────────────────────────────── */
.install { margin-top: clamp(2rem, 4vw, 2.75rem); max-width: 46rem; }
.install .tabs { padding: 0; }
.install .tabs button { font-size: 1rem; padding: 0.6rem 1.1rem; }
.os { padding-top: 1.5rem; }
.os + .os { margin-top: 1rem; }
.os h3 { font: 600 1.0625rem/1.3 var(--body); letter-spacing: 0; margin-bottom: 0.5rem; }
.js .os h3 { display: none; }
.needs { font-size: 0.9375rem; color: var(--muted); }
.todo-list { margin-top: 1.25rem; display: grid; gap: 1.1rem; counter-reset: n; }
.todo-list > li { counter-increment: n; display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); column-gap: 0.75rem; }
.todo-list > li::before { content: counter(n); font: 500 0.875rem/1.9 var(--mono); color: var(--muted); }
.todo-list > li > div { min-width: 0; }
.cmd { margin-top: 0.6rem; display: flex; align-items: stretch; background: var(--sunken); border: 1px solid var(--line); border-radius: 0.6rem; overflow: hidden; }
/* Wrapped, never scrolled: a command someone is asked to run should be readable in full. */
.cmd pre { flex: 1; min-width: 0; padding: 0.85rem 1rem; font: 0.8125rem/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.cmd code { background: none; padding: 0; font-size: inherit; }
.copy { border: 0; border-left: 1px solid var(--line); background: var(--surface); padding: 0 1rem; font-size: 0.875rem; font-weight: 600; cursor: pointer; min-width: 5.2rem; }
.copy:hover { background: color-mix(in srgb, var(--surface) 88%, var(--remote)); }
.fine { margin-top: 1.75rem; font-size: 0.9375rem; color: var(--muted); max-width: 42rem; }

/* ── questions ───────────────────────────────────────────── */
.qa { margin-top: clamp(1.5rem, 3vw, 2.25rem); max-width: 44rem; border-top: 1px solid var(--line); }
.qa details { border-bottom: 1px solid var(--line); }
.qa summary { cursor: pointer; padding: 1rem 2rem 1rem 0; font-weight: 600; list-style: none; position: relative; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; position: absolute; right: 0.25rem; top: 0.9rem; font: 400 1.25rem/1 var(--mono); color: var(--muted); }
.qa details[open] summary::after { content: "–"; }
.qa details p { padding: 0 2rem 1.15rem 0; color: var(--soft); }

/* ── foot ────────────────────────────────────────────────── */
.foot { padding-block: 2.5rem 3.5rem; border-top: 1px solid var(--line); font-size: 0.9375rem; color: var(--muted); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; margin-left: auto; }
.foot p { flex-basis: 100%; }

/* ── narrower screens ────────────────────────────────────── */
@media (max-width: 64rem) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-demo { max-width: 40rem; }
  .reason { grid-template-columns: var(--gutter) minmax(0, 1fr); }
  .reason .spec { grid-column: 2; margin-top: 1.5rem; max-width: 34rem; }
  .files { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 46rem) {
  .top nav a:not(.btn) { display: none; }
  .g { grid-template-columns: minmax(0, 1fr); }
  .label { text-align: left; margin-bottom: 0.5rem; }
  .reason { grid-template-columns: minmax(0, 1fr); }
  .reason .spec { grid-column: 1; }
  .caps li { grid-template-columns: 3.7rem 2.3rem minmax(0, 1fr); column-gap: 0.6rem; }
  .folder li { grid-template-columns: minmax(0, 1fr); }
  .copy { min-width: 4.4rem; padding: 0 0.7rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Language switch in the top bar: both flags side by side, the current one on
   a pill, so it reads as a choice between two. The two-letter code stays next
   to each flag because a flag alone is a country, not a language. */
.langs { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.langs > * { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.6rem; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; line-height: 1; text-decoration: none; color: var(--muted); }
.langs .on { background: var(--sunken); color: var(--text); }
.langs a:hover { color: var(--text); background: color-mix(in srgb, var(--sunken) 55%, transparent); }
.flag { display: block; width: 1.25rem; height: 0.875rem; border-radius: 2px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 22%, transparent); }
@media (max-width: 46rem) {
  .top .wrap { gap: 0.75rem; }
  .langs .code { display: none; }
  .langs > * { padding: 0.3rem 0.45rem; }
}
