/* ==========================================================================
   AntJanus — Scroll-Driven redesign (demo 010)
   The page is a timeline: the scrollbar is a playhead, every section carries a
   keyframe ruler, and motion is bound to scroll position, never to a clock.
   All scroll-linked motion is progressive enhancement: it lives inside
   @supports (animation-timeline) + prefers-reduced-motion + [data-motion],
   and every base style is the finished, readable state.
   ========================================================================== */

@property --pct { syntax: "<integer>"; inherits: true; initial-value: 0; }
@property --num { syntax: "<integer>"; inherits: true; initial-value: 0; }

/* ---------- Tokens ---------- */
:root {
  --paper-0: #f4f1e9; --paper-1: #fbfaf6; --paper-2: #e8e3d7; --paper-line: #d3ccbc;
  --night-0: #0d1015; --night-1: #151a21; --night-2: #1d242d; --night-line: #2c3541;
  --slate: #364f6a; --slate-lift: #6f92bd;
  --red: #d9391f; --red-ink: #a8260f; --red-lift: #ff6b4a; --red-lift-ink: #ff9278;

  --ground: var(--paper-0);
  --surface: var(--paper-1);
  --surface-2: var(--paper-2);
  --line: var(--paper-line);
  --ink: #15171c;
  --text: #2a2e36;
  --muted: #555c68;
  --track: var(--slate);
  --track-soft: #dbe2ea;
  --play: var(--red);
  --play-ink: var(--red-ink);
  --on-play: #ffffff;
  --scrim: rgba(13, 16, 21, .72);
  --code-bg: #12161c;
  --code-head: #1b2129;
  --code-text: #e4e8ee;
  --shadow: 0 1px 0 rgba(21,23,28,.04), 0 12px 32px -18px rgba(21,23,28,.35);

  --panel: #10151c; --panel-2: #18202a; --panel-line: #2b3643; --panel-ink: #eef2f6; --panel-muted: #a7b1be;

  --f-display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --f-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --max: 1240px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 14px;
  --header-h: 4.25rem;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ground: var(--night-0); --surface: var(--night-1); --surface-2: var(--night-2); --line: var(--night-line);
  --ink: #f1f3f6; --text: #cfd5dd; --muted: #9aa4b1;
  --track: var(--slate-lift); --track-soft: #1d2a39;
  --play: var(--red-lift); --play-ink: var(--red-lift-ink); --on-play: #15171c;
  --scrim: rgba(5, 7, 10, .76);
  --code-bg: #090b0f; --code-head: #121720;
  --shadow: 0 1px 0 rgba(0,0,0,.3), 0 16px 40px -20px rgba(0,0,0,.8);
  --panel: #151b23; --panel-2: #1c242e;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: var(--night-0); --surface: var(--night-1); --surface-2: var(--night-2); --line: var(--night-line);
    --ink: #f1f3f6; --text: #cfd5dd; --muted: #9aa4b1;
    --track: var(--slate-lift); --track-soft: #1d2a39;
    --play: var(--red-lift); --play-ink: var(--red-lift-ink); --on-play: #15171c;
    --scrim: rgba(5, 7, 10, .76);
    --code-bg: #090b0f; --code-head: #121720;
    --shadow: 0 1px 0 rgba(0,0,0,.3), 0 16px 40px -20px rgba(0,0,0,.8);
    --panel: #151b23; --panel-2: #1c242e;
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1.5rem); }
body {
  margin: 0; background: var(--ground); color: var(--text);
  font: 400 1.0625rem/1.65 var(--f-body);
  overflow-x: clip; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
main { overflow-x: clip; }
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--f-display); color: var(--ink); line-height: 1.08; margin: 0; font-weight: 720; letter-spacing: -0.02em; font-optical-sizing: auto; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--play); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--play); color: var(--on-play); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 200; background: var(--ink); color: var(--ground); padding: .75rem 1rem; border-radius: 8px; text-decoration: none; font-weight: 600; }
.skip:focus { top: 1rem; }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.mono { font-family: var(--f-mono); }
.eyebrow { font: 500 .8125rem/1.3 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: inline-flex; gap: .6rem; align-items: center; }
.eyebrow .kf { color: var(--play-ink); }
.lede { font-size: clamp(1.15rem, 1rem + .6vw, 1.4rem); line-height: 1.5; color: var(--text); max-width: 60ch; }

/* ---------- Scroll progress + scrubber ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 120; background: var(--play); transform-origin: 0 50%; transform: scaleX(var(--progress, 0)); pointer-events: none; }
.scrubber { position: fixed; right: .9rem; top: 50%; translate: 0 -50%; height: min(52vh, 440px); width: 14px; z-index: 60; display: none; pointer-events: none; }
.scrub-track { position: absolute; inset: 0; margin-inline: auto; width: 14px;
  background:
    repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 10px) center / 8px 100% no-repeat,
    repeating-linear-gradient(to bottom, var(--muted) 0 1px, transparent 1px 50px) center / 14px 100% no-repeat; opacity: .9; }
.scrub-head { position: absolute; left: -3px; width: 20px; height: 3px; background: var(--play); top: calc(var(--pct) * 1%); translate: 0 -50%; border-radius: 2px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--play) 25%, transparent); }
@media (min-width: 1360px) { .scrubber { display: block; } }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 100; background: color-mix(in srgb, var(--ground) 88%, transparent); backdrop-filter: blur(12px) saturate(1.2); -webkit-backdrop-filter: blur(12px) saturate(1.2); border-bottom: 1px solid var(--line); }
.hdr { display: flex; align-items: center; gap: 1.25rem; padding-block: .7rem; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); margin-right: auto; min-height: 44px; }
.brand svg { width: 40px; height: 40px; flex: none; }
.brand .logo-bar { transform-origin: 6px 34px; transform: scaleX(1); }
.brand-word { display: flex; flex-direction: column; line-height: 1.05; }
.brand-word b { font: 780 1.2rem/1 var(--f-display); letter-spacing: -.02em; }
.brand-word small { font: 500 .8125rem/1.2 var(--f-mono); color: var(--muted); letter-spacing: .04em; margin-top: .2rem; }
.nav { position: relative; timeline-scope: --navx; }
.nav ul { list-style: none; display: flex; gap: .15rem; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .85rem; border-radius: 999px; text-decoration: none; font-weight: 550; color: var(--text); white-space: nowrap; position: relative; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: .85rem; right: .85rem; bottom: 7px; height: 2px; background: var(--play); border-radius: 2px; }
.nav a.nav-ai { color: var(--ink); }
.nav a.nav-ai::before { content: ""; width: 7px; height: 7px; background: var(--play); rotate: 45deg; margin-right: .5rem; border-radius: 1px; }
.hdr-tools { display: flex; align-items: center; gap: .4rem; }
.timecode { font: 500 .8125rem/1 var(--f-mono); color: var(--muted); letter-spacing: .06em; min-width: 7.5ch; text-align: right; padding-right: .35rem; font-variant-numeric: tabular-nums; }
.timecode .tc-val::after { counter-reset: pct var(--pct); content: counter(pct, decimal-leading-zero) "%"; color: var(--ink); }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; transition: background .15s, border-color .15s; }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .icon-btn .i-sun { display: block; }
:root[data-theme="dark"] .icon-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .icon-btn .i-sun { display: block; } :root:not([data-theme="light"]) .icon-btn .i-moon { display: none; } }
#motion-toggle[aria-pressed="false"] { color: var(--muted); border-style: dashed; }
#motion-toggle[aria-pressed="false"] .i-wave { opacity: .35; }
@media (max-width: 899px) {
  .hdr { flex-wrap: wrap; row-gap: .1rem; padding-block: .5rem 0; }
  .nav { order: 3; flex: 0 0 auto; width: calc(100% + var(--gutter) * 2); min-width: 0; margin-inline: calc(var(--gutter) * -1); }
  .nav ul { overflow-x: auto; scrollbar-width: none; padding: 0 var(--gutter) .4rem; scroll-timeline: --navx inline; }
  .nav ul::-webkit-scrollbar { display: none; }
  .nav::before, .nav::after { content: ""; position: absolute; top: 0; bottom: .4rem; width: 2.5rem; pointer-events: none; z-index: 1; opacity: 0; }
  .nav::before { left: 0; background: linear-gradient(to right, var(--ground), transparent); }
  .nav::after { right: 0; background: linear-gradient(to left, var(--ground), transparent); opacity: 1; }
  .timecode { display: none; }
  .brand-word small { display: none; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 48px; padding: .75rem 1.3rem; border-radius: 12px; font-weight: 650; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform .15s, background .15s, color .15s, border-color .15s; }
.btn-primary { background: var(--ink); color: var(--ground); }
.btn-primary:hover { background: var(--play-ink); color: #fff; }
:root[data-theme="dark"] .btn-primary:hover { background: var(--play); color: var(--on-play); }
.btn-primary:active { transform: translateY(1px); }
.btn-line { color: var(--ink); text-decoration: underline; text-decoration-color: var(--play); text-decoration-thickness: 2px; text-underline-offset: .3em; padding-inline: .4rem; }
.btn-line:hover { color: var(--play-ink); }
.btn-quiet { color: var(--muted); padding-inline: .4rem; }
.btn-quiet:hover { color: var(--ink); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--ink); }
.arrow-link { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; font-weight: 650; color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--play); line-height: 1.2; }
.arrow-link:hover { color: var(--play-ink); }

.chip { display: inline-flex; align-items: center; min-height: 30px; padding: .2rem .7rem; border-radius: 999px; border: 1px solid var(--line); font: 500 .8125rem/1.2 var(--f-mono); color: var(--text); text-decoration: none; background: var(--surface); }
a.chip:hover { border-color: var(--ink); color: var(--ink); }
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .55rem; border-radius: 6px; font: 600 .8125rem/1.4 var(--f-mono); letter-spacing: .04em; text-transform: uppercase; }
.badge-new { background: var(--play); color: var(--on-play); }
:root:not([data-theme="dark"]) .badge-new { background: var(--red-ink); color: #fff; }
.badge-upd { border: 1px solid var(--track); color: var(--track); }
.badge-soon { border: 1px dashed var(--muted); color: var(--muted); }

/* ---------- Sections + keyframe ruler ---------- */
.section { padding-block: clamp(4rem, 9vw, 7.5rem); view-timeline: --sec block; position: relative; }
.section.tight { padding-block: clamp(3rem, 6vw, 5rem); }
.section.alt { background: var(--surface); border-block: 1px solid var(--line); }
.sec-head { display: grid; gap: .9rem; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.sec-head-row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; }
.sec-head h2 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.75rem); }
.sec-head p { color: var(--muted); font-size: 1.125rem; margin: 0; max-width: 58ch; }
.ruler { position: relative; height: 22px; margin-bottom: .4rem;
  background:
    repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px 12px) left bottom / 100% 9px no-repeat,
    repeating-linear-gradient(to right, var(--muted) 0 1px, transparent 1px 120px) left bottom / 100% 16px no-repeat;
}
.ruler::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); }
.ruler .head { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--play); border-radius: 2px; }
.ruler .head::after { content: ""; position: absolute; right: -7px; bottom: -6px; width: 14px; height: 14px; background: var(--play); rotate: 45deg; border-radius: 2px; box-shadow: 0 0 0 3px var(--ground); }
.section.alt .ruler .head::after { box-shadow: 0 0 0 3px var(--surface); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: relative; transition: border-color .15s, transform .2s; }
.card:hover { border-color: color-mix(in srgb, var(--ink) 45%, var(--line)); }
.card-link { position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.card-link:focus-visible { outline-offset: -3px; }
.media { position: relative; overflow: hidden; background: linear-gradient(135deg, var(--track-soft), var(--surface-2)); }
.media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .media img { transform: scale(1.04); }
.post-card .media { aspect-ratio: 16 / 9; border-bottom: 1px solid var(--line); }
.post-card .body { padding: 1.2rem 1.3rem 1.4rem; display: grid; gap: .55rem; }
.meta { font: 500 .8125rem/1.4 var(--f-mono); color: var(--muted); letter-spacing: .05em; text-transform: uppercase; display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: center; }
.meta .dot { width: 6px; height: 6px; rotate: 45deg; background: var(--play); display: inline-block; }
.post-card h3 { font-size: 1.35rem; line-height: 1.2; }
.post-card p { margin: 0; color: var(--text); font-size: 1rem; }
.coll-dg { --coll: #2f7d5b; } .coll-dt { --coll: #a0661a; } .coll-ai { --coll: #6d4fc2; } .coll-st { --coll: #b0344e; }
:root[data-theme="dark"] .coll-dg { --coll: #5cc497; } :root[data-theme="dark"] .coll-dt { --coll: #e0a24f; } :root[data-theme="dark"] .coll-ai { --coll: #a78bfa; } :root[data-theme="dark"] .coll-st { --coll: #f07a93; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .coll-dg { --coll: #5cc497; } :root:not([data-theme="light"]) .coll-dt { --coll: #e0a24f; } :root:not([data-theme="light"]) .coll-ai { --coll: #a78bfa; } :root:not([data-theme="light"]) .coll-st { --coll: #f07a93; } }
.coll-tag { color: var(--coll, var(--muted)); font-weight: 600; }
.coll-tag::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--coll); margin-right: .45rem; vertical-align: 1px; }

.grid { display: grid; gap: clamp(1rem, 2vw, 1.5rem); }
.g-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.g-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.g-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }

/* ---------- Hero (home) ---------- */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3rem, 6vw, 5rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero h1 { font-size: clamp(2.8rem, 1.2rem + 6vw, 5.9rem); line-height: 1; letter-spacing: -.022em; margin: 1.2rem 0 1.5rem; font-weight: 760; }
.hero h1 .w { display: inline; }
.hero h1 .hl { background: linear-gradient(var(--play), var(--play)) no-repeat 0 90% / 100% .14em; padding-bottom: .02em; }
.hero .lede { margin-bottom: 2rem; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 2rem; max-width: 560px; }
.stat { background: var(--surface); padding: 1rem 1.1rem; }
.stat b { display: block; font: 760 clamp(1.8rem, 1.2rem + 2vw, 2.6rem)/1 var(--f-display); color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat > span { font: 500 .8125rem/1.3 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: block; margin-top: .45rem; }
.count::after { counter-reset: n var(--num); content: counter(n); }
.count { --num: var(--to); }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.1rem; }
.portrait { position: relative; margin: 0; }
.portrait .frame { border-radius: 24px; overflow: hidden; aspect-ratio: 4 / 5; background: var(--surface-2); clip-path: inset(0 0 0 0 round 24px); }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 22% 30%; }
.portrait figcaption { display: flex; justify-content: space-between; gap: 1rem; margin-top: .9rem; font: 500 .8125rem/1.3 var(--f-mono); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.portrait .tickbar { height: 14px; margin-top: .8rem; background: repeating-linear-gradient(to right, var(--muted) 0 1px, transparent 1px 10px) bottom / 100% 8px no-repeat; position: relative; }
.portrait .tickbar::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--play); transform-origin: 0 50%; }
.scroll-cue { display: inline-flex; align-items: center; gap: .6rem; margin-top: 2.25rem; font: 500 .8125rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.scroll-cue i { width: 1px; height: 36px; background: linear-gradient(var(--play), transparent); display: inline-block; }
@media (max-width: 899px) {
  .hero-grid { grid-template-columns: 1fr; }
  .portrait { order: -1; max-width: 460px; --iris-x: 12%; --iris-y: 6%; }
  .portrait .frame { aspect-ratio: 5 / 4; }
  .portrait img { object-position: 30% 18%; }
}

/* ---------- Marquee band ---------- */
.marquee { border-block: 1px solid var(--line); padding-block: 1.1rem; overflow: hidden; background: var(--surface); }
.marquee-row { display: flex; gap: 2.5rem; white-space: nowrap; font: 700 clamp(1.6rem, 1rem + 2.5vw, 3rem)/1.1 var(--f-display); color: var(--ink); letter-spacing: -.02em; width: max-content; }
.marquee-row + .marquee-row { margin-top: .5rem; color: transparent; -webkit-text-stroke: 1px var(--muted); }
.marquee-row span { display: inline-flex; align-items: center; gap: 2.5rem; }
.marquee-row span::after { content: ""; width: .45em; height: .45em; background: var(--play); rotate: 45deg; border-radius: 2px; }
.marquee-row + .marquee-row { translate: -30% 0; }

/* ---------- Stacking cards ---------- */
.stack { display: grid; gap: 1.5rem; view-timeline: --stack block; }
.stack-card { position: sticky; top: calc(var(--header-h) + 1.5rem + var(--i) * 1.4rem); transform-origin: 50% 0; box-shadow: var(--shadow); }
.feature { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: min(62vh, 480px); }
.feature .media { min-height: 260px; }
.feature .body { padding: clamp(1.4rem, 3vw, 2.6rem); display: flex; flex-direction: column; gap: 1rem; justify-content: center; }
.feature h3 { font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.6rem); line-height: 1.05; }
.feature p { font-size: 1.1rem; margin: 0; }
.feature .index { font: 700 clamp(3rem, 2rem + 4vw, 5.5rem)/1 var(--f-display); color: transparent; -webkit-text-stroke: 1.5px var(--play); letter-spacing: -.04em; }
@media (max-width: 799px) { .feature { grid-template-columns: 1fr; min-height: 0; } .feature .media { aspect-ratio: 16/9; min-height: 0; } .stack-card { position: relative; top: auto; } }

/* ---------- Horizontal scrub strip ---------- */
.hs-sticky { display: flex; flex-direction: column; justify-content: center; }
.hs-sticky > .wrap, .hs-meter { width: 100%; }
.hs-track .post-card p, .hs-track .story-card p { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.hs-track { display: flex; gap: 1.25rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: .5rem var(--gutter) 1.5rem; scroll-padding-inline: var(--gutter); overscroll-behavior-x: contain; }
.hs-track > * { flex: 0 0 min(84vw, 390px); scroll-snap-align: start; }
.hs-track .post-card { display: flex; flex-direction: column; }
.hs-meter { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); display: flex; align-items: center; gap: 1rem; font: 500 .8125rem/1 var(--f-mono); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.hs-meter .bar { flex: 1; height: 3px; background: var(--line); border-radius: 2px; position: relative; overflow: hidden; }
.hs-meter .bar i { position: absolute; inset: 0; background: var(--play); transform-origin: 0 50%; transform: scaleX(1); }
@media (min-width: 1240px) { .hs-track { padding-inline: calc((100vw - var(--max)) / 2 + var(--gutter)); } }

/* ---------- Lists ---------- */
.row-list { list-style: none; border-top: 1px solid var(--line); }
.row-item { border-bottom: 1px solid var(--line); position: relative; display: grid; grid-template-columns: 9rem minmax(0, 1fr) auto; gap: .4rem 1.5rem; padding: 1.35rem 0; align-items: baseline; }
.row-item .date { font: 500 .875rem/1.4 var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.row-item h3 { font-size: 1.35rem; line-height: 1.2; }
.row-item h3 a { text-decoration: none; }
.row-item h3 a::after { content: ""; position: absolute; inset: 0; }
.row-item p { margin: .35rem 0 0; color: var(--text); font-size: 1rem; max-width: 70ch; }
.row-item .go { font: 500 .875rem/1 var(--f-mono); color: var(--muted); transition: transform .15s, color .15s; }
.row-item:hover .go { color: var(--play-ink); transform: translateX(4px); }
.row-item:hover h3 { color: var(--play-ink); }
@media (max-width: 699px) { .row-item { grid-template-columns: 1fr; } .row-item .go { display: none; } }

/* ---------- Experiments / small cards ---------- */
.xp-card { padding: 1.4rem; display: grid; gap: .7rem; align-content: start; }
.xp-card .glyph { width: 48px; height: 48px; border-radius: 12px; background: var(--ink); color: var(--ground); display: grid; place-items: center; font: 700 1.1rem/1 var(--f-mono); }
.xp-card h3 { font-size: 1.3rem; }
.xp-card p { margin: 0; font-size: 1rem; }
.xp-card .fill { position: absolute; left: 0; top: 0; height: 4px; width: 100%; background: var(--play); transform-origin: 0 50%; }
.tech { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .25rem; }

.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 899px) { .trio { grid-template-columns: 1fr; } }
.link-list { list-style: none; display: grid; }
.link-list a { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 52px; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 600; color: var(--ink); }
.link-list a small { font: 500 .8125rem/1 var(--f-mono); color: var(--muted); font-weight: 500; }
.link-list a:hover { color: var(--play-ink); }
.work-card { background: var(--panel); color: var(--panel-ink); border-color: var(--panel-line); }
.work-card h3 { color: var(--panel-ink); }
.work-card p { color: var(--panel-muted); }
.work-card .btn { background: var(--panel-ink); color: var(--panel); }
.work-card .btn:hover { background: var(--red-lift); color: #15171c; }
.pad { padding: clamp(1.3rem, 2.5vw, 1.9rem); }
.card-title { font-size: 1.5rem; margin-bottom: .8rem; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { position: relative; padding-block: clamp(3rem, 7vw, 6rem) clamp(2.5rem, 5vw, 4rem); overflow: hidden; }
.page-hero h1 { font-size: clamp(3rem, 1.4rem + 7vw, 7.5rem); line-height: .95; letter-spacing: -.03em; margin: 1rem 0 1.25rem; }
.page-hero .split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: end; }
.page-hero .shot { border-radius: 20px; overflow: hidden; aspect-ratio: 16 / 10; border: 1px solid var(--line); background: var(--surface-2); }
.page-hero .shot img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 899px) { .page-hero .split { grid-template-columns: 1fr; } }
.bleed-hero { position: relative; min-height: min(78vh, 680px); display: grid; align-items: end; color: #f3f5f8; overflow: hidden; isolation: isolate; background: #0b1220; }
.bleed-hero .bg { position: absolute; inset: 0; z-index: -2; }
.bleed-hero .bg img { width: 100%; height: 100%; object-fit: cover; }
.bleed-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(8,11,16,.94) 8%, rgba(8,11,16,.55) 55%, rgba(8,11,16,.25)); }
.bleed-hero h1, .bleed-hero .lede { color: #f3f5f8; }
.bleed-hero .eyebrow { color: #c6cfdb; }
.bleed-hero .eyebrow .kf { color: #ff9278; }
.bleed-hero .inner { padding-block: 6rem 3.5rem; width: 100%; }
.bleed-hero h1 { font-size: clamp(3rem, 1.4rem + 7vw, 7.5rem); line-height: .95; letter-spacing: -.03em; margin: 1rem 0 1.25rem; }

/* ---------- Jump bar ---------- */
.jumpbar { position: sticky; top: var(--header-h); z-index: 50; background: color-mix(in srgb, var(--ground) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.jumpbar .wrap { display: flex; gap: .5rem; align-items: center; overflow-x: auto; padding-block: .55rem; scrollbar-width: none; }
.jumpbar .wrap::-webkit-scrollbar { display: none; }
.jumpbar span { font: 500 .8125rem/1 var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; margin-right: .3rem; }
.jumpbar a { white-space: nowrap; min-height: 40px; display: inline-flex; align-items: center; }
@media (max-width: 899px) { .jumpbar { top: 6.9rem; } }

/* ---------- Projects ---------- */
.showcase { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); background: var(--panel); color: var(--panel-ink); border-radius: 22px; overflow: hidden; border: 1px solid var(--panel-line); }
.showcase .media { min-height: 340px; background: #0b1420; }
.showcase .body { padding: clamp(1.5rem, 3.5vw, 3rem); display: grid; gap: 1.1rem; align-content: center; }
.showcase h3 { color: var(--panel-ink); font-size: clamp(2rem, 1.4rem + 2vw, 3rem); }
.showcase p { color: var(--panel-muted); font-size: 1.1rem; margin: 0; }
.showcase .eyebrow { color: var(--panel-muted); }
.showcase .chip { background: transparent; border-color: var(--panel-line); color: var(--panel-ink); }
.showcase .stats { background: var(--panel-line); border-color: var(--panel-line); margin: 0; max-width: none; }
.showcase .stat { background: var(--panel-2); }
.showcase .stat b { color: var(--panel-ink); }
.showcase .stat span { color: var(--panel-muted); }
.showcase .btn { background: var(--panel-ink); color: var(--panel); justify-self: start; }
.showcase .btn:hover { background: var(--red-lift); color: #15171c; }
@media (max-width: 899px) { .showcase { grid-template-columns: 1fr; } .showcase .media { min-height: 0; aspect-ratio: 16 / 10; } }
.proj { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: min(56vh, 440px); }
.proj .media { background: #10151c; }
.proj .media img { object-fit: contain; background: #10151c; }
.proj .body { padding: clamp(1.4rem, 3vw, 2.4rem); display: grid; gap: .9rem; align-content: center; }
.proj h3 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem); }
.proj p { margin: 0; font-size: 1.05rem; }
.mini-stats { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; font: 500 .875rem/1.3 var(--f-mono); color: var(--muted); }
.mini-stats b { color: var(--ink); font-weight: 600; }
@media (max-width: 799px) { .proj { grid-template-columns: 1fr; min-height: 0; } .proj .media { aspect-ratio: 16/10; } }
.side-card .media { aspect-ratio: 16 / 10; border-bottom: 1px solid var(--line); background: #10151c; }
.side-card .body { padding: 1.1rem 1.2rem 1.3rem; display: grid; gap: .5rem; }
.side-card h3 { font-size: 1.2rem; }
.side-card p { margin: 0; font-size: 1rem; }
.term-ph { width: 100%; height: 100%; display: grid; place-items: center; background:
  linear-gradient(#10151c, #10151c) padding-box; color: #9fb4cc; font: 500 .9rem/1.4 var(--f-mono); padding: 1rem; text-align: center; position: relative; }
.term-ph::before { content: "● ● ●"; position: absolute; top: .6rem; left: .8rem; letter-spacing: .15em; color: #4d5a6a; font-size: .8125rem; }
.term-ph b { color: #ff9278; font-weight: 500; }
.star { font: 600 .875rem/1 var(--f-mono); color: var(--ink); display: inline-flex; gap: .35rem; align-items: center; }
.star::before { content: "★"; color: var(--play); }

/* ---------- Writing ---------- */
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.25rem, 3vw, 2.5rem); }
@media (max-width: 899px) { .two-col { grid-template-columns: 1fr; } }
.shelf h3 { font-size: 1.5rem; }
.shelf > p { color: var(--muted); margin: .3rem 0 1rem; }
.coll-card { padding: 1.4rem; display: grid; gap: .5rem; border-top: 4px solid var(--coll); }
.coll-card .n { font: 760 3rem/1 var(--f-display); color: var(--ink); letter-spacing: -.03em; }
.coll-card h3 { font-size: 1.3rem; }
.coll-card p { margin: 0; font-size: 1rem; }
.archive { display: grid; gap: 0; }
.year-block { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 2rem; view-timeline: --year block; }
.year-block + .year-block { border-top: 1px solid var(--line); padding-top: 1.5rem; margin-top: 1.5rem; }
.year-label { position: sticky; top: calc(var(--header-h) + 1.5rem); align-self: start; font: 760 clamp(3rem, 2rem + 3vw, 5rem)/1 var(--f-display); letter-spacing: -.04em; color: var(--ink); font-variant-numeric: tabular-nums; }
.year-label small { display: block; font: 500 .8125rem/1.3 var(--f-mono); letter-spacing: .08em; color: var(--muted); text-transform: uppercase; margin-top: .6rem; }
.year-label .yfill { display: block; height: 3px; margin-top: .8rem; width: 100%; background: var(--play); transform-origin: 0 50%; border-radius: 2px; }
.year-block .row-list { border-top: 0; }
.year-block .row-item { grid-template-columns: 7rem minmax(0, 1fr) auto; }
@media (max-width: 799px) { .year-block { grid-template-columns: 1fr; gap: .5rem; } .year-label { position: relative; top: auto; font-size: 2.6rem; } .year-block .row-item { grid-template-columns: 1fr; } }
.filterbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1.5rem; }
.pill { min-height: 44px; padding: .4rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: .95rem; color: var(--text); display: inline-flex; align-items: center; gap: .45rem; transition: background .15s, border-color .15s; }
.pill:hover { border-color: var(--ink); }
.pill[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.pill .n { font: 500 .8125rem/1 var(--f-mono); opacity: .8; }
.status-line { font: 500 .875rem/1.4 var(--f-mono); color: var(--muted); margin-left: auto; }
.series-card { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.series-card .media { min-height: 300px; }
.series-card .body { padding: clamp(1.4rem, 3vw, 2.4rem); display: grid; gap: 1rem; align-content: center; }
.series-card h3 { font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.6rem); }
.parts { list-style: none; display: grid; gap: .1rem; counter-reset: part; }
.parts li { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto; gap: .8rem; align-items: center; min-height: 48px; border-bottom: 1px solid var(--line); }
.parts li::before { counter-increment: part; content: counter(part, decimal-leading-zero); font: 500 .875rem/1 var(--f-mono); color: var(--play-ink); }
.parts a { font-weight: 600; color: var(--ink); text-decoration: none; }
.parts a:hover { color: var(--play-ink); text-decoration: underline; }
.parts .soon { color: var(--muted); }
@media (max-width: 799px) { .series-card { grid-template-columns: 1fr; } .series-card .media { aspect-ratio: 16/9; min-height: 0; } }
.tagcloud { display: flex; flex-wrap: wrap; gap: .55rem; }
.tagcloud .chip { font-size: .875rem; min-height: 40px; padding-inline: .9rem; }
.tagcloud .chip sup { font-size: .8125rem; color: var(--muted); margin-left: .35rem; top: 0; }

/* ---------- AI ---------- */
.consult { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding: 1.3rem 1.6rem; background: var(--panel); color: var(--panel-ink); border-radius: var(--radius); }
.consult p { margin: 0; font-size: 1.15rem; max-width: 60ch; }
.consult .btn { background: var(--panel-ink); color: var(--panel); }
.consult .btn:hover { background: var(--red-lift); color: #15171c; }
.lead-post { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); margin-bottom: 1.5rem; }
.lead-post .media { min-height: 320px; }
.lead-post .body { padding: clamp(1.4rem, 3vw, 2.5rem); display: grid; gap: .9rem; align-content: center; }
.lead-post h3 { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.5rem); }
.lead-post p { margin: 0; font-size: 1.1rem; }
@media (max-width: 799px) { .lead-post { grid-template-columns: 1fr; } .lead-post .media { aspect-ratio: 16/9; min-height: 0; } }
.story-card { display: flex; flex-direction: column; }
.story-card .media { aspect-ratio: 4 / 3; border-bottom: 1px solid var(--line); }
.story-card .body { padding: 1.3rem; display: grid; gap: .6rem; }
.story-card h3 { font-size: 1.4rem; }
.story-card p { margin: 0; font-size: 1rem; }
.story-card.soon { border-style: dashed; background: transparent; }
.story-card.soon .media { display: grid; place-items: center; background: repeating-linear-gradient(135deg, var(--surface-2) 0 10px, transparent 10px 20px); color: var(--muted); font: 500 .875rem/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; }
.notice { border: 1px solid color-mix(in srgb, var(--play) 50%, var(--line)); border-left: 4px solid var(--play); background: color-mix(in srgb, var(--play) 7%, var(--surface)); border-radius: 10px; padding: 1rem 1.2rem; font-size: 1rem; }
.notice strong { color: var(--ink); }

/* ---------- About ---------- */
.about-hero .frame { border-radius: 22px; overflow: hidden; aspect-ratio: 4/5; clip-path: inset(0 0 0 0 round 22px); background: var(--surface-2); }
.about-hero .frame img { width: 100%; height: 100%; object-fit: cover; }
.careerbar { display: flex; gap: 3px; margin-bottom: 1rem; border-radius: 10px; overflow: hidden; }
.careerbar div { flex: var(--w) 1 0; background: var(--surface-2); position: relative; min-height: 64px; padding: .55rem .6rem; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.careerbar div::before { content: ""; position: absolute; inset: 0; background: var(--track); transform-origin: 0 50%; z-index: 0; }
.careerbar b, .careerbar span { position: relative; z-index: 1; color: #fff; }
.careerbar b { font: 650 .875rem/1.15 var(--f-body); }
.careerbar span { font: 500 .8125rem/1 var(--f-mono); opacity: .9; }
.careerbar div:first-child::before { background: var(--play); }
:root[data-theme="dark"] .careerbar b, :root[data-theme="dark"] .careerbar span { color: #0d1015; }
:root[data-theme="dark"] .careerbar div:first-child b, :root[data-theme="dark"] .careerbar div:first-child span { color: #0d1015; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .careerbar b, :root:not([data-theme="light"]) .careerbar span { color: #0d1015; } }
@media (max-width: 899px) { .careerbar { flex-direction: column; } .careerbar div { min-height: 48px; flex-direction: row; align-items: center; } }
.phases { display: grid; gap: 0; }
.phase { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 2rem; padding-block: 2rem; border-top: 1px solid var(--line); view-timeline: --phase block; }
.phase-when { position: sticky; top: calc(var(--header-h) + 1.5rem); align-self: start; }
.phase-when .yrs { font: 760 clamp(1.8rem, 1.3rem + 1.4vw, 2.5rem)/1 var(--f-display); color: var(--ink); letter-spacing: -.03em; }
.phase-when .nm { font: 500 .8125rem/1.3 var(--f-mono); color: var(--play-ink); text-transform: uppercase; letter-spacing: .1em; margin-top: .6rem; display: block; }
.phase-body > p { font-size: 1.125rem; max-width: 62ch; }
.roles { list-style: none; display: grid; gap: .9rem; }
.role { padding: 1rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.role h4 { font-size: 1.15rem; line-height: 1.25; }
.role .when { font: 500 .8125rem/1.4 var(--f-mono); color: var(--muted); display: block; margin-top: .25rem; }
.role ul { margin: .7rem 0 0 1.1rem; display: grid; gap: .45rem; }
.role li { font-size: 1rem; }
@media (max-width: 799px) { .phase { grid-template-columns: 1fr; gap: 1rem; } .phase-when { position: relative; top: auto; } }
.dark-panel { background: var(--panel); color: var(--panel-ink); }
.dark-panel h2, .dark-panel h3 { color: var(--panel-ink); }
.dark-panel .sec-head p { color: var(--panel-muted); }
.dark-panel .eyebrow { color: var(--panel-muted); }
.dark-panel .eyebrow .kf { color: #ff9278; }
.dark-panel .ruler { --line: var(--panel-line); --muted: #6b7788; --ground: var(--panel); }
.dark-panel .arrow-link { color: var(--panel-ink); }
.principles { list-style: none; counter-reset: pr; display: grid; }
.principles li { counter-increment: pr; display: grid; grid-template-columns: 4rem minmax(0, 1fr); gap: 1rem; padding-block: clamp(1.1rem, 2.5vw, 2rem); border-bottom: 1px solid var(--panel-line); align-items: baseline; }
.principles li::before { content: counter(pr, decimal-leading-zero); font: 500 .9rem/1 var(--f-mono); color: #ff9278; }
.principles q { font: italic 500 clamp(1.5rem, 1rem + 2.4vw, 3rem)/1.12 var(--f-display); letter-spacing: -.02em; color: var(--panel-ink); quotes: "\201C" "\201D"; }
.beyond { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.beyond .frame { border-radius: 20px; overflow: hidden; aspect-ratio: 4/5; background: var(--surface-2); }
.beyond .frame img { width: 100%; height: 100%; object-fit: cover; }
.beyond dl { margin: 0; display: grid; gap: 1.4rem; }
.beyond dt { font: 700 1.4rem/1.2 var(--f-display); color: var(--ink); }
.beyond dd { margin: .35rem 0 0; font-size: 1.1rem; }
@media (max-width: 899px) { .beyond { grid-template-columns: 1fr; } .beyond .frame { aspect-ratio: 4/3; } }
.caps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--panel-line); border: 1px solid var(--panel-line); border-radius: 16px; overflow: hidden; }
.cap { background: var(--panel-2); padding: clamp(1.2rem, 2.5vw, 1.9rem); }
.cap h3 { font-size: 1.4rem; color: var(--panel-ink); }
.cap p { color: var(--panel-muted); margin: .5rem 0 1rem; font-size: 1.05rem; }
.cap ul { list-style: none; display: flex; flex-wrap: wrap; gap: .45rem; }
.cap li { font: 500 .875rem/1.3 var(--f-mono); padding: .35rem .7rem; border: 1px solid var(--panel-line); border-radius: 999px; color: var(--panel-ink); }
@media (max-width: 799px) { .caps { grid-template-columns: 1fr; } }

/* ---------- Article ---------- */
.art-hero { position: relative; min-height: min(86vh, 760px); display: grid; align-items: end; overflow: hidden; isolation: isolate; background: #0b1220; color: #f3f5f8; }
.art-hero .bg { position: absolute; inset: 0; z-index: -2; }
.art-hero .bg img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.1); }
.art-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(8,11,16,.97) 10%, rgba(8,11,16,.84) 50%, rgba(8,11,16,.55)); }
.art-hero .inner { padding-block: 7rem 3rem; width: 100%; }
.art-hero .inner > * { max-width: 980px; }
.art-hero .crumb { display: inline-flex; align-items: center; gap: .5rem; color: #d9e0e8; font: 500 .875rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; min-height: 44px; }
.art-hero .crumb:hover { color: #fff; text-decoration: underline; }
.art-hero h1 { color: #fff; font-size: clamp(2.5rem, 1.3rem + 5vw, 5.4rem); line-height: .98; letter-spacing: -.035em; margin: .6rem 0 1rem; }
.art-hero .desc { font-size: clamp(1.15rem, 1rem + .5vw, 1.4rem); color: #dfe5ec; max-width: 52ch; }
.art-hero .meta { color: #c6cfdb; margin-top: 1.25rem; }
.art-hero .meta .dot { background: #ff9278; }
.art-hero .tags .chip { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.28); color: #f3f5f8; }
.art-layout { display: grid; grid-template-columns: 250px minmax(0, 760px); gap: clamp(2rem, 5vw, 5rem); justify-content: center; padding-block: 3.5rem 4rem; timeline-scope: --s0, --s1, --s2, --s3, --s4, --s5, --s6, --s7; }
.toc { position: sticky; top: calc(var(--header-h) + 1.5rem); align-self: start; }
.toc h2 { font: 500 .8125rem/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.toc ol { list-style: none; display: grid; gap: .15rem; border-left: 1px solid var(--line); }
.toc a { display: block; position: relative; padding: .55rem .9rem .75rem; text-decoration: none; color: var(--muted); font-weight: 550; font-size: 1rem; line-height: 1.3; }
.toc a:hover { color: var(--ink); }
.toc a .tbar { position: absolute; left: .9rem; right: .9rem; bottom: .35rem; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.toc a .tbar::after { content: ""; position: absolute; inset: 0; background: var(--play); transform-origin: 0 50%; transform: scaleX(0); }
.toc a.is-active { color: var(--ink); }
.toc a.is-active::before { content: ""; position: absolute; left: -2px; top: .45rem; bottom: .45rem; width: 3px; background: var(--play); border-radius: 2px; }
.toc .toc-foot { margin-top: 1.5rem; display: grid; gap: .5rem; }
.toc .toc-foot a { color: var(--ink); padding: .4rem 0; font-size: .95rem; }
.toc-mobile { display: none; margin-bottom: 2rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.toc-mobile summary { cursor: pointer; min-height: 52px; display: flex; align-items: center; padding: 0 1.1rem; font: 500 .875rem/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.toc-mobile ol { padding: 0 1.1rem 1rem 2.4rem; display: grid; gap: .3rem; }
.toc-mobile a { color: var(--text); display: block; padding: .3rem 0; }
@media (max-width: 1099px) { .art-layout { grid-template-columns: minmax(0, 760px); } .toc { display: none; } .toc-mobile { display: block; } }

.prose { font-size: 1.1875rem; line-height: 1.72; color: var(--text); min-width: 0; }
.prose > * { margin: 0 0 1.35rem; }
.prose h2 { font-size: clamp(1.8rem, 1.4rem + 1.4vw, 2.5rem); margin: 3.5rem 0 1.25rem; padding-top: 1.25rem; position: relative; }
.prose h2::before { content: attr(data-kf); position: absolute; top: 0; left: 0; font: 500 .8125rem/1 var(--f-mono); letter-spacing: .12em; color: var(--play-ink); }
.prose a { color: var(--ink); text-decoration-color: var(--play); text-decoration-thickness: 2px; text-underline-offset: .2em; }
.prose a:hover { color: var(--play-ink); }
.prose code:not(pre code) { font: 500 .88em/1 var(--f-mono); background: var(--surface-2); padding: .15em .4em; border-radius: 5px; color: var(--ink); }
.prose ol, .prose ul { padding-left: 1.4rem; display: grid; gap: .45rem; }
.prose li::marker { color: var(--play-ink); font-family: var(--f-mono); font-size: .9em; }
.prose em { color: var(--ink); }
.prose section { margin: 0; }
.callout { border-radius: 12px; padding: 1.1rem 1.3rem 1.1rem 1.3rem; border: 1px solid var(--line); background: var(--surface); font-size: 1.0625rem; line-height: 1.6; position: relative; }
.callout > :last-child { margin-bottom: 0; }
.callout .lbl { display: inline-block; font: 600 .8125rem/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; margin-bottom: .55rem; }
.callout-skill { border-color: var(--track); background: color-mix(in srgb, var(--track) 9%, var(--surface)); }
.callout-skill .lbl { color: var(--track); }
.callout-note .lbl { color: var(--muted); }
.callout-why { border-left: 4px solid var(--track); }
.callout-why .lbl { color: var(--track); }
.callout-q { border: 1px dashed color-mix(in srgb, var(--play) 60%, var(--line)); background: color-mix(in srgb, var(--play) 5%, var(--surface)); }
.callout-q .lbl { color: var(--play-ink); }
.code { margin: 0 0 1.6rem; border-radius: 12px; overflow: hidden; background: var(--code-bg); border: 1px solid #252d38; }
@media (min-width: 1200px) { .code { margin-inline: -2.5rem; } }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: .3rem .4rem .3rem 1rem; background: var(--code-head); border-bottom: 1px solid #252d38; }
.code-head span { font: 500 .8125rem/1 var(--f-mono); letter-spacing: .1em; color: #aab6c4; text-transform: uppercase; }
.copy-btn { min-height: 38px; padding: 0 .85rem; border-radius: 8px; border: 1px solid #36414f; background: transparent; color: #e4e8ee; cursor: pointer; font: 500 .8125rem/1 var(--f-mono); }
.copy-btn:hover { border-color: #e4e8ee; }
.code pre { margin: 0; padding: 1.1rem 1.25rem 1.3rem; overflow-x: auto; font: 400 .9rem/1.65 var(--f-mono); color: var(--code-text); tab-size: 2; }
.code pre code { font: inherit; background: none; padding: 0; }
/* Prism tokens, tuned for the code ground in both themes */
.token.comment, .token.prolog { color: #8b98a8; font-style: italic; }
.token.keyword, .token.module, .token.operator.arrow { color: #ff9278; }
.token.string, .token.template-string { color: #b5d98a; }
.token.function { color: #8fc2ff; }
.token.class-name, .token.builtin { color: #f0c674; }
.token.tag, .token.boolean, .token.number { color: #f0a0c0; }
.token.attr-name, .token.property { color: #9fd8d0; }
.token.punctuation, .token.operator { color: #c1cad6; }
.after-article { border-top: 1px solid var(--line); padding-top: 2rem; margin-top: 3rem; display: grid; gap: 2rem; }
.tags-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.tags-row strong { font: 500 .8125rem/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-right: .5rem; }
.share { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.share strong { font-family: var(--f-display); font-size: 1.25rem; color: var(--ink); margin-right: .6rem; }
.newsletter { padding: clamp(1.5rem, 3vw, 2.2rem); background: var(--panel); color: var(--panel-ink); border-radius: 18px; display: grid; gap: 1rem; }
.newsletter h2, .newsletter h3 { color: var(--panel-ink); font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
.newsletter p { margin: 0; color: var(--panel-muted); }
.nl-form { display: flex; flex-wrap: wrap; gap: .6rem; }
.nl-form label { flex: 1 1 100%; }
.nl-form input[type="email"] { flex: 1 1 220px; min-height: 48px; padding: 0 1rem; border-radius: 10px; border: 1px solid var(--panel-line); background: var(--panel-2); color: var(--panel-ink); }
.nl-form input::placeholder { color: #8e99a7; }
.nl-form button { min-height: 48px; padding: 0 1.3rem; border-radius: 10px; border: 0; background: var(--panel-ink); color: var(--panel); font-weight: 700; cursor: pointer; }
.nl-form button:hover { background: var(--red-lift); color: #15171c; }
.nl-status { font-size: .95rem; color: var(--panel-muted); min-height: 1.4em; }
.md-link { font: 500 .875rem/1 var(--f-mono); }

/* ---------- Patterns ---------- */
.three-ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.three-ways > div { background: var(--surface); padding: 1.4rem; }
.three-ways h3 { font-size: 1.35rem; display: flex; gap: .6rem; align-items: baseline; }
.three-ways h3 span { font: 500 .8125rem/1 var(--f-mono); color: var(--play-ink); }
.three-ways p { margin: .5rem 0 0; font-size: 1rem; }
.three-ways-foot { margin-top: 1rem; max-width: 80ch; color: var(--muted); font-size: 1rem; }
@media (max-width: 799px) { .three-ways { grid-template-columns: 1fr; } }
.pat-tools { display: grid; gap: 1rem; margin-bottom: 1.75rem; }
.search { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 0 1rem; min-height: 54px; }
.search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--play) 30%, transparent); }
.search input { flex: 1; border: 0; background: transparent; min-height: 52px; font-size: 1.05rem; outline: none; min-width: 0; }
.search svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.pat-row { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; }
.pat-row .count-line { font: 500 .9rem/1 var(--f-mono); color: var(--muted); }
.pat-row .count-line b { color: var(--ink); }
.pat-row select { min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); padding: 0 .8rem; }
.pat-row .sortwrap { margin-left: auto; display: flex; align-items: center; gap: .6rem; font-size: .95rem; }
.linkish { background: none; border: 0; color: var(--ink); text-decoration: underline; text-decoration-color: var(--play); text-underline-offset: .25em; cursor: pointer; min-height: 44px; font-weight: 600; }
.pat-card { display: flex; flex-direction: column; }
.pat-card .thumb { aspect-ratio: 16 / 9; border-bottom: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.pat-card .thumb svg { width: 72%; height: auto; color: var(--track); }
.pat-card .body { padding: 1.15rem 1.25rem 1.3rem; display: grid; gap: .55rem; }
.pat-card h2 { font-size: 1.3rem; line-height: 1.2; }
.pat-card p { margin: 0; font-size: 1rem; }
.pat-card .tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .2rem; }
.empty { text-align: center; padding: 3rem 1rem; border: 1px dashed var(--line); border-radius: 16px; display: none; }
.empty h3 { font-size: 1.5rem; margin-bottom: .5rem; }
.empty.show { display: block; }
[hidden] { display: none !important; }

.pat-detail { max-width: 1060px; }
.backlink { display: inline-flex; min-height: 44px; align-items: center; gap: .4rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.backlink:hover { color: var(--play-ink); }
.uses { columns: 2 16rem; column-gap: 2rem; list-style: none; }
.uses li { break-inside: avoid; padding: .45rem 0 .45rem 1.3rem; position: relative; border-bottom: 1px solid var(--line); }
.uses li::before { content: ""; position: absolute; left: 0; top: 1.05rem; width: 7px; height: 7px; background: var(--play); rotate: 45deg; }
.panes { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); }
.pane-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding: .5rem; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tablist { display: flex; flex-wrap: wrap; gap: .25rem; }
.tab { min-height: 44px; padding: 0 1rem; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; font-weight: 600; color: var(--text); }
.tab:hover { color: var(--ink); background: var(--surface); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: inset 0 -2px 0 var(--play); }
.pane-actions { display: flex; gap: .4rem; }
.pane-actions button { min-height: 44px; padding: 0 1rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; }
.pane-actions button:hover { border-color: var(--ink); }
.pane { padding: clamp(1rem, 3vw, 2rem); }
.pane pre { margin: 0; background: var(--code-bg); color: var(--code-text); border-radius: 10px; padding: 1.1rem 1.2rem; overflow-x: auto; font: 400 .9rem/1.6 var(--f-mono); }
.pane-note { font-size: 1rem; color: var(--muted); margin-bottom: 1rem; }
.prompt-text { font-size: 1.0625rem; line-height: 1.7; max-width: 70ch; }
.prompt-text h3 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
.prompt-text code { font: 500 .88em var(--f-mono); background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }

/* The demo pattern itself, on the pattern tokens */
.pat-stage { --p-ground: #eef0f3; --p-surface: #ffffff; --p-border: #d2d8e0; --p-ink: #161b22; --p-dim: #56606e; --p-accent: #364f6a; --p-ok: #1c6e52; --p-warn: #7e610f; --p-bad: #a03227;
  background: var(--p-ground); color: var(--p-ink); border-radius: 12px; padding: clamp(1rem, 3vw, 1.75rem); display: grid; gap: 1rem; }
:root[data-theme="dark"] .pat-stage { --p-ground: #10141a; --p-surface: #191f27; --p-border: #2c3743; --p-ink: #e6ecf3; --p-dim: #97a4b4; --p-accent: #6f92bd; --p-ok: #4fbe93; --p-warn: #ddb44a; --p-bad: #ee8579; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pat-stage { --p-ground: #10141a; --p-surface: #191f27; --p-border: #2c3743; --p-ink: #e6ecf3; --p-dim: #97a4b4; --p-accent: #6f92bd; --p-ok: #4fbe93; --p-warn: #ddb44a; --p-bad: #ee8579; } }
.pat-stage .cap-line { font-size: 1rem; color: var(--p-dim); margin: 0; }
.hss-strip { display: grid; gap: 1px; background: var(--p-border); border: 1px solid var(--p-border); border-radius: 10px; overflow: hidden; grid-template-columns: 1fr; }
@media (min-width: 21rem) { .hss-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 42rem) { .hss-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } .hss-strip.five { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.hss-tile { background: var(--p-surface); padding: .9rem 1rem; display: grid; gap: .25rem; text-align: left; border: 0; font: inherit; color: inherit; min-width: 0; }
.hss-label { font: 500 .8125rem/1.25 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--p-dim); overflow-wrap: anywhere; }
.hss-fig { font: 700 1.6rem/1.1 var(--f-display); font-variant-numeric: tabular-nums; }
.hss-fig.none { color: var(--p-dim); font-weight: 500; }
.hss-sub { font-size: .875rem; color: var(--p-dim); }
button.hss-tile { cursor: pointer; min-height: 44px; }
button.hss-tile:hover { background: color-mix(in srgb, var(--p-accent) 7%, var(--p-surface)); }
button.hss-tile[aria-pressed="true"] { background: color-mix(in srgb, var(--p-accent) 14%, var(--p-surface)); box-shadow: inset 0 -3px 0 var(--p-accent); }
button.hss-tile:focus-visible { outline: 3px solid var(--p-accent); outline-offset: -3px; }
.hss-list { list-style: none; border: 1px solid var(--p-border); border-radius: 10px; overflow: hidden; background: var(--p-surface); }
.hss-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 1rem; border-bottom: 1px solid var(--p-border); font-size: 1rem; }
.hss-list li:last-child { border-bottom: 0; }
.hss-st { font: 500 .8125rem/1.4 var(--f-mono); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.hss-st[data-s="Done"] { color: var(--p-ok); } .hss-st[data-s="Failed"] { color: var(--p-bad); } .hss-st[data-s="Downloading"] { color: var(--p-accent); } .hss-st[data-s="Queued"] { color: var(--p-warn); }
.hss-status { font-size: .95rem; color: var(--p-dim); margin: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--panel); color: var(--panel-muted); padding-block: 4rem 2rem; margin-top: 0; view-timeline: --foot block; }
.site-footer a { color: var(--panel-ink); text-decoration: none; }
.site-footer a:hover { color: #ff9278; text-decoration: underline; }
.foot-reel { display: flex; align-items: center; gap: 1rem; margin-bottom: 3rem; font: 500 .8125rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--panel-muted); }
.foot-reel .bar { flex: 1; height: 3px; background: #ff6b4a; border-radius: 2px; position: relative; }
.foot-reel .bar::after { content: ""; position: absolute; right: -7px; top: -6px; width: 14px; height: 14px; background: #ff6b4a; rotate: 45deg; border-radius: 2px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.5fr; gap: 2.5rem; }
.foot-grid h2 { font: 500 .8125rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--panel-muted); margin-bottom: 1rem; }
.foot-grid ul { list-style: none; display: grid; gap: .1rem; }
.foot-grid li a { display: inline-flex; min-height: 40px; align-items: center; }
.foot-brand { display: grid; gap: 1rem; align-content: start; }
.foot-brand .brand { color: var(--panel-ink); }
.foot-brand .brand-word small { color: var(--panel-muted); display: block; }
.foot-brand p { margin: 0; max-width: 34ch; }
.site-footer .nl-form input[type="email"] { background: var(--panel-2); }
.foot-bottom { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--panel-line); display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; font-size: .95rem; }
@media (max-width: 899px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand, .foot-news { grid-column: 1 / -1; } }

/* ==========================================================================
   Scroll-driven layer. Only here does anything move, and only when the
   browser supports timelines, the OS allows motion, and the reader has
   not switched motion off with the header toggle.
   ========================================================================== */
@keyframes k-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes k-pct { from { --pct: 0; } to { --pct: 100; } }
@keyframes k-header { to { box-shadow: 0 10px 30px -18px rgba(0,0,0,.45); } }
@keyframes k-hdr-pad { from { min-height: 5rem; } to { min-height: var(--header-h); } }
@keyframes k-reveal { from { opacity: 0; translate: 0 2.5rem; } }
@keyframes k-reveal-x { from { opacity: 0; translate: -2rem 0; } }
@keyframes k-weight { from { font-weight: 320; letter-spacing: .01em; } }
@keyframes k-grow { from { width: 0; } }
@keyframes k-scale-x { from { transform: scaleX(0); } }
@keyframes k-tbar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes k-count { from { --num: var(--from, 0); } }
@keyframes k-iris { from { clip-path: inset(var(--iris-y, 10%) var(--iris-x, 26%) var(--iris-y, 10%) var(--iris-x, 26%) round 200px); } }
@keyframes k-parallax { from { transform: translateY(-7%) scale(1.14); } to { transform: translateY(7%) scale(1.14); } }
@keyframes k-hero-bg { to { transform: translateY(18%) scale(1.1); filter: saturate(.6); } }
@keyframes k-fade-out { to { opacity: 0; translate: 0 -1rem; } }
@keyframes k-marquee-l { to { transform: translateX(-38%); } }
@keyframes k-marquee-r { from { transform: translateX(-38%); } to { transform: translateX(0); } }
@keyframes k-hs { to { transform: translateX(calc(-100% + 100vw)); } }
@keyframes k-stack { to { scale: var(--end-scale, .92); filter: brightness(.9); } }
@keyframes k-mark { from { background-size: 0% .14em; } }
@keyframes k-toc-on { from, to { color: var(--ink); } }
@keyframes k-toc-rail { from, to { opacity: 1; } }
@keyframes k-shadow-in { to { opacity: 1; } }
@keyframes k-shadow-out { to { opacity: 0; } }
@keyframes k-principle { 0% { color: #7f8a99; } 50% { color: #ffffff; } 100% { color: #7f8a99; } }
@keyframes k-tilt { from { opacity: 0; transform: perspective(900px) rotateX(18deg) translateY(3rem); } }
@keyframes k-logo { from { transform: scaleX(.08); } to { transform: scaleX(1); } }

@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    html:not([data-motion="off"]) {
      animation: k-pct linear both; animation-timeline: scroll(root block);
    }
    html:not([data-motion="off"]) .progress { transform: scaleX(0); animation: k-progress linear both; animation-timeline: scroll(root block); }
    html:not([data-motion="off"]) .brand .logo-bar { animation: k-logo linear both; animation-timeline: scroll(root block); }
    html:not([data-motion="off"]) .site-header { animation: k-header linear both; animation-timeline: scroll(root block); animation-range: 0 180px; }
    html:not([data-motion="off"]) .hdr { animation: k-hdr-pad linear both; animation-timeline: scroll(root block); animation-range: 0 180px; }

    /* Mobile nav: scroll-linked edge shadows on the link row */
    html:not([data-motion="off"]) .nav::before { animation: k-shadow-in linear both; animation-timeline: --navx; animation-range: 0 3rem; }
    html:not([data-motion="off"]) .nav::after { animation: k-shadow-out linear both; animation-timeline: --navx; animation-range: calc(100% - 3rem) 100%; }

    /* Section rulers: the playhead crosses as the section crosses the viewport */
    html:not([data-motion="off"]) .ruler .head { animation: k-grow linear both; animation-timeline: --sec; animation-range: entry 40% exit 30%; }
    html:not([data-motion="off"]) .sec-head h2, html:not([data-motion="off"]) .stretch { animation: k-weight linear both; animation-timeline: view(); animation-range: entry 10% cover 35%; }

    html:not([data-motion="off"]) .reveal { animation: k-reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 85%; }
    html:not([data-motion="off"]) .reveal-x { animation: k-reveal-x linear both; animation-timeline: view(); animation-range: entry 5% entry 90%; }
    html:not([data-motion="off"]) .tilt { animation: k-tilt linear both; animation-timeline: view(); animation-range: entry 0% entry 90%; }
    html:not([data-motion="off"]) .count { animation: k-count linear both; animation-timeline: view(); animation-range: entry 20% cover 45%; }
    html:not([data-motion="off"]) .parallax img { animation: k-parallax linear both; animation-timeline: view(); animation-range: cover; }
    html:not([data-motion="off"]) .xp-card .fill,
    html:not([data-motion="off"]) .hs-meter .bar i { animation: k-scale-x linear both; animation-timeline: view(); animation-range: entry 30% cover 55%; }

    /* Home hero: portrait iris opens and marker underlines sweep as you leave the fold */
    html:not([data-motion="off"]) .portrait .frame { animation: k-iris linear both; animation-timeline: scroll(root block); animation-range: 0 55vh; }
    html:not([data-motion="off"]) .portrait .tickbar::after { animation: k-scale-x linear both; animation-timeline: scroll(root block); animation-range: 0 55vh; }
    html:not([data-motion="off"]) .hero h1 .hl { animation: k-mark linear both; animation-timeline: scroll(root block); animation-range: calc(var(--i) * 7vh) calc(var(--i) * 7vh + 12vh); }
    html:not([data-motion="off"]) .scroll-cue { animation: k-fade-out linear both; animation-timeline: scroll(root block); animation-range: 0 20vh; }

    html:not([data-motion="off"]) .marquee-row { animation: k-marquee-l linear both; animation-timeline: view(); animation-range: cover; }
    html:not([data-motion="off"]) .marquee-row + .marquee-row { translate: 0 0; animation-name: k-marquee-r; }

    html:not([data-motion="off"]) .bleed-hero .bg img,
    html:not([data-motion="off"]) .art-hero .bg img { animation: k-hero-bg linear both; animation-timeline: view(); animation-range: exit 0% exit 100%; }
    html:not([data-motion="off"]) .bleed-hero .inner,
    html:not([data-motion="off"]) .art-hero .inner { animation: k-fade-out linear both; animation-timeline: view(); animation-range: exit 30% exit 90%; }
    html:not([data-motion="off"]) .about-hero .frame { animation: k-iris linear both; animation-timeline: view(); animation-range: entry 0% cover 50%; }

    html:not([data-motion="off"]) .year-label .yfill { animation: k-scale-x linear both; animation-timeline: --year; animation-range: contain 0% contain 100%; }
    html:not([data-motion="off"]) .careerbar div::before { animation: k-scale-x linear both; animation-timeline: view(); animation-range: entry calc(20% + var(--i) * 9%) cover calc(28% + var(--i) * 4%); }
    html:not([data-motion="off"]) .principles q { animation: k-principle linear both; animation-timeline: view(); animation-range: cover 10% cover 90%; }

    /* Article TOC: one named view timeline per section, exposed via timeline-scope */
    html:not([data-motion="off"]) .toc a .tbar::after { animation: k-tbar linear both; }
    html:not([data-motion="off"]) .toc a { animation: k-toc-on linear none; }
    html:not([data-motion="off"]) .toc a::before { content: ""; position: absolute; left: -2px; top: .45rem; bottom: .45rem; width: 3px; background: var(--play); border-radius: 2px; opacity: 0; animation: k-toc-rail linear none; }
    html:not([data-motion="off"]) .toc a.is-active { color: var(--muted); }
    html:not([data-motion="off"]) .toc a.is-active:hover { color: var(--ink); }
    #s0 { view-timeline: --s0 block; } #s1 { view-timeline: --s1 block; } #s2 { view-timeline: --s2 block; }
    #s3 { view-timeline: --s3 block; } #s4 { view-timeline: --s4 block; } #s5 { view-timeline: --s5 block; } #s6 { view-timeline: --s6 block; } #s7 { view-timeline: --s7 block; }
    html:not([data-motion="off"]) .toc [data-s="0"], html:not([data-motion="off"]) .toc [data-s="0"] .tbar::after, html:not([data-motion="off"]) .toc [data-s="0"]::before { animation-timeline: --s0; }
    html:not([data-motion="off"]) .toc [data-s="1"], html:not([data-motion="off"]) .toc [data-s="1"] .tbar::after, html:not([data-motion="off"]) .toc [data-s="1"]::before { animation-timeline: --s1; }
    html:not([data-motion="off"]) .toc [data-s="2"], html:not([data-motion="off"]) .toc [data-s="2"] .tbar::after, html:not([data-motion="off"]) .toc [data-s="2"]::before { animation-timeline: --s2; }
    html:not([data-motion="off"]) .toc [data-s="3"], html:not([data-motion="off"]) .toc [data-s="3"] .tbar::after, html:not([data-motion="off"]) .toc [data-s="3"]::before { animation-timeline: --s3; }
    html:not([data-motion="off"]) .toc [data-s="4"], html:not([data-motion="off"]) .toc [data-s="4"] .tbar::after, html:not([data-motion="off"]) .toc [data-s="4"]::before { animation-timeline: --s4; }
    html:not([data-motion="off"]) .toc [data-s="5"], html:not([data-motion="off"]) .toc [data-s="5"] .tbar::after, html:not([data-motion="off"]) .toc [data-s="5"]::before { animation-timeline: --s5; }
    html:not([data-motion="off"]) .toc [data-s="6"], html:not([data-motion="off"]) .toc [data-s="6"] .tbar::after, html:not([data-motion="off"]) .toc [data-s="6"]::before { animation-timeline: --s6; }
    html:not([data-motion="off"]) .toc [data-s="7"], html:not([data-motion="off"]) .toc [data-s="7"] .tbar::after, html:not([data-motion="off"]) .toc [data-s="7"]::before { animation-timeline: --s7; }
    html:not([data-motion="off"]) .toc a, html:not([data-motion="off"]) .toc a::before { animation-range: cover 0% cover 100%; }
    html:not([data-motion="off"]) .toc a .tbar::after { animation-range: entry 100% exit 0%; }
    #s0, #s1, #s2, #s3, #s4, #s5, #s6, #s7 { view-timeline-inset: 45% 50%; }

    @media (min-width: 800px) {
      html:not([data-motion="off"]) .stack-card { animation: k-stack linear both; animation-timeline: --stack; animation-range: contain calc((var(--i) + 1) * 24%) contain 100%; --end-scale: calc(1 - (var(--n) - var(--i)) * .03); }
      html:not([data-motion="off"]) .stack-card:last-child { animation: none; }
    }

    /* Pinned horizontal strip: vertical scroll drives the sideways track */
    @media (min-width: 900px) and (min-height: 620px) {
      html:not([data-motion="off"]) .hs { view-timeline: --hs block; height: calc(100vh + var(--count) * 300px); }
      html:not([data-motion="off"]) .hs-sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; padding-top: var(--header-h); }
      html:not([data-motion="off"]) .hs-track { overflow: visible; width: max-content; scroll-snap-type: none; animation: k-hs linear both; animation-timeline: --hs; animation-range: contain 0% contain 100%; }
      html:not([data-motion="off"]) .hs-track > * { flex-basis: 380px; }
      html:not([data-motion="off"]) .hs-meter .bar i { animation: k-scale-x linear both; animation-timeline: --hs; animation-range: contain 0% contain 100%; }
      html:not([data-motion="off"]) .hs .sec-head { margin-bottom: 1.5rem; }
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* UI pattern library article */
.prose .prose-fig { margin: 2rem 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.prose .prose-fig img { width: 100%; height: auto; display: block; }
.prose .callout p + p { margin-top: .8rem; }
.prose .live-pattern a.btn { white-space: normal; text-decoration: none; color: var(--ground); }
.prose .live-pattern a.btn:hover { color: #fff; }
.prose p code { overflow-wrap: anywhere; }
.prose section > div > ul, .prose section > div > ol, .prose section > div > .callout { margin-bottom: 1.35rem; }
