/* ==========================================================================
   Madison Marino — shared components & chrome
   ========================================================================== */

/* --- Site header -------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: color-mix(in srgb, var(--void) 72%, transparent);
  backdrop-filter: saturate(1.3) blur(14px);
  -webkit-backdrop-filter: saturate(1.3) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease-out),
              background-color var(--dur) var(--ease-out);
}
.site-header.is-stuck {
  border-bottom-color: var(--line-soft);
  background: color-mix(in srgb, var(--void) 86%, transparent);
}
/* Header + footer run wider than the content column. */
.site-header .wrap, .site-footer .wrap { width: min(1560px, 100%); }
.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;   /* brand | centered nav | actions */
  align-items: center;
  gap: 20px;
  height: var(--header-h);
}
.header-inner .brand { justify-self: start; }
.header-inner .nav { justify-self: center; }
.header-inner .header-actions { justify-self: end; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--text);
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
}

/* MM monogram — interlocking serif M's threaded with the spectrum. */
.mm-monogram { display: block; width: 42px; height: 42px; overflow: visible; }
.mm-first, .mm-second {
  font: 700 49px/1 var(--font-serif);
  paint-order: stroke;
  fill: var(--text);
  stroke: var(--text);
  stroke-width: 1.6;
}
.mm-stem  { fill: none; stroke: var(--text); stroke-width: 3; }
.mm-serif { fill: none; stroke: var(--text); stroke-width: 2.4; }
.mm-thread {
  fill: none;
  stroke: url(#mm-spectrum);
  stroke-width: 2.2;
  opacity: 0.9;
  stroke-dasharray: 200;
  stroke-dashoffset: calc(200 - var(--sig, 0) * 40);
  transition: stroke-dashoffset 200ms linear;
}
@media (prefers-reduced-motion: reduce) {
  .mm-thread { stroke-dashoffset: 0; transition: none; }
}

/* --- Primary nav -------------------------------------------------------- */
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav a {
  position: relative;
  padding: 9px 14px;
  border-radius: var(--pill);
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a[aria-current="page"], .nav a.is-active { color: var(--text); }
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 3px;
  height: 2px; border-radius: 2px;
  background: var(--band);
}

.header-actions { display: flex; align-items: center; gap: 10px; }

/* Mobile menu button + panel (JS-enhanced; nav still reachable without JS). */
.menu-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}
.menu-toggle .bars { position: relative; width: 16px; height: 10px; }
.menu-toggle .bars::before, .menu-toggle .bars::after {
  content: ""; position: absolute; left: 0; right: 0; height: 2px;
  background: currentColor; border-radius: 2px; transition: transform var(--dur) var(--ease-out);
}
.menu-toggle .bars::before { top: 0; }
.menu-toggle .bars::after { bottom: 0; }

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 22px;
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.btn:hover { transform: translateY(-2px); border-color: var(--text); }
.btn .arw { transition: transform var(--dur-fast) var(--ease-out); }
.btn:hover .arw { transform: translate(3px, -3px); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.btn-band {
  background: var(--band);
  border-color: var(--band);
  color: var(--band-ink, #0c0d10);
}
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { color: var(--text); }
.btn-sm { padding: 9px 15px; font-size: 14px; }
.btn-lg { padding: 16px 28px; font-size: 16px; }

/* --- Pills / tags ------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--pill);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tag .swatch {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--band, var(--accent));
}

/* --- Project card (work index + home overture) -------------------------- */
.card {
  --band: var(--accent);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  isolation: isolate;
  transition: transform var(--dur) var(--ease-out),
              border-color var(--dur) var(--ease-out),
              box-shadow var(--dur) var(--ease-out);
}
a.card:hover, a.card:focus-visible {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--band) 55%, var(--line));
  box-shadow: var(--shadow-2),
              0 0 0 1px color-mix(in srgb, var(--band) 22%, transparent);
}
/* Top band line grows on hover. */
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--band);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease-out);
  z-index: 3;
}
a.card:hover::before, a.card:focus-visible::before { transform: scaleX(1); }

/* Magnetic grid mode: work.js adds .is-magnetic when a fine pointer and motion
   are available, and drives each card's --mx/--my/--rx/--ry toward the cursor
   (or the focused card) via the shared signal. The classic hover lift above is
   the fallback for no-JS, reduced motion, and touch. */
.work-grid.is-magnetic { perspective: 1100px; }
.work-grid.is-magnetic .card {
  --mx: 0px; --my: 0px; --rx: 0deg; --ry: 0deg;
  transform: translate3d(var(--mx), var(--my), 0) rotateX(var(--rx)) rotateY(var(--ry));
  transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.work-grid.is-magnetic a.card:hover,
.work-grid.is-magnetic a.card:focus-visible {
  transform: translate3d(var(--mx), var(--my), 0) rotateX(var(--rx)) rotateY(var(--ry));
}

/* Drifting columns view: work.js reorganizes the grid into .wg-col columns
   that scroll-drift in alternating directions (scroll.js/GSAP), and the card
   under the cursor takes focus. Only active on capable desktops; the plain
   grid + filters is the fallback. */
.work-grid.is-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 2vw, 22px);
  align-items: start;
}
@media (max-width: 1040px) { .work-grid.is-columns { grid-template-columns: repeat(2, 1fr); } }
.wg-col { display: flex; flex-direction: column; gap: clamp(14px, 2vw, 22px); will-change: transform; }
.work-grid.is-columns .card {
  transform: scale(var(--focus, 1));
  transform-origin: center;
  transition: transform var(--dur) var(--ease-out),
              box-shadow var(--dur) var(--ease-out),
              border-color var(--dur) var(--ease-out);
}
.work-grid.is-columns a.card:hover,
.work-grid.is-columns a.card:focus-visible { transform: scale(var(--focus, 1)); }
.work-grid.is-columns .card.is-focus {
  z-index: 5;
  border-color: color-mix(in srgb, var(--band) 55%, var(--line));
  box-shadow: var(--shadow-2), 0 0 0 1px color-mix(in srgb, var(--band) 26%, transparent);
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 15% 10%, color-mix(in srgb, var(--band) 22%, transparent), transparent 55%),
    var(--panel-2);
}
.card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 700ms var(--ease-out);
}
a.card:hover .card-media img { transform: scale(1.05); }
/* Placeholder mark for projects without a photo. */
.card-glyph {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font: 800 clamp(56px, 9vw, 128px)/1 var(--font-display);
  color: color-mix(in srgb, var(--band) 40%, transparent);
  letter-spacing: -0.04em;
}
.card-num {
  position: absolute; top: 14px; left: 16px; z-index: 2;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  color: var(--text);
  opacity: 0.85;
}
.card-flag {
  position: absolute; top: 12px; right: 14px; z-index: 2;
  padding: 4px 10px;
  border-radius: var(--pill);
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--void) 60%, transparent);
  backdrop-filter: blur(6px);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
}
.card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px 24px;
}
.card-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--band) 78%, var(--text));
}
.card-kicker .swatch { width: 8px; height: 8px; border-radius: 50%; background: var(--band); }
.card-title {
  font-size: var(--fs-h3);
  letter-spacing: -0.02em;
}
.card-desc { color: var(--muted); font-size: 0.95em; }
.card-role { margin-top: auto; color: var(--faint); font-family: var(--font-mono); font-size: var(--fs-mono); letter-spacing: 0.04em; }
.card-go {
  position: absolute; right: 20px; bottom: 22px; z-index: 2;
  color: var(--band);
  font-size: 18px;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
a.card:hover .card-go, a.card:focus-visible .card-go { opacity: 1; transform: translateX(0); }

/* --- Kinetic headings ---------------------------------------------------
   [data-kinetic] headings are split (in motion.js) into word -> char spans and
   settle in on view: a per-letter variable-weight Syne rise echoing the hero
   wordmark. Content is plain text without JS; reduced motion rests at full
   weight. Syne's variable axis is 600..800 (see tokens.css @font-face). */
.kin .kin-word { display: inline-block; white-space: nowrap; }
.kin .kin-ch { display: inline-block; will-change: transform, opacity; }
/* Animate ONLY opacity + transform — never font weight/width — so the line
   never re-wraps and the heading keeps a stable box while it settles in. */
.js .kin .kin-ch {
  opacity: 0;
  transform: translate3d(0, 0.34em, 0);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 22ms);
}
.js .kin.is-in .kin-ch {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .js .kin .kin-ch { opacity: 1; transform: none; transition: none; }
}

/* --- Iris intro (homepage) ---------------------------------------------
   A cream aperture that irises away to reveal the page on the first load of a
   tab session. The reveal is a pure CSS animation so it can't get stuck if
   later JS errors; an inline head script tags .iris-seen so repeat views skip
   it. Hidden without JS (data-enhance) and removed under reduced motion. */
.iris-cover {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  /* A spectrum-tinted aperture so the reveal reads clearly against the page. */
  background:
    radial-gradient(120% 92% at 50% 44%,
      color-mix(in srgb, var(--range-violet) 20%, var(--void)),
      var(--void) 60%);
  clip-path: circle(150% at 50% 50%);
  animation: iris-open 1.05s var(--ease-io) 0.05s forwards;
}
.iris-cover .iris-dot {
  width: min(46vmin, 360px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
    color-mix(in srgb, var(--range-pink) 80%, transparent),
    color-mix(in srgb, var(--range-gold) 46%, transparent) 34%,
    color-mix(in srgb, var(--range-teal) 40%, transparent) 56%,
    color-mix(in srgb, var(--range-violet) 34%, transparent) 72%,
    transparent 80%);
  filter: blur(5px);
  animation: iris-dot 0.85s var(--ease-out) forwards;
}
@keyframes iris-open {
  0%   { clip-path: circle(150% at 50% 50%); }
  99%  { clip-path: circle(0% at 50% 50%); visibility: visible; }
  100% { clip-path: circle(0% at 50% 50%); visibility: hidden; }
}
@keyframes iris-dot {
  0%   { opacity: 0; transform: scale(0.55); }
  35%  { opacity: 1; }
  100% { opacity: 0; transform: scale(1.5); }
}
.iris-seen .iris-cover { display: none; }
@media (prefers-reduced-motion: reduce) {
  .iris-cover { display: none; }
}

/* Iris page transitions (chrome.js) — a spectrum-tinted aperture that closes
   over the page on an internal link, then opens on the destination. Pure JS +
   CSS so it works in every browser (independent of View Transitions). */
.iris-nav {
  position: fixed; inset: 0; z-index: 500; pointer-events: none;
  background: radial-gradient(120% 100% at 50% 48%,
    color-mix(in srgb, var(--range-violet) 22%, var(--void)),
    var(--void) 60%);
  clip-path: circle(0% at 50% 50%);
}
.iris-nav.is-closing { animation: iris-nav-close 0.5s var(--ease-io) forwards; }
.iris-nav.is-opening { animation: iris-nav-open 0.6s var(--ease-io) forwards; }
@keyframes iris-nav-close { from { clip-path: circle(0% at 50% 50%); } to { clip-path: circle(150% at 50% 50%); } }
@keyframes iris-nav-open  { from { clip-path: circle(150% at 50% 50%); } to { clip-path: circle(0% at 50% 50%); } }
@media (prefers-reduced-motion: reduce) { .iris-nav { display: none; } }

/* --- Editorial marquee band --------------------------------------------
   Three big Syne lines whose tracks slide horizontally at different rates as
   you scroll (scroll.js scrubs xPercent). Decorative and aria-hidden. Without
   JS / under reduced motion the tracks rest and read as a static type band. */
.ticker {
  position: relative;
  overflow: hidden;
  padding-block: clamp(30px, 7vh, 76px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(60% 150% at 22% 50%, color-mix(in srgb, var(--range-violet) 9%, transparent), transparent 72%),
    radial-gradient(60% 150% at 82% 50%, color-mix(in srgb, var(--range-pink) 7%, transparent), transparent 72%),
    var(--void-deep);
  display: grid;
  gap: clamp(2px, 1.1vh, 12px);
}
.ticker-row { overflow: hidden; }
.ticker-track {
  display: flex;
  width: max-content;
  white-space: nowrap;
  will-change: transform;
}
.ticker-set {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(24px, 4.4vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text);
}
.ticker-row.is-stroke .ticker-set {
  color: transparent;
  -webkit-text-stroke: 1.4px color-mix(in srgb, var(--text) 74%, transparent);
}
.ticker-row.is-grad .ticker-set {
  background: var(--spectrum);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- Filter bar --------------------------------------------------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.filters .filter {
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--panel);
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}
.filters .filter:hover { color: var(--text); border-color: var(--line-strong); }
.filters .filter[aria-pressed="true"] {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}
.filters .filter .count { opacity: 0.6; font-family: var(--font-mono); font-size: 11px; margin-left: 6px; }

/* --- Footer + contact --------------------------------------------------- */
.contact {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
  background:
    radial-gradient(52% 130% at 12% 52%, color-mix(in srgb, var(--range-pink) 14%, transparent), transparent 72%),
    radial-gradient(52% 130% at 88% 52%, color-mix(in srgb, var(--range-teal) 13%, transparent), transparent 72%),
    var(--void-deep);
}
.contact-inner {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 22px;
}
.contact-title {
  font-size: var(--fs-h1);
  letter-spacing: -0.035em;
}
.contact-pulse {
  position: absolute; inset: 0;
  z-index: 0;
  display: grid; place-items: center;
  color: var(--accent);
  opacity: 0.18;
  pointer-events: none;
}
.contact-pulse svg { width: 120%; height: 200px; }
.contact-inner > * { position: relative; z-index: 1; }
.email-cta {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 30px;
  border-radius: var(--pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: var(--fs-lead);
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.email-cta:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--accent) 88%, #fff); }
.socials { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: center; }
.socials a {
  color: var(--muted); text-decoration: none; font-weight: 500;
  transition: color var(--dur-fast) var(--ease-out);
}
.socials a:hover { color: var(--text); }

.site-footer { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--void-deep) 88%, var(--panel)); }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding-block: 26px;
  color: var(--faint);
  font-size: 14px;
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-nav a { color: var(--muted); text-decoration: none; }
.footer-nav a:hover { color: var(--text); }

/* --- Case-study building blocks ----------------------------------------- */
.cs-hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(48px, 10vh, 120px) clamp(40px, 7vh, 80px);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(90% 120% at 82% -10%, color-mix(in srgb, var(--band) 22%, transparent), transparent 60%),
    radial-gradient(55% 100% at 6% 100%, color-mix(in srgb, var(--range-gold) 8%, transparent), transparent 74%),
    var(--void);
}
.cs-eyebrow { color: color-mix(in srgb, var(--band) 62%, var(--text)); }
.cs-title { font-size: var(--fs-h1); margin-top: 14px; }
.cs-lede { max-width: 44ch; margin-top: 20px; color: var(--text-dim); font-size: var(--fs-lead); }
.cs-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.cs-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 4vw, 48px);
  padding-block: clamp(36px, 6vh, 64px);
  border-bottom: 1px solid var(--line);
}
.cs-meta dt {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--band) 62%, var(--text));
  margin-bottom: 10px;
}
.cs-meta dd { margin: 0; color: var(--text-dim); }

.cs-section { padding-block: clamp(40px, 7vh, 88px); border-bottom: 1px solid var(--line); }
.cs-section h2 { font-size: var(--fs-h2); margin-bottom: 18px; }
.cs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
.cs-prose { max-width: 62ch; color: var(--text-dim); }
.cs-prose h3 { font-size: var(--fs-h3); margin: 28px 0 10px; color: var(--text); }
.cs-prose p + p { margin-top: 0.9em; }
.cs-prose ul { list-style: none; display: grid; gap: 10px; margin-top: 12px; }
.cs-prose ul li { position: relative; padding-left: 20px; }
.cs-prose ul li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--band);
}

.figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}
.figure img { width: 100%; height: auto; }
.figure figcaption {
  padding: 12px 16px;
  color: var(--faint);
  font-size: 13px;
  border-top: 1px solid var(--line);
}
.figure-row { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* --- Live-scene shell --------------------------------------------------- */
.scene-host {
  position: relative;
  min-height: 280px;
  overflow: hidden;
  isolation: isolate;
  background: var(--panel-2);
}
.scene-host [data-scene-canvas] {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 500ms var(--ease-out);
}
.scene-host.is-scene-live [data-scene-canvas][data-first-frame="true"] { opacity: 1; }
.scene-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  background-position: center;
  background-size: cover;
}
.scene-fallback::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, color-mix(in srgb, var(--void) 75%, transparent));
}
.scene-status {
  position: absolute;
  z-index: 3;
  inset: auto 14px 14px;
  width: fit-content;
  color: #f5f1ea;
  text-shadow: 0 1px 8px #08090b;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.scene-host.is-scene-live .scene-fallback { opacity: 0; }
.scene-host.is-scene-failed .scene-fallback { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .scene-host [data-scene-canvas] { display: none; }
  .scene-host .scene-fallback { opacity: 1; }
}

.pull {
  border-left: 3px solid var(--band);
  padding: 4px 0 4px 22px;
  margin: 28px 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.26;
  color: var(--text);
}
.pull cite { display: block; margin-top: 14px; font-family: var(--font-mono); font-size: var(--fs-mono); letter-spacing: 0.06em; color: var(--muted); font-style: normal; text-transform: none; }

.toolset { display: flex; flex-wrap: wrap; gap: 8px; }
.toolset li {
  list-style: none;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--panel);
  color: var(--text-dim);
  font-size: 14px;
}

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; }
.stat { border-left: 2px solid var(--band); padding-left: 16px; }
.stat b { display: block; font-family: var(--font-display); font-weight: 800; font-size: clamp(26px, 3vw, 40px); letter-spacing: -0.02em; }
.stat span { color: var(--muted); font-size: 14px; }

.prevnext {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding-block: clamp(32px, 5vh, 56px);
}
.prevnext a {
  --band: var(--accent);
  display: flex; flex-direction: column; gap: 6px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.prevnext a:hover { border-color: color-mix(in srgb, var(--band) 60%, var(--line)); transform: translateY(-3px); }
.prevnext a.next { text-align: right; align-items: flex-end; }
.prevnext .pn-label { font-family: var(--font-mono); font-size: var(--fs-mono); letter-spacing: 0.1em; text-transform: uppercase; color: color-mix(in srgb, var(--band) 62%, var(--text)); }
.prevnext .pn-title { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-h3); }

/* --- Responsive chrome -------------------------------------------------- */
@media (max-width: 820px) {
  .cs-grid { grid-template-columns: 1fr; }
  .cs-meta { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 680px) {
  .menu-toggle { display: inline-flex; }
  /* Nav collapses to a fixed dropdown; drop the centered grid column. */
  .header-inner { grid-template-columns: 1fr auto; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 14px var(--gutter) 20px;
    background: color-mix(in srgb, var(--void) 96%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out), visibility 0s linear var(--dur);
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: translateY(0); transition-delay: 0s; }
  .nav a { padding: 14px 12px; font-size: 17px; }
  .nav a[aria-current="page"]::after { display: none; }
  /* No JS: keep nav visible so links always work (wrap the header cleanly). */
  .no-js .header-inner { flex-wrap: wrap; height: auto; padding-block: 12px; gap: 6px 16px; }
  .no-js .nav { position: static; inset: auto; flex-direction: row; flex-wrap: wrap; opacity: 1; visibility: visible; transform: none; background: none; border: 0; padding: 0; }
  .no-js .nav a { padding: 8px 10px; font-size: 15px; }
  .brand-name { white-space: nowrap; }
  .header-cta { display: none; }
  .prevnext { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .header-inner { gap: 8px; }
  .brand { gap: 6px; }
  .mm-monogram { width: 34px; height: 34px; }
  .brand-name { font-size: 14px; }
  .menu-toggle { padding-inline: 10px; }
}
