/* Transcripts — one stylesheet, no framework. The site is seven static pages;
   a build pipeline for that is a liability, not an asset. */

:root {
  --bg: #ffffff;
  --fg: #16161a;
  --muted: #6b6b76;
  --line: #e6e6ec;
  --accent: #5b46e5;
  --accent-2: #7c3aed;
  --code-bg: #f7f7fa;
  --code-tab: #eeeef4;
  --tok-key: #7c3aed;
  --tok-str: #0a7c5a;
  --tok-num: #b25000;
  --tok-kw:  #b02a8f;
  --max: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101014;
    --fg: #ececf1;
    --muted: #9a9aa8;
    --line: #26262e;
    --accent: #8b7cf6;
    --accent-2: #a78bfa;
    --code-bg: #16161c;
    --code-tab: #1e1e26;
    --tok-key: #b7a6ff;
    --tok-str: #6ee7b7;
    --tok-num: #fbbf87;
    --tok-kw:  #f0a6e0;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.65 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- chrome --------------------------------------------------------------- */

.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.wordmark {
  display: flex; align-items: center; gap: .55rem;
  font-weight: 650; color: var(--fg); letter-spacing: -.01em;
}
.wordmark img { border-radius: 7px; }
.top nav { display: flex; gap: 1.25rem; font-size: .95rem; }

footer {
  border-top: 1px solid var(--line);
  margin-top: 4rem; padding: 2rem 1.5rem;
  color: var(--muted); font-size: .9rem;
}
footer p { max-width: var(--max); margin: 0 auto; }

main { padding: 0 1.5rem; }

/* --- landing -------------------------------------------------------------- */

.hero {
  --hero-top: 4.5rem;               /* one value: the padding AND the wave's offset */
  max-width: var(--max); margin: 0 auto; padding: var(--hero-top) 0 3rem;
  text-align: center;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 3.4rem); line-height: 1.08;
  letter-spacing: -.03em; margin: 0 0 1rem;
}
.hero .sub { font-size: 1.2rem; color: var(--muted); margin: 0 auto 2rem; max-width: 34rem; }

/* Block, not inline. As inline elements the mark and the beta pill shared a
   line box and were centred together — mark left of centre, pill right of it,
   sitting on the mark's baseline rather than under it. */
.hero .mark { display: block; width: 96px; height: 96px; border-radius: 22px; margin: 0 auto 1.5rem; }

.badges { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: .7rem 1.35rem; border-radius: 10px;
  background: var(--accent); color: #fff; font-weight: 600;
}
.btn:hover { background: var(--accent-2); text-decoration: none; }
.btn.secondary { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.beta {
  display: inline-block; margin-bottom: 1.25rem; padding: .3rem .7rem;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: .8rem; color: var(--muted); letter-spacing: .02em;
}

.claims {
  max-width: var(--max); margin: 4rem auto; display: grid; gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.claim h3 { margin: 0 0 .4rem; font-size: 1.05rem; letter-spacing: -.01em; }
.claim p { margin: 0; color: var(--muted); font-size: .95rem; }

.shots { max-width: 62rem; margin: 4rem auto; display: grid; gap: 1.25rem;
         grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.shots img { width: 100%; border: 1px solid var(--line); border-radius: 12px; }

.note {
  max-width: var(--max); margin: 3rem auto; padding: 1.1rem 1.25rem;
  border: 1px solid var(--line); border-radius: 12px;
  color: var(--muted); font-size: .93rem;
}

/* --- guide ---------------------------------------------------------------- */

/* Two columns on a wide screen: the sidebar is how you tell where you are in a
   guide of eleven pages, which a wrapped row of links cannot do. The grid
   collapses to one column before the sidebar starts squeezing the prose. */
.guide main {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 0 3rem;
  max-width: 66rem;
  margin: 0 auto;
  align-items: start;
}
.guide-body { min-width: 0; }             /* lets code blocks scroll, not stretch */

.guide-nav {
  position: sticky; top: 5rem;
  padding: 2.5rem 0 2rem;
  font-size: .9rem;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
}
.nav-section + .nav-section { margin-top: 1.6rem; }
.guide-nav h4 {
  margin: 0 0 .5rem; font-size: .72rem; font-weight: 650;
  letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
}
.guide-nav ul { list-style: none; margin: 0; padding: 0; }
.guide-nav li { margin: 0; }
.guide-nav a {
  display: block; padding: .3rem .7rem; margin-left: -.7rem;
  border-radius: 7px; color: var(--muted); line-height: 1.4;
}
.guide-nav a:hover { color: var(--fg); background: var(--code-bg); text-decoration: none; }
.guide-nav a.here {
  color: var(--accent); background: var(--code-bg); font-weight: 550;
  box-shadow: inset 2px 0 0 var(--accent);
}

@media (max-width: 56rem) {
  /* Above the content rather than beside it, and not sticky — a sticky nav on a
     short viewport eats the page. */
  .guide main { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .guide-nav {
    position: static; max-height: none; overflow: visible;
    padding: 1.5rem 0 1rem; margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
    display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 1.25rem 1.5rem; align-items: start;
  }
  .nav-section + .nav-section { margin-top: 0; }   /* the grid gap spaces them */
}

.guide-body > h1, .guide-body > h2, .guide-body > h3, .guide-body > h4,
.guide-body > p, .guide-body > ul, .guide-body > pre, .guide-body > hr,
.guide-body > img, .guide-body > table {
  max-width: var(--max); margin-left: 0; margin-right: 0;
}
.guide-body { padding: 2.5rem 0 1rem; }
.guide h1 { font-size: 2rem; letter-spacing: -.025em; margin: 2.25rem auto 1rem; }
.guide h2 { font-size: 1.3rem; letter-spacing: -.015em; margin: 2.5rem auto .6rem; }
.guide h3 { font-size: 1.05rem; margin: 1.75rem auto .4rem; }
.guide ul { padding-left: 1.2rem; }
.guide li { margin: .3rem 0; }
.guide img { display: block; width: 100%; border: 1px solid var(--line); border-radius: 10px; margin: 1.5rem auto; }
.guide hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem auto; }

code {
  background: var(--code-bg); padding: .12em .38em; border-radius: 5px;
  font: .88em ui-monospace, SFMono-Regular, Menlo, monospace;
}
pre {
  background: var(--code-bg); padding: .9rem 1.1rem; border-radius: 10px;
  overflow-x: auto; max-width: var(--max); margin: 1.25rem auto;
}
pre code { background: none; padding: 0; }

@media (max-width: 34rem) {
  .top { padding: .85rem 1rem; }
  main { padding: 0 1rem; }
  .hero { --hero-top: 3rem; }
}

.hero .brew {
  margin: 1.5rem auto 0; color: var(--muted); font-size: .9rem;
}
.hero .brew code { font-size: .95em; }

/* Temporary — removed once builds are notarized. Deliberately conspicuous:
   a Gatekeeper refusal with no warning reads as "this app is broken or
   malicious", which is a worse first impression than an honest caveat. */
.hero .unsigned {
  max-width: 34rem; margin: 2rem auto 0; padding: .9rem 1.1rem;
  border: 1px solid var(--line); border-radius: 12px;
  color: var(--muted); font-size: .85rem; line-height: 1.55; text-align: left;
}
.hero .unsigned code { display: inline-block; margin: .35rem 0; font-size: .95em; }

/* --- hero waveform -------------------------------------------------------- */

/* Deliberately plain. An earlier version faded the wave with two CSS mask
   layers composited by `mask-composite`, and used 100vw for full bleed — both
   diverge in Safari, where the composite is ignored (so the clear centre never
   appears) and vw counts the scrollbar (so the wave sits off-centre). The
   fading is arithmetic the canvas already does per bar, so none of it needed to
   be CSS in the first place.

   Width comes from a positioned full-bleed box rather than viewport units, so
   it never disagrees with the scrollbar. */
.hero { position: relative; --mark: 96px; --wave-h: 340px; }
#wave {
  position: absolute;
  /* Centred on the mark rather than aligned to its top: at twice the mark's
     height, top-alignment would hang the wave down over the version pill. The
     offset is derived from the two heights, so changing either keeps them
     concentric. */
  top: calc(var(--hero-top) - (var(--wave-h) - var(--mark)) / 2);
  left: 50%;
  transform: translateX(-50%);
  width: min(1000px, 92vw);
  height: var(--wave-h);
  pointer-events: none;
  z-index: 0;
}
.hero > *:not(#wave) { position: relative; z-index: 1; }

@media (max-width: 40rem) {
  .hero { --wave-h: 260px; }
}

/* --- code blocks ---------------------------------------------------------- */

/* A reference page is read by people who will copy from it, so the code wants
   to look like code: a distinct ground, a language tab, and enough colour to
   separate keys from values at a glance. Deliberately restrained — this is
   documentation, not a terminal emulator. */
.guide pre {
  position: relative;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.1rem 1.1rem .95rem;
  overflow-x: auto;
  font-size: .84rem;
  line-height: 1.65;
  margin: 1.4rem 0;
}
.guide pre[class^="lang-"]::before {
  content: attr(class);
  position: absolute; top: 0; right: 0;
  padding: .18rem .55rem;
  font-size: .66rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
  background: var(--code-tab);
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0 10px 0 8px;
}
.guide pre.lang-json::before { content: "json"; }
.guide pre.lang-bash::before { content: "bash"; }
.guide pre.lang-swift::before { content: "swift"; }
.guide pre code { background: none; padding: 0; font-size: inherit; }

.tok-key { color: var(--tok-key); }
.tok-str { color: var(--tok-str); }
.tok-num { color: var(--tok-num); }
.tok-lit { color: var(--tok-num); }
.tok-kw  { color: var(--tok-kw); font-weight: 500; }
.tok-var { color: var(--tok-key); }
.tok-com { color: var(--muted); font-style: italic; }

/* Schema tables. A reference page is mostly these, so they carry the weight:
   left-aligned, ruled between rows only, and the first column monospaced
   because it is always a key name. */
.guide table {
  width: 100%; max-width: var(--max); margin: 1.4rem auto;
  border-collapse: collapse; font-size: .92rem;
  display: block; overflow-x: auto;      /* narrow screens scroll the table, not the page */
}
.guide thead th {
  text-align: left; font-weight: 600; font-size: .8rem;
  letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  padding: 0 .8rem .5rem 0; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.guide tbody td {
  padding: .6rem .8rem .6rem 0; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.guide tbody tr:last-child td { border-bottom: 0; }
.guide tbody td:first-child { white-space: nowrap; }
.guide tbody td:first-child code { background: none; padding: 0; color: var(--tok-key); }
