/* Manifest docs. Same tokens and typefaces as the app (web/static/app.css). */
@font-face {
  font-family: "GeneralSans-Variable";
  src: url("/static/fonts/GeneralSans-Variable.woff2") format("woff2");
  font-weight: 200 600;
  font-display: swap;
}
@font-face {
  font-family: "JetBrainsMono-Variable";
  src: url("/static/fonts/JetBrainsMono-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 800;
  font-display: swap;
}
:root {
  --top-h: 68px;
  --font-sans: "GeneralSans-Variable", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrainsMono-Variable", ui-monospace, Menlo, monospace;
  --bg: #ffffff;
  --bg-subtle: #f6f7f8;
  --border: rgba(28, 33, 39, .12);
  --fg: #171717;
  --fg-muted: #5c6168;
  --accent: #2563a8;
  --accent-hover: #1d4f87;
  --accent-subtle: #ecf3f9;
  --accent-deep: #14395f;
  --graphite: #1c2127;
  --warn-bg: #fff7e6;
  --warn-fg: #7a4b00;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light; }
body {
  margin: 0;
  font: 17px/1.6 var(--font-sans);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--bg); padding: 6px 10px; }

/* Header matches the app's graphite top bar: brand, docs sections, and one
   Sign in button. On wide screens it stays pinned while long pages scroll. */
.top {
  background: var(--graphite);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding-top: env(safe-area-inset-top);
}
.top-inner {
  max-width: 1120px; margin: 0 auto;
  padding: 0 max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
  min-height: var(--top-h);
  display: flex; align-items: center; gap: 28px;
}
.brand {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  color: #fff; text-decoration: none; font-weight: 600; font-size: 17px; flex: none;
}
.brand:hover { color: #fff; }
.brand-mark { width: 28px; height: 28px; border-radius: 3px; flex: none; display: block; }
/* "docs" shares the wordmark's baseline. Centering the two boxes set it 2.4px high. */
.brand-name { display: flex; align-items: baseline; gap: 10px; }
.brand-sub { font: 12px var(--font-mono); color: #aab2bd; font-weight: 400; }
.top-nav { display: flex; gap: 2px; margin-left: auto; }
.top-nav a {
  color: #c9d1d9; text-decoration: none; font-size: 15px; white-space: nowrap;
  padding: 0 12px; border-radius: 4px; min-height: 40px; display: inline-flex; align-items: center;
  transition: background-color 150ms ease-out, color 150ms ease-out;
}
.top-nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.top-nav a[aria-current="page"] { color: #fff; background: rgba(255,255,255,.1); box-shadow: inset 0 -2px 0 #8fb8e6; }
.top-cta {
  flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px;
  border-radius: 4px; background: var(--accent); color: #fff; text-decoration: none; font-size: 15px; font-weight: 500;
  transition: background-color 150ms ease-out;
}
.top-cta:hover { background: var(--accent-hover); color: #fff; }
/* The page accent is too dark to show a focus ring on graphite. */
.top :focus-visible, .video-card :focus-visible, footer :focus-visible { outline-color: #8fb8e6; }
@media (min-width: 761px) {
  .top { position: sticky; top: 0; z-index: 20; }
  h2, h3, [id] { scroll-margin-top: calc(var(--top-h) + 20px); }
}

main { max-width: 1120px; margin: 0 auto; padding: 72px 24px 112px; }
.prose { max-width: 70ch; }
.eyebrow {
  margin: 0 0 10px; font: 12px var(--font-mono); letter-spacing: .06em;
  text-transform: uppercase; color: var(--fg-muted);
}
h1 { font-size: 40px; line-height: 1.15; letter-spacing: -.025em; margin: 0 0 16px; font-weight: 600; text-wrap: balance; }
h2 { font-size: 26px; line-height: 1.25; letter-spacing: -.015em; margin: 56px 0 12px; font-weight: 600; text-wrap: balance; scroll-margin-top: 16px; }
h3 { font-size: 19px; line-height: 1.35; margin: 32px 0 8px; font-weight: 600; scroll-margin-top: 16px; }
p, ul, ol { margin: 0 0 16px; }
p, li { text-wrap: pretty; }
li { margin: 4px 0; }
.lede { font-size: 20px; line-height: 1.5; color: var(--fg-muted); max-width: 62ch; }
code, kbd, .mono { font-family: var(--font-mono); font-size: .88em; }
code { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px; }
b.ui { font-weight: 600; }

/* Four-way Diátaxis map on the landing page. */
.map { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 32px 0; }
.map a {
  display: block; padding: 22px 24px; border: 1px solid var(--border); border-top: 3px solid var(--graphite);
  text-decoration: none; color: var(--fg); background: var(--bg);
  transition: border-color 150ms ease-out, background-color 150ms ease-out;
}
.map a:hover { border-color: var(--accent); background: var(--accent-subtle); color: var(--fg); }
.map .kind { font: 12px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.map .title { display: block; font-size: 21px; font-weight: 600; margin: 6px 0 6px; }
.map .desc { color: var(--fg-muted); font-size: 16px; }

.video-card {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 28px; align-items: center;
  background: var(--graphite); color: #e6eaef; padding: 24px; margin: 32px 0;
}
/* A video poster that opens the player dialog (assets/video-dialog.js). */
.video-poster {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
  background: #14181d; border: 1px solid rgba(255,255,255,.12); color: #fff; text-decoration: none;
}
.video-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Bottom right: the poster's own title sits left of centre. */
.video-poster .play {
  position: absolute; right: 4%; bottom: 7%;
  display: inline-flex; align-items: center; gap: 12px; white-space: nowrap;
  padding: 14px 24px 14px 18px; border-radius: 999px; background: var(--accent);
  font-size: 17px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.35);
  transition: background-color 150ms ease-out, transform 160ms cubic-bezier(.2,.8,.2,1);
}
.video-poster .play svg { width: 22px; height: 22px; flex: none; }
.video-poster:hover { color: #fff; }
.video-poster:hover .play { background: var(--accent-hover); }
.video-poster:active .play { transform: scale(.97); }
.video-poster:focus-visible { outline-offset: 3px; }
@media (max-width: 420px) { .video-poster .play { padding: 11px 18px 11px 14px; font-size: 15px; } }
.video-card h2 { color: #fff; margin: 0 0 8px; font-size: 24px; }
.video-card p { color: #b9c1cb; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px;
  background: var(--accent); color: #fff; text-decoration: none; border-radius: 4px; font-weight: 500;
}
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid rgba(255,255,255,.35); }
.btn-ghost:hover { background: rgba(255,255,255,.08); }

/* Steps in the tutorial. */
ol.steps { list-style: none; padding: 0; counter-reset: step; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 52px; margin: 0 0 48px; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 34px; height: 34px; border: 1.5px solid var(--graphite); border-radius: 50%;
  display: grid; place-items: center; font: 14px var(--font-mono);
}
ol.steps > li > h3 { margin-top: 4px; }

figure { margin: 20px 0 8px; }
figure img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
}
figcaption { font-size: 14px; color: var(--fg-muted); margin-top: 8px; }

.expect, .note, .warn {
  padding: 12px 16px; margin: 16px 0; border-left: 3px solid; font-size: 16px;
}
.expect { background: var(--accent-subtle); border-color: var(--accent); color: var(--accent-deep); }
.note { background: var(--bg-subtle); border-color: #9aa3ad; }
.warn { background: var(--warn-bg); border-color: #d48a00; color: var(--warn-fg); }
.expect strong, .note strong, .warn strong { font-weight: 600; }

/* Reference tables. */
.table-wrap { overflow-x: auto; margin: 16px 0 24px; border: 1px solid var(--border); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--border); }
th { background: var(--bg-subtle); font-weight: 600; font-size: 13px; letter-spacing: .02em; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }

.toc { border: 1px solid var(--border); padding: 16px 20px; margin: 24px 0 8px; max-width: 70ch; }
.toc p { margin: 0 0 6px; font-weight: 600; font-size: 15px; }
.toc ul { margin: 0; padding-left: 20px; columns: 2; column-gap: 32px; }
.toc li { font-size: 15px; break-inside: avoid; }

.next { margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.next a { font-weight: 500; }

footer { border-top: 1px solid var(--border); color: var(--fg-muted); font-size: 14px; }
footer .inner {
  max-width: 1120px; margin: 0 auto; padding: 24px 24px max(24px, env(safe-area-inset-bottom));
  display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap;
}
footer nav { display: flex; gap: 4px 20px; flex-wrap: wrap; }
footer nav a { display: inline-flex; align-items: center; min-height: 44px; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  h1 { font-size: 31px; }
  h2 { font-size: 23px; margin-top: 44px; }
  .lede { font-size: 18px; }
  .map { grid-template-columns: 1fr; }
  .video-card { grid-template-columns: 1fr; padding: 18px; }
  .toc ul { columns: 1; }
  ol.steps > li { padding-left: 44px; }

  /* Two rows: brand and Sign in, then the docs sections as one scrolling
     row with full-size touch targets. */
  .top-inner { flex-wrap: wrap; row-gap: 4px; padding-top: 14px; padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); min-height: 0; }
  .top-cta { margin-left: auto; min-height: 44px; }
  .top-nav {
    order: 3; flex: 1 0 100%; margin: 0 -18px; padding: 0 18px 10px; gap: 4px;
    overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 28px), transparent);
            mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 28px), transparent);
  }
  .top-nav::-webkit-scrollbar { display: none; }
  .top-nav a { min-height: 44px; flex: none; }
  main { padding: 40px 18px 80px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
