/* Layered Depth — antjanus.com redesign 055
   Scrolling is a descent: each section sits on a deeper, darker ground,
   and content slabs float above it with a visible edge and a stacked shadow. */

:root {
  --font-display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* primitives */
  --navy-50: #f5f8fb;
  --navy-100: #eaf0f6;
  --navy-150: #dfe7ef;
  --navy-200: #d2dce7;
  --navy-300: #b7c5d4;
  --navy-500: #536579;
  --navy-600: #3f5268;
  --navy-700: #364f6a;
  --navy-800: #203246;
  --navy-900: #0f1a26;
  --ember-600: #b2441a;
  --ember-300: #ff9467;

  /* semantic — light */
  --ground-top: #f7f9fc;
  --ground-deep: #cfd9e4;
  --surface: #ffffff;
  --surface-2: #f2f5f9;
  --edge: #c3cfdc;
  --edge-strong: #9fb0c2;
  --ink: #0f1a26;
  --text: #25384b;
  --muted: #4d5f73;
  --line: #d4dde7;
  --brand: #364f6a;
  --brand-ink: #ffffff;
  --brand-soft: #e3ebf3;
  --accent: #b2441a;
  --accent-ink: #ffffff;
  --accent-soft: #fbe8df;
  --link: #2c5a8a;
  --grid: rgba(54, 79, 106, 0.16);
  --ridge-far: #c4d1de;
  --ridge-mid: #a9bacb;
  --ridge-near: #8699ad;
  --code-bg: #0e1824;
  --code-text: #dbe6f1;
  --focus: #b2441a;
  --shadow-color: 212deg 40% 22%;
  --sh-1: 0 1px 1px hsl(var(--shadow-color) / 0.08), 0 2px 3px hsl(var(--shadow-color) / 0.08);
  --sh-2: 0 1px 1px hsl(var(--shadow-color) / 0.07), 0 3px 4px hsl(var(--shadow-color) / 0.07),
    0 8px 12px hsl(var(--shadow-color) / 0.08), 0 18px 28px hsl(var(--shadow-color) / 0.08);
  --sh-3: 0 1px 1px hsl(var(--shadow-color) / 0.06), 0 4px 6px hsl(var(--shadow-color) / 0.07),
    0 12px 18px hsl(var(--shadow-color) / 0.08), 0 28px 40px hsl(var(--shadow-color) / 0.1),
    0 48px 72px hsl(var(--shadow-color) / 0.12);
  --rim: inset 0 1px 0 rgba(255, 255, 255, 0.7);

  --radius: 14px;
  --radius-sm: 9px;
  --max: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground-top: #121b27;
    --ground-deep: #04070b;
    --surface: #1b2635;
    --surface-2: #223043;
    --edge: #0a1119;
    --edge-strong: #2e3e53;
    --ink: #f1f5fa;
    --text: #cdd8e4;
    --muted: #9eaec0;
    --line: #2d3b4e;
    --brand: #8fb2d8;
    --brand-ink: #0b1420;
    --brand-soft: #1f3148;
    --accent: #ff9467;
    --accent-ink: #1a0b04;
    --accent-soft: #3a2116;
    --link: #9cc3ec;
    --grid: rgba(143, 178, 216, 0.14);
    --ridge-far: #1b2839;
    --ridge-mid: #142030;
    --ridge-near: #0c1520;
    --code-bg: #070c12;
    --focus: #ff9467;
    --shadow-color: 215deg 60% 2%;
    --rim: inset 0 1px 0 rgba(255, 255, 255, 0.07);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground-top: #121b27;
  --ground-deep: #04070b;
  --surface: #1b2635;
  --surface-2: #223043;
  --edge: #0a1119;
  --edge-strong: #2e3e53;
  --ink: #f1f5fa;
  --text: #cdd8e4;
  --muted: #9eaec0;
  --line: #2d3b4e;
  --brand: #8fb2d8;
  --brand-ink: #0b1420;
  --brand-soft: #1f3148;
  --accent: #ff9467;
  --accent-ink: #1a0b04;
  --accent-soft: #3a2116;
  --link: #9cc3ec;
  --grid: rgba(143, 178, 216, 0.14);
  --ridge-far: #1b2839;
  --ridge-mid: #142030;
  --ridge-near: #0c1520;
  --code-bg: #070c12;
  --focus: #ff9467;
  --shadow-color: 215deg 60% 2%;
  --rim: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  color-scheme: dark;
}

/* ---------- base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--ground-top);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
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; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
  font-optical-sizing: auto;
}
p { margin: 0; }
code, kbd, pre { font-family: var(--font-mono); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.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: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 8px;
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.mono { font-family: var(--font-mono); }

/* ---------- topbar: the front-most plane ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  padding: 12px var(--gutter) 0;
  pointer-events: none;
}
.topbar-slab {
  pointer-events: auto;
  max-width: var(--max); margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  min-height: 62px; padding: 8px 10px 8px 14px;
  background: color-mix(in oklab, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-radius: 16px;
  box-shadow: var(--rim), 0 5px 0 var(--edge), var(--sh-2);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink); flex-shrink: 0;
  min-height: 44px;
}
.brand svg { width: 40px; height: 40px; }
.brand-word { display: flex; flex-direction: column; line-height: 1.05; }
.brand-word small {
  font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.brand-word strong { font-family: var(--font-display); font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; }
.mono-back { fill: var(--accent); }
.mono-mid { fill: var(--brand); opacity: 0.55; }
.mono-front { fill: var(--brand); }
.mono-letter { fill: var(--brand-ink); font-family: var(--font-display); font-weight: 800; }

.nav-list { display: flex; gap: 2px; list-style: none; margin: 0 0 0 auto; padding: 0; }
.nav-list a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 1rem;
  transition: background 0.15s, color 0.15s, transform 0.15s var(--ease);
}
.nav-list a:hover { background: var(--surface-2); color: var(--ink); }
.nav-list a[aria-current="page"] {
  background: var(--brand); color: var(--brand-ink);
  box-shadow: 0 3px 0 color-mix(in oklab, var(--brand) 55%, #000);
  transform: translateY(-2px);
}
.controls { display: flex; gap: 6px; align-items: center; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 44px; height: 44px; padding: 0 10px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 600 0.875rem var(--font-body); cursor: pointer;
  box-shadow: 0 3px 0 var(--edge);
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--edge); }
.icon-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.icon-btn[aria-pressed="false"] .depth-on { display: none; }
.icon-btn[aria-pressed="true"] .depth-off { display: none; }
.theme-sun { display: none; }
[data-theme-effective="dark"] .theme-sun { display: block; }
[data-theme-effective="dark"] .theme-moon { display: none; }
.menu-btn { display: none; }

@media (max-width: 960px) {
  .nav-list a { padding: 0 10px; }
  .depth-label { display: none; }
}
@media (max-width: 820px) {
  .menu-btn { display: inline-flex; }
  .topbar-slab { flex-wrap: wrap; }
  .controls { margin-left: auto; }
  .primary-nav { order: 3; width: 100%; display: none; }
  .primary-nav.is-open { display: block; }
  .nav-list { flex-direction: column; margin: 4px 0 6px; gap: 4px; }
  .nav-list a { width: 100%; padding: 0 14px; font-size: 1.0625rem; }
  .nav-list a[aria-current="page"] { transform: none; }
  .brand-word small { display: none; }
}

/* ---------- depth gauge (scroll-spy rail) ---------- */
.gauge {
  position: fixed; right: 14px; top: 50%; transform: translateY(-50%);
  z-index: 40; display: none;
}
@media (min-width: 1400px) { .gauge { display: block; } }
.gauge ol { list-style: none; margin: 0; padding: 14px 0; position: relative; }
.gauge ol::before {
  content: ""; position: absolute; right: 10px; top: 0; bottom: 0; width: 2px;
  background: repeating-linear-gradient(to bottom, var(--edge-strong) 0 2px, transparent 2px 10px);
}
.gauge a {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  min-height: 34px; padding-right: 0; text-decoration: none;
  font: 500 0.8125rem/1 var(--font-mono); color: var(--muted);
}
.gauge a span { opacity: 0; transform: translateX(6px); transition: opacity 0.2s, transform 0.2s var(--ease); background: var(--surface); padding: 5px 8px; border-radius: 6px; box-shadow: var(--sh-1); }
.gauge a::after {
  content: ""; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px;
  background: var(--surface); border: 2px solid var(--edge-strong);
  transform: rotate(45deg); transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.gauge a:hover span, .gauge a:focus-visible span, .gauge a[aria-current="true"] span { opacity: 1; transform: none; }
.gauge a[aria-current="true"] { color: var(--ink); }
.gauge a[aria-current="true"]::after { background: var(--accent); border-color: var(--accent); transform: rotate(45deg) scale(1.2); }

/* ---------- planes (sections that descend) ---------- */
.plane {
  --zi: 0;
  position: relative;
  padding-block: clamp(56px, 8vw, 104px);
  background: var(--ground-top);
  background: color-mix(in oklab, var(--ground-top), var(--ground-deep) calc(var(--zi) * 14%));
}
.plane + .plane { box-shadow: inset 0 18px 24px -18px hsl(var(--shadow-color) / 0.22); }
.plane-head { display: grid; gap: 10px; margin-bottom: clamp(28px, 4vw, 44px); max-width: 60rem; }
.plane-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; margin-bottom: clamp(28px, 4vw, 44px); }
.plane-head-row .plane-head { margin-bottom: 0; }
.z-tag {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 0.8125rem/1.3 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.z-tag b {
  font-weight: 500; color: var(--accent);
  padding: 4px 8px; border-radius: 6px; background: var(--surface); box-shadow: 0 2px 0 var(--edge);
}
.plane-head h2 { font-size: clamp(2rem, 4.2vw, 3.25rem); font-weight: 750; }
.plane-sub { color: var(--muted); font-size: 1.125rem; max-width: 44rem; }
.more-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font-weight: 700; color: var(--ink); text-decoration: none;
  padding: 0 16px; border-radius: 11px; background: var(--surface); box-shadow: 0 4px 0 var(--edge), var(--sh-1);
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.more-link:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--edge), var(--sh-2); }
.more-link:active { transform: translateY(4px); box-shadow: 0 0 0 var(--edge); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px; border-radius: 12px; border: 0;
  font: 700 1.0625rem var(--font-body); text-decoration: none; cursor: pointer;
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
}
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 6px 0 color-mix(in oklab, var(--brand) 50%, #000), var(--sh-2); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 0 color-mix(in oklab, var(--brand) 50%, #000), var(--sh-3); }
.btn-primary:active { transform: translateY(6px); box-shadow: 0 0 0 color-mix(in oklab, var(--brand) 50%, #000), var(--sh-1); }
.btn-accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 0 color-mix(in oklab, var(--accent) 50%, #000), var(--sh-2); }
.btn-accent:hover { transform: translateY(-2px); }
.btn-accent:active { transform: translateY(6px); box-shadow: none; }
.btn-ghost { background: var(--surface); color: var(--ink); box-shadow: 0 5px 0 var(--edge), var(--sh-1); }
.btn-ghost:hover { transform: translateY(-2px); }
.btn-ghost:active { transform: translateY(5px); box-shadow: none; }
.link-secondary { font-weight: 700; color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 6px; min-height: 44px; display: inline-flex; align-items: center; }
.link-tertiary { color: var(--muted); font-weight: 600; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.link-tertiary:hover { color: var(--ink); text-decoration: underline; }

/* ---------- slabs (cards with thickness) ---------- */
.slab {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--rim), 0 6px 0 var(--edge), var(--sh-2);
}
.tilt {
  --rx: 0deg; --ry: 0deg; --lift: 0px;
  transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--lift));
  transform-style: preserve-3d;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.tilt:hover, .tilt:focus-within { --lift: -6px; box-shadow: var(--rim), 0 6px 0 var(--edge), var(--sh-3); }
.tilt.is-tracking { transition: transform 0.08s linear, box-shadow 0.35s var(--ease); }
.pop-1 { transform: translateZ(18px); }
.pop-2 { transform: translateZ(36px); }

/* article card */
.card { display: flex; flex-direction: column; min-width: 0; }
.card-media {
  position: relative; aspect-ratio: 16 / 9; margin: 10px 10px 0;
  border-radius: 10px; overflow: hidden; background: var(--surface-2);
  box-shadow: 0 10px 18px -10px hsl(var(--shadow-color) / 0.45);
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 24px; flex: 1; }
.card-meta { font: 500 0.8125rem/1.4 var(--font-mono); color: var(--muted); letter-spacing: 0.03em; text-transform: uppercase; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.card h3 { font-size: 1.375rem; font-weight: 700; line-height: 1.18; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card h3 a:focus-visible { outline: none; }
.card:has(h3 a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 4px; }
.card p.desc { color: var(--text); font-size: 1rem; line-height: 1.55; }
.card .tags { margin-top: auto; padding-top: 6px; }
.card .tags, .card .ext { position: relative; z-index: 1; }

/* placeholder plate for items with no image — layered planes drawn in CSS */
.plate {
  position: absolute; inset: 0; overflow: hidden;
  background: linear-gradient(160deg, var(--brand-soft), var(--surface-2));
  display: grid; place-items: center;
}
.plate i {
  position: absolute; width: 46%; aspect-ratio: 4 / 3; border-radius: 10px;
  background: var(--surface); box-shadow: 0 4px 0 var(--edge), var(--sh-2);
}
.plate i:nth-child(1) { transform: translate(-30%, -18%) rotate(-6deg); opacity: 0.55; }
.plate i:nth-child(2) { transform: translate(-6%, -4%) rotate(-2deg); opacity: 0.8; }
.plate i:nth-child(3) { transform: translate(18%, 10%) rotate(3deg); }
.plate span {
  position: relative; z-index: 2; transform: translate(18%, 10%) rotate(3deg);
  font: 800 clamp(1.4rem, 3vw, 2.2rem)/1 var(--font-display); color: var(--brand); letter-spacing: -0.03em;
}
.plate.warm { background: linear-gradient(160deg, var(--accent-soft), var(--surface-2)); }
.plate.warm span { color: var(--accent); }

/* tags / chips */
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.tag {
  display: inline-flex; align-items: center; min-height: 30px; padding: 2px 10px;
  border-radius: 999px; background: var(--surface-2); color: var(--text);
  font: 500 0.8125rem/1.2 var(--font-mono); text-decoration: none; border: 1px solid var(--line);
}
a.tag:hover { border-color: var(--brand); color: var(--ink); }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 6px;
  font: 600 0.8125rem/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--accent); color: var(--accent-ink);
}
.badge.soft { background: var(--brand-soft); color: var(--ink); }

/* grids */
.grid { display: grid; gap: clamp(20px, 2.6vw, 32px); }
.g2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }

/* ---------- hero stage (diorama) ---------- */
.stage {
  --px: 0; --py: 0; --sy: 0;
  position: relative; isolation: isolate;
  margin-top: -74px; padding-top: 74px;
  min-height: min(94vh, 940px);
  display: flex; align-items: center;
  overflow: clip;
  perspective: 1400px; perspective-origin: 50% 35%;
  background:
    radial-gradient(ellipse 70% 60% at 70% 20%, color-mix(in oklab, var(--brand) 18%, transparent), transparent 70%),
    linear-gradient(to bottom, var(--ground-top), color-mix(in oklab, var(--ground-top), var(--ground-deep) 30%));
}
.layer {
  position: absolute; inset: 0; pointer-events: none;
  transform: translate3d(calc(var(--px) * var(--pd, 0) * -1px), calc(var(--py) * var(--pd, 0) * -1px + var(--sy) * var(--sd, 0) * 1px), 0);
  will-change: transform;
}
.floor {
  position: absolute; left: -40%; right: -40%; bottom: -6%; height: 62%;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 72px 72px; background-position: center bottom;
  transform: rotateX(70deg); transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 85%);
  mask-image: linear-gradient(to top, #000 10%, transparent 85%);
}
.ridges { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: auto; }
.ridge-far { fill: var(--ridge-far); }
.ridge-mid { fill: var(--ridge-mid); }
.ridge-near { fill: var(--ridge-near); }
.has-art .ridges-svg { display: none; }
.ridge-art { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: auto; display: none; }
.has-art .ridge-art { display: block; }
.ghost-word {
  position: absolute; left: -2vw; top: 14%;
  font: 800 clamp(8rem, 26vw, 24rem)/0.8 var(--font-display); letter-spacing: -0.06em;
  color: transparent; -webkit-text-stroke: 2px color-mix(in oklab, var(--brand) 30%, transparent);
  white-space: nowrap; user-select: none;
}
.stage-inner {
  position: relative; z-index: 3; width: min(100% - 2 * var(--gutter), var(--max)); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 5vw, 72px); align-items: center;
  padding-block: 48px 96px;
}
.stage-copy { transform: translate3d(calc(var(--px) * -10px), calc(var(--py) * -8px), 0); }
.eyebrow {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font: 500 0.8125rem/1.3 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 20px;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
.hero-title { font-size: clamp(2.6rem, 6.2vw, 5.4rem); font-weight: 800; line-height: 0.98; letter-spacing: -0.035em; }
.hero-title .lift-word { display: inline-block; color: var(--accent); text-shadow: 0 4px 0 color-mix(in oklab, var(--accent) 30%, transparent); }
.hero-sub { font-size: clamp(1.125rem, 1.6vw, 1.3rem); margin-top: 22px; max-width: 36rem; color: var(--text); }
.stats {
  display: flex; flex-wrap: wrap; gap: 12px; list-style: none; padding: 0; margin: 28px 0 0;
}
.stats li {
  display: grid; padding: 10px 16px 12px; border-radius: 12px; background: var(--surface);
  box-shadow: var(--rim), 0 4px 0 var(--edge), var(--sh-1); min-width: 118px;
}
.stats li:nth-child(2) { transform: translateY(-6px); }
.stats li:nth-child(3) { transform: translateY(-12px); }
.stats strong { font: 800 1.75rem/1.1 var(--font-display); color: var(--ink); }
.stats span { font: 500 0.8125rem/1.3 var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 34px; }

/* the portrait as an exploded stack of frames */
.frames {
  position: relative; aspect-ratio: 4 / 5; width: 100%; max-width: 440px; justify-self: center;
  transform-style: preserve-3d;
  transform: rotateY(calc(-16deg + var(--px) * 6deg)) rotateX(calc(5deg + var(--py) * -5deg));
  transition: transform 0.4s var(--ease);
}
.frames > * { position: absolute; inset: 0; border-radius: 18px; }
.frame-back { background: var(--accent); transform: translateZ(-120px) translate(28px, 22px); opacity: 0.9; }
.frame-mid { border: 2px dashed var(--edge-strong); transform: translateZ(-60px) translate(14px, 10px); background: color-mix(in oklab, var(--surface) 40%, transparent); }
.frame-photo { overflow: hidden; background: var(--surface-2); box-shadow: 0 8px 0 var(--edge), var(--sh-3); }
.frame-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 30%; }
.frame-label {
  inset: auto auto -22px -18px !important; border-radius: 10px !important;
  transform: translateZ(70px);
  background: var(--surface); padding: 10px 14px; box-shadow: 0 4px 0 var(--edge), var(--sh-2);
  font: 500 0.8125rem/1.3 var(--font-mono); color: var(--text);
}
.frame-label b { display: block; font: 700 1rem/1.2 var(--font-display); color: var(--ink); }

@media (max-width: 900px) {
  .stage { min-height: auto; }
  .stage-inner { grid-template-columns: 1fr; padding-block: 28px 72px; }
  .frames { order: -1; max-width: 300px; aspect-ratio: 1 / 1; margin: 12px auto 18px; }
  .stats li:nth-child(n) { transform: none; }
}

/* page hero (interior pages) */
.page-hero {
  --px: 0; --py: 0; --sy: 0;
  position: relative; isolation: isolate; overflow: clip;
  margin-top: -74px; padding: calc(74px + clamp(48px, 7vw, 96px)) 0 clamp(56px, 7vw, 96px);
  background: linear-gradient(to bottom, var(--ground-top), color-mix(in oklab, var(--ground-top), var(--ground-deep) 18%));
  perspective: 1200px;
}
.page-hero .wrap { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(24px, 5vw, 64px); align-items: center; }
.page-hero h1 { font-size: clamp(2.75rem, 7vw, 5.5rem); font-weight: 800; letter-spacing: -0.04em; line-height: 0.95; }
.page-hero .lede { font-size: clamp(1.125rem, 1.7vw, 1.35rem); margin-top: 20px; max-width: 38rem; }
.hero-plate {
  position: relative; aspect-ratio: 4 / 3; transform-style: preserve-3d;
  transform: rotateY(calc(-18deg + var(--px) * 5deg)) rotateX(calc(6deg + var(--py) * -4deg));
  transition: transform 0.4s var(--ease);
}
.hero-plate > * { position: absolute; inset: 0; border-radius: 16px; }
.hero-plate .pl-back { background: var(--brand); transform: translateZ(-110px) translate(30px, 26px); opacity: 0.35; }
.hero-plate .pl-mid { background: var(--accent); transform: translateZ(-55px) translate(15px, 13px); opacity: 0.8; }
.hero-plate .pl-img { overflow: hidden; box-shadow: 0 8px 0 var(--edge), var(--sh-3); background: var(--surface-2); }
.hero-plate .pl-img img { width: 100%; height: 100%; object-fit: cover; }
.hero-plate .pl-chip {
  inset: auto -14px -20px auto; border-radius: 10px; transform: translateZ(60px);
  background: var(--surface); padding: 10px 14px; box-shadow: 0 4px 0 var(--edge), var(--sh-2);
  font: 500 0.8125rem/1.35 var(--font-mono); color: var(--text); max-width: 70%;
}
@media (max-width: 900px) {
  .page-hero .wrap { grid-template-columns: 1fr; }
  .hero-plate { max-width: 460px; width: 92%; margin-top: 8px; }
}

/* sticky jump pills */
.jump {
  position: sticky; top: 84px; z-index: 30; margin-top: -26px; margin-bottom: 0;
}
.jump-inner {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px; border-radius: 14px;
  background: color-mix(in oklab, var(--surface) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--rim), 0 4px 0 var(--edge), var(--sh-2); scrollbar-width: thin;
}
.jump-inner > span { font: 500 0.8125rem/44px var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 0 6px; flex-shrink: 0; }
.jump a {
  flex-shrink: 0; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  border-radius: 10px; font-weight: 600; font-size: 0.9375rem; color: var(--text); text-decoration: none; background: var(--surface-2);
}
.jump a:hover { color: var(--ink); background: var(--brand-soft); }
.jump a small { font-family: var(--font-mono); color: var(--muted); margin-left: 6px; font-size: 0.8125rem; }

/* ---------- home: receding shelf ---------- */
.shelf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; perspective: 1800px; }
.shelf > .card:nth-child(1) { transform: rotateY(14deg) translateZ(-30px); transform-origin: right center; }
.shelf > .card:nth-child(3) { transform: rotateY(-14deg) translateZ(-30px); transform-origin: left center; }
.shelf > .card:nth-child(2) { transform: translateZ(30px) translateY(-10px); }
.shelf > .card { transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease); }
.shelf > .card:hover, .shelf > .card:focus-within { transform: translateZ(50px) translateY(-8px); box-shadow: var(--rim), 0 6px 0 var(--edge), var(--sh-3); }
.shelf-num { position: absolute; top: -18px; left: 20px; z-index: 2; font: 800 1rem/1 var(--font-mono); background: var(--accent); color: var(--accent-ink); padding: 8px 10px; border-radius: 8px; box-shadow: 0 3px 0 color-mix(in oklab, var(--accent) 50%, #000); }
@media (max-width: 900px) {
  .shelf { grid-template-columns: 1fr; }
  .shelf > .card:nth-child(n) { transform: none; }
}

/* feature + list mosaic for AI */
.mosaic { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(20px, 2.6vw, 32px); }
.mosaic > :nth-child(1) { grid-column: span 7; grid-row: span 2; }
.mosaic > :nth-child(1) h3 { font-size: clamp(1.6rem, 2.4vw, 2.2rem); }
.mosaic > :nth-child(1) .card-media { aspect-ratio: 16 / 10; }
.mosaic > :nth-child(n + 2) { grid-column: span 5; }
.mosaic > :nth-child(n + 2) { flex-direction: row; }
.mosaic > :nth-child(n + 2) .card-media { width: 38%; flex-shrink: 0; aspect-ratio: auto; margin: 10px 0 10px 10px; }
.mosaic > :nth-child(n + 2) .card-body { padding: 16px 18px; }
.mosaic > :nth-child(n + 2) h3 { font-size: 1.125rem; }
.mosaic > :nth-child(n + 2) .desc { display: none; }
.mosaic > :nth-child(n + 4) { grid-column: span 4; flex-direction: column; }
.mosaic > :nth-child(n + 4) .card-media { width: auto; margin: 10px 10px 0; aspect-ratio: 16 / 9; }
.mosaic > :nth-child(n + 4) .desc { display: block; }
@media (max-width: 1000px) {
  .mosaic > :nth-child(n) { grid-column: span 12; }
  .mosaic > :nth-child(n + 2) { grid-column: span 6; flex-direction: column; }
  .mosaic > :nth-child(n + 2) .card-media { width: auto; margin: 10px 10px 0; aspect-ratio: 16 / 9; }
}
@media (max-width: 640px) {
  .mosaic > :nth-child(n + 2) { grid-column: span 12; }
}

/* strata: rows stepping back */
.strata { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.strata > li { --i: 0; margin-left: calc(var(--i) * clamp(0px, 3vw, 44px)); }
.stratum {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 24px; align-items: center;
  padding: 20px 24px; text-decoration: none; color: inherit;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.stratum:hover { transform: translateX(-6px) translateY(-3px); box-shadow: var(--rim), 0 6px 0 var(--edge), var(--sh-3); }
.stratum .depth { font: 500 0.8125rem/1 var(--font-mono); color: var(--accent); writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: 0.08em; }
.stratum h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; }
.stratum p { color: var(--muted); font-size: 1rem; }
.stratum time { font: 500 0.8125rem/1.2 var(--font-mono); color: var(--muted); text-transform: uppercase; white-space: nowrap; }
.strata > li:nth-child(2) .stratum { box-shadow: var(--rim), 0 5px 0 var(--edge), var(--sh-1); }
.strata > li:nth-child(n + 3) .stratum { box-shadow: var(--rim), 0 4px 0 var(--edge); }
@media (max-width: 640px) {
  .stratum { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .stratum .depth { display: none; }
  .strata > li { margin-left: calc(var(--i) * 8px); }
}

/* icon tiles */
.tile { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.tile-icon {
  width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand); color: var(--brand-ink); box-shadow: 0 4px 0 color-mix(in oklab, var(--brand) 50%, #000);
  transform: translateZ(30px);
}
.tile-icon svg { width: 26px; height: 26px; }
.tile h3 { font-size: 1.3rem; }
.tile h3 a { color: inherit; text-decoration: none; }
.tile h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.tile p { font-size: 1rem; }
.tile .type { font: 500 0.8125rem/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
.tile.is-warm .tile-icon { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 0 color-mix(in oklab, var(--accent) 50%, #000); }

/* layered trio (connect / projects / work with me) */
.trio { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 28px; align-items: end; }
.trio > :nth-child(1) { transform: translateY(24px); box-shadow: var(--rim), 0 4px 0 var(--edge), var(--sh-1); }
.trio > :nth-child(2) { transform: translateY(12px); }
.trio > :nth-child(3) { box-shadow: 0 8px 0 color-mix(in oklab, var(--brand) 45%, #000), var(--sh-3); }
.trio .slab { padding: 26px; }
.trio h3 { font-size: 1.35rem; margin-bottom: 14px; }
.linklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.linklist a { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; margin: 0 -12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.linklist a:hover { background: var(--surface-2); }
.linklist small { font: 500 0.8125rem var(--font-mono); color: var(--muted); }
.dark-slab { background: var(--brand); color: var(--brand-ink); }
.dark-slab h3, .dark-slab p { color: var(--brand-ink); }
.dark-slab p { font-size: 1.125rem; margin-bottom: 22px; }
.dark-slab .btn { background: var(--brand-ink); color: var(--brand); box-shadow: 0 5px 0 color-mix(in oklab, var(--brand-ink) 60%, #000); }
@media (max-width: 900px) {
  .trio { grid-template-columns: 1fr; }
  .trio > :nth-child(n) { transform: none; }
}

/* ---------- footer: bedrock ---------- */
.site-footer {
  position: relative; overflow: clip; color: var(--text);
  background: color-mix(in oklab, var(--ground-top), var(--ground-deep) 92%);
  padding: 120px 0 36px;
}
[data-theme-effective="light"] .site-footer { --text: #203246; }
.site-footer .ridges { top: 0; bottom: auto; transform: scaleY(-1); opacity: 0.9; }
.foot-grid { position: relative; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.4fr; gap: 36px; }
.site-footer h2 { font: 500 0.8125rem/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.site-footer ul a { display: inline-flex; min-height: 40px; align-items: center; color: var(--ink); text-decoration: none; font-weight: 600; }
.site-footer ul a:hover { text-decoration: underline; }
.foot-blurb { margin-top: 14px; max-width: 22rem; }
.foot-bottom { position: relative; margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 0.9375rem; color: var(--muted); }
@media (max-width: 900px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .foot-grid { grid-template-columns: 1fr; } }

/* newsletter form */
.nl-form { display: grid; gap: 10px; }
.nl-row { display: flex; gap: 8px; flex-wrap: wrap; }
.input {
  flex: 1 1 200px; min-height: 50px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--edge-strong); background: var(--surface); color: var(--ink);
  font: 400 1.0625rem var(--font-body);
  box-shadow: inset 0 3px 6px hsl(var(--shadow-color) / 0.12);
}
.input::placeholder { color: var(--muted); }
.form-msg { font-size: 1rem; min-height: 1.5em; }
.form-msg.is-error { color: var(--accent); font-weight: 600; }
.form-msg.is-success { color: var(--ink); font-weight: 600; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9375rem; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--brand); }

/* ---------- interior content ---------- */
.lede-panel { padding: clamp(24px, 4vw, 40px); display: grid; grid-template-columns: auto 1fr auto; gap: 20px 28px; align-items: center; }
.lede-panel p { font-size: 1.1875rem; color: var(--ink); }
@media (max-width: 700px) { .lede-panel { grid-template-columns: 1fr; } }

/* landscape project rows */
.land { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; perspective: 1400px; }
.land + .land { margin-top: clamp(48px, 7vw, 88px); }
.land-media { position: relative; aspect-ratio: 16 / 10; transform-style: preserve-3d; transform: rotateY(12deg); transition: transform 0.5s var(--ease); }
.land:nth-child(even) .land-media { order: 2; transform: rotateY(-12deg); }
.land:hover .land-media { transform: rotateY(0deg); }
.land-media > * { position: absolute; inset: 0; border-radius: 14px; }
.land-media .lm-back { background: var(--brand-soft); border: 2px dashed var(--edge-strong); transform: translateZ(-70px) translate(24px, 20px); }
.land-media .lm-img { overflow: hidden; background: #0b121b; box-shadow: 0 7px 0 var(--edge), var(--sh-3); }
.land-media .lm-img img { width: 100%; height: 100%; object-fit: cover; }
.land-media .lm-img.contain img { object-fit: contain; }
.land-copy h3 { font-size: clamp(1.75rem, 3vw, 2.4rem); margin: 8px 0 12px; }
.land-copy p { font-size: 1.0625rem; margin-bottom: 16px; }
.mini-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 18px; list-style: none; padding: 0; }
.mini-stats li { padding: 8px 12px; border-radius: 10px; background: var(--surface); box-shadow: 0 3px 0 var(--edge); font: 500 0.8125rem/1.3 var(--font-mono); color: var(--muted); text-transform: uppercase; }
.mini-stats b { display: block; font: 800 1.35rem/1.1 var(--font-display); color: var(--ink); text-transform: none; }
@media (max-width: 800px) {
  .land { grid-template-columns: 1fr; }
  .land:nth-child(even) .land-media { order: 0; }
  .land-media, .land:nth-child(even) .land-media { transform: rotateY(0) rotateX(8deg); }
}

/* exploded feature (patterns featured) */
.exploded { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.explode-stack { position: relative; aspect-ratio: 5 / 4; perspective: 1400px; }
.explode-stack .xs-inner { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(52deg) rotateZ(-28deg); transition: transform 0.6s var(--ease); }
.explode-stack:hover .xs-inner { transform: rotateX(46deg) rotateZ(-24deg); }
.xs-inner > * { position: absolute; border-radius: 14px; }
.xs-img { inset: 8% 6%; overflow: hidden; box-shadow: 0 10px 0 var(--edge), 0 40px 60px hsl(var(--shadow-color) / 0.35); }
.xs-img img { width: 100%; height: 100%; object-fit: cover; }
.xs-stat {
  background: var(--surface); padding: 14px 18px; box-shadow: 0 6px 0 var(--edge), 0 30px 40px hsl(var(--shadow-color) / 0.3);
  font: 500 0.8125rem/1.2 var(--font-mono); text-transform: uppercase; color: var(--muted);
}
.xs-stat b { display: block; font: 800 2.2rem/1 var(--font-display); color: var(--ink); }
.xs-stat:nth-of-type(2) { left: 2%; top: 14%; transform: translateZ(90px); }
.xs-stat:nth-of-type(3) { right: 4%; top: 40%; transform: translateZ(150px); }
.xs-stat:nth-of-type(4) { left: 26%; bottom: 6%; transform: translateZ(210px); background: var(--accent); color: var(--accent-ink); }
.xs-stat:nth-of-type(4) b { color: var(--accent-ink); }
@media (max-width: 800px) { .exploded { grid-template-columns: 1fr; } }

/* stories tunnel */
.tunnel { display: grid; gap: 28px; perspective: 1600px; }
.story {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); overflow: hidden;
  text-decoration: none; color: inherit;
}
.story-media { position: relative; min-height: 260px; }
.story-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.story-body { padding: clamp(22px, 3vw, 36px); display: flex; flex-direction: column; gap: 12px; }
.story-body h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.story-body p { font-size: 1rem; }
.story .part { font: 800 3.4rem/0.9 var(--font-display); color: var(--accent); letter-spacing: -0.04em; }
.story:hover { box-shadow: var(--rim), 0 6px 0 var(--edge), var(--sh-3); }
.tunnel > :nth-child(2) { margin-inline: clamp(0px, 3vw, 36px); }
.tunnel > :nth-child(3) { margin-inline: clamp(0px, 6vw, 72px); }
.ghost-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-inline: clamp(0px, 9vw, 108px); }
.ghost {
  border: 2px dashed var(--edge-strong); border-radius: var(--radius); padding: 22px;
  background: color-mix(in oklab, var(--surface) 35%, transparent);
}
.ghost h3 { font-size: 1.15rem; margin: 6px 0 8px; color: var(--text); }
.ghost p { font-size: 1rem; color: var(--muted); }
.notice {
  display: flex; gap: 14px; padding: 18px 20px; border-radius: 12px;
  background: var(--accent-soft); color: var(--ink); border-left: 5px solid var(--accent); font-size: 1rem;
}
@media (max-width: 760px) {
  .story { grid-template-columns: 1fr; }
  .story-media { min-height: 200px; }
  .ghost-row { grid-template-columns: 1fr; }
  .tunnel > :nth-child(n) { margin-inline: 0; }
}

/* compact tiles */
.compact { padding: 20px 22px; display: grid; gap: 8px; align-content: start; }
.compact h3 { font-size: 1.2rem; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.compact h3 a { color: inherit; text-decoration: none; }
.compact h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.compact .stars { font: 600 0.875rem var(--font-mono); color: var(--accent); white-space: nowrap; }
.compact p { font-size: 1rem; }
.compact .tech { font: 500 0.8125rem/1.3 var(--font-mono); color: var(--muted); }

/* about */
.strata-core { display: grid; gap: 0; list-style: none; padding: 0; margin: 0; border-radius: var(--radius); overflow: hidden; box-shadow: 0 6px 0 var(--edge), var(--sh-3); }
.core-layer { --shade: 0; padding: clamp(22px, 3vw, 34px); background: color-mix(in oklab, var(--surface), var(--brand) calc(var(--shade) * 11%)); display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 12px 28px; }
.core-layer + .core-layer { border-top: 1px solid color-mix(in oklab, var(--line), var(--brand) 20%); }
.core-layer .period { font: 600 0.9375rem/1.3 var(--font-mono); color: var(--accent); }
.core-layer .period small { display: block; color: var(--muted); font-weight: 500; font-size: 0.8125rem; margin-top: 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.core-layer h3 { font-size: 1.5rem; margin-bottom: 6px; }
.core-layer details { margin-top: 12px; }
.core-layer summary { cursor: pointer; font-weight: 700; color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; }
.roles { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 12px; }
.roles li { padding: 12px 14px; border-radius: 10px; background: color-mix(in oklab, var(--surface) 70%, transparent); }
.roles b { color: var(--ink); }
.roles ul { margin: 6px 0 0; padding-left: 1.2em; font-size: 1rem; }
.core-layer:nth-child(4) { --shade: 3; }
.core-layer:nth-child(3) { --shade: 2; }
.core-layer:nth-child(2) { --shade: 1; }
[data-theme-effective="dark"] .core-layer { background: color-mix(in oklab, var(--surface), #000 calc(var(--shade) * 12%)); }
@media (max-width: 700px) { .core-layer { grid-template-columns: 1fr; } }
.career-bar { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 28px; }
.career-bar li { padding: 8px 12px; border-radius: 9px; background: var(--surface); box-shadow: 0 3px 0 var(--edge); font-size: 0.9375rem; }
.career-bar b { color: var(--ink); }
.career-bar span { font-family: var(--font-mono); color: var(--muted); font-size: 0.8125rem; margin-left: 6px; }

.proverbs { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; perspective: 1400px; }
.proverbs li {
  padding: 22px 26px; font: italic 500 clamp(1.25rem, 2.2vw, 1.65rem)/1.3 var(--font-display); color: var(--ink);
  display: flex; gap: 18px; align-items: baseline;
}
.proverbs li::before { content: attr(data-n); font: 600 0.875rem var(--font-mono); font-style: normal; color: var(--accent); }
.proverbs li:nth-child(1) { margin-right: 20%; }
.proverbs li:nth-child(2) { margin-inline: 5% 15%; }
.proverbs li:nth-child(3) { margin-inline: 10% 10%; }
.proverbs li:nth-child(4) { margin-inline: 15% 5%; }
.proverbs li:nth-child(5) { margin-left: 20%; }
@media (max-width: 700px) { .proverbs li:nth-child(n) { margin-inline: 0; } }

.cap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 24px; }
.cap { padding: 24px; display: grid; gap: 10px; align-content: start; }
.cap h3 { font-size: 1.3rem; }
.cap p { font-size: 1rem; color: var(--muted); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
.beyond { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.beyond li { padding: 20px 22px; }
.beyond h3 { font-size: 1.25rem; margin-bottom: 6px; }

/* ---------- article ---------- */
.progress { position: fixed; left: 0; top: 0; height: 4px; width: 100%; z-index: 60; transform-origin: 0 50%; transform: scaleX(0); background: var(--accent); }
.progress-pct { position: fixed; right: 12px; bottom: 12px; z-index: 60; font: 600 0.8125rem var(--font-mono); background: var(--surface); color: var(--ink); padding: 6px 10px; border-radius: 8px; box-shadow: 0 3px 0 var(--edge), var(--sh-1); }
.art-hero {
  --px: 0; --py: 0; --sy: 0;
  position: relative; overflow: clip; isolation: isolate;
  margin-top: -74px; padding: calc(74px + clamp(48px, 9vw, 140px)) 0 clamp(40px, 6vw, 72px);
  background: var(--code-bg); color: #fff; perspective: 1000px;
}
.art-hero .bg { position: absolute; inset: -12% -6%; z-index: -2; }
.art-hero .bg img { width: 100%; height: 100%; object-fit: cover; }
.art-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(6, 11, 18, 0.96) 22%, rgba(6, 11, 18, 0.72) 60%, rgba(6, 11, 18, 0.45)); }
.art-hero .crumb { color: #ffd2bd; font-weight: 700; text-decoration: none; font: 600 0.875rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; display: inline-flex; min-height: 44px; align-items: center; }
.art-hero .crumb:hover { text-decoration: underline; }
.art-hero h1 { color: #fff; font-size: clamp(2.4rem, 5.8vw, 4.6rem); font-weight: 800; letter-spacing: -0.035em; max-width: 18ch; margin: 6px 0 18px; }
.art-hero .desc { font-size: 1.25rem; color: #dbe5ef; max-width: 40rem; }
.art-hero .meta { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 24px; font: 500 0.875rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: #c3d0dd; align-items: center; }
.art-hero .tag { background: rgba(255, 255, 255, 0.1); color: #fff; border-color: rgba(255, 255, 255, 0.25); }
.art-hero .meta a { color: #fff; }
.art-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); align-items: start; padding-block: 48px 80px; }
.toc { position: sticky; top: 96px; padding: 20px; }
.toc h2 { font: 500 0.8125rem/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: toc; }
.toc a { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 0.9375rem; line-height: 1.35; counter-increment: toc; }
.toc a::before { content: counter(toc, decimal-leading-zero); font: 500 0.8125rem var(--font-mono); color: var(--muted); }
.toc a:hover { background: var(--surface-2); }
.toc a[aria-current="true"] { background: var(--brand); color: var(--brand-ink); box-shadow: 0 3px 0 color-mix(in oklab, var(--brand) 50%, #000); transform: translateX(6px); }
.toc a[aria-current="true"]::before { color: inherit; }
.toc a { transition: transform 0.2s var(--ease), background 0.2s; }
.toc details summary { display: none; }
@media (max-width: 1000px) {
  .art-shell { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; padding: 6px 16px; }
  .toc details summary { display: flex; align-items: center; min-height: 48px; cursor: pointer; font-weight: 700; color: var(--ink); }
  .toc details:not([open]) ol { display: none; }
  .toc h2 { display: none; }
}
.prose { max-width: 44rem; font-size: 1.125rem; line-height: 1.72; color: var(--text); min-width: 0; }
.prose > * + * { margin-top: 1.25em; }
.prose h2 { font-size: clamp(1.75rem, 3vw, 2.3rem); margin-top: 2.4em; scroll-margin-top: 100px; display: flex; gap: 14px; align-items: baseline; }
.prose h2::before { content: attr(data-z); font: 500 0.8125rem var(--font-mono); color: var(--accent); letter-spacing: 0.04em; flex-shrink: 0; transform: translateY(-4px); }
.prose ol, .prose ul { padding-left: 1.4em; }
.prose li + li { margin-top: 0.35em; }
.prose code:not(pre code) { font-size: 0.88em; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.prose strong { color: var(--ink); }

/* code: sunk into the page (negative depth) */
.code {
  position: relative; margin-inline: clamp(-36px, -3vw, 0px); border-radius: 14px;
  background: var(--code-bg); color: var(--code-text);
  box-shadow: inset 0 10px 18px rgba(0, 0, 0, 0.55), inset 0 -2px 0 rgba(255, 255, 255, 0.04), 0 0 0 1px var(--line);
}
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 6px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); font: 600 0.8125rem var(--font-mono); color: #9fb3c8; text-transform: uppercase; letter-spacing: 0.08em; }
.copy-btn { min-height: 38px; min-width: 76px; padding: 0 12px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.06); color: #e7eef6; font: 600 0.8125rem var(--font-mono); cursor: pointer; }
.copy-btn:hover { background: rgba(255, 255, 255, 0.14); }
.code pre { margin: 0; padding: 18px 20px 22px; overflow-x: auto; font-size: 0.9375rem; line-height: 1.6; tab-size: 2; }
.tok-c { color: #8497ab; font-style: italic; }
.tok-s { color: #b5e08a; }
.tok-k { color: #ff9f7a; }
.tok-t { color: #8cc8ff; }
.tok-n { color: #f2cf73; }

/* raised callouts */
.callout { position: relative; padding: 18px 22px 20px 22px; border-radius: 12px; background: var(--surface); box-shadow: var(--rim), 0 5px 0 var(--edge), var(--sh-2); font-size: 1.0625rem; }
.callout-label { display: inline-block; font: 600 0.8125rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; padding: 4px 8px; border-radius: 6px; margin-bottom: 8px; background: var(--brand-soft); color: var(--ink); }
.callout.why { border-left: 5px solid var(--brand); }
.callout.skill { background: var(--brand); color: var(--brand-ink); box-shadow: 0 6px 0 color-mix(in oklab, var(--brand) 50%, #000), var(--sh-2); }
.callout.skill a, .callout.skill strong { color: var(--brand-ink); }
.callout.skill code:not(pre code) { background: rgba(255, 255, 255, 0.16); color: var(--brand-ink); border-color: transparent; }
.callout.skill .callout-label { background: var(--brand-ink); color: var(--brand); }
.callout.question { background: var(--accent-soft); color: var(--ink); transform: rotate(-0.8deg); box-shadow: 0 5px 0 color-mix(in oklab, var(--accent) 40%, var(--edge)), var(--sh-2); }
.callout.question .callout-label { background: var(--accent); color: var(--accent-ink); }
.callout.note .callout-label { background: var(--surface-2); }

.after-article { padding-block: 56px; }
.share-zone { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 28px; align-items: stretch; }
.share-zone .slab { padding: clamp(22px, 3vw, 34px); }
.share-zone h2 { font-size: 1.6rem; margin-bottom: 14px; }
.share-btns { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 820px) { .share-zone { grid-template-columns: 1fr; } }

/* ---------- patterns ---------- */
.three-ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; perspective: 1400px; margin-top: 8px; }
.three-ways > div { padding: 24px; }
.three-ways > div:nth-child(1) { transform: translateZ(40px); z-index: 3; }
.three-ways > div:nth-child(2) { transform: translateZ(0) translateY(14px); z-index: 2; margin-left: -12px; }
.three-ways > div:nth-child(3) { transform: translateZ(-40px) translateY(28px); z-index: 1; margin-left: -12px; }
.three-ways h3 { font-size: 1.35rem; margin: 8px 0; }
.three-ways p { font-size: 1rem; }
.three-foot { margin-top: 56px; max-width: 52rem; font-size: 1.0625rem; color: var(--text); padding-left: 18px; border-left: 4px solid var(--accent); }
@media (max-width: 820px) { .three-ways { grid-template-columns: 1fr; gap: 16px; } .three-ways > div:nth-child(n) { transform: none; margin-left: 0; } }

.filters { display: grid; gap: 16px; padding: 18px; margin-bottom: 36px; }
.search-field { position: relative; }
.search-field svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); }
.search-field .input { width: 100%; padding-left: 48px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { min-height: 44px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: 600 0.9375rem var(--font-body); cursor: pointer; transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease); box-shadow: 0 3px 0 var(--edge); }
.pill:hover { color: var(--ink); }
.pill[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: transparent; transform: translateY(3px); box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.3); }
.result-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; font-size: 1rem; }
.result-meta select { min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--edge-strong); background: var(--surface); color: var(--ink); font: 500 1rem var(--font-body); }
.clear-btn { min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--link); font: 600 1rem var(--font-body); text-decoration: underline; cursor: pointer; }
.empty-state { padding: 40px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.empty-state h2 { font-size: 1.6rem; }

.pcard { display: flex; flex-direction: column; min-width: 0; }
.pthumb { position: relative; height: 200px; margin: 10px 10px 0; border-radius: 10px; overflow: hidden; background: var(--surface-2); perspective: 700px; }
.pthumb .pt-inner { position: absolute; inset: 12% 10%; transform-style: preserve-3d; transform: rotateX(48deg) rotateZ(-22deg); transition: transform 0.5s var(--ease); }
.pcard:hover .pthumb .pt-inner, .pcard:focus-within .pthumb .pt-inner { transform: rotateX(20deg) rotateZ(-8deg); }
.pt-inner i { position: absolute; border-radius: 6px; background: var(--surface); box-shadow: 0 3px 0 var(--edge), 0 10px 16px hsl(var(--shadow-color) / 0.25); }
.pt-inner i.b { background: var(--brand); }
.pt-inner i.a { background: var(--accent); }
.pt-inner i.l { background: var(--edge-strong); }
.pcard .card-body { gap: 8px; }
.pcard .row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.pcard .cat { font: 600 0.8125rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
.pcard .date { font: 500 0.8125rem var(--font-mono); color: var(--muted); }
.pcard h2 { font-size: 1.3rem; line-height: 1.2; }
.pcard h2 a { color: inherit; text-decoration: none; }
.pcard h2 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.pcard:has(h2 a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 4px; }
.pcard h2 a:focus-visible { outline: none; }
.pcard p { font-size: 1rem; }

/* pattern detail */
.back-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--ink); text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.use-list { columns: 2 16rem; padding-left: 1.2em; margin: 10px 0 0; font-size: 1.0625rem; }
.use-list li { margin-bottom: 6px; break-inside: avoid; }
.panes { overflow: hidden; }
.pane-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tablist { display: flex; flex-wrap: wrap; gap: 4px; }
.tab { min-height: 44px; padding: 0 14px; border-radius: 10px; border: 0; background: transparent; color: var(--text); font: 600 0.9375rem var(--font-body); cursor: pointer; }
.tab:hover { background: var(--surface); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 3px 0 var(--edge), var(--sh-1); transform: translateY(-2px); }
.pane-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pane-actions .btn { min-height: 44px; font-size: 0.9375rem; padding: 0 14px; }
.pane { padding: clamp(18px, 3vw, 32px); }
.pane[hidden] { display: none; }
.pane pre { margin: 0; padding: 18px; border-radius: 12px; background: var(--code-bg); color: var(--code-text); overflow-x: auto; font-size: 0.9375rem; line-height: 1.6; box-shadow: inset 0 8px 16px rgba(0, 0, 0, 0.5); }
.pane .note { margin-bottom: 14px; font-size: 1rem; padding: 12px 14px; border-radius: 10px; background: var(--brand-soft); color: var(--ink); }
.prompt-text { max-width: 46rem; display: grid; gap: 1em; font-size: 1.0625rem; }
.explode-toggle { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.explode-toggle p { font-size: 1rem; color: var(--muted); }

/* the demo pattern itself: hairline stat strip */
.hss-stage { perspective: 1400px; }
.hss-caption { font-size: 1rem; color: var(--muted); margin: 0 0 12px; }
.hss-strip {
  container-type: inline-size;
  display: grid; gap: 1px; grid-template-columns: 1fr;
  background: var(--edge-strong); border: 1px solid var(--edge-strong); border-radius: 12px; overflow: hidden;
  transform-style: preserve-3d; transition: transform 0.7s var(--ease), gap 0.7s var(--ease), background 0.4s;
}
.hss-wrap { container-type: inline-size; }
@container (min-width: 21rem) { .hss-strip { grid-template-columns: repeat(2, 1fr); } }
@container (min-width: 42rem) { .hss-strip.four { grid-template-columns: repeat(4, 1fr); } .hss-strip.five { grid-template-columns: repeat(3, 1fr); } }
@container (min-width: 50rem) { .hss-strip.five { grid-template-columns: repeat(5, 1fr); } }
.hss-tile { background: var(--surface); padding: 14px 16px; display: grid; gap: 2px; min-width: 0; transition: transform 0.7s var(--ease), box-shadow 0.4s; }
.hss-label { font: 600 0.8125rem/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); overflow-wrap: anywhere; }
.hss-fig { font: 800 1.6rem/1.15 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.hss-fig.is-missing { color: var(--muted); font-weight: 500; }
.hss-sub { font-size: 0.875rem; color: var(--muted); }
button.hss-tile { border: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; min-height: 44px; }
button.hss-tile:hover { background: var(--surface-2); }
button.hss-tile[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); box-shadow: inset 0 -3px 0 var(--accent); }
.hss-list { list-style: none; margin: 14px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.hss-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; font-size: 1rem; }
.hss-list li + li { border-top: 1px solid var(--line); }
.hss-list .st { font: 600 0.8125rem var(--font-mono); text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.hss-status { margin-top: 10px; font-size: 1rem; color: var(--ink); }
.is-exploded .hss-strip { transform: rotateX(55deg) rotateZ(-10deg) translateY(-10px); background: color-mix(in oklab, var(--edge-strong) 70%, transparent); gap: 10px; padding: 10px; }
.is-exploded .hss-tile { transform: translateZ(46px); box-shadow: 0 16px 20px hsl(var(--shadow-color) / 0.35); }
.explode-legend { display: none; gap: 16px; flex-wrap: wrap; margin-top: 22px; font-size: 0.9375rem; }
.is-exploded + .explode-legend, .is-exploded .explode-legend { display: flex; }
.explode-legend span { display: inline-flex; align-items: center; gap: 8px; }
.explode-legend i { width: 16px; height: 16px; border-radius: 4px; display: inline-block; }

/* ---------- flat mode + reduced motion: collapse the stack ---------- */
:root[data-depth="flat"] .tilt,
:root[data-depth="flat"] .layer,
:root[data-depth="flat"] .stage-copy,
:root[data-depth="flat"] .frames,
:root[data-depth="flat"] .hero-plate,
:root[data-depth="flat"] .land-media,
:root[data-depth="flat"] .shelf > .card,
:root[data-depth="flat"] .three-ways > div,
:root[data-depth="flat"] .callout.question,
:root[data-depth="flat"] .pthumb .pt-inner,
:root[data-depth="flat"] .explode-stack .xs-inner { transform: none !important; }
:root[data-depth="flat"] .frames > :not(.frame-photo):not(.frame-label),
:root[data-depth="flat"] .hero-plate > :not(.pl-img):not(.pl-chip),
:root[data-depth="flat"] .land-media .lm-back { display: none; }
:root[data-depth="flat"] .frame-label, :root[data-depth="flat"] .pl-chip { transform: none; }
:root[data-depth="flat"] .xs-stat { position: static; transform: none; }
:root[data-depth="flat"] .xs-inner { position: static; display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
:root[data-depth="flat"] .xs-img { position: relative; inset: auto; grid-column: 1 / -1; aspect-ratio: 16 / 9; }
:root[data-depth="flat"] .explode-stack { aspect-ratio: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .layer, .stage-copy { transform: none !important; }
}
.is-exploded .hss-wrap { perspective: 1200px; }

/* fix pass */
.code pre, .pane pre { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
.plate span { max-width: 40%; text-align: center; font-size: clamp(1.05rem, 1.9vw, 1.6rem); overflow-wrap: anywhere; line-height: 1.1; }
.prose .tags { padding-left: 0; }
.prose .tags li { margin-top: 0; }
.mosaic > :nth-child(2) .desc, .mosaic > :nth-child(3) .desc { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.9375rem; }
.mosaic > :nth-child(2) .tags, .mosaic > :nth-child(3) .tags { display: none; }
.ghost-word { -webkit-text-stroke-color: color-mix(in oklab, var(--brand) 16%, transparent); }
.share-zone .slab:first-child { align-content: start; }
main { overflow-x: clip; }

.prose-fig { margin-left: 0; margin-right: 0; padding: 0; overflow: hidden; border-radius: 12px; }
.prose-fig img { display: block; width: 100%; height: auto; }
.prose blockquote.callout { margin-left: 0; margin-right: 0; }
.prose blockquote.callout > * + * { margin-top: .8em; }
.prose code { overflow-wrap: anywhere; }
