/* The fonts of the videos, served from here (Latin subsets of renderer/fonts, SIL OFL: fonts/LICENSE-*.txt). */
@font-face { font-family: "Unbounded"; src: url("/fonts/Unbounded-Variable.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/fonts/Manrope-Variable.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/IBMPlexMono-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/IBMPlexMono-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }

/* Layout: a video frame stretched into a page: a dotted stage, numbered chapter headers with a progress bar, card rows
   like the ones in the videos, and the spoken word lit the way the captions light it. Two themes, as the videos have:
   night (the default) and light (the light theme's colors), by the system's choice or the person's (data-theme). */
:root {
  --stage: #0a1224;
  --stage-low: #0f1d3a;
  --card: #111c36;
  --card-line: #26375c;
  --ink: #eef4ff;
  --ink-soft: #8fa3c7;
  --line: #5b6f99;
  --dot: #9fb6ff1f;
  --spoken: #38bdf8;
  --on-spoken: #04111f;
  --spoken-fill: #0b2a47;
  --spoken-ink: #7dd3fc;
  --go: #34d399;
  --go-fill: #0b2e2a;
  --go-ink: #6ee7b7;
  --amber: #fbbf24;
  --amber-fill: #33260b;
  --amber-ink: #fcd34d;
  --alarm: #e11d48;
  --on-alarm: #ffffff;
  --body-ink: #cfdcf3;
  --shadow: #02061799;
  --font-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --font-body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 10px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --stage: #eceef1;
    --stage-low: #f5f6f8;
    --card: #ffffff;
    --card-line: #d3d8df;
    --ink: #151a22;
    --ink-soft: #5d6674;
    --line: #9aa3b0;
    --dot: #1a243221;
    --spoken: #5b4bd5;
    --on-spoken: #ffffff;
    --spoken-fill: #f1eefe;
    --spoken-ink: #4b3cc4;
    --go: #1f9a78;
    --go-fill: #e6f5ef;
    --go-ink: #0d7a5c;
    --amber: #dca13a;
    --amber-fill: #fdf3e1;
    --amber-ink: #8a560c;
    --body-ink: #2a313c;
    --shadow: #1a24322e;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --stage: #eceef1;
  --stage-low: #f5f6f8;
  --card: #ffffff;
  --card-line: #d3d8df;
  --ink: #151a22;
  --ink-soft: #5d6674;
  --line: #9aa3b0;
  --dot: #1a243221;
  --spoken: #5b4bd5;
  --on-spoken: #ffffff;
  --spoken-fill: #f1eefe;
  --spoken-ink: #4b3cc4;
  --go: #1f9a78;
  --go-fill: #e6f5ef;
  --go-ink: #0d7a5c;
  --amber: #dca13a;
  --amber-fill: #fdf3e1;
  --amber-ink: #8a560c;
  --body-ink: #2a313c;
  --shadow: #1a24322e;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background-color: var(--stage);
  background-image:
    radial-gradient(var(--dot) 1.2px, transparent 1.6px),
    linear-gradient(180deg, var(--stage) 0%, var(--stage-low) 60%, var(--stage) 100%);
  background-size: 22px 22px, 100% 100%;
  color: var(--ink);
  font: 400 1rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--spoken-ink); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--spoken);
  outline-offset: 3px;
}
img { display: block; max-width: 100%; height: auto; }

.wrap { max-width: 1120px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 40px); }

/* The word being spoken, as the captions mark it. */
.spoken {
  background: var(--spoken);
  color: var(--on-spoken);
  border-radius: 6px;
  padding: 0 0.16em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Theme switch */
.theme { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--card-line); border-radius: 8px; background: transparent; color: var(--ink-soft); cursor: pointer; flex: none; }
.theme:hover { color: var(--ink); border-color: var(--spoken); }
.theme .ic { width: 20px; height: 20px; }

/* Header */
.top {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: color-mix(in srgb, var(--stage) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-line);
}
.top .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font: 600 0.95rem/1 var(--font-display); letter-spacing: 0.01em;
}
/* A 9:16 frame with a presenter's head and a caption bar. */
.mark {
  position: relative; width: 15px; height: 26px;
  border: 2px solid var(--spoken); border-radius: 4px;
}
.mark::before {
  content: ""; position: absolute; left: 2px; bottom: 8px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--ink);
}
.mark::after {
  content: ""; position: absolute; left: 2px; right: 2px; bottom: 3px;
  height: 2px; border-radius: 1px; background: var(--spoken);
}
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--ink-soft); text-decoration: none; font-size: 0.9rem; }
.nav a:hover { color: var(--ink); }
.login {
  display: inline-flex; align-items: center; height: 36px; padding-inline: 16px;
  border: 1px solid var(--spoken); border-radius: 8px;
  color: var(--spoken-ink); text-decoration: none; font-weight: 700; font-size: 0.9rem;
}
.login:hover { background: var(--spoken); color: var(--on-spoken); }
@media (max-width: 760px) {
  .nav { display: none; }
  .theme { margin-left: auto; }
}

/* Chapter header: number, name and a progress bar, like the top of every video. */
.chapter {
  display: flex; align-items: center; gap: 10px; margin: 0 0 12px;
  font: 500 0.78rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft);
}
.chapter b { color: var(--spoken); font-weight: 600; }
.progress { display: flex; gap: 4px; margin-left: auto; }
.progress i { width: 18px; height: 3px; border-radius: 2px; background: var(--card-line); }
.progress i.on { background: var(--spoken); }

h1, h2, h3 { text-wrap: balance; margin: 0; }
h2 {
  font: 600 clamp(1.5rem, 3.4vw, 2.3rem)/1.15 var(--font-display);
  text-transform: uppercase; letter-spacing: 0.005em;
}
.lede { color: var(--ink-soft); font-size: 1.08rem; max-width: 62ch; margin: 14px 0 0; }

section.chapter-section { padding-block: clamp(56px, 9vw, 104px); border-top: 1px solid var(--card-line); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; height: 46px; padding-inline: 22px;
  border: 0; border-radius: 8px; background: var(--spoken); color: var(--on-spoken);
  font: 700 0.98rem/1 var(--font-body); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--spoken-ink); }

/* A video frame on a phone */
.phone {
  margin: 0;
  border-radius: 22px; overflow: hidden;
  border: 1px solid var(--card-line);
  background: var(--card);
  box-shadow: 0 24px 60px var(--shadow);
  aspect-ratio: 9 / 16;
  max-width: 100%;
}
.phone img { width: 100%; height: 100%; object-fit: cover; }

/* Card rows, as the videos draw them */
.rows { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.row {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: start;
  padding: 14px 16px; border: 1px solid var(--card-line); border-radius: var(--radius); background: var(--card);
}
.row .ic { width: 28px; height: 28px; color: var(--ink); margin: 2px 0 0 4px; }
.row h3 { font: 800 0.92rem/1.3 var(--font-body); text-transform: uppercase; letter-spacing: 0.03em; }
.row p { margin: 4px 0 0; color: var(--ink-soft); font-size: 0.95rem; min-width: 0; }
.row > div { min-width: 0; }
.tag {
  font: 500 0.7rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-soft); padding: 5px 7px; border: 1px solid var(--card-line); border-radius: 5px; white-space: nowrap;
}
.row.lit { border-color: var(--spoken); background: var(--spoken-fill); }
.row.lit .ic, .row.lit .tag { color: var(--spoken-ink); }
.row.lit .tag { border-color: var(--spoken); }
.row.beta { border-color: var(--amber); background: var(--amber-fill); }
.row.beta .ic, .row.beta .tag { color: var(--amber-ink); }
.row.beta .tag { border-color: var(--amber); }

/* Footer */
.foot { border-top: 1px solid var(--card-line); padding-block: 32px; color: var(--ink-soft); font-size: 0.9rem; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.foot a { color: var(--ink-soft); }
.foot a:hover { color: var(--ink); }
.foot .legal { display: flex; gap: 20px; margin-left: auto; }
@media (max-width: 640px) { .foot .legal { margin-left: 0; } }

/* Legal pages */
.doc { max-width: 72ch; padding-block: clamp(40px, 7vw, 80px); }
.doc h1 { font: 600 clamp(1.7rem, 4vw, 2.4rem)/1.15 var(--font-display); text-transform: uppercase; }
.doc .meta { font: 500 0.8rem/1.5 var(--font-mono); color: var(--ink-soft); letter-spacing: 0.04em; margin: 12px 0 28px; }
.doc h2 { font-size: 1.05rem; margin: 40px 0 10px; letter-spacing: 0.02em; }
.doc p, .doc li { color: var(--body-ink); }
.doc ul { padding-left: 1.2em; display: grid; gap: 6px; }
.doc .summary {
  border: 1px solid var(--card-line); background: var(--card); border-radius: var(--radius);
  padding: 16px 20px; margin: 0 0 8px;
}
.doc .summary p { margin: 0 0 8px; }
.doc .summary ul { margin: 0; }

/* Beta strip on top of every page */
.beta-strip {
  display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 16px; background: var(--alarm); color: var(--on-alarm); text-align: center;
  font: 600 0.74rem/1.35 var(--font-mono); letter-spacing: 0.06em;
}
.beta-strip b { padding: 2px 6px; border: 1px solid var(--on-alarm); border-radius: 4px; font-weight: 600; }
