/* Palette and type follow the episode videos: near-black, warm white, cyan line art,
   red for stamps, gold for what matters, a serif for anything said out loud. */
@font-face {
  font-family: "Cormorant Garamond";
  src: url("fonts/CormorantGaramond.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --navy-900: #0b0f14;
  --navy-800: #111821;
  --navy-700: #18222c;
  --ink: #f5f3ee;
  --ink-muted: #c3c8cd;
  --ink-faint: #8a94a0;
  --cyan: #6fd3e6;
  --gold: #e8b65a;
  --pen: #e0605a;
  --line: #293a43;
  --card: rgba(17, 24, 33, 0.72);
  --radius: 8px;
  --max: 1080px;
  --serif: "Cormorant Garamond", "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  color-scheme: dark;
}
/* Chinese reads in Songti, as in the Chinese videos; Cormorant's figures look odd beside it. */
html[data-lang="zh"] { --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", Georgia, serif; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--navy-900);
  color: var(--ink);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-underline-offset: 3px; }
a:hover { color: #a6e6f2; }
a:focus-visible, button:focus-visible, video:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(11, 15, 20, 0.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 22px; }
.brand img { width: 30px; height: 30px; }
.nav { display: flex; align-items: center; gap: 22px; font-size: 15px; }
.brand-group { display: flex; align-items: center; gap: 12px; min-width: 0; }
.menu-link { color: var(--ink-muted); text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; font-size: 14px; white-space: nowrap; }
.menu-link:hover, .menu-link:focus-visible { color: var(--ink); }
.nav a { color: var(--ink-muted); text-decoration: none; }
.nav a:hover { color: var(--ink); }
.nav .btn { color: var(--navy-900); }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 999px; font-weight: 650; text-decoration: none; background: var(--cyan); color: var(--navy-900); border: 1px solid transparent; }
.btn:hover { background: #a6e6f2; color: var(--navy-900); }
.btn.ghost { background: transparent; color: var(--ink); border-color: rgba(111, 211, 230, 0.45); }
.btn.ghost:hover { border-color: var(--cyan); color: var(--ink); }
.btn.small { padding: 7px 13px; font-size: 14px; }

/* Hero */
.hero { padding: 72px 0 40px; }
section.hero { border-top: 0; }
.eyebrow { color: var(--cyan); font-weight: 650; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 14px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; font-variant-numeric: lining-nums; }
h1 { font-size: clamp(40px, 6.6vw, 70px); line-height: 1.06; letter-spacing: -0.01em; margin: 0 0 10px; }
h1 .mark { position: relative; white-space: nowrap; }
h1 .mark::after { content: ""; position: absolute; left: -6px; right: -6px; bottom: 2px; height: 0.42em; border-bottom: 4px solid var(--pen); border-radius: 50%; transform: rotate(-1.5deg); }
.hero .sub { font-size: clamp(22px, 3vw, 30px); color: var(--ink-muted); margin: 0 0 22px; font-weight: 500; }
.hero p.lead { max-width: 62ch; color: var(--ink-muted); margin: 0 0 28px; font-family: var(--serif); font-size: 22px; line-height: 1.45; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.cta .meta { color: var(--ink-faint); font-size: 14px; flex-basis: 100%; margin-top: 6px; }
.release-status { max-width: 68ch; padding: 14px 16px; border-left: 3px solid var(--cyan); background: var(--card); border-radius: 0 8px 8px 0; color: var(--ink-muted); font-size: 15px; margin: 24px 0 0; }
.release-status strong { color: var(--ink); }

/* Sections */
section { padding: 56px 0; border-top: 1px solid var(--line); }
section.flush { border-top: 0; padding-top: 8px; }
h2 { font-size: clamp(30px, 4vw, 42px); line-height: 1.15; margin: 0 0 14px; }
h3 { font-size: 23px; margin: 0 0 8px; }
.section-lead { color: var(--ink-muted); max-width: 64ch; margin: 0 0 28px; }

.video-frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #000; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); }
.video-frame video { display: block; width: 100%; aspect-ratio: 16 / 9; }
.note { color: var(--ink-faint); font-size: 14px; margin-top: 10px; }

.grid { display: grid; gap: 18px; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card p { color: var(--ink-muted); margin: 0; }
.step-num { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border: 2.5px solid var(--pen); border-radius: 50%; color: var(--pen); font-weight: 800; margin-bottom: 12px; transform: rotate(-4deg); }
kbd { font: 600 14px/1 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--navy-700); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 3px 7px; color: var(--ink); }

.compare { width: 100%; border-collapse: collapse; font-size: 15px; }
.compare th, .compare td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare th { color: var(--ink-faint); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
.compare td:first-child { font-weight: 600; color: var(--ink); }
.compare td { color: var(--ink-muted); }
.compare tr.us td { color: var(--ink); background: rgba(232, 182, 90, 0.08); }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }

.usecase { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: center; }
.usecase svg { width: 100%; height: auto; display: block; border-radius: var(--radius); border: 1px solid var(--line); }
.quote { background: var(--navy-800); border-left: 3px solid var(--pen); padding: 14px 16px; border-radius: 8px; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; margin: 16px 0; }

ul.checks { list-style: none; padding: 0; margin: 0; }
ul.checks li { padding-left: 26px; position: relative; margin: 8px 0; color: var(--ink-muted); }
ul.checks li::before { content: ""; position: absolute; left: 4px; top: 0.55em; width: 10px; height: 10px; border-radius: 2px; border: 1.5px solid var(--cyan); }

details { border-bottom: 1px solid var(--line); padding: 14px 0; }
summary { cursor: pointer; font-weight: 600; }
details p { color: var(--ink-muted); margin: 10px 0 0; }

figure.shot { margin: 8px 0 18px; }
figure.shot img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.split figure.shot { margin: 0; }
figure.shot.cutout img { border: 0; border-radius: 0; filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.5)); }
figure.shot figcaption { color: var(--ink-faint); font-size: 14px; margin-top: 10px; }

/* Scenario videos */
.scenarios { margin-bottom: 18px; }
.scenario { display: flex; flex-direction: column; gap: 10px; padding: 14px 14px 20px; }
.scenario .video-frame { border-radius: 10px; box-shadow: none; margin-bottom: 8px; }
.scenario .eyebrow { margin: 4px 6px 0; font-size: 13px; }
.scenario h3, .scenario p { margin-left: 6px; margin-right: 6px; }
.scenario h3 { margin-bottom: 0; }
.scenario .note { margin-top: auto; padding-top: 4px; }

/* Article pages */
.article { max-width: 760px; }
.article p, .article li { color: var(--ink-muted); }
.article h2 { margin-top: 40px; }
.article .hero { padding: 24px 0 20px; }
.article h1 { font-size: clamp(38px, 5.4vw, 56px); }
.article figure.wide { position: relative; left: 50%; transform: translateX(-50%); width: min(1040px, calc(100vw - 40px)); }
.crumb { font-size: 14px; color: var(--ink-faint); margin: 32px 0 0; }
.crumb a { color: var(--ink-faint); }

/* Download choices */
.downloads .hero { padding-bottom: 40px; }
.downloads h1 { max-width: 18ch; }
.download-options { align-items: stretch; }
.download-options .card .eyebrow { color: var(--cyan); margin-bottom: 12px; }
.download-options h2 { font-size: 27px; }
.download-options .card .download-action { margin-top: 22px; }
.download-options .card .note { margin-top: 18px; font-size: 14px; }
.first-use-steps { max-width: 78ch; padding-left: 24px; color: var(--ink-muted); }
.first-use-steps li { padding-left: 6px; margin-bottom: 18px; }
.first-use-steps strong { color: var(--ink); }
.downloads section > p:not(.eyebrow) { max-width: 78ch; color: var(--ink-muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--ink-faint); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.site-footer a { color: var(--ink-muted); text-decoration: none; margin-right: 18px; }
.site-footer a:hover { color: var(--ink); }
.site-footer .credit { flex-basis: 100%; margin: 0; }
.site-footer .credit a { margin-right: 0; color: var(--ink-muted); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 820px) {
  .grid.three, .grid.two, .usecase, .split { grid-template-columns: 1fr; }
  .split figure.shot { order: -1; }
  .nav a:not(.btn) { display: none; }
  .brand-group .brand { display: none; } /* the Menu button already goes home */
  .hero { padding-top: 48px; }
}

/* Drift episodes: language toggle, spoiler gate, papers, letters, numbers, copyable prompts */
html[data-lang="en"] body [lang="zh"], html[data-lang="zh"] body [lang="en"] { display: none !important; }
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-switch button { background: transparent; color: var(--ink-muted); border: 0; padding: 6px 11px; font: inherit; font-size: 14px; cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: var(--cyan); color: var(--navy-900); font-weight: 650; }
.spoiler { border-left-color: var(--pen); }
.papers { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 8px 0 22px; }
.paper { background: var(--navy-800); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.paper .lbl { display: block; color: var(--ink-faint); font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.paper .val { font: 700 28px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); }
.paper .val.bad { color: var(--pen); text-decoration: underline wavy var(--pen); text-underline-offset: 6px; }
.letter { max-width: 520px; background: var(--navy-800); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; font: 15px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); margin: 8px 0 18px; }
.letter .stamp { color: var(--pen); font-weight: 700; }
.letter .why { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--cyan); }
.numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 8px 0 24px; }
.numbers .card { padding: 18px; }
.numbers .big { display: block; font-size: 30px; font-weight: 800; line-height: 1.1; color: var(--ink); margin-bottom: 6px; }
.numbers p { font-size: 14px; }
td.hit { color: var(--cyan) !important; font-weight: 600; }
.prompt { position: relative; margin: 10px 0 18px; }
.prompt pre { margin: 0; white-space: pre-wrap; word-break: break-word; background: var(--navy-800); border: 1px solid var(--line); border-radius: 10px; padding: 16px; font: 13.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink-muted); }
.prompt .copy { position: absolute; top: 0; right: 0; }
.prompt h3 { font-size: 15px; color: var(--ink-faint); margin: 0 0 8px; line-height: 32px; }
@media (max-width: 820px) { .papers { grid-template-columns: 1fr; } }
