/* buchiang — "Darkroom". Shared tokens, chrome and components; each page adds its own sheet. */
/* Geist and Geist Mono (SIL Open Font License, static/fonts/OFL.txt), served from this site: no third-party
   request. Variable fonts: one file per script covers every weight; latin-ext loads only if a page needs it. */
@font-face { font-family: "Geist"; font-style: normal; font-weight: 200 500; font-display: swap; src: url(/static/fonts/geist-latin.woff2?v=1) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 200 500; font-display: swap; src: url(/static/fonts/geist-latin-ext.woff2?v=1) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400 500; font-display: swap; src: url(/static/fonts/geist-mono-latin.woff2?v=1) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400 500; font-display: swap; src: url(/static/fonts/geist-mono-latin-ext.woff2?v=1) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
:root {
  --bg: #0D0F11; --bg-2: #121517; --fg: #E9EDEB; --dim: #8B9592; --faint: #4A5250;
  --line: rgba(233, 237, 235, .11); --line-2: rgba(233, 237, 235, .22);
  --teal: #37E2B2; --teal-rgb: 55, 226, 178;  /* the site's own accent; stays teal where --glow turns red */
  --glow: var(--teal); --glow-rgb: var(--teal-rgb); --crl: #FF6A55; --crl-rgb: 255, 106, 85;
  --text: rgba(233, 237, 235, .84);          /* long paragraphs: slightly softer than --fg, easier on a dark page */
  --pad: clamp(20px, 3vw, 44px);
  /* Chinese is set in the reader's own system font: no webfont to download, and it works where Google Fonts does not */
  --sans: "Geist", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, "PingFang SC", "Microsoft YaHei", monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: dark;
}
/* A rejected application turns the page's one accent red (liquid, bloom, marks): darkroom safelight. */
html[data-accent="crl"] { --glow: var(--crl); --glow-rgb: var(--crl-rgb); }
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { background: var(--bg); color: var(--fg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; -webkit-text-size-adjust: 100%; }
body { font: 400 15px/1.6 var(--sans); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; overflow-x: hidden; }
:lang(zh-CN) body { line-height: 1.75; }
main { flex: 1; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
img, canvas, svg { display: block; max-width: 100%; }
::selection { background: var(--glow); color: var(--bg); }
:focus-visible { outline: 1px solid var(--glow); outline-offset: 4px; border-radius: 2px; }
.sr { position: absolute; left: -9999px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }   /* for screen readers only */
.ph { display: inline-block; max-width: 100%; }                 /* a phrase that should not break inside */
:lang(zh-CN) { text-autospace: normal; }                        /* a hair of space where Chinese meets Latin or digits */
.sr:focus { left: var(--pad); top: 12px; z-index: 100; background: var(--fg); color: var(--bg); padding: 8px 14px; }
@view-transition { navigation: auto; }

/* film grain over the page, and a faint light that follows the cursor */
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 40; opacity: .5; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E"); }
.torch { position: fixed; inset: 0; pointer-events: none; z-index: 30; mix-blend-mode: screen;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 38%), rgba(140, 200, 185, .07), transparent 70%); }

/* ---------- type ---------- */
.mono { font: 400 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
:lang(zh-CN) .mono { font-size: 12px; letter-spacing: .12em; }
.prose p, p.prose { color: var(--text); max-width: 62ch; }
:lang(zh-CN) .prose p, :lang(zh-CN) p.prose { max-width: 34em; line-height: 1.9; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.thin { font-weight: 200; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); }
.glow { color: var(--glow); }
h1, h2, h3 { font-weight: 400; letter-spacing: -.025em; line-height: 1.1; }
:lang(zh-CN) h1, :lang(zh-CN) h2, :lang(zh-CN) h3 { letter-spacing: -.01em; line-height: 1.2; }
.h-xl { font: 300 clamp(34px, 4.4vw, 72px)/1.02 var(--sans); letter-spacing: -.04em; }
:lang(zh-CN) .h-xl { letter-spacing: -.01em; line-height: 1.15; }

/* ---------- chrome ---------- */
.top { position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; padding: 12px var(--pad) 22px;
  background: linear-gradient(var(--bg) 45%, rgba(13, 15, 17, 0)); }
.mark { font: 500 16px/1 var(--sans); letter-spacing: -.01em; display: flex; align-items: center; gap: 9px; }
.mark::before { content: ""; width: 7px; height: 16px; border-radius: 4px; background: linear-gradient(transparent 38%, var(--glow) 38%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55); }
.nav { display: flex; gap: clamp(14px, 2.2vw, 32px); font-size: 13px; align-items: center; }
.nav a { color: var(--dim); transition: color .3s; padding: 12px 0; }       /* 44px tap height */
.nav a:hover, .nav a[aria-current] { color: var(--fg); }
.lang { position: relative; font: 400 11px var(--mono); letter-spacing: .08em; color: var(--dim); border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px !important; transition: color .3s, border-color .3s; }
.lang::after { content: ""; position: absolute; inset: -9px 0; }          /* the pill stays small, the hit area is 44px */
.lang:hover { color: var(--fg); border-color: var(--dim); }
.foot { margin-top: clamp(70px, 12vh, 150px); padding: 22px var(--pad) 30px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 14px 28px; flex-wrap: wrap; color: var(--dim); font-size: 13px; }
.foot nav { display: flex; gap: 22px; }
.foot a:hover { color: var(--fg); }
.page { padding: clamp(96px, 14vh, 150px) var(--pad) 0; }

/* ---------- pieces ---------- */
.rule { border: 0; border-top: 1px solid var(--line); }
.facts { display: grid; grid-auto-flow: column; grid-auto-columns: max-content; gap: 0 clamp(20px, 3vw, 44px); padding-top: 16px; border-top: 1px solid var(--line); }
.facts b { display: block; font: 400 clamp(17px, 1.45vw, 21px)/1.25 var(--mono); letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.facts b em { font-style: normal; color: var(--dim); font-size: .7em; margin: 0 .2em 0 .12em; }
.tag { display: inline-flex; align-items: center; gap: 7px; font: 400 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); border: 1px solid var(--line); border-radius: 99px; padding: 6px 11px; white-space: nowrap; }
.tag::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.tag.approved { color: var(--glow); border-color: rgba(55, 226, 178, .35); }
.tag.crl { color: var(--crl); border-color: rgba(255, 106, 85, .35); }
.go { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; padding: 6px 0; border-bottom: 1px solid var(--line-2); transition: border-color .3s, gap .4s var(--ease); }
.go::after { content: "→"; font-family: var(--mono); }
.go:hover { border-color: var(--glow); gap: 16px; }

/* the capsule on its stage: frames on a canvas, a bloom over the liquid, a label at the base-rate level */
.stage { position: relative; aspect-ratio: 440 / 1100; --y: .9; --by: .3; }
.vial { position: absolute; inset: 0; animation: float 8s ease-in-out infinite; -webkit-box-reflect: below -15.5% linear-gradient(transparent 68%, rgba(0, 0, 0, .34)); }
.vial canvas, .mini canvas { width: 100%; height: 100%; }
@keyframes float { 50% { transform: translateY(-9px); } }
.bloom { position: absolute; left: -70%; right: -70%; top: calc(var(--y) * 100% - 12%); bottom: -6%; pointer-events: none; mix-blend-mode: screen; z-index: 3;
  background: radial-gradient(closest-side, rgba(var(--glow-rgb), .2), rgba(var(--glow-rgb), .06) 55%, transparent); filter: blur(18px); animation: breathe 5s ease-in-out infinite; }
.stage.is-crl .bloom { background: radial-gradient(closest-side, rgba(var(--crl-rgb), .2), rgba(var(--crl-rgb), .06) 55%, transparent); }
.stage.is-void canvas { filter: saturate(0) brightness(.8); }
.stage.is-void .bloom { display: none; }
@keyframes breathe { 50% { opacity: .68; } }
.tick { position: absolute; top: calc(var(--by) * 100%); right: calc((1 - var(--cap-left, .19)) * 100% + 10px); transform: translateY(-50%); display: flex; flex-direction: row-reverse; align-items: center; gap: 8px; white-space: nowrap; z-index: 4; transition: top 1.2s var(--ease); }
.tick i { width: 22px; height: 0; border-top: 1px dashed var(--dim); }
.mini { aspect-ratio: 440 / 1100; }
.mini .pill, .vial img { display: block; width: 100%; height: 100%; }     /* what stands in without scripts */

/* ---------- shared components (used by more than one page) ---------- */

/* .pill: a small capsule with no canvas and no script, cut from the sprite sheet.
   <span class="pill" style="background-position: {{ cap.sprite_position(45) }}"></span>; size it with `height` (or width). */
.pill { display: inline-block; aspect-ratio: 440 / 1100; height: 64px; background: url(/static/capsule/ink/sprite.webp?v=1) no-repeat; background-size: 1100% 1000%; }
.pill.crl { background-image: url(/static/capsule/crl/sprite.webp?v=1); }
.pill.void { filter: saturate(0) brightness(.8); }
.pill.wait { opacity: .5; }                  /* dim the image only, never the text next to it */

/* .gauge: a three-step level. <span class="gauge" data-level="low|medium|high"><i></i><i></i><i></i></span> */
.gauge { display: inline-flex; gap: 3px; vertical-align: middle; }
.gauge i { width: 4px; height: 12px; background: var(--faint); }
.gauge[data-level="low"] i:nth-child(-n+1), .gauge[data-level="medium"] i:nth-child(-n+2), .gauge[data-level="high"] i { background: var(--fg); }

/* .notches: weight of a factor: print 1, 2 or 4 <i> inside. */
.notches { display: inline-flex; gap: 2px; vertical-align: middle; }
.notches i { width: 5px; height: 5px; background: currentColor; }

/* Section head: a mono label on the left, the statement on the right. */
.sec { padding: clamp(70px, 12vh, 150px) var(--pad) 0; }
.sec-head { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: var(--pad); align-items: baseline; padding-bottom: 22px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.sec-head h2 { font: 300 clamp(28px, 3.4vw, 56px)/1.05 var(--sans); letter-spacing: -.035em; }
:lang(zh-CN) .sec-head h2 { letter-spacing: -.01em; line-height: 1.2; }

/* .fold: evidence on demand. <details class="fold"><summary>…</summary><div class="fold-body">…</div></details> */
.fold { border-bottom: 1px solid var(--line); }
.fold > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 16px 0; min-height: 44px; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: "+"; font: 300 22px/1 var(--mono); color: var(--dim); transition: transform .4s var(--ease), color .3s; }
.fold[open] > summary::after { transform: rotate(45deg); color: var(--fg); }
.fold > summary:hover::after { color: var(--fg); }
.fold-body { padding: 0 0 22px; }

/* key / value rows */
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0 clamp(16px, 2vw, 32px); }
.kv dt { color: var(--dim); padding: 11px 0; border-bottom: 1px solid var(--line); }
.kv dd { padding: 11px 0; border-bottom: 1px solid var(--line); }

.btn { font: 400 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); border: 1px solid var(--line-2); border-radius: 99px; padding: 8px 12px; transition: color .3s, border-color .3s; }
.btn:hover { color: var(--fg); border-color: var(--dim); }
.cmd { display: block; font: 400 13px/1.6 var(--mono); color: var(--fg); background: var(--bg-2); border: 1px solid var(--line); padding: 12px 14px; overflow-x: auto; white-space: pre; }

/* .dock: a slim bar under the header that keeps the forecast in view once the hero has scrolled away */
.dock { position: fixed; inset: 56px 0 auto 0; z-index: 19; display: flex; align-items: center; gap: clamp(12px, 2vw, 28px); height: 48px; padding: 0 var(--pad); background: var(--bg); border-bottom: 1px solid var(--line); transform: translateY(-120%); opacity: 0; transition: transform .5s var(--ease), opacity .3s; pointer-events: none; }
.dock::before { content: ""; position: absolute; inset: -56px 0 100% 0; background: var(--bg); }   /* no see-through strip under the header */
.dock.on { transform: none; opacity: 1; pointer-events: auto; }
.dock .pill { height: 34px; }

/* Reveal on scroll. site.js turns it on (class rv-on on <html>): if that script never arrives, nothing is hidden. */
.rv { transition: opacity 1s var(--ease), transform 1s var(--ease); }
.rv-on .rv:not(.in) { opacity: 0; transform: translateY(20px); }
.intro { animation: fade 1.2s .15s both; }
@keyframes fade { from { opacity: 0; } }

@media (max-width: 720px) {
  body::before { mix-blend-mode: normal; opacity: .22; }      /* blend modes over a whole page are costly on phones */
  .sec-head { grid-template-columns: 1fr; gap: 8px; }
}
@media (hover: none) {
  .torch { display: none; }
  .foot a { padding: 12px 0; }                                  /* 44px tap height */
  .go { min-height: 44px; }
  .mark { min-height: 44px; }
}
@media (max-width: 480px) {
  .mark { font-size: 0; gap: 0; min-width: 44px; min-height: 44px; }      /* keep the capsule glyph, drop the word: room for all three links */
  .nav { gap: 14px; font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01s !important; }
  .rv-on .rv:not(.in) { opacity: 1; transform: none; }
  @view-transition { navigation: none; }
}
