/* Portfolio v2, the borderless article look (facts.md R231; deliverables/portfolio-v2/HANDOFF-2026-11-28-borderless.md,
   design/borderless-2026-11-28/site.css). Every color, corner, weight and type size is a token, so the theme engine
   (theme.js) restyles every component. Brand values below. No color is written outside :root (tokens.mjs checks). */

:root {
  --bg: #ffffff;
  --ink: #000000;
  --heading: #000000;
  --text: #000000;
  --link: #000000;
  --muted: rgba(0, 0, 0, 0.6);
  --underline: rgba(0, 0, 0, 0.35);
  --rule: rgba(0, 0, 0, 0.1);
  --rule-soft: rgba(0, 0, 0, 0.08);
  --rule-strong: rgba(0, 0, 0, 0.12);
  --chart-mark: #000000;
  --chart-base: rgba(0, 0, 0, 0.32);
  --chart-track: rgba(0, 0, 0, 0.07);
  --code-bg: #f4f4f4;
  --media-bg: #f4f4f4;
  --sep: rgba(0, 0, 0, 0.25);
  /* V2.1: semantic tokens for every color that is written out below. Brand values. */
  --surface: #ffffff;
  --well: rgba(0, 0, 0, 0.04);
  --hover: rgba(0, 0, 0, 0.08);
  --hover-soft: rgba(0, 0, 0, 0.04);
  --hover-glass: rgba(255, 255, 255, 0.55);
  --press: rgba(0, 0, 0, 0.12);
  --track: rgba(0, 0, 0, 0.04);
  --control-text: rgba(0, 0, 0, 0.6);
  --field-border: rgba(0, 0, 0, 0.32);
  --accent: #000000;
  --accent-hover: #222222;
  --accent-press: #000000;
  --on-accent: #ffffff;
  --accent-text: #000000;
  --second: #374151;
  --glass: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(0, 0, 0, 0.1);
  --scrim: rgba(0, 0, 0, 0.32);
  --shadow: rgba(0, 0, 0, 0.12);
  --r-xs: 4px;
  --r-sm: 10px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 40px;
  --display-weight: 500;
  --display-track: -0.03em;
  --display-case: none;
  --underline-style: solid;
  --underline-w: 1px;
  --rule-w: 1px;
  --rule-style: solid;
  --elev: none;
  --label-font: var(--voice);
  --label-case: none;
  --label-track: -0.015em;
  --label-color: var(--heading);
  --voice-text: var(--voice);
  --body-adjust: none;
  --dur-fast: .12s;
  --ease: ease;
  --t-title: 48px;
  --t-title-lh: 1.083;
  --t-sec: 30px;
  --t-sec-lh: 1.333;
  --t-stat: 34px;
  --sans: Geist, ui-sans-serif, system-ui, sans-serif;
  --voice: 'Instrument Sans', Geist, ui-sans-serif, system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
  --ring: color-mix(in srgb, var(--ink) 6%, transparent);
  --col: 672px;
  --hero: min(960px, calc(100vw - 48px));
  --wide: min(1120px, calc(100vw - 48px));
}

html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); font-family: var(--sans); color: var(--text); font-size: 17px; line-height: 28px; letter-spacing: -0.01em; -webkit-font-smoothing: antialiased; font-size-adjust: var(--body-adjust); font-size-adjust: var(--body-adjust); }
.site { overflow-x: hidden; overflow-x: clip; }
.page { max-width: var(--col); margin: 0 auto; padding: 0 24px; box-sizing: border-box; }
p { text-wrap: pretty; }
h1 { text-wrap: balance; }
::selection { background: var(--ink); color: var(--bg); }
img, video { max-width: 100%; }

a { color: var(--link); text-decoration: underline; text-decoration-color: var(--underline); text-decoration-thickness: var(--underline-w); text-decoration-style: var(--underline-style); text-underline-offset: 3px; }
a:hover { color: var(--ink); text-decoration-color: var(--ink); }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.plain, .plain:hover { color: var(--heading); text-decoration: none; }
.small { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--muted); }
.muted { color: var(--muted); }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ic { display: block; flex: 0 0 auto; }
.js .nojs-only { display: none !important; }
.no-js .jsonly { display: none !important; }

/* ---------- Pills and segmented controls ---------- */
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 6px; box-sizing: border-box; height: 36px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: var(--well); color: var(--heading); font-family: var(--sans); font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: -0.005em; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background-color var(--dur-fast) var(--ease); }
.pill:hover { background: var(--hover); color: var(--heading); text-decoration: none; }
.pill:active { background: var(--press); }
.pill.dark { background: var(--accent); color: var(--on-accent); }
.pill.dark:hover { background: var(--accent-hover); color: var(--on-accent); }
.pill.round { width: 36px; padding: 0; }
.pill:disabled { opacity: .45; cursor: default; }
.btn, .btn-sec, .btn-sm, .qbtn { font-family: var(--sans); }
.tg { display: inline-flex; gap: 0; padding: 3px; border-radius: var(--r-pill); background: var(--well); }
.tg > button, .tg > a { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 36px; height: 30px; padding: 0; border: 0; border-radius: var(--r-pill); background: none; color: var(--control-text); font: inherit; cursor: pointer; text-decoration: none; transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.tg > button:hover, .tg > a:hover { color: var(--heading); }
.tg > [aria-pressed="true"], .tg > [aria-pressed="true"]:hover { background: var(--bg); color: var(--heading); box-shadow: 0 0 0 1px var(--ring); }

/* ---------- Header: sticky, 64px, its content at most 1280px wide (R231 section 2) ---------- */
.hdr { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 24px; box-sizing: border-box; height: 64px;
  margin: 0 calc(50% - 50vw); padding: 0 max(24px, calc(50vw - 616px));
  transition: transform .28s ease; }
/* The frosted ground sits on a layer behind the header: a backdrop filter on the header itself would make it the
   containing block for the theme console, which is fixed to the bottom of the screen on a phone. */
.hdr::before { content: ""; position: absolute; inset: 0; z-index: -1; background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(12px); backdrop-filter: saturate(1.6) blur(12px); pointer-events: none; }
.hdr.is-hidden { transform: translateY(-100%); }
.name { order: 0; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 10px; padding: 10px 0; font-family: var(--voice); font-size: 18px; line-height: 24px; letter-spacing: -0.01em; color: var(--heading); text-decoration: none; }
.name { font-weight: 600; }
.name:hover { color: var(--heading); text-decoration: none; }
.hnav { order: 0; display: flex; margin-left: -10px; font-size: 14px; line-height: 20px; }
.nav { padding: 12px 10px; font-weight: 500; color: var(--heading); text-decoration: none; }
.nav:hover { color: var(--muted); text-decoration: none; }
.nav[aria-current="page"] { text-decoration: underline; text-decoration-color: currentColor; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.hdr-r { order: 2; margin-left: auto; display: flex; align-items: center; gap: 8px; }
.hdr-tools { display: inline-flex; align-items: center; gap: 8px; }
.isl-div { flex: 0 0 auto; width: 1px; height: 20px; background: var(--rule); }
.menu-btn { display: none; }
.mnav { position: absolute; top: 100%; left: 0; right: 0; display: flex; flex-direction: column; padding: 8px 24px 20px; background: var(--bg); border-bottom: var(--rule-w) solid var(--rule); font-size: 18px; line-height: 24px; font-weight: 500; }
.mnav[hidden] { display: none; }
.mnav > a { padding: 12px 0; }
.mnav-mode { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; margin-top: 4px; border-top: var(--rule-w) solid var(--rule); }
@media (prefers-reduced-motion: reduce) { .hdr { transition: none; } }

/* The pixel flame (R194): 24px beside the name, only its tip dot flickers; 16px still and muted in the footer. */
.flame { display: block; flex: 0 0 auto; fill: currentColor; }
.flame.live .fa { animation: fa 5.2s steps(1, end) infinite; }
.flame.live .fb { opacity: 0; animation: fb 5.2s steps(1, end) infinite; }
@keyframes fa { 0% { opacity: 1 } 24% { opacity: 0 } 32% { opacity: 1 } 56% { opacity: 0 } 64% { opacity: 1 } 80% { opacity: 0 } 88% { opacity: 1 } }
@keyframes fb { 0% { opacity: 0 } 24% { opacity: 1 } 32% { opacity: 0 } 80% { opacity: 1 } 88% { opacity: 0 } }
@media (prefers-reduced-motion: reduce) { .flame.live .fa, .flame.live .fb { animation: none; } .flame.live .fb { opacity: 0; } }

/* ---------- Agent view (R212, R231 section 7) ---------- */
.page.as-agent > :not(.hdr):not(.site-foot):not(.agent) { display: none; }
.agent { padding: 72px 0 24px; }
.agent[hidden] { display: none; }
.agent-line { margin: 0 0 14px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--muted); }
.pt { overflow: hidden; background: var(--surface); border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--rule), 0 12px 40px var(--shadow); }
.pt-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--rule-soft); }
.pt-label, .pt-file { display: inline-flex; align-items: center; min-height: 36px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--muted); }
.pt-file { font-family: var(--mono); font-size: 13px; line-height: 18px; font-weight: 400; }
.pt-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; margin-left: auto; }
.pt-body { margin: 0; padding: 20px; font-family: var(--mono); font-size: 13px; line-height: 22px; letter-spacing: 0; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.pt-body .mk { color: var(--muted); }
.pt-status { margin: 8px 0 0; font-size: 14px; line-height: 20px; color: var(--muted); }
.pt-status:empty { margin: 0; }

/* Ask your AI about me: a 4% card, its toolbar shown on hover and focus, always on touch */
.ask-card { background: var(--well); box-shadow: none; overflow: visible; }
.ask-card .pt-bar { border-bottom: 0; padding: 14px 14px 0 24px; }
.ask-card .pt-body { padding: 8px 24px 24px; font-size: 14px; line-height: 22px; }
.ask-card .tools { opacity: 0; transition: opacity .2s ease; }
.ask-card:hover .tools, .ask-card:focus-within .tools { opacity: 1; }
@media (hover: none) { .ask-card .tools { opacity: 1; } }
.slot { background: var(--hover); border-radius: var(--r-xs); padding: 1px 4px; }

/* Menus: the Copy menu */
.cm { position: relative; }
.cm-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 10; box-sizing: border-box; min-width: 280px; padding: 6px; background: var(--surface); border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--rule), 0 12px 40px var(--shadow); }
.cm-menu[hidden] { display: none; }
.cm-h { display: block; padding: 8px 12px 4px; font-size: 13px; line-height: 18px; color: var(--muted); }
.cm-item, .cm-item:hover { display: flex; flex-direction: column; gap: 2px; box-sizing: border-box; width: 100%; padding: 10px 12px; font-family: var(--sans); color: var(--heading); text-align: left; text-decoration: none; background: none; border: 0; border-radius: var(--r-sm); cursor: pointer; }
.cm-item:hover, .cm-item:focus-visible { background: var(--well); }
.cm-row, .cm-row:hover { flex-direction: row; align-items: center; gap: 10px; }
.cm-chk { flex: 0 0 auto; width: 16px; }
.cm-t { display: block; font-size: 14px; line-height: 20px; font-weight: 500; }
.cm-s { display: block; font-size: 13px; line-height: 18px; font-weight: 400; color: var(--muted); }
.cm-mono { font-family: var(--mono); }

/* ---------- Type ---------- */
.title { margin: 0; font-family: var(--voice); font-size: var(--t-title); line-height: var(--t-title-lh); font-weight: var(--display-weight); letter-spacing: var(--display-track); text-transform: var(--display-case); color: var(--heading); text-wrap: balance; text-transform: var(--display-case); }
.subtitle { margin: 16px 0 0; font-family: var(--voice-text); font-size: 19px; line-height: 28px; font-weight: 500; letter-spacing: -0.01em; color: var(--muted); }
.sec, .label { margin: 112px 0 18px; padding: 0; font-family: var(--label-font); font-size: var(--t-sec); line-height: var(--t-sec-lh); font-weight: var(--display-weight); letter-spacing: var(--label-track); text-transform: var(--display-case); color: var(--label-color); }
.label { font-family: var(--label-font); text-transform: var(--label-case); font-size: var(--t-label, var(--t-sec)); font-family: var(--label-font); text-transform: var(--label-case); letter-spacing: var(--label-track); }
.sec { font-family: var(--voice); letter-spacing: calc(var(--display-track) / 2); color: var(--heading); text-transform: var(--display-case); }
.sub { margin: 52px 0 10px; font-size: 19px; line-height: 28px; font-weight: 600; letter-spacing: -0.01em; color: var(--heading); }
strong { font-weight: 600; color: var(--heading); }

/* ---------- Home ---------- */
.intro { padding: 120px 0 96px; }
.intro .title { font-size: 52px; line-height: 56px; }
.intro > p:not(.subtitle) { margin: 32px 0 0; }
.block { margin-top: 136px; }
.block + .block { margin-top: 96px; }
.block > .label { margin-top: 0; }
.block > p { margin: 0 0 18px; }
.glance > .label { margin-bottom: 18px; }
.ask > p:not(.pt-status) { margin: 0 0 20px; }
/* Selected work: two columns of 4:3 cards, 1120px wide */
.works { position: relative; left: 50%; transform: translateX(-50%); width: var(--wide); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; row-gap: 24px; }
.works > .label { grid-column: 1 / -1; margin: 0; }
.works > .work { margin-bottom: 32px; }
.works > .note { grid-column: 1 / -1; }
.work { display: flex; flex-direction: column; gap: 14px; }
.thumb { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--media-bg); border-radius: var(--r-lg); box-shadow: var(--elev); box-shadow: var(--elev); }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity .2s ease; }
.work:hover .thumb img, .card:hover .thumb img { opacity: .92; }
.work.held .thumb img { opacity: .85; }
.work-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.row-title { font-size: 19px; line-height: 26px; font-weight: 500; letter-spacing: -0.015em; color: var(--heading); text-decoration: none; text-wrap: balance; }
a.row-title:hover, .work:hover a.row-title { color: var(--heading); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.row-meta { font-size: 15px; line-height: 22px; letter-spacing: -0.005em; color: var(--muted); }
.co { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--heading); }
.work .co { margin-top: 4px; color: var(--muted); }
.co svg { display: block; flex: 0 0 auto; }
/* Amazon's letters fill the top 58% of its wordmark and the smile hangs below. Centered in a row, the letters ride high, so the
   mark drops until their bottom sits on the text baseline and the smile falls below it, everywhere the mark is used
   (measured 2026-11-28: letters end at 0.585 of the mark's height; 0.28em at 14px puts them on the baseline). */
.wm-amazon { position: relative; top: .28em; }
/* Intuit's wordmark (R221) is all letters, so its box is the cap height (0.71em of Geist) and its bottom edge sits on the
   text baseline: the row aligns by baseline, and a replaced element's baseline is its bottom edge. */
.wm.wm-intuit { width: 3.53em; height: .71em; }
.co:has(.wm-intuit) { align-items: baseline; }
.co .meta { font-variant-numeric: tabular-nums; color: var(--muted); }
.co .meta::before { content: "·"; margin-right: 8px; }
.note { margin: 0; font-size: 15px; line-height: 22px; font-weight: 500; color: var(--muted); }
.note a { color: var(--muted); }
.gl { margin: 0 0 18px; }
.writing { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 0; border-bottom: var(--rule-w) var(--rule-style) var(--rule); text-decoration: none; }
.writing .row-title { font-size: 17px; line-height: 28px; font-weight: 400; letter-spacing: -0.01em; }
.writing:hover .row-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.writing .row-meta { font-size: 14px; line-height: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.writing-sec > .label { margin-bottom: 10px; }

/* ---------- Fact rows (About's Facts) ---------- */
.facts-sec > .fact:first-of-type { border-top: var(--rule-w) var(--rule-style) var(--rule); }
.fact { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 14px 0; border-bottom: var(--rule-w) var(--rule-style) var(--rule); font-size: 15px; line-height: 22px; }
.fact-k { flex: 0 0 120px; font-size: 14px; line-height: 22px; font-weight: 500; color: var(--muted); }
.fact-v { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }

/* ---------- About ---------- */
.about { padding-top: 96px; }
.about > .title { margin-bottom: 40px; }
.about > p { margin: 0 0 22px; }
.about > .cta { margin: 12px 0 28px; }
.strip-sec > .label { margin-bottom: 18px; }
.strip-intro { margin: 0; }
.strip-more { margin: 0; font-size: 15px; line-height: 22px; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; row-gap: 48px; }
.cards.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.strip.cards { position: relative; left: 50%; transform: translateX(-50%); width: var(--wide); margin: 40px 0 64px; }
.card { position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card .thumb { text-decoration: none; }
/* The image links (R191) sit above the card's title overlay, and hovering one underlines the title as hovering the title does. */
a.thumb { z-index: 1; color: inherit; text-decoration: none; }
.card-t { font-size: 17px; line-height: 24px; font-weight: 500; letter-spacing: -0.01em; color: var(--heading); text-decoration: none; }
.card-t::after { content: ""; position: absolute; inset: 0; }
.card:hover .card-t { color: var(--heading); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.card-m { margin-top: -4px; }
.strip .one { margin: -4px 0 0; font-size: 15px; line-height: 22px; color: var(--muted); }
.strip .play { position: absolute; left: 10px; bottom: 10px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-pill); background: var(--surface); color: var(--heading); }
.strip .play svg { display: block; }

/* ---------- Case, Lab, concept pages ---------- */
.case { padding-top: 96px; }
.facts-line { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--muted); }
.facts-line .co, .facts-line .f-lead { color: var(--heading); }
.facts-line + .title { margin-top: 20px; }
.lede { margin: 22px 0 0; color: var(--heading); }
.case section > p, .case > p { margin: 0 0 22px; }
.case > .lede { margin: 22px 0 56px; }
.case .brief > .sec { margin-top: 72px; }
.case em { font-style: italic; }
.quote { margin: 52px 0; padding: 0; }
.quote p { margin: 0; font-family: var(--voice-text); font-size: 26px; line-height: 36px; font-weight: 400; letter-spacing: -0.015em; color: var(--heading); text-wrap: pretty; }
.quote footer { margin-top: 14px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--muted); }
.readmore { display: flex; flex-direction: column; }
.lrow, .rm { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 0; border-bottom: var(--rule-w) var(--rule-style) var(--rule); color: var(--heading); text-decoration: none; }
.lrow:hover > span:first-child { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.lrow .small { text-align: right; }
.more { position: relative; left: 50%; transform: translateX(-50%); width: var(--wide); padding-top: 152px; }
.more-h { margin: 0 0 24px; }

/* The contents list: fixed at the left edge from 1240px up; the current section in ink (v2.js). */
.toc { position: fixed; left: 32px; top: 50%; transform: translateY(-50%); z-index: 5; width: 160px; }
.toc a { display: block; padding: 7px 0; font-size: 13px; line-height: 17px; letter-spacing: -0.01em; color: var(--muted); text-decoration: none; transition: color .15s ease; }
.toc a:hover, .toc a.on { color: var(--heading); }
@media (max-width: 1239.98px) { .toc { display: none; } }

/* Stat row (R168, R232) */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 24px; margin: 44px 0 22px; padding: 28px 0; border-top: var(--rule-w) var(--rule-style) var(--rule); border-bottom: var(--rule-w) var(--rule-style) var(--rule); font-variant-numeric: tabular-nums; }
.stat { display: flex; flex-direction: column; min-width: 0; }
.stat-n { font-family: var(--voice); font-size: var(--t-stat); line-height: 38px; font-weight: var(--display-weight); letter-spacing: -0.02em; color: var(--heading); }
.stat-n + .stat-l { margin-top: 8px; }
.stat-l { margin-top: 0; font-size: 14px; line-height: 20px; color: var(--text); }
.stat-d { margin-top: 8px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--muted); }
.stat-l + .stat-d ~ .stat-d { margin-top: 0; }
.micro { height: 8px; margin: 12px 0 10px; color: var(--chart-mark); }
.micro svg { display: block; }
.micro.bars { display: flex; flex-direction: column; justify-content: space-between; }
.micro.bars span { display: block; height: 3px; }
.micro.bars .before { background: var(--chart-base); }
.micro.bars .after { width: 100%; background: var(--chart-mark); }
.micro.gain { display: flex; background: var(--chart-track); }
.micro.gain span { background: var(--chart-mark); }
.micro.labeled, .micro.span, .micro.scaled { height: auto; }
.micro.labeled .br { display: flex; align-items: center; gap: 8px; height: 16px; }
.micro.labeled .br + .br { margin-top: 2px; }
.micro.labeled .before, .micro.labeled .after { flex: none; height: 3px; }
.micro .ml { font-size: 12px; line-height: 16px; color: var(--muted); white-space: nowrap; }
.micro .ml.a { display: block; margin: 2px 0 6px; }
.micro .trk { position: relative; display: block; height: 8px; background: var(--chart-track); }
.micro.scaled .trk { display: flex; }
.micro.scaled .trk span { background: var(--chart-mark); }
.micro .ends { position: relative; display: flex; justify-content: space-between; height: 16px; margin-top: 4px; font-size: 12px; line-height: 16px; color: var(--muted); }
.micro.span .trk { height: 2px; margin: 7px 0; background: var(--chart-track); }
.micro.span .rng { position: absolute; top: -4px; height: 10px; background: color-mix(in srgb, var(--chart-mark) 22%, transparent); }
.micro.span .dot { position: absolute; top: -5px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--chart-base); }
.micro.span .dot.to { background: var(--chart-mark); }
.micro.span .vals { position: relative; display: block; height: 16px; margin-bottom: 4px; font-size: 12px; line-height: 16px; color: var(--muted); }
.micro.span .ev { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.micro.span .ev:not(.to) { transform: translateX(-85%); }
.micro.span .ev.to { transform: translateX(-15%); }
.micro.span .ev.to { color: var(--heading); font-weight: 600; }
.micro.span .e1 { margin-left: auto; }

/* Table */
.table-wrap { overflow-x: auto; margin: 36px 0 44px; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 22px; color: var(--text); }
.table-wrap thead th { padding: 0 16px 12px 0; border-bottom: var(--rule-w) var(--rule-style) var(--rule); font-size: 14px; line-height: 20px; font-weight: 500; color: var(--muted); text-align: left; }
.table-wrap tbody th { width: 34%; padding: 14px 16px 14px 0; border-bottom: var(--rule-w) var(--rule-style) var(--rule); font-weight: 500; color: var(--heading); text-align: left; vertical-align: top; }
.table-wrap td { padding: 14px 0; border-bottom: var(--rule-w) var(--rule-style) var(--rule); vertical-align: top; }

/* ---------- Media (R231 section 4) ---------- */
.m { margin: 52px 0; }
.m-hero, .m-wide, .m-small { position: relative; left: 50%; transform: translateX(-50%); }
.m-hero { width: var(--hero); }
.m-wide { width: var(--wide); }
.m-small { width: min(320px, calc(100vw - 48px)); }
.m img { display: block; max-width: 100%; height: auto; }
.cap { max-width: 624px; margin: 14px auto 0; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--muted); text-align: center; text-wrap: pretty; }
.zoom { display: block; cursor: zoom-in; text-decoration: none; }
.single img { width: 100%; border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--rule-strong); background: var(--surface); }
.plain-img img { width: 100%; }
.plain-img img.dk { display: none; }
html[data-mode="dark"] .plain-img img.lt { display: none; }
html[data-mode="dark"] .plain-img img.dk { display: block; }
.shot img, img.shot { border-radius: var(--r-sm); box-shadow: 0 0 0 1px var(--ring), 0 1px 2px var(--ring); background: var(--surface); }

/* Bands: one grey band holds a whole set; white with a hairline for grey screenshots; none for media with its own background. */
.band { padding: 24px 24px 20px; background: var(--media-bg); border-radius: var(--r-lg); line-height: 0; }
.band.band-white { background: var(--surface); box-shadow: 0 0 0 1px var(--rule-strong); }
.band-none { line-height: 0; }

/* Strip and pan header row (rule 4) */
.mhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; }
.mhead-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mtitle { font-size: 16px; line-height: 22px; font-weight: 600; letter-spacing: -0.01em; color: var(--heading); }
.mhead-r { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.count { margin-right: 6px; font-size: 14px; line-height: 20px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--heading); white-space: nowrap; }
.harrow { font-size: 16px; opacity: 0; transition: opacity .2s ease; }
.gal:hover .harrow, .gal:focus-within .harrow { opacity: 1; }
.harrow:disabled { opacity: 0; }
.gal:hover .harrow:disabled, .gal:focus-within .harrow:disabled { opacity: .35; }

/* Film strip */
.sc-row { display: flex; gap: 24px; overflow-x: auto; scrollbar-width: none; line-height: normal; }
/* Snapping only after the first touch, so the drift can move the row freely (R174, R176). */
.sc-row.snap { scroll-snap-type: x mandatory; }
.sc-row::-webkit-scrollbar, .pan-box::-webkit-scrollbar { display: none; }
/* At most the row less 64px, so part of the next frame always shows at the right edge (handoff section 4, Film strip). */
.frame { flex: 0 0 auto; width: var(--fw); max-width: min(80vw, calc(100% - 64px)); margin: 0; scroll-snap-align: start; }
.frame img { width: 100%; height: auto; }
.fcap { display: flex; gap: 10px; margin: 12px 0 0; max-width: 520px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--muted); }
.fcap > span:first-child { flex: 0 0 auto; color: var(--heading); font-variant-numeric: tabular-nums; }

/* Pan: the journey map */
.pan-box { height: 520px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.pan-box .zoom { display: inline-block; height: 100%; }
.pan-box img { height: 100%; width: auto; max-width: none; }

/* Tabbed gallery (rule 5) */
.gal-panels { position: relative; line-height: 0; }
.gal-panel { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; }
.gal-panel.on { display: flex; }
.gal-panel > .zoom { display: flex; align-items: center; justify-content: center; max-width: 100%; height: 100%; }
.gal-panel > .zoom img { width: auto; height: auto; max-width: 100%; max-height: 100%; }
.gv { height: 100%; max-width: 100%; }
.arrow { position: absolute; top: 50%; z-index: 3; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-top: -22px; padding: 0; border: 0; border-radius: var(--r-pill); background: var(--surface); color: var(--heading); font-family: var(--sans); font-size: 18px; line-height: 1; cursor: pointer; box-shadow: 0 1px 3px var(--shadow); }
.gal-prev { left: 12px; }
.gal-next { right: 12px; }
.gal-panels .arrow { opacity: 0; transition: opacity .2s ease; }
.gal-panels:hover .arrow, .gal-panels:focus-within .arrow { opacity: 1; }
.tabs-row { display: flex; justify-content: center; margin-top: 16px; }
.tabs { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 3px; border-radius: 24px; background: var(--well); }
.tab { height: 32px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: none; font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; }
.tab:hover { color: var(--heading); }
.tab.on { background: var(--surface); color: var(--heading); box-shadow: 0 0 0 1px var(--ring); }
.gal-cap { display: none; }
.gal-cap.on { display: block; }
.gal-note { margin-top: 6px; }
.nojs-label, .nojs-cap { display: none; }
.no-js .gal-panels { aspect-ratio: auto !important; }
.no-js .gal-panel { position: static; display: block; }
.no-js .gal-panel > .zoom { height: auto; }
.no-js .nojs-label { display: block; margin: 24px 0 8px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--heading); }
.no-js .nojs-cap { display: block; margin: 10px 0 0; font-size: 14px; line-height: 20px; color: var(--muted); }

/* Pair (rule 6) */
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.pair-m { display: flex; justify-content: center; line-height: 0; }
.pair-m > .zoom img { width: auto; max-height: 720px; }
.pair-m > .player { width: 100%; }

/* Stack (rule 7): the front card, and the other tilted 4° behind it at 90% */
.stack { position: relative; max-width: 820px; margin: 0 auto; aspect-ratio: var(--sr); }
.stack-card { position: absolute; display: block; transition: transform .55s cubic-bezier(.2, .7, .2, 1), width .55s cubic-bezier(.2, .7, .2, 1), top .55s cubic-bezier(.2, .7, .2, 1), left .55s cubic-bezier(.2, .7, .2, 1), opacity .3s ease; }
.stack-card img { width: 100%; height: auto; box-shadow: 0 0 0 1px var(--ring), 0 6px 24px var(--shadow); }
.stack-card.front { left: 0; top: 6%; width: 84%; z-index: 2; transform: rotate(0deg); cursor: zoom-in; }
.stack-card.back { left: 28%; top: 0; width: 72%; z-index: 1; transform: rotate(4deg); opacity: .9; cursor: pointer; }
.no-js .stack { aspect-ratio: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.no-js .stack-card { position: static; width: auto; transform: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .stack-card { transition: none; } }

/* ---------- The video player (option C, R231 section 5) ---------- */
.player { position: relative; overflow: hidden; line-height: 0; background: var(--media-bg); border-radius: var(--r-lg); }
.player { isolation: isolate; }
.player video { display: block; width: 100%; height: auto; cursor: pointer; border-radius: inherit; }
.player video[data-zoom] { cursor: zoom-in; }
.player.round { border-radius: 50%; }
.player.fill { height: 100%; }
.player.fill video { height: 100%; object-fit: cover; }
.ctl { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .2s ease; }
.player:hover .ctl, .player:focus-within .ctl, .player.is-paused .ctl, .player.hint .ctl { opacity: 1; }
.wp { display: inline-flex; align-items: center; gap: 10px; box-sizing: border-box; height: 36px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: var(--surface); color: var(--heading); font-family: var(--sans); font-size: 13px; line-height: normal; font-weight: 500; letter-spacing: 0; white-space: nowrap; box-shadow: 0 1px 3px var(--shadow); cursor: pointer; pointer-events: auto; }
.wp.r { width: 36px; padding: 0; justify-content: center; }
.wp[hidden] { display: none; }
.center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.bigsound { height: 52px; padding: 0 22px; font-size: 15px; font-weight: 600; box-shadow: 0 2px 8px var(--shadow); }
.bigplay { width: 64px; height: 64px; padding: 0; justify-content: center; }
.bar { position: absolute; left: 14px; right: 14px; bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; transition: opacity .2s ease; }
.bar-l { cursor: default; }
.bar-r { display: flex; gap: 8px; }
.bare { display: flex; align-items: center; min-width: 20px; min-height: 36px; margin: 0; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.time { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.prog { position: relative; display: inline-block; width: 96px; height: 3px; overflow: hidden; border-radius: 2px; background: color-mix(in srgb, var(--heading) 15%, transparent); }
.prog i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--heading); border-radius: 2px; }
/* What shows in the center, by state (v2.js sets is-playing, has-audio, sound-on, hint) */
.player [data-sound-on] { display: none; }
.player.is-playing.has-audio:not(.sound-on) [data-sound-on] { display: inline-flex; }
.player.is-playing.has-audio:not(.sound-on) [data-center] { display: none; }
[data-center] .ic + .ic, [data-toggle] .ic + .ic { display: none; }
.is-playing [data-center] .ic:first-child, .is-playing [data-toggle] .ic:first-child { display: none; }
.is-playing [data-center] .ic + .ic, .is-playing [data-toggle] .ic + .ic { display: block; }
.player.hint .bar { opacity: 0; }
.player.round .ctl .bigplay { width: 48px; height: 48px; }
.watch-nojs { margin: 12px 0 0; text-align: center; }
@media (hover: none) { .ctl, .harrow, .gal-panels .arrow { opacity: 1; } }
@media (max-width: 480px) { .prog { display: none; } .bigsound { height: 44px; padding: 0 16px; font-size: 14px; } }

/* YouTube */
.yt-poster { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--ink); cursor: pointer; }
.yt-poster img { width: 100%; height: 100%; object-fit: cover; }
.yt-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: var(--ink); }
.player.yt.is-live .ctl { opacity: 0; pointer-events: none; }
.player.yt.is-live:hover .ctl { opacity: 1; }

/* ---------- Footer (R194, R230) ---------- */
.site-foot { position: relative; left: 50%; transform: translateX(-50%); width: var(--wide); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding: 120px 0 64px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--muted); }
.foot-r { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.site-foot .loc { display: inline-flex; align-items: center; gap: 8px; }
.foot-ver { color: var(--muted); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--muted) 45%, transparent); text-underline-offset: 3px; }
.foot-ver:hover { color: var(--heading); }

/* ---------- Sign-in (R204, R231 section 7) ---------- */
.sgn { position: fixed; inset: 0; z-index: 110; display: flex; justify-content: center; align-items: flex-start; padding: 22vh 16px 24px; box-sizing: border-box; overflow-y: auto; background: var(--scrim); opacity: 0; transition: opacity 180ms ease-out; }
.sgn[hidden] { display: none; }
.sgn.on { opacity: 1; }
.sgn.out { opacity: 0; transition: opacity 170ms ease-in; }
html.sgn-open { overflow: hidden; }
.dlg { width: 420px; max-width: 100%; padding: 20px 20px 24px; box-sizing: border-box; outline: none; background: var(--surface); border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--rule), 0 12px 40px var(--shadow); opacity: 0; transform: translateY(-14px); transition: opacity 240ms cubic-bezier(0.22, 1, 0.36, 1), transform 240ms cubic-bezier(0.22, 1, 0.36, 1); }
.sgn.on .dlg { opacity: 1; transform: none; }
.sgn.out .dlg { opacity: 0; transform: translateY(10px); transition: opacity 170ms cubic-bezier(0.55, 0, 1, 0.45), transform 170ms cubic-bezier(0.55, 0, 1, 0.45); }
.dlg-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dlg-h { display: inline-flex; align-items: center; gap: 10px; font-family: var(--voice); font-size: 18px; line-height: 24px; font-weight: var(--display-weight); color: var(--heading); }
.dlg-h svg { display: block; flex: 0 0 auto; }
.dlg-f { margin: 20px 0 0; }
.dlg-opens { margin: 14px 0 0; font-size: 14px; line-height: 20px; color: var(--muted); }
.dlg-co { font-weight: 500; color: var(--heading); }
.dlg-co svg { display: inline-block; vertical-align: -3px; margin: 0 4px 0 2px; color: var(--heading); }
@media (prefers-reduced-motion: reduce) { .sgn, .sgn.out, .dlg, .sgn.out .dlg { transition: none; transform: none; } }
/* The field: a 48px pill on 4% black with a black round arrow inside; the error is a 2px black ring. */
.fx .bx { position: relative; display: flex; align-items: center; gap: 8px; box-sizing: border-box; height: 48px; padding: 0 6px 0 18px; background: var(--well); border-radius: var(--r-pill); }
.fx .bx:has(.in:focus-visible) { outline: 2px solid var(--heading); outline-offset: 2px; }
.fx .in { flex: 1 1 auto; width: 0; min-width: 0; padding: 0; font-family: var(--sans); font-size: 16px; line-height: 24px; color: var(--text); background: transparent; border: 0; outline: none; }
.ibtn { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 36px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); font-family: var(--sans); font-size: 16px; line-height: 1; cursor: pointer; }
.ibtn:hover { background: var(--accent-hover); }
.ibtn:active { background: var(--accent-press); }
.fx .bx.err { box-shadow: inset 0 0 0 2px var(--heading); }
.fx .bx.err:has(.in:focus-visible) { outline: none; }
.fx-err { display: flex; gap: 8px; align-items: center; margin: 10px 0 0; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--heading); }
.fx-err[hidden] { display: none; }
.fx-err b { display: inline-grid; place-items: center; flex: 0 0 18px; width: 18px; height: 18px; border-radius: 50%; background: var(--heading); color: var(--bg); font-size: 12px; line-height: 1; font-weight: 600; }

/* ---------- Lightbox (R224 to R228, R231 section 6) ---------- */
.lb { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 72px 88px 24px; box-sizing: border-box; background: color-mix(in srgb, var(--bg) 98.5%, transparent); outline: none; }
.lb[hidden] { display: none; }
.lb .lbc { transition: opacity .25s ease; }
.lb.idle .lbc { opacity: 0; }
.lb-x { position: absolute; top: 16px; right: 16px; z-index: 3; }
.lb-stage { display: flex; align-items: center; justify-content: center; flex: 1 1 auto; width: 100%; min-height: 0; min-width: 0; }
.lb .lb-stage:focus, .lb .lb-stage:focus-visible { outline: none; }
.lb-stage img, .lb-stage video:not([hidden]) { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--ring), 0 2px 12px var(--ring); }
.lb-foot { display: flex; justify-content: center; gap: 14px; max-width: 720px; margin: 16px 0 0; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--muted); text-align: center; }
.lb-n { color: var(--heading); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-n:empty { display: none; }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }
html.lb-open { overflow: hidden; }
.lb.scroll .lb-stage { overflow-y: auto; align-items: flex-start; }
.lb.scroll .lb-stage img { max-height: none; height: auto; }
.lb.pan .lb-stage { overflow-x: auto; overflow-y: hidden; justify-content: flex-start; }
.lb.pan .lb-stage img { max-width: none; max-height: none; width: auto; flex: none; margin: 0 auto; }
.lbv .lb-stage video { background: var(--ink); }
.lbv-cap { max-width: 624px; margin: 16px auto 0; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--muted); text-align: center; }
@media (hover: none) { .lb.idle .lbc { opacity: 1; } }

/* ---------- Phones (under 760px) ---------- */
@media (max-width: 759.98px) {
  .hnav, .isl > .tg, .isl > .isl-div, .isl > .nojs-only { display: none !important; }
  .menu-btn { display: inline-flex; }
  .title, .about > .title { font-size: 36px; line-height: 40px; }
  .intro .title { font-size: 38px; line-height: 42px; }
  .intro { padding: 72px 0 64px; }
  .block { margin-top: 96px; }
  .case, .about { padding-top: 56px; }
  .sec, .label { margin-top: 80px; }
  .works, .cards, .cards.c3, .pair { grid-template-columns: minmax(0, 1fr); }
  .band { padding: 16px 16px 14px; }
  .sc-row { gap: 16px; }
  .pan-box { height: 360px; }
  .pair-m > .zoom img { max-height: 520px; }
  .lb { padding: 64px 12px 16px; }
  .lb-prev { left: 8px; } .lb-next { right: 8px; }
  .site-foot { padding: 80px 0 48px; }
  .quote p { font-size: 22px; line-height: 31px; }
  .more { padding-top: 104px; }
}

@media print { .hdr, .ctl, .toc { display: none !important; } }
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .ctl, .harrow, .lb .lbc, .bar, .pill, .tg > button, .thumb img { transition: none; }
}
