/* Split Screen — a persistent 50/50 diptych.
   Left half: fixed identity pane (who, where you are, what is in view).
   Right half: the scrolling reading pane. Grotesque on the left, serif on the right. */

:root {
  --split: 50%;
  --bar-h: 4.5rem;

  --paper: #f3efe7;
  --paper-2: #e9e3d6;
  --surface: #fbf9f5;
  --ink: #18212c;
  --ink-2: #38424f;
  --muted: #59626f;
  --rule: #d4cbbb;
  --rule-strong: #b9ad98;
  --link: #2b4764;
  --accent: #935509;
  --accent-soft: #f1e1c4;
  --ok: #1c6e52;
  --bad: #a03227;

  --pane: #1e2f42;
  --pane-2: #283d55;
  --pane-3: #34506e;
  --pane-ink: #f1f4f7;
  --pane-muted: #b3c1d0;
  --pane-rule: rgba(241, 244, 247, 0.18);
  --pane-accent: #e8b865;

  --code-bg: #141b23;
  --code-ink: #dde5ee;
  --code-dim: #8e9bab;

  --font-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --font-read: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 4px;
  --focus: #e8b865;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1318;
    --paper-2: #181e25;
    --surface: #151a20;
    --ink: #eef1f4;
    --ink-2: #c6cdd6;
    --muted: #9ca6b3;
    --rule: #2a323c;
    --rule-strong: #3d4854;
    --link: #93b6de;
    --accent: #e8b865;
    --accent-soft: #3a2e1a;
    --ok: #4fbe93;
    --bad: #ee8579;
    --pane: #1a2939;
    --pane-2: #223448;
    --pane-3: #2d445e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1318;
  --paper-2: #181e25;
  --surface: #151a20;
  --ink: #eef1f4;
  --ink-2: #c6cdd6;
  --muted: #9ca6b3;
  --rule: #2a323c;
  --rule-strong: #3d4854;
  --link: #93b6de;
  --accent: #e8b865;
  --accent-soft: #3a2e1a;
  --ok: #4fbe93;
  --bad: #ee8579;
  --pane: #1a2939;
  --pane-2: #223448;
  --pane-3: #2d445e;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--font-read);
  font-size: 1.125rem;
  line-height: 1.65;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
.content :focus-visible { outline-color: var(--accent); }
h1, h2, h3, h4 { color: var(--ink); margin: 0; }
p { margin: 0 0 1em; }
button { font: inherit; cursor: pointer; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip { position: absolute; left: 1rem; top: -4rem; z-index: 50; background: var(--pane-accent); color: #1a1a1a; padding: .6rem 1rem; font-family: var(--font-display); font-weight: 700; }
.skip:focus { top: 1rem; }

/* ───────── The bar: brand, nav, theme. Lives on the left half. ───────── */
.bar {
  position: fixed; top: 0; left: 0; width: var(--split); z-index: 20;
  height: var(--bar-h);
  display: flex; align-items: center; gap: 1.25rem;
  padding: 0 clamp(1.25rem, 3vw, 3rem);
  color: var(--pane-ink);
  font-family: var(--font-display);
  background: linear-gradient(var(--pane) 70%, transparent);
}
.brand { display: flex; align-items: center; gap: .7rem; color: var(--pane-ink); text-decoration: none; flex-shrink: 0; }
.brand svg { width: 2.25rem; height: 2.25rem; }
.brand-word { display: flex; flex-direction: column; line-height: 1.05; }
.brand-word small { font-size: .8125rem; letter-spacing: .14em; text-transform: uppercase; color: var(--pane-muted); font-weight: 500; }
.brand-word strong { font-size: 1.125rem; letter-spacing: .02em; font-weight: 800; }
.nav { margin-left: auto; flex: 0 0 auto; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .1rem; flex-wrap: nowrap; justify-content: flex-end; }
.nav a {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 .6rem;
  color: var(--pane-muted); text-decoration: none; font-size: 1rem; font-weight: 500;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--pane-ink); }
.nav a[aria-current="page"] { color: var(--pane-ink); border-bottom-color: var(--pane-accent); }
.nav a.nav-ai { color: var(--pane-accent); }
.icon-btn {
  width: 2.75rem; height: 2.75rem; display: inline-grid; place-items: center;
  border: 1px solid var(--pane-rule); border-radius: 999px; background: transparent; color: var(--pane-ink);
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--pane-2); }
.icon-btn svg { width: 1.2rem; height: 1.2rem; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
.menu-btn { display: none; }
.bar-sync { display: none; }
@media (min-width: 900px) and (max-width: 1560px) { .brand-word { display: none; } }

/* ───────── The cover: left identity pane ───────── */
.cover {
  position: fixed; top: 0; bottom: 0; left: 0; width: var(--split);
  background: var(--pane); color: var(--pane-ink);
  font-family: var(--font-display);
  display: flex; flex-direction: column;
  padding: calc(var(--bar-h) + 1rem) clamp(1.25rem, 3vw, 3rem) 0;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-color: var(--pane-3) transparent;
  isolation: isolate;
}
.cover-media { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: var(--pane); }
.cover-media img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: luminosity; opacity: .62; }
.cover-media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(20, 31, 44, .78) 0%, rgba(20, 31, 44, .12) 26%, rgba(20, 31, 44, .35) 50%, rgba(18, 28, 40, .94) 78%, var(--pane) 100%);
}
.cover-media.tint img { opacity: .38; }
.cover-grid {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    url("assets/cover-blueprint-tall.webp"),
    linear-gradient(var(--pane-rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--pane-rule) 1px, transparent 1px);
  background-size: cover, 48px 48px, 48px 48px; background-position: center; opacity: .35;
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
}
.cover-body { margin-top: auto; padding-bottom: 1.5rem; max-width: 36rem; }
.cover-body.top { margin-top: 1rem; }
.eyebrow {
  font-family: var(--font-mono); font-size: .8125rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--pane-accent); margin: 0 0 .9rem; font-weight: 500;
}
.cover h1 {
  color: var(--pane-ink); font-weight: 700; letter-spacing: -0.025em;
  font-size: clamp(2.4rem, min(4.3vw, 7.4vh), 4.6rem); line-height: 1.02; margin-bottom: 1.1rem;
  text-wrap: balance;
}
.cover h1.long { font-size: clamp(2.1rem, min(3.3vw, 6vh), 3.6rem); line-height: 1.06; }
.lede { font-size: clamp(1.125rem, 1.35vw, 1.3rem); line-height: 1.5; color: var(--pane-muted); margin: 0 0 1.4rem; max-width: 34rem; }
.cover .lede strong { color: var(--pane-ink); font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--pane-rule); border: 1px solid var(--pane-rule); margin: 0 0 1.5rem; max-width: 30rem; }
.stat { background: rgba(20, 31, 44, .72); padding: .7rem .9rem; }
.stat b { display: block; font-size: 1.6rem; font-weight: 700; color: var(--pane-ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat span { font-family: var(--font-mono); font-size: .8125rem; color: var(--pane-muted); letter-spacing: .04em; }

.ctas { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 2.9rem; padding: 0 1.25rem;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem; text-decoration: none;
  border-radius: var(--radius); border: 1px solid transparent;
}
.btn-primary { background: var(--pane-accent); color: #1b1407; }
.btn-primary:hover { background: #f2cb85; }
.btn-line { color: var(--pane-ink); text-decoration: underline; text-underline-offset: .25em; padding: 0; min-height: 2.9rem; }
.btn-quiet { color: var(--pane-muted); padding: 0; min-height: 2.9rem; text-decoration: none; font-weight: 500; }
.btn-quiet:hover { color: var(--pane-ink); }
.btn-ghost { border-color: var(--pane-rule); color: var(--pane-ink); }
.btn-ghost:hover { background: var(--pane-2); }

/* sync strip: the left pane captions whatever the right pane shows */
.sync {
  display: flex; align-items: center; gap: 1rem;
  border-top: 1px solid var(--pane-rule);
  padding: .9rem 0 1.1rem; margin-top: .5rem;
  font-family: var(--font-mono); font-size: .875rem; color: var(--pane-muted);
}
.sync-num { color: var(--pane-accent); font-weight: 500; min-width: 2ch; }
.sync-label { color: var(--pane-ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-display); font-size: 1rem; font-weight: 600; }
.sync-count { font-variant-numeric: tabular-nums; }
.sync-socials { display: flex; gap: .25rem; }
.sync-socials a { color: var(--pane-muted); display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; }
.sync-socials a:hover { color: var(--pane-ink); }
.sync-socials svg { width: 1.15rem; height: 1.15rem; }

/* index list in the cover — jump links synced to right-pane sections */
.jump { list-style: none; margin: 0 0 1.25rem; padding: 0; border-top: 1px solid var(--pane-rule); max-width: 30rem; }
.jump li { border-bottom: 1px solid var(--pane-rule); }
.jump a {
  display: flex; align-items: baseline; gap: 1rem; min-height: 2.75rem; padding: .45rem .25rem;
  color: var(--pane-muted); text-decoration: none; font-size: 1.0625rem; font-weight: 500;
  transition: color .15s, padding .15s;
}
.jump a small { font-family: var(--font-mono); font-size: .8125rem; color: var(--pane-muted); opacity: .85; min-width: 2ch; }
.jump a .count { margin-left: auto; font-family: var(--font-mono); font-size: .875rem; }
.jump a:hover, .jump a[aria-current="true"] { color: var(--pane-ink); padding-left: .75rem; }
.jump a[aria-current="true"] { box-shadow: inset 3px 0 0 var(--pane-accent); }
.jump a[aria-current="true"] small { color: var(--pane-accent); opacity: 1; }
@media (prefers-reduced-motion: reduce) { .jump a { transition: none; } }

.pane-note { border: 1px solid var(--pane-rule); background: rgba(40, 61, 85, .6); padding: 1rem 1.1rem; margin: 0 0 1.25rem; max-width: 32rem; border-radius: var(--radius); }
.pane-note p { margin: 0 0 .75rem; font-size: 1.0625rem; line-height: 1.5; color: var(--pane-ink); }
.pane-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.25rem; }
.pane-chip { font-family: var(--font-mono); font-size: .8125rem; color: var(--pane-muted); border: 1px solid var(--pane-rule); padding: .2rem .55rem; border-radius: 999px; }

/* controls in the cover (filters, search) */
.control-label { font-family: var(--font-mono); font-size: .8125rem; letter-spacing: .1em; text-transform: uppercase; color: var(--pane-muted); margin: 0 0 .5rem; display: block; }
.toggle-row { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1.2rem; }
.toggle {
  min-height: 2.75rem; padding: 0 .95rem; border-radius: 999px;
  border: 1px solid var(--pane-rule); background: transparent; color: var(--pane-ink);
  font-family: var(--font-display); font-size: 1rem; font-weight: 500;
}
.toggle small { font-family: var(--font-mono); font-size: .8125rem; color: var(--pane-muted); margin-left: .35rem; }
.toggle:hover { background: var(--pane-2); }
.toggle[aria-pressed="true"] { background: var(--pane-ink); color: var(--pane); border-color: var(--pane-ink); }
.toggle[aria-pressed="true"] small { color: var(--pane-3); }
.toggle.tag { font-family: var(--font-mono); font-size: .875rem; min-height: 2.5rem; }
.field {
  width: 100%; min-height: 3rem; padding: .6rem .95rem; border-radius: var(--radius);
  border: 1px solid var(--pane-rule); background: rgba(10, 18, 28, .55); color: var(--pane-ink);
  font-family: var(--font-display); font-size: 1.0625rem;
}
.field::placeholder { color: #93a3b5; }
.control-meta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; font-family: var(--font-mono); font-size: .875rem; color: var(--pane-muted); margin: 0 0 1rem; }
.control-meta output { color: var(--pane-ink); }
.linkish { background: none; border: 0; padding: .4rem 0; color: var(--pane-accent); text-decoration: underline; font-family: var(--font-mono); font-size: .875rem; min-height: 2.75rem; }
.select {
  min-height: 2.75rem; padding: 0 .75rem; border-radius: var(--radius);
  border: 1px solid var(--pane-rule); background: var(--pane-2); color: var(--pane-ink); font-family: var(--font-display); font-size: 1rem;
}

/* ───────── The seam ───────── */
.seam {
  position: fixed; top: 0; bottom: 0; left: var(--split); width: 3px; z-index: 15;
  transform: translateX(-1px); background: var(--rule); pointer-events: none;
}
.seam i { position: absolute; left: 0; top: 0; width: 100%; height: 100%; background: var(--accent); transform-origin: top; transform: scaleY(var(--progress, 0)); }

/* ───────── The content: right reading pane ───────── */
.content { margin-left: var(--split); min-width: 0; }
.content-inner { padding: clamp(2.5rem, 5vw, 5rem) clamp(1.5rem, 4.5vw, 4.5rem) 0; max-width: 46rem; }
.section { padding: 0 0 4.5rem; scroll-margin-top: 2rem; }
.section + .section { border-top: 1px solid var(--rule); padding-top: 3rem; }
.sec-head { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: .9rem; margin: 0 0 1.75rem; }
.sec-num { font-family: var(--font-mono); font-size: .875rem; color: var(--accent); }
.sec-head h2 { font-family: var(--font-read); font-size: clamp(1.8rem, 2.6vw, 2.25rem); line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; }
.sec-head p { grid-column: 2 / -1; margin: -.4rem 0 0; color: var(--muted); font-size: 1.0625rem; }
.sec-link { font-family: var(--font-display); font-weight: 600; font-size: 1rem; white-space: nowrap; }

.mono { font-family: var(--font-mono); }
.meta { font-family: var(--font-mono); font-size: .875rem; color: var(--muted); letter-spacing: .02em; }
.pill {
  display: inline-block; font-family: var(--font-mono); font-size: .8125rem; line-height: 1.4;
  padding: .12rem .5rem; border-radius: 999px; border: 1px solid var(--rule-strong); color: var(--ink-2);
}
.pill.accent { border-color: var(--accent); color: var(--accent); }
.pill.solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }

/* entry rows: the right pane's workhorse list */
.rows { list-style: none; margin: 0; padding: 0; }
.row { border-top: 1px solid var(--rule); }
.row:last-child { border-bottom: 1px solid var(--rule); }
.row > a {
  display: grid; grid-template-columns: 2.4rem 1fr 7.5rem; gap: 1.1rem; align-items: start;
  padding: 1.35rem 0; text-decoration: none; color: inherit;
}
.row.no-thumb > a { grid-template-columns: 2.4rem 1fr; }
.row-n { font-family: var(--font-mono); font-size: .875rem; color: var(--muted); padding-top: .35rem; }
.row h3 { font-family: var(--font-read); font-size: 1.3rem; line-height: 1.3; font-weight: 600; margin: 0 0 .35rem; }
.row p { margin: 0 0 .5rem; color: var(--ink-2); font-size: 1.0625rem; line-height: 1.55; }
.row .thumb { width: 7.5rem; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); background: var(--paper-2); filter: saturate(.85); }
.row > a:hover h3 { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.row > a:hover .thumb { filter: none; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; }

/* feature rows: big image, used for Start here */
.feature { display: grid; gap: 1.25rem; }
.feature-card { display: block; text-decoration: none; color: inherit; border: 1px solid var(--rule); background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.feature-card img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; }
.feature-card .fc-body { padding: 1.25rem 1.4rem 1.4rem; }
.feature-card h3 { font-size: 1.45rem; line-height: 1.25; font-weight: 600; margin: .4rem 0 .5rem; }
.feature-card p { margin: 0; font-size: 1.0625rem; }
.feature-card:hover h3 { color: var(--link); text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px; }
.feature-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.feature-duo .feature-card img { aspect-ratio: 16 / 10; }
.feature-duo .feature-card h3 { font-size: 1.2rem; }

/* tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.tile { background: var(--surface); padding: 1.3rem 1.3rem 1.4rem; text-decoration: none; color: inherit; display: block; }
a.tile:hover h3 { color: var(--link); text-decoration: underline; text-underline-offset: .18em; }
.tile h3 { font-size: 1.2rem; font-weight: 600; margin: .45rem 0 .4rem; line-height: 1.3; }
.tile p { margin: 0 0 .6rem; font-size: 1.0625rem; line-height: 1.5; }
.tile .meta { display: block; }

.panel-dark { background: var(--pane); color: var(--pane-ink); padding: 2rem; border-radius: var(--radius); }
.panel-dark h3 { color: var(--pane-ink); font-family: var(--font-display); font-size: 1.5rem; margin-bottom: .6rem; }
.panel-dark p { color: var(--pane-muted); }
.panel-dark .btn-primary { margin-top: .5rem; }

/* footer (right pane) */
.site-foot { border-top: 2px solid var(--ink); margin-top: 1rem; padding: 3rem 0 2.5rem; }
.foot-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 2rem; }
.foot-grid h2 { font-family: var(--font-mono); font-size: .8125rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 0 0 .8rem; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li a { display: inline-block; padding: .2rem 0; font-family: var(--font-display); font-size: 1rem; }
.foot-news p { font-size: 1.0625rem; margin: 0 0 .8rem; }
.news-form { display: flex; flex-wrap: wrap; gap: .5rem; }
.news-form input[type="email"] {
  flex: 1 1 12rem; min-height: 2.9rem; padding: 0 .9rem; border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font-family: var(--font-display); font-size: 1rem;
}
.news-form input::placeholder { color: var(--muted); }
.btn-ink { background: var(--ink); color: var(--paper); min-height: 2.9rem; border: 0; border-radius: var(--radius); padding: 0 1.2rem; font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
.btn-ink:hover { background: var(--link); }
.btn-ink[aria-busy="true"] { opacity: .7; }
.form-msg { flex-basis: 100%; margin: .3rem 0 0; font-size: 1rem; min-height: 1.5em; }
.form-msg.is-error { color: var(--bad); }
.form-msg.is-success { color: var(--ok); }
.foot-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }

/* ───────── Article ───────── */
.toc-list { list-style: none; margin: 0 0 1rem; padding: 0; counter-reset: toc; max-width: 30rem; border-left: 1px solid var(--pane-rule); }
.toc-list a {
  display: flex; gap: .8rem; align-items: baseline; padding: .4rem .9rem; min-height: 2.5rem;
  color: var(--pane-muted); text-decoration: none; font-size: 1.0625rem; font-weight: 500; margin-left: -1px; border-left: 3px solid transparent;
}
.toc-list a::before { counter-increment: toc; content: counter(toc, decimal-leading-zero); font-family: var(--font-mono); font-size: .8125rem; }
.toc-list a:hover { color: var(--pane-ink); }
.toc-list a[aria-current="true"] { color: var(--pane-ink); border-left-color: var(--pane-accent); }
.art-meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-family: var(--font-mono); font-size: .875rem; color: var(--pane-muted); margin: 0 0 1.25rem; }
.crumb { color: var(--pane-accent); text-decoration: none; }
.crumb:hover { text-decoration: underline; }
.read-meter { display: flex; align-items: center; gap: .75rem; font-family: var(--font-mono); font-size: .875rem; color: var(--pane-muted); margin: 0 0 1rem; max-width: 30rem; }
.read-meter .track { flex: 1; height: 3px; background: var(--pane-rule); position: relative; overflow: hidden; }
.read-meter .track i { position: absolute; inset: 0; background: var(--pane-accent); transform-origin: left; transform: scaleX(var(--progress, 0)); }

.prose { font-size: 1.1875rem; line-height: 1.72; color: var(--ink-2); }
.prose > * + * { margin-top: 1.15em; }
.prose p { margin-bottom: 0; }
.prose h2 { font-size: 1.85rem; line-height: 1.2; font-weight: 600; margin-top: 2.4em; scroll-margin-top: 2rem; letter-spacing: -0.01em; }
.prose h2 .h-num { display: block; font-family: var(--font-mono); font-size: .875rem; color: var(--accent); font-weight: 400; margin-bottom: .35rem; letter-spacing: 0; }
.prose ol, .prose ul { padding-left: 1.4em; }
.prose li + li { margin-top: .35em; }
.prose code { font-family: var(--font-mono); font-size: .86em; background: var(--paper-2); padding: .1em .35em; border-radius: 3px; color: var(--ink); }
.prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; border-radius: 0; }
.prose .hero-img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: 0 40%; border-radius: var(--radius); border: 1px solid var(--rule); }
.hero-cap { font-family: var(--font-mono); font-size: .875rem; color: var(--muted); margin-top: .5rem !important; }
.callout { border-left: 3px solid var(--rule-strong); padding: .9rem 1.2rem; background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; }
.callout p { margin: 0; }
.callout .c-label { display: block; font-family: var(--font-mono); font-size: .8125rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .3rem; }
.callout.why { border-left-color: var(--link); }
.callout.why .c-label { color: var(--link); }
.callout.question { border-left-color: var(--accent); background: var(--accent-soft); }
.callout.question .c-label { color: var(--accent); }
.callout.skill { border: 1px solid var(--rule-strong); border-left: 3px solid var(--ok); }
.callout.skill .c-label { color: var(--ok); }
.callout.note .c-label { color: var(--muted); }

.code { background: var(--code-bg); color: var(--code-ink); border-radius: var(--radius); overflow: hidden; margin-left: calc(-1 * min(2rem, 3vw)); margin-right: calc(-1 * min(2rem, 3vw)); }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: .35rem .5rem .35rem 1rem; border-bottom: 1px solid #26303b; font-family: var(--font-mono); font-size: .8125rem; color: var(--code-dim); }
.code-copy { background: transparent; border: 1px solid #34404d; color: var(--code-ink); border-radius: 3px; min-height: 2.25rem; padding: 0 .7rem; font-family: var(--font-mono); font-size: .8125rem; }
.code-copy:hover { background: #222c37; }
.code pre { margin: 0; padding: 1rem 1.1rem 1.2rem; overflow-x: auto; font-family: var(--font-mono); font-size: .875rem; line-height: 1.6; tab-size: 2; }
.code .k { color: #c792ea; } .code .s { color: #c3e88d; } .code .c { color: #7f8c9b; font-style: italic; } .code .t { color: #ffcb6b; } .code .f { color: #82aaff; }

.share-zone { border-top: 2px solid var(--ink); margin-top: 3.5rem; padding-top: 2rem; }
.share-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0 2rem; }
.btn-out { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 1rem; border: 1px solid var(--rule-strong); border-radius: var(--radius); color: var(--ink); text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 1rem; background: transparent; }
.btn-out:hover { background: var(--paper-2); }
.news-card { background: var(--surface); border: 1px solid var(--rule); padding: 1.6rem; border-radius: var(--radius); }
.news-card h3 { font-size: 1.4rem; margin-bottom: .35rem; }

/* ───────── Projects ───────── */
.proj { display: grid; grid-template-columns: 1fr; gap: 0; }
.proj-card { border-top: 1px solid var(--rule); padding: 1.6rem 0; display: grid; grid-template-columns: 1fr 11rem; gap: 1.4rem; align-items: start; }
.proj-card:last-child { border-bottom: 1px solid var(--rule); }
.proj-card h3 { font-size: 1.35rem; font-weight: 600; margin: 0 0 .4rem; }
.proj-card h3 a { color: var(--ink); text-decoration: none; }
.proj-card h3 a:hover { color: var(--link); text-decoration: underline; }
.proj-card p { font-size: 1.0625rem; margin: 0 0 .7rem; }
.proj-card .shot { width: 11rem; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--rule); background: var(--paper-2); }
.term {
  width: 11rem; aspect-ratio: 4 / 3; border-radius: var(--radius); background: #10161d; border: 1px solid #26303b;
  font-family: var(--font-mono); font-size: .8125rem; color: #9fe0b4; padding: .9rem .8rem; line-height: 1.5; overflow: hidden; position: relative;
}
.term::before { content: "● ● ●"; display: block; color: #3d4957; letter-spacing: .1em; margin-bottom: .45rem; font-size: .8125rem; }
.term span { color: #dde5ee; }
.term .cur { display: inline-block; width: .55em; height: 1em; background: #9fe0b4; vertical-align: -.15em; }
@media (prefers-reduced-motion: no-preference) { .term .cur { animation: blink 1.1s steps(1) infinite; } }
@keyframes blink { 50% { opacity: 0; } }
.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin: 1rem 0; }
.stat-strip div { background: var(--surface); padding: .8rem 1rem; }
.stat-strip span { display: block; font-family: var(--font-mono); font-size: .8125rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stat-strip b { font-family: var(--font-display); font-size: 1.7rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.compact { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.compact a, .compact div.cell { background: var(--surface); padding: 1.1rem 1.2rem; text-decoration: none; color: inherit; display: block; }
.compact h3 { font-size: 1.1rem; font-weight: 600; margin: 0 0 .3rem; display: flex; justify-content: space-between; gap: .5rem; }
.compact p { font-size: 1rem; line-height: 1.5; margin: 0 0 .5rem; }
.compact a:hover h3 { color: var(--link); text-decoration: underline; }
.stars { font-family: var(--font-mono); font-size: .875rem; color: var(--accent); white-space: nowrap; }

/* ───────── About ───────── */
.career { display: flex; gap: 2px; margin: 0 0 2rem; flex-wrap: wrap; }
.career span { flex: 1 1 auto; background: var(--paper-2); padding: .5rem .6rem; font-family: var(--font-mono); font-size: .8125rem; color: var(--ink-2); line-height: 1.35; }
.career span b { display: block; font-family: var(--font-display); font-size: .95rem; color: var(--ink); }
.career span:first-child { background: var(--ink); color: var(--paper); }
.career span:first-child b { color: var(--paper); }
.phase { display: grid; grid-template-columns: 7rem 1fr; gap: 1.25rem; padding: 1.4rem 0; border-top: 1px solid var(--rule); }
.phase-when { font-family: var(--font-mono); font-size: .875rem; color: var(--accent); padding-top: .3rem; }
.phase h3 { font-size: 1.3rem; font-weight: 600; margin-bottom: .35rem; }
.phase ul { margin: .5rem 0 0; padding-left: 1.1rem; }
.phase li { font-size: 1.0625rem; margin: .25rem 0; }
.phase li b { color: var(--ink); font-weight: 600; }
.phase blockquote { margin: .7rem 0 0; padding-left: 1rem; border-left: 2px solid var(--rule-strong); font-size: 1.0625rem; }
.principles { list-style: none; counter-reset: pr; margin: 0; padding: 0; }
.principles li { counter-increment: pr; display: grid; grid-template-columns: 2.5rem 1fr; gap: .5rem; padding: .9rem 0; border-top: 1px solid var(--pane-rule); font-family: var(--font-read); font-style: italic; font-size: 1.3rem; color: var(--pane-ink); line-height: 1.4; }
.principles li::before { content: counter(pr, decimal-leading-zero); font-family: var(--font-mono); font-style: normal; font-size: .875rem; color: var(--pane-accent); padding-top: .3rem; }
.panel-dark a { color: var(--pane-accent); }
.cap { padding: 1.3rem 0; border-top: 1px solid var(--rule); }
.cap h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: .25rem; }
.cap p { font-size: 1.0625rem; margin: 0 0 .6rem; color: var(--muted); }
.beyond { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.beyond img { border-radius: var(--radius); aspect-ratio: 3 / 4; object-fit: cover; width: 100%; }
.beyond dl { margin: 0; }
.beyond dt { font-family: var(--font-display); font-weight: 700; color: var(--ink); font-size: 1.1rem; }
.beyond dd { margin: .2rem 0 1.1rem; font-size: 1.0625rem; }

/* ───────── AI stories ───────── */
.story { display: grid; grid-template-columns: 9rem 1fr; gap: 1.3rem; padding: 1.5rem 0; border-top: 1px solid var(--rule); text-decoration: none; color: inherit; }
.story img { width: 9rem; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); }
.story h3 { font-size: 1.35rem; font-weight: 600; margin: .3rem 0 .4rem; }
.story p { font-size: 1.0625rem; margin: 0 0 .5rem; }
a.story:hover h3 { color: var(--link); text-decoration: underline; text-underline-offset: .18em; }
.story.soon { opacity: 1; }
.story.soon .ph { width: 9rem; aspect-ratio: 1; border: 1px dashed var(--rule-strong); border-radius: var(--radius); display: grid; place-items: center; font-family: var(--font-mono); font-size: .875rem; color: var(--muted); }
.notice { border: 1px solid var(--accent); background: var(--accent-soft); padding: 1rem 1.2rem; border-radius: var(--radius); font-size: 1.0625rem; margin-bottom: 1rem; }
.notice b { color: var(--ink); }

/* ───────── Patterns ───────── */
.three-ways { border: 1px solid var(--rule); background: var(--surface); border-radius: var(--radius); padding: 1.5rem; }
.three-ways dl { display: grid; grid-template-columns: 1fr; gap: .8rem; margin: .8rem 0 1rem; }
.three-ways dt { font-family: var(--font-display); font-weight: 700; color: var(--ink); }
.three-ways dd { margin: 0; font-size: 1.0625rem; }
.three-ways > p:last-child { margin: 0; color: var(--muted); font-size: 1.0625rem; }
.pgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.pgrid > li { background: var(--surface); }
.pcard { display: flex; flex-direction: column; height: 100%; padding: 1rem 1rem 1.2rem; text-decoration: none; color: inherit; }
.pcard:hover h3 { color: var(--link); text-decoration: underline; text-underline-offset: .18em; }
.pcard h3 { font-size: 1.15rem; font-weight: 600; margin: .4rem 0 .35rem; line-height: 1.3; }
.pcard p { font-size: 1rem; line-height: 1.5; margin: 0 0 .6rem; }
.pcard .good { font-size: .9375rem; color: var(--muted); margin-top: auto; }
.pcard-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.badge { font-family: var(--font-mono); font-size: .8125rem; padding: .08rem .45rem; border-radius: 3px; }
.badge.new { background: var(--accent); color: var(--paper); }
.badge.upd { border: 1px solid var(--accent); color: var(--accent); }
.thumbx { height: 7.5rem; border-radius: 3px; background: var(--paper-2); margin-bottom: .75rem; position: relative; overflow: hidden; border: 1px solid var(--rule); }
.thumbx i { position: absolute; background: var(--rule-strong); border-radius: 2px; }
.thumbx.c-data i:nth-child(1) { left: 10%; right: 10%; top: 18%; height: 10%; background: var(--link); opacity: .7; }
.thumbx.c-data i:nth-child(2) { left: 10%; right: 38%; top: 40%; height: 10%; }
.thumbx.c-data i:nth-child(3) { left: 10%; right: 22%; top: 60%; height: 10%; background: var(--accent); opacity: .7; }
.thumbx.c-data i:nth-child(4) { left: 10%; right: 55%; top: 80%; height: 6%; }
.thumbx.c-layout i:nth-child(1) { left: 8%; top: 14%; width: 40%; height: 72%; }
.thumbx.c-layout i:nth-child(2) { left: 52%; top: 14%; width: 40%; height: 32%; background: var(--link); opacity: .6; }
.thumbx.c-layout i:nth-child(3) { left: 52%; top: 54%; width: 40%; height: 32%; }
.thumbx.c-layout i:nth-child(4) { display: none; }
.thumbx.c-interaction i:nth-child(1) { left: 12%; top: 22%; width: 34%; height: 22%; border-radius: 999px; background: var(--link); opacity: .7; }
.thumbx.c-interaction i:nth-child(2) { left: 54%; top: 22%; width: 34%; height: 22%; border-radius: 999px; }
.thumbx.c-interaction i:nth-child(3) { left: 12%; top: 58%; width: 76%; height: 20%; }
.thumbx.c-interaction i:nth-child(4) { left: 70%; top: 62%; width: 8%; height: 12%; background: var(--accent); border-radius: 50%; }
.thumbx.c-forms i:nth-child(1) { left: 12%; top: 16%; width: 76%; height: 18%; background: var(--surface); border: 1px solid var(--rule-strong); }
.thumbx.c-forms i:nth-child(2) { left: 12%; top: 42%; width: 30%; height: 14%; border-radius: 999px; background: var(--link); opacity: .6; }
.thumbx.c-forms i:nth-child(3) { left: 46%; top: 42%; width: 24%; height: 14%; border-radius: 999px; }
.thumbx.c-forms i:nth-child(4) { left: 12%; top: 68%; width: 40%; height: 16%; background: var(--ink); }
.thumbx.c-color i:nth-child(1) { left: 10%; top: 20%; width: 18%; height: 60%; background: #364f6a; }
.thumbx.c-color i:nth-child(2) { left: 31%; top: 20%; width: 18%; height: 60%; background: #6f92bd; }
.thumbx.c-color i:nth-child(3) { left: 52%; top: 20%; width: 18%; height: 60%; background: #a65210; }
.thumbx.c-color i:nth-child(4) { left: 73%; top: 20%; width: 18%; height: 60%; background: #1c6e52; }
.empty { border: 1px dashed var(--rule-strong); padding: 2rem; text-align: center; border-radius: var(--radius); }
.empty h3 { font-size: 1.3rem; margin-bottom: .4rem; }
.empty .btn-out { margin-top: .6rem; }
[hidden] { display: none !important; }

/* pattern detail panes */
.panes { border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.panes-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; border-bottom: 1px solid var(--rule); padding: .4rem .5rem; background: var(--paper-2); }
.tabs { display: flex; flex-wrap: wrap; gap: .15rem; }
.tabs button { min-height: 2.75rem; padding: 0 .85rem; border: 0; background: transparent; color: var(--muted); font-family: var(--font-display); font-weight: 600; font-size: 1rem; border-bottom: 2px solid transparent; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs button:hover { color: var(--ink); }
.pane-actions { display: flex; gap: .4rem; }
.pane-actions button { min-height: 2.5rem; padding: 0 .8rem; border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink); border-radius: 3px; font-family: var(--font-mono); font-size: .8125rem; }
.tabpanel { padding: 1.25rem; }
.tabpanel pre { margin: 0; background: var(--code-bg); color: var(--code-ink); padding: 1rem; border-radius: 3px; overflow-x: auto; font-family: var(--font-mono); font-size: .875rem; line-height: 1.6; }
.tabpanel .note { font-size: 1rem; color: var(--muted); margin: 0 0 1rem; }
.prompt-text { font-size: 1.0625rem; }
.prompt-text p { margin: 0 0 1em; }

/* the demo pattern itself: hairline stat strip */
.stage { background: var(--paper); border: 1px solid var(--rule); border-radius: 3px; padding: 1.25rem; }
.stage-cap { font-size: 1rem; color: var(--muted); margin: 0 0 .75rem; }
.hss-wrap { container-type: inline-size; }
.hss-strip { display: grid; gap: 1px; background: var(--rule-strong); border: 1px solid var(--rule-strong); border-radius: 8px; overflow: hidden; grid-template-columns: 1fr; margin: 0 0 1.5rem; }
@container (min-width: 21rem) { .hss-strip { grid-template-columns: repeat(2, 1fr); } .hss-filter .hss-tile:first-child { grid-column: 1 / -1; } }
@container (min-width: 42rem) { .hss-strip.four { grid-template-columns: repeat(4, 1fr); } .hss-filter { grid-template-columns: repeat(4, 1fr); } }
.hss-tile { background: var(--surface); padding: .8rem .9rem; min-width: 0; text-align: left; border: 0; color: inherit; font: inherit; }
.hss-tile .l { display: block; font-family: var(--font-mono); font-size: .8125rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.hss-tile .v { display: block; font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.hss-tile .v.dim { color: var(--muted); }
.hss-tile .u { display: block; font-size: .9375rem; color: var(--muted); }
button.hss-tile { cursor: pointer; }
button.hss-tile:hover { background: var(--paper-2); }
button.hss-tile[aria-pressed="true"] { background: color-mix(in srgb, var(--link) 16%, var(--surface)); box-shadow: inset 0 -3px 0 var(--link); }
.hss-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.hss-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--rule); font-size: 1.0625rem; }
.hss-list .st { font-family: var(--font-mono); font-size: .875rem; color: var(--muted); }
.hss-status { font-size: 1rem; margin: .75rem 0 0; color: var(--ink-2); }

/* ───────── Responsive ───────── */
@media (min-width: 900px) and (max-width: 1180px) {
  :root { --split: 42%; }
}
@media (max-width: 1180px) {
  .menu-btn { display: inline-grid; margin-left: auto; }
  .nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--pane); border-bottom: 1px solid var(--pane-rule); padding: .5rem clamp(1rem, 3vw, 3rem) 1rem; display: none; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
  .nav a { font-size: 1.125rem; padding: 0 .25rem; border-bottom: 1px solid var(--pane-rule); width: 100%; min-height: 3rem; }
  .nav a[aria-current="page"] { border-bottom-color: var(--pane-accent); }
  .bar { background: var(--pane); }
}
@media (min-width: 900px) and (max-height: 760px) {
  .cover h1 { font-size: clamp(2.1rem, min(3.6vw, 6.4vh), 3.6rem); }
  .lede { font-size: 1.0625rem; margin-bottom: 1rem; }
  .stats { margin-bottom: 1rem; }
}

@media (max-width: 899px) {
  :root { --split: 100%; --bar-h: 4rem; }
  .bar { position: sticky; width: 100%; background: var(--pane); border-bottom: 1px solid var(--pane-rule); padding: 0 1rem; gap: .6rem; }
  .bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--pane-accent); transform-origin: left; transform: scaleX(var(--progress, 0)); }
  .bar-sync { display: block; min-width: 0; flex: 1; overflow: hidden; }
  .bar-sync .sync-label { display: block; font-family: var(--font-mono); font-size: .875rem; color: var(--pane-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 1px solid var(--pane-rule); padding-left: .7rem; }
  .menu-btn { margin-left: 0; }
  .read-meter { display: none; }
  .cover { position: relative; width: 100%; min-height: 0; padding: 3rem 1rem 0; overflow: visible; }
  .cover.hero-cover { min-height: calc(92svh - var(--bar-h)); }
  .cover h1 { font-size: clamp(2.3rem, 10vw, 3.2rem); }
  .sync { display: none; }
  .seam { display: none; }
  .content { margin-left: 0; }
  .content-inner { padding: 2.5rem 1rem 0; }
  .sec-head { grid-template-columns: auto 1fr; }
  .sec-link { grid-column: 2; }
  .row > a { grid-template-columns: 1fr 5.5rem; gap: .9rem; }
  .row.no-thumb > a { grid-template-columns: 1fr; }
  .row-n { display: none; }
  .row .thumb { width: 5.5rem; }
  .row h3 { font-size: 1.15rem; }
  .feature-duo, .tiles, .compact, .pgrid, .beyond { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
  .proj-card { grid-template-columns: 1fr; }
  .proj-card .shot, .proj-card .term { width: 100%; max-width: 22rem; }
  .phase { grid-template-columns: 1fr; gap: .3rem; }
  .story { grid-template-columns: 5.5rem 1fr; gap: 1rem; }
  .story img, .story.soon .ph { width: 5.5rem; }
  .code { margin-left: -1rem; margin-right: -1rem; border-radius: 0; }
  .prose { font-size: 1.125rem; }
  .prose h2 { font-size: 1.6rem; }
  .stats { max-width: none; }
  .jump, .toc-list { max-width: none; }
  .panel-dark { padding: 1.4rem; }
}
@media (max-width: 480px) {
  .brand-word { display: none; }
  .stat b { font-size: 1.35rem; }
  .stat { padding: .6rem .6rem; }
}

/* gallery article */
.prose figure { margin: 1.5rem 0; }
.prose figure img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--rule); }
.prose blockquote.callout { margin-inline: 0; }
.callout p + p { margin-top: .75rem; }
.prose .live-pattern .btn-out { display: inline-block; }
.prose code { overflow-wrap: anywhere; }
