/* ── TOKENS ─────────────────────────────────── */
:root {
  --black:  #0a0a0a;
  --white:  #f5f2ec;
  --paper:  #ece7de;
  --pink:   #FFB0C8;   /* accent on dark surfaces (11:1)          */
  --pink-ink: #B4295F; /* accent text on light surfaces (5.3:1)   */

  --ff-display: 'Bebas Neue', 'Arial Narrow', sans-serif;
  --ff-sans:    'Instrument Sans', system-ui, -apple-system, sans-serif;
  --ff-mono:    'IBM Plex Mono', ui-monospace, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease:     cubic-bezier(0.4, 0, 0.2, 1);

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --maxw:   1320px;
  --nav-h:  4.25rem;
}

/* Every section declares its surface; everything inside reads these. */
.surface-dark {
  --bg: var(--black);
  --fg: var(--white);
  --muted: rgba(245, 242, 236, 0.72);
  --faint: rgba(245, 242, 236, 0.54);
  --line:  rgba(245, 242, 236, 0.14);
  --track: rgba(245, 242, 236, 0.08);
  --accent: var(--pink);
  --scribble: var(--pink);
  background: var(--bg);
  color: var(--fg);
}
.surface-light {
  --bg: var(--white);
  --fg: var(--black);
  --muted: rgba(10, 10, 10, 0.74);
  --faint: rgba(10, 10, 10, 0.6);
  --line:  rgba(10, 10, 10, 0.12);
  --track: rgba(10, 10, 10, 0.06);
  --accent: var(--pink-ink);
  --scribble: #E27BA0;
  background: var(--bg);
  color: var(--fg);
}
.surface-paper { --bg: var(--paper); }

/* Film grain on dark surfaces: one static tile of sparse white specks (noise mapped to
   alpha), rendered once. No animated grain, so it costs nothing while scrolling. */
.surface-dark { position: relative; }
.surface-dark::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 4 0 0 0 -1.7'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 180px;
  opacity: 0.07;
}

/* ── RESET ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }

body {
  font-family: var(--ff-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  background: var(--black);
  color: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

:focus-visible {
  outline: 2px solid var(--accent, var(--pink));
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -3rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--pink);
  color: var(--black);
  font-family: var(--ff-mono);
  font-size: 0.8rem;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
}

/* ── TYPE PRIMITIVES ────────────────────────── */
.eyebrow {
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.display {
  font-family: var(--ff-display);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: 0;
  text-transform: uppercase;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  color: var(--faint);
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.section-num { color: var(--accent); }

.section-title {
  font-size: clamp(3.25rem, 8vw, 7rem);
  margin-bottom: 1.5rem;
}
.section-intro {
  max-width: 38rem;
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  color: var(--muted);
}

/* ── NAV ────────────────────────────────────── */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--white);
  border-bottom: 1px solid transparent;
  transition: color 0.3s, background-color 0.3s, border-color 0.3s;
}
.nav[data-theme="light"] { color: var(--black); }
.nav.is-scrolled {
  background: rgba(10, 10, 10, 0.78);
  border-bottom-color: rgba(245, 242, 236, 0.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
}
.nav.is-scrolled[data-theme="light"] {
  background: rgba(245, 242, 236, 0.82);
  border-bottom-color: rgba(10, 10, 10, 0.08);
}
.nav-mono {
  font-family: var(--ff-display);
  font-size: 1.6rem;
  letter-spacing: 0.06em;
  line-height: 1;
  text-decoration: none;
}
.nav-links { display: flex; gap: clamp(1rem, 3vw, 2.25rem); }
.nav-links a {
  position: relative;
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -0.35rem;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}
.nav-links a:hover, .nav-links a.is-active { opacity: 1; }
.nav-links a.is-active::after { transform: scaleX(1); }

/* ── BUTTONS ────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.5rem;
  font-family: var(--ff-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid currentColor;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.3s var(--ease-out);
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--pink); border-color: var(--pink); color: var(--black); }
.btn--primary:hover { background: var(--white); border-color: var(--white); }
.btn--ghost { color: var(--fg); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--fg); }
.btn-arrow { transition: transform 0.3s var(--ease-out); }
.btn:hover .btn-arrow { transform: translateY(2px); }

/* ── HERO ───────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  padding: calc(var(--nav-h) + 3rem) var(--gutter) clamp(2.5rem, 5vw, 4rem);
}
.hero-inner {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: clamp(1.75rem, 3.5vw, 2.75rem);
}
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 0 4px rgba(255, 176, 200, 0.18);
}
.hero-name {
  font-size: clamp(5rem, 17vw, 17.5rem);
  line-height: 0.84;
  margin-left: -0.04em;
}
.hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) auto;
  align-items: end;
  gap: 2rem 4rem;
}
.hero-lede {
  max-width: 36rem;
  font-size: clamp(1.15rem, 1.9vw, 1.5rem);
  line-height: 1.45;
  color: var(--muted);
}
.hero-lede strong { color: var(--fg); font-weight: 500; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.hero-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  gap: 1.5rem;
}
.hero-proof dt {
  font-family: var(--ff-display);
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  line-height: 1;
  color: var(--accent);
}
.hero-proof dd {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--faint);
  line-height: 1.4;
}
/* Split-flap intro for the proof values (main.js). Each cell is exactly as wide as its final
   glyph (no padding), so the strip is never wider than the plain text and nothing shifts. */
.flap {
  position: relative;
  isolation: isolate;
  display: inline-block;
  overflow: clip;
  text-align: center;
}
.flap::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 2px;
  background:
    linear-gradient(var(--bg), var(--bg)) center / 100% 1px no-repeat,
    linear-gradient(var(--track), var(--track)) center / calc(100% - 2px) 100% no-repeat;
  opacity: 0;
  transition: opacity 0.6s;
}
.flap:is(.is-waiting, .is-flipping)::before { opacity: 1; transition: none; }
.flap.is-waiting { color: transparent; }
.hero-ambient {
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(245, 242, 236, 0.16);
  pointer-events: none;
  user-select: none;
}

.hero-name, .hero-eyebrow, .hero-row, .hero-proof {
  animation: heroUp 1s var(--ease-out) both;
}
.hero-eyebrow { animation-delay: 0.05s; }
.hero-row     { animation-delay: 0.3s; }
.hero-proof   { animation-delay: 0.45s; }
@keyframes heroUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}

/* ── CURTAIN (pinned layers) ────────────────── */
/* With JS, the hero stays pinned while About slides over it like paper, and the finale
   (testimonials + contact) waits underneath until Outside slides off it. main.js sets the pin
   offsets: a hero taller than the viewport scrolls to its end first, and the finale rests with
   the testimonials on the bottom of the viewport so they then scroll by at reading pace.
   Flow sections always paint over the hero, which paints over the finale; anything in main.js
   that asks "what's showing" respects that order. The finale sits at 0, not -1: a negative z-index would put it
   under <body>'s box for hit-testing, and its links would stop being clickable. */
.js .finale { position: sticky; bottom: var(--finale-pin, 0px); z-index: 0; }
.js .hero { position: sticky; top: var(--hero-pin, 0px); z-index: 1; }
.js main > :not(.hero) { position: relative; z-index: 2; }
.js #about { box-shadow: 0 -28px 56px -20px rgba(0, 0, 0, 0.6); }
.js #outside { box-shadow: 0 28px 56px -20px rgba(0, 0, 0, 0.6); }
/* The hero content recedes as it's covered (scroll-driven; static where unsupported) */
@keyframes heroCovered { to { opacity: 0.3; transform: scale(0.95); } }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .js .hero-inner {
      transform-origin: 50% 30%;
      animation: heroCovered linear both;
      animation-timeline: scroll();
      animation-range: calc(var(--hero-pin, 0px) * -1) calc(var(--hero-pin, 0px) * -1 + 100vh);
    }
  }
}

/* ── SECTIONS ───────────────────────────────── */
.section { padding: clamp(5rem, 10vw, 8rem) var(--gutter); }

/* ── ABOUT ──────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}
.about-photo-wrap {
  position: relative;
  overflow: hidden;
  background: #d8d4ce;
}
.about-photo-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid var(--pink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.about-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center 20%;
  filter: grayscale(100%) contrast(1.04);
  transition: filter 0.35s ease;
}
.about-photo-wrap:hover::after,
.about-photo-wrap.is-playing::after { opacity: 1; }
.about-photo-wrap:hover .about-photo,
.about-photo-wrap.is-playing .about-photo { filter: grayscale(80%) contrast(1.08) brightness(1.05); }

/* Coffee doodle */
@keyframes pipeDraw { to { stroke-dashoffset: 0; } }
@keyframes smokeRise {
  0%   { stroke-dashoffset: 70; opacity: 0; }
  12%  { opacity: 0.7; }
  55%  { stroke-dashoffset: 0; opacity: 0.5; }
  88%  { stroke-dashoffset: 0; opacity: 0; }
  100% { stroke-dashoffset: 70; opacity: 0; }
}
.pipe-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.pp-body, .pp-rim, .pp-handle, .pp-fill,
.pp-d1, .pp-d2, .pp-d3, .pp-d4, .pp-d5 { stroke-dasharray: 500; stroke-dashoffset: 500; }
.pp-s1, .pp-s2, .pp-s3 { stroke-dasharray: 70; stroke-dashoffset: 70; opacity: 0; }
.pp-body, .pp-rim, .pp-fill { fill-opacity: 0; transition: fill-opacity 0.3s 0.5s; }
:is(.about-photo-wrap:hover, .about-photo-wrap.is-playing) :is(.pp-body, .pp-rim, .pp-fill) { fill-opacity: 1; }
:is(.about-photo-wrap:hover, .about-photo-wrap.is-playing) .pp-body   { animation: pipeDraw 0.55s 0.00s ease forwards; }
:is(.about-photo-wrap:hover, .about-photo-wrap.is-playing) .pp-rim    { animation: pipeDraw 0.30s 0.45s ease forwards; }
:is(.about-photo-wrap:hover, .about-photo-wrap.is-playing) .pp-handle { animation: pipeDraw 0.30s 0.55s ease forwards; }
:is(.about-photo-wrap:hover, .about-photo-wrap.is-playing) .pp-fill   { animation: pipeDraw 0.22s 0.70s ease forwards; }
:is(.about-photo-wrap:hover, .about-photo-wrap.is-playing) .pp-d1     { animation: pipeDraw 0.30s 0.10s ease forwards; }
:is(.about-photo-wrap:hover, .about-photo-wrap.is-playing) .pp-d2     { animation: pipeDraw 0.30s 0.25s ease forwards; }
:is(.about-photo-wrap:hover, .about-photo-wrap.is-playing) .pp-d3     { animation: pipeDraw 0.40s 0.20s ease forwards; }
:is(.about-photo-wrap:hover, .about-photo-wrap.is-playing) .pp-d4     { animation: pipeDraw 0.70s 0.50s ease forwards; }
:is(.about-photo-wrap:hover, .about-photo-wrap.is-playing) .pp-d5     { animation: pipeDraw 0.80s 0.65s ease forwards; }
:is(.about-photo-wrap:hover, .about-photo-wrap.is-playing) .pp-s1 { animation: smokeRise 2.6s 1.0s ease-in-out infinite; }
:is(.about-photo-wrap:hover, .about-photo-wrap.is-playing) .pp-s2 { animation: smokeRise 2.6s 1.8s ease-in-out infinite; }
:is(.about-photo-wrap:hover, .about-photo-wrap.is-playing) .pp-s3 { animation: smokeRise 2.6s 2.6s ease-in-out infinite; }

.about-heading { font-size: clamp(3.5rem, 7vw, 6.5rem); margin-bottom: 2rem; }
.about-body { max-width: 40rem; }
.about-body p { font-size: clamp(1.0625rem, 1.4vw, 1.1875rem); line-height: 1.7; color: var(--muted); }
.about-body p + p { margin-top: 1.25rem; }
.about-body p:first-child { font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.45; color: var(--fg); }
.about-body strong { font-weight: 600; color: var(--fg); }
.about-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
}
.about-facts span::before { content: '— '; color: var(--accent); }

/* ── SCRIBBLE UNDERLINE ─────────────────────── */
.scribble { position: relative; display: inline-block; }
.scribble-svg {
  position: absolute;
  left: -2px;
  bottom: -0.12em;
  width: calc(100% + 4px);
  height: 0.22em;
  min-height: 12px;
  pointer-events: none;
  overflow: visible;
  color: var(--scribble);
}

/* ── SKILLS ─────────────────────────────────── */
.pillars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  margin-top: clamp(3rem, 6vw, 4.5rem);
}
.pillar {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 2rem 2rem 2.25rem 0;
  border-right: 1px solid var(--line);
}
.pillar + .pillar { padding-left: 2rem; }
.pillar:last-child { border-right: 0; padding-right: 0; }
.pillar-num { color: var(--accent); }
.pillar h3 {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.pillar p { font-size: 0.975rem; color: var(--muted); line-height: 1.6; }
.pillar-proof {
  margin-top: auto;
  padding-top: 1rem;
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--fg);
}
.pillar-proof b {
  font-family: var(--ff-display);
  font-weight: 400;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--accent);
}
.pillar-proof span {
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  color: var(--faint);
  border-bottom: 1px solid var(--line);
  transition: color 0.2s, border-color 0.2s;
}
.pillar-proof:hover span { color: var(--fg); border-color: var(--accent); }

.toolkit {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.toolkit-label { display: block; color: var(--faint); margin-bottom: 1.5rem; }
.toolkit-groups {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
}
.toolkit-group h3 { color: var(--accent); margin-bottom: 0.85rem; font-size: 0.72rem; }
.toolkit ul { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.toolkit li {
  font-family: var(--ff-mono);
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--line);
  color: var(--muted);
}

/* ── WORK INTRO ─────────────────────────────── */
.work-intro { padding-bottom: clamp(3rem, 6vw, 4.5rem); }

/* ── CASE STUDY ─────────────────────────────── */
.case { padding: clamp(4rem, 8vw, 6.5rem) var(--gutter); }
.case-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  align-items: center;
  padding-bottom: 1.25rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  color: var(--faint);
}
.case-company { color: var(--accent); }
.case-num { margin-left: auto; }

.case-head {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 1.5rem 4rem;
  align-items: end;
  margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}
.case-title { font-size: clamp(3.5rem, 9vw, 8.5rem); }
.case-lede {
  font-size: clamp(1.15rem, 1.8vw, 1.4rem);
  line-height: 1.45;
  color: var(--muted);
  padding-bottom: 0.4em;
}

.case-role {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 0.35rem 2rem;
  align-items: baseline;
  max-width: 62rem;
  margin: calc(clamp(2.5rem, 5vw, 3.5rem) * -0.45) 0 clamp(2rem, 4vw, 3rem);
  padding: 0.2rem 0 0.2rem 1.25rem;
  border-left: 2px solid var(--accent);
}
.case-role dt { color: var(--accent); }
.case-role dd { font-size: clamp(1rem, 1.3vw, 1.075rem); line-height: 1.55; color: var(--fg); }
.case--compact .case-role { grid-template-columns: 1fr; margin: -0.75rem 0 1.5rem; }
.case--compact .case-role dd { font-size: 0.95rem; }

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}
.metric { padding: 1.5rem 1.75rem 1.6rem; }
.metric + .metric { border-left: 1px solid var(--line); }
.metric dt {
  font-family: var(--ff-display);
  font-size: clamp(2.5rem, 4.5vw, 4rem);
  line-height: 1;
  color: var(--accent);
}
.metric dd {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--faint);
}

.case-visual { margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.case-visual figcaption {
  margin-top: 0.85rem;
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  color: var(--faint);
}

.story {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem 3rem;
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
}
.story h4 { color: var(--accent); margin-bottom: 0.75rem; }
.story p { font-size: 1rem; line-height: 1.7; color: var(--muted); }
.story-outcome p { color: var(--fg); }
.story ul { margin-top: 0.75rem; display: grid; gap: 0.35rem; }
.story li {
  position: relative;
  padding-left: 1.1rem;
  font-size: 0.95rem;
  color: var(--muted);
}
.story li::before { content: '→'; position: absolute; left: 0; color: var(--accent); font-size: 0.85em; }

/* ── APP WINDOW (product mock frame) ────────── */
/* The demo windows stay dark on any surface. Like surfaces, the skin is a token set
   and everything inside .app reads only these (plus --pink / --black for accents). */
.app {
  --app-bg: #121212;
  --app-raise: #1b1b1b;                          /* popovers, sticky headers      */
  --app-fg: var(--white);
  --app-text:  rgba(245, 242, 236, 0.8);
  --app-muted: rgba(245, 242, 236, 0.6);
  --app-faint: rgba(245, 242, 236, 0.5);         /* lowest text alpha; 5:1 on bg  */
  --app-dim:   rgba(245, 242, 236, 0.35);        /* idle icons, hover borders     */
  --app-line:        rgba(245, 242, 236, 0.08);
  --app-line-strong: rgba(245, 242, 236, 0.16);
  --app-fill:        rgba(245, 242, 236, 0.04);
  --app-fill-strong: rgba(245, 242, 236, 0.1);
  --app-accent-wash: rgba(255, 176, 200, 0.08);  /* highlighted rows              */
  --app-accent-soft: rgba(255, 176, 200, 0.14);  /* chips, badges, focus glow     */
  --app-accent-line: rgba(255, 176, 200, 0.4);

  position: relative;
  background: var(--app-bg);
  color: var(--app-fg);
  border: 1px solid var(--app-line);
  border-radius: 10px;
  overflow: hidden;
  font-family: var(--ff-mono);
  /* Screenshot depth on a light page: lit top edge, tight contact shadow, soft ambient one */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 1px 2px rgba(10, 10, 10, 0.14),
    0 6px 14px -4px rgba(10, 10, 10, 0.16),
    0 44px 80px -28px rgba(10, 10, 10, 0.42);
}
.surface-dark .app { --app-bg: #141414; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07); }
.app-bar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.7rem 1rem;
  background: linear-gradient(var(--app-fill), transparent), var(--app-fill);
  border-bottom: 1px solid var(--app-line);
  font-size: 0.72rem;
  color: var(--app-muted);
}
/* Cursor sheen: a faint light that follows the pointer (main.js sets --mx / --my) */
@media (hover: hover) and (pointer: fine) {
  .app::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 5;
    border-radius: inherit;
    background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, 0.05), transparent 45%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s;
  }
  .app:hover::after { opacity: 1; }
}
/* Settle flat: windows lean back as they enter and lie flat by the time they're in view.
   Scroll-driven, so browsers without view timelines simply show them flat. */
@keyframes appSettle {
  from { transform: rotateX(12deg) translateY(32px) scale(0.97); }
  to   { transform: none; }
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .case-visual:has(> .app) { perspective: 1600px; }
    .case-visual > .app {
      animation: appSettle linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 35%;
    }
  }
}
.app-dots { display: flex; gap: 6px; }
.app-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--app-line-strong); }
.app-title { letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── VALIDATION DEMO (interactive) ──────────── */
@keyframes vdIn   { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes vdOut  { to { opacity: 0; transform: translateX(-10px); } }
@keyframes vdPop  { 0% { transform: scale(0); } 60% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes vdFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes vdFly  { from { opacity: 0; transform: translateX(-8px) scale(0.98); } to { opacity: 1; transform: none; } }

.vd-try {
  margin-left: auto;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  background: var(--app-accent-soft);
  color: var(--pink);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.vd-body {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  min-height: 360px;
}

/* Sidebar */
.vd-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.85rem 0;
  border-right: 1px solid var(--app-line);
  background: var(--app-fill);
}
.vd-ico {
  position: relative;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  color: var(--app-dim);
}
.vd-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.vd-ico.is-active { color: var(--app-fg); background: var(--app-fill-strong); }
.vd-shield { margin-top: auto; cursor: pointer; transition: color 0.2s, background-color 0.2s; }
.vd-shield:hover, .vd-shield[aria-expanded="true"] { color: var(--app-fg); background: var(--app-accent-soft); }
.vd-badge {
  position: absolute;
  top: 1px; right: 0;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--pink);
  color: var(--black);
  font-family: var(--ff-sans);
  font-size: 0.65rem;
  font-weight: 600;
  box-shadow: 0 0 0 2px var(--app-bg);
}
.vd-badge[hidden] { display: none; }
.vd-badge.is-pop { animation: vdPop 0.45s var(--ease-out); }

/* Editor */
.vd-main { display: flex; flex-direction: column; gap: 1rem; padding: 1.1rem 1.5rem 1.25rem; min-width: 0; }
.vd-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--ff-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--app-fg);
}
.vd-section-sub { font-family: var(--ff-mono); font-size: 0.7rem; font-weight: 400; color: var(--app-faint); }
.vd-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.vd-table th {
  padding: 0 0.75rem 0.55rem 0.5rem;
  border-bottom: 1px solid var(--app-line);
  text-align: left;
  font-weight: 400;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--app-faint);
}
.vd-table td {
  padding: 0.45rem 0.75rem 0.45rem 0.5rem;
  border-bottom: 1px solid var(--app-line);
  color: var(--app-text);
  transition: background-color 0.3s;
}
.vd-table td:first-child { width: 4.5rem; color: var(--app-faint); }
.vd-table th:last-child, .vd-table td:last-child { text-align: right; padding-right: 0.5rem; }
.vd-table tr.is-flagged td { background: var(--app-accent-wash); }
.vd-table tr.is-flagged td:first-child { box-shadow: inset 2px 0 0 var(--pink); }
.vd-price {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--app-line-strong);
  border-radius: 4px;
  background: var(--app-fill);
  cursor: text;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.vd-price span { color: var(--app-faint); }
.vd-price:hover { border-color: var(--app-dim); }
.vd-price:focus-within, .vd-price.is-typing { border-color: var(--pink); box-shadow: 0 0 0 3px var(--app-accent-soft); }
.vd-input {
  width: 6.5ch;
  background: none;
  border: 0;
  outline: none;
  color: var(--app-fg);
  font: inherit;
  font-size: 16px; /* prevents iOS zoom on focus */
  line-height: 1.2;
  text-align: right;
}
.vd-actions { display: flex; align-items: center; gap: 0.6rem; margin-top: auto; }
.vd-status { margin-right: auto; font-size: 0.75rem; color: var(--app-muted); opacity: 0; }
.vd-status.is-shown { opacity: 1; animation: vdFade 0.3s ease both; }
.vd-btn {
  padding: 0.55rem 1rem;
  border-radius: 4px;
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 0.12s, background-color 0.2s, color 0.2s;
}
.vd-reset { color: var(--app-text); background: var(--app-fill-strong); }
.vd-reset:hover { color: var(--app-fg); background: var(--app-line-strong); }
.vd-save { background: var(--app-fg); color: var(--black); }
.vd-save:hover, .vd-save.is-pressed { background: var(--pink); }
.vd-btn:active, .vd-save.is-pressed { transform: scale(0.94); }

/* Validation flyout, anchored to the shield */
.vd-fly {
  position: absolute;
  left: 62px;
  bottom: 10px;
  z-index: 3;
  width: min(360px, calc(100% - 72px));
  max-height: calc(100% - 20px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--app-line-strong);
  border-radius: 8px;
  background: var(--app-raise);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  animation: vdFly 0.3s var(--ease-out) both;
}
.vd-fly[hidden] { display: none; }
.vd-fly-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.75rem 0.7rem 1rem;
  border-bottom: 1px solid var(--app-line);
}
.vd-fly-title { font-family: var(--ff-sans); font-size: 0.95rem; font-weight: 600; color: var(--app-fg); margin-right: auto; }
.vd-chip-count {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--pink);
  color: var(--black);
  font-family: var(--ff-sans);
  font-size: 0.72rem;
  font-weight: 600;
}
.vd-chip-count.is-clear { background: var(--app-fill-strong); color: var(--app-text); }
.vd-close { width: 26px; height: 26px; border-radius: 4px; font-size: 1.1rem; line-height: 1; color: var(--app-muted); }
.vd-close:hover { color: var(--app-fg); background: var(--app-fill-strong); }
.vd-fly-body { overflow-y: auto; padding: 0.4rem 0 0.5rem; }
.vd-group {
  padding: 0.55rem 1rem 0.25rem;
  font-family: var(--ff-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--app-muted);
}
.vd-group--err { color: var(--pink); }
.vd-issue {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: start;
  padding: 0.55rem 0.75rem 0.65rem 1rem;
  animation: vdIn 0.35s var(--ease-out) both;
}
.vd-issue.is-leaving { animation: vdOut 0.25s ease forwards; }
.vd-sev {
  width: 18px; height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-sans);
  font-size: 0.68rem;
  font-weight: 600;
}
.vd-issue--err  .vd-sev { background: var(--pink); color: var(--black); }
.vd-issue--warn .vd-sev { background: transparent; color: var(--pink); box-shadow: inset 0 0 0 1.5px var(--pink); }
.vd-msg { font-family: var(--ff-sans); font-size: 0.85rem; line-height: 1.35; color: var(--app-fg); }
.vd-ctx { margin-top: 0.15rem; font-size: 0.72rem; color: var(--app-muted); }
.vd-code {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: var(--app-accent-soft);
  color: var(--pink);
  font-family: var(--ff-mono);
  font-size: 0.64rem;
  letter-spacing: 0.02em;
}
.vd-ack {
  width: 28px; height: 28px;
  border-radius: 50%;
  color: var(--app-muted);
  font-size: 0.85rem;
  transition: color 0.2s, background-color 0.2s;
}
.vd-ack:hover { color: var(--black); background: var(--pink); }
.vd-clear { padding: 0.9rem 1rem; font-size: 0.78rem; color: var(--app-muted); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── PRICE TESTING TOOL (interactive) ───────── */
@keyframes pttRow { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.ptt-config {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.1rem 1.75rem;
  align-items: end;
  padding: 1.25rem 1.5rem 0;
}
.ptt-field { display: grid; gap: 0.5rem; }
.ptt-label {
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--app-faint);
}
.ptt-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ptt-chip {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--app-line-strong);
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  color: var(--app-muted);
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.ptt-chip[aria-pressed="true"] { background: var(--app-accent-soft); border-color: var(--app-accent-line); color: var(--pink); }
.ptt-chip[aria-pressed="true"]::after { content: ' ×'; opacity: 0.6; }
.ptt-chip[aria-pressed="false"]::before { content: '+ '; }
.ptt-chip:hover { border-color: var(--app-dim); }
.ptt-seg {
  display: inline-flex;
  width: max-content;
  border: 1px solid var(--app-line-strong);
  border-radius: 5px;
  overflow: hidden;
}
.ptt-seg button {
  padding: 0.4rem 0.7rem;
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  color: var(--app-muted);
  transition: background-color 0.2s, color 0.2s;
}
.ptt-seg button + button { border-left: 1px solid var(--app-line); }
.ptt-seg button[aria-pressed="true"] { background: var(--app-fill-strong); color: var(--app-fg); }
.ptt-seg button:hover { color: var(--app-fg); }

.ptt-switch { display: flex; align-items: center; gap: 0.7rem; cursor: pointer; }
.ptt-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ptt-track {
  position: relative;
  flex-shrink: 0;
  width: 36px; height: 20px;
  border-radius: 10px;
  background: var(--app-line-strong);
  transition: background-color 0.2s;
}
.ptt-track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--app-fg);
  transition: transform 0.25s var(--ease-out);
}
.ptt-switch input:checked + .ptt-track { background: var(--pink); }
.ptt-switch input:checked + .ptt-track::after { transform: translateX(16px); background: var(--black); }
.ptt-switch input:focus-visible + .ptt-track { outline: 2px solid var(--pink); outline-offset: 3px; }
.ptt-switch-text { display: grid; line-height: 1.25; }
.ptt-switch-text b { font-family: var(--ff-sans); font-size: 0.85rem; font-weight: 600; color: var(--app-fg); }
.ptt-switch-text small { font-size: 0.68rem; color: var(--app-faint); }

.ptt-run-row { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 1rem; }
.ptt-state { margin-right: auto; font-size: 0.75rem; color: var(--app-muted); }
.ptt-state.is-done { color: var(--pink); }
.ptt-run:disabled { opacity: 0.6; cursor: progress; }
.ptt-progress { grid-column: 1 / -1; height: 2px; margin: 0 -1.5rem; background: var(--app-fill); overflow: hidden; }
.ptt-progress-bar { width: 0; height: 100%; background: var(--pink); }
.ptt-progress-bar.is-running { width: 100%; transition: width 1.1s var(--ease); }

.ptt-results { padding: 1.1rem 1.5rem 1.25rem; }
.ptt-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.ptt-stat {
  padding: 0.75rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--app-line);
  background: var(--app-fill);
  transition: background-color 0.3s, border-color 0.3s;
}
.ptt-stat b { display: block; font-family: var(--ff-display); font-weight: 400; font-size: 2rem; line-height: 1; color: var(--app-fg); }
.ptt-stat span { display: block; margin-top: 0.3rem; font-size: 0.68rem; line-height: 1.3; color: var(--app-muted); }
.ptt.is-checking .ptt-stat--paid.has-paid { background: var(--app-accent-soft); border-color: var(--app-accent-line); }
.ptt.is-checking .ptt-stat--paid.has-paid b { color: var(--pink); }

.ptt-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.1rem 0 0.6rem; }
.ptt-table-wrap {
  position: relative;
  max-height: 248px;
  overflow-y: auto;
  border: 1px solid var(--app-line);
  border-radius: 6px;
  overscroll-behavior: contain;
}
.ptt-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.ptt-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.55rem 0.8rem;
  background: var(--app-raise);
  text-align: left;
  font-weight: 400;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--app-faint);
}
.ptt-table td { padding: 0.5rem 0.8rem; border-top: 1px solid var(--app-line); color: var(--app-text); white-space: nowrap; }
.ptt-table tbody tr { animation: pttRow 0.3s var(--ease-out) both; }
.ptt-table td:first-child { color: var(--app-fg); text-decoration: underline; text-decoration-color: var(--app-dim); text-underline-offset: 3px; }
.ptt.is-checking .ptt-table tr.is-paid td { background: var(--app-accent-wash); }
.ptt-tag { font-size: 0.7rem; color: var(--app-muted); }
.ptt.is-checking tr.is-paid .ptt-tag { color: var(--pink); }
.ptt-empty { padding: 1.25rem; font-size: 0.78rem; color: var(--app-faint); text-align: center; }
.ptt-table:has(tbody tr) + .ptt-empty { display: none; }

/* ── COLUMN CHART (coverage) ────────────────── */
.chart {
  border: 1px solid var(--line);
  padding: clamp(1.25rem, 3vw, 2rem);
}
.chart-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-bottom: 1.75rem;
}
.chart-title { font-size: 1rem; font-weight: 600; }
.chart-sub { font-family: var(--ff-mono); font-size: 0.75rem; color: var(--faint); }

.cols {
  position: relative;
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  gap: 0 0.75rem;
}
.cols-y {
  position: relative;
  height: 220px;
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  color: var(--faint);
}
.cols-y span { position: absolute; right: 0; transform: translateY(50%); }
.cols-plot {
  position: relative;
  height: 220px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 2px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  background-image: linear-gradient(to top, var(--line) 1px, transparent 1px);
  background-size: 100% 25%;
}
.col {
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  outline: none;
}
.col-bar {
  width: min(70%, 34px);
  height: var(--v);
  background: color-mix(in srgb, var(--fg) 26%, transparent);
  border-radius: 4px 4px 0 0;
  transform-origin: bottom;
  transition: background-color 0.2s;
}
.js .col-bar { transform: scaleY(0); transition: transform 0.9s var(--ease-out), background-color 0.2s; }
.is-playing .col-bar { transform: scaleY(1); transition-delay: calc(var(--i) * 60ms), 0s; }
.col--key .col-bar { background: var(--accent); }
.col:hover .col-bar, .col:focus-visible .col-bar { background: color-mix(in srgb, var(--fg) 55%, transparent); }
.col--key:hover .col-bar, .col--key:focus-visible .col-bar { background: var(--accent); }
.col-tip {
  position: absolute;
  bottom: calc(var(--v) + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.3rem 0.5rem;
  background: var(--fg);
  color: var(--bg);
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  white-space: nowrap;
  border-radius: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 2;
}
.col:hover .col-tip, .col:focus-visible .col-tip { opacity: 1; }
.col-label {
  position: absolute;
  bottom: calc(var(--v) + 0.45rem);
  font-family: var(--ff-display);
  font-size: 1.35rem;
  line-height: 1;
  color: var(--fg);
}
.col--key .col-label { color: var(--accent); }
.col:hover .col-label, .col:focus-visible .col-label { opacity: 0; }
.cols-x {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 2px;
  padding-top: 0.5rem;
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  color: var(--faint);
  text-align: center;
}
.cols-x .is-key { color: var(--accent); font-weight: 500; }
.cols-note {
  position: absolute;
  top: 0;
  left: calc(2.75rem + 0.75rem);
  right: 0;
  display: flex;
  justify-content: flex-start;
  pointer-events: none;
}
.chart-callout {
  margin-top: 1.25rem;
  font-family: var(--ff-mono);
  font-size: 0.78rem;
  color: var(--muted);
}
.chart-callout b { color: var(--accent); font-weight: 500; }

/* Stacked segment bar */
.segs { margin-top: 2rem; padding-top: 1.75rem; border-top: 1px solid var(--line); }
.segs-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 1rem; }
.segs-bar { display: flex; gap: 2px; height: 14px; }
.seg { height: 100%; width: var(--w); background: color-mix(in srgb, var(--fg) var(--k), transparent); }
.seg:first-child { border-radius: 4px 0 0 4px; }
.seg:last-child  { border-radius: 0 4px 4px 0; }
.segs-bracket {
  position: relative;
  width: 52%;
  height: 10px;
  margin-bottom: 0.4rem;
  border: 1.5px solid var(--accent);
  border-bottom: 0;
}
.segs-bracket span {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.3rem);
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  color: var(--accent);
  white-space: nowrap;
}
.segs-bracket-wrap { padding-top: 1.4rem; }
.segs-legend {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.segs-legend li { display: flex; gap: 0.6rem; align-items: baseline; }
.segs-legend i { width: 10px; height: 10px; flex-shrink: 0; border-radius: 2px; background: color-mix(in srgb, var(--fg) var(--k), transparent); transform: translateY(1px); }
.segs-legend b { display: block; font-family: var(--ff-display); font-weight: 400; font-size: 1.6rem; line-height: 1; }
.segs-legend span { font-size: 0.82rem; color: var(--faint); }

/* ── BEFORE / AFTER BARS ────────────────────── */
.bars { display: grid; gap: 0.6rem; }
.bar-row {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
}
.bar-label { font-family: var(--ff-mono); font-size: 0.75rem; color: var(--faint); text-align: right; }
.bar-track { height: 2.5rem; background: var(--track); border-radius: 0 4px 4px 0; overflow: hidden; }
.bar {
  height: 100%;
  width: var(--w);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 0.85rem;
  border-radius: 0 4px 4px 0;
  background: color-mix(in srgb, var(--fg) 30%, transparent);
  font-family: var(--ff-display);
  font-size: 1.35rem;
  line-height: 1;
  color: var(--fg);
  white-space: nowrap;
}
.bar--after { background: var(--pink); color: var(--black); }
.js .bar { width: 0; transition: width 1.4s var(--ease-out); }
.js .bar--after { transition-delay: 0.2s; }
.is-playing .bar { width: var(--w); }
.bars-foot {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 0.75rem;
  margin-top: 1rem;
}
.bars-foot b { font-family: var(--ff-display); font-weight: 400; font-size: 2.25rem; line-height: 1; color: var(--accent); }
.bars-foot span { font-family: var(--ff-mono); font-size: 0.75rem; color: var(--faint); }

/* ── ONE-HOUR LOOP (case 02) ────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.hour-grid {
  display: grid;
  grid-template-columns: minmax(200px, 300px) minmax(0, 1fr);
  gap: 2rem 3.5rem;
  align-items: center;
}
.hour-loop svg { width: 100%; height: auto; overflow: visible; }
.hour-arc { fill: none; stroke: color-mix(in srgb, var(--fg) 30%, transparent); stroke-width: 2; }
.hour-arrowhead { fill: none; stroke: color-mix(in srgb, var(--fg) 45%, transparent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.hour-node { fill: var(--bg); stroke: var(--fg); stroke-width: 2; }
.hour-node--key { fill: var(--accent); stroke: var(--accent); }
.hour-orbit { transform-origin: 150px 150px; }
.hour-orbit circle { fill: var(--accent); opacity: 0.35; }
.is-playing .hour-orbit { animation: spin 4.5s linear infinite; }
.hour-label { font-family: var(--ff-mono); font-size: 13px; fill: var(--muted); }
.hour-num { font-family: var(--ff-display); font-size: 58px; fill: var(--fg); }
.hour-sub { font-family: var(--ff-mono); font-size: 10.5px; letter-spacing: 0.12em; fill: var(--faint); }
.hour-steps { counter-reset: step; }
.hour-steps li { position: relative; padding: 0.95rem 0 0.95rem 2.75rem; border-top: 1px solid var(--line); }
.hour-steps li:first-child { border-top: 0; padding-top: 0; }
.hour-steps li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0; top: 1.1rem;
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  color: var(--faint);
}
.hour-steps li:first-child::before { top: 0.15rem; }
.hour-steps b { display: block; font-size: 1.05rem; font-weight: 600; }
.hour-steps span { display: block; margin-top: 0.15rem; font-size: 0.925rem; color: var(--muted); }
.hour-steps .is-key::before, .hour-steps .is-key b { color: var(--accent); }
.hour-vs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.hour-vs .eyebrow { color: var(--faint); }
.hour-vs ol { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.hour-vs li {
  padding: 0.3rem 0.6rem;
  border: 1px dashed var(--line);
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  color: var(--faint);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--fg) 35%, transparent);
}

/* ── CONFIG RACE (case 05) ────────────────── */
.race-lanes { display: grid; gap: 1.1rem; }
.race-meta { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.4rem; }
.race-name { font-size: 0.925rem; font-weight: 500; }
.race-time { font-family: var(--ff-mono); font-size: 0.8rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.race-lane--after .race-time { color: var(--accent); }
.race-track { height: 0.9rem; border-radius: 4px; background: var(--track); overflow: hidden; }
.race-fill {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  background: color-mix(in srgb, var(--fg) 32%, transparent);
  transform: scaleX(var(--p, 0));
  transform-origin: left;
}
.race-lane--after .race-fill { background: var(--pink); }
.race-done {
  margin-top: 0.55rem;
  font-family: var(--ff-mono);
  font-size: 0.78rem;
  color: var(--faint);
}
.race-count {
  display: inline-block;
  min-width: 2.2ch;
  font-family: var(--ff-display);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.race-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.race-note { font-size: 0.9rem; line-height: 1.5; color: var(--muted); }
.race-note b { color: var(--fg); font-weight: 600; }
.race-replay {
  flex-shrink: 0;
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  color: var(--faint);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.race-replay:hover { color: var(--fg); }

/* ── MIGRATION: GAPS + DELIVERY (case 06) ────── */
.gap-stack { display: flex; gap: 2px; height: 1.75rem; margin-bottom: 1.1rem; }
.gap-seg { width: var(--w); background: var(--c); transform-origin: left; }
.gap-seg:first-child { border-radius: 4px 0 0 4px; }
.gap-seg:last-child  { border-radius: 0 4px 4px 0; }
.js .gap-seg { transform: scaleX(0); transition: transform 0.8s var(--ease-out); }
.js .gap-seg:nth-child(2) { transition-delay: 0.08s; }
.js .gap-seg:nth-child(3) { transition-delay: 0.16s; }
.js .gap-seg:nth-child(4) { transition-delay: 0.24s; }
.js .gap-seg:nth-child(5) { transition-delay: 0.32s; }
.is-playing .gap-seg { transform: scaleX(1); }
/* One column when narrow; two columns filled top-to-bottom when there's room, so the two
   "new" areas always stack together (the brace annotation relies on that). */
.chart--gaps { container-type: inline-size; }
.gap-legend { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.55rem 1.75rem; }
@container (min-width: 30rem) {
  .gap-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, auto); grid-auto-flow: column; }
}
.gap-legend li { position: relative; display: flex; align-items: center; gap: 0.6rem; font-size: 0.925rem; }
.gap-legend i { width: 10px; height: 10px; flex-shrink: 0; border-radius: 2px; background: var(--c); }
.gap-legend b { margin-left: auto; font-family: var(--ff-mono); font-size: 0.75rem; font-weight: 500; color: var(--faint); }
.gap-legend .is-new b { color: var(--accent); }

.deliv { margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.deliv-title { margin-bottom: 0.75rem; font-size: 0.95rem; font-weight: 600; }
.deliv-plot { display: grid; grid-template-columns: repeat(18, minmax(0, 1fr)); column-gap: 3px; }
.deliv-note {
  grid-column: 15 / 19;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.4rem;
  padding-top: 0.3rem;
  border-top: 1.5px solid var(--accent);
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  color: var(--accent);
  white-space: nowrap;
}
.deliv-bars {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(18, minmax(0, 1fr));
  gap: 3px;
  align-items: end;
  height: 84px;
  border-bottom: 1px solid var(--line);
}
.deliv-bars span { height: var(--h); border-radius: 3px 3px 0 0; background: color-mix(in srgb, var(--fg) 28%, transparent); transform-origin: bottom; }
.deliv-bars .is-spike { background: var(--accent); }
.js .deliv-bars span { transform: scaleY(0); transition: transform 0.7s var(--ease-out) calc(var(--i) * 45ms); }
.is-playing .deliv-bars span { transform: scaleY(1); }
.deliv-axis span { white-space: nowrap; }
.deliv-axis { display: flex; justify-content: space-between; gap: 1rem; margin-top: 0.5rem; font-family: var(--ff-mono); font-size: 0.7rem; color: var(--faint); }
.deliv-caption { margin-top: 0.75rem; font-size: 0.8rem; color: var(--faint); }

/* ── HAND-DRAWN CHART ANNOTATIONS ───────────── */
/* Notebook marks on the charts, each anchored inside the element it marks so it follows the
   responsive layout. Strokes get the sketch wobble; the note text stays crisp. main.js draws
   them in (drawIn); without JS they're simply there. */
.annot { position: absolute; z-index: 1; pointer-events: none; }
.annot svg { width: 100%; height: 100%; overflow: visible; }
.annot path {
  fill: none;
  stroke: var(--scribble);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url(#sketch-rough);
}
.annot-note {
  position: absolute;
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  line-height: 1.3;
  color: var(--accent);
  white-space: nowrap;
}
.js .annot-note { opacity: 0; transition: opacity 0.5s ease 1.5s; }
.js .annot.is-drawn .annot-note { opacity: 1; }

/* Case 03: ring around the MVP column's top and its label */
.annot--ring { left: 50%; bottom: calc(var(--v) - 1.05rem); width: 3.9rem; height: 3.3rem; transform: translateX(-50%); }
.annot--ring path { stroke-width: 2; }
.annot--ring .annot-note { right: calc(100% + 0.3rem); top: 0.15rem; }

/* Case 04: arrow from the end of Before to the end of After. Bar rows are a 4.5rem label,
   a 1rem gap and the track; --from is where the Before bar ends. */
.bars { position: relative; }
.annot--gain {
  --track-w: calc(100% - 5.5rem);
  left: calc(5.5rem + var(--track-w) * var(--from));
  width: calc(var(--track-w) * (1 - var(--from)));
  top: 1.25rem;
  height: 3.1rem;
}
.annot--gain .annot-note { left: 0.25rem; bottom: calc(100% + 1.6rem); }

/* Case 06: brace beside the two "new" legend rows, in the chart's right padding */
.annot--brace { top: -0.1rem; right: -1rem; width: 0.65rem; height: calc(200% + 0.75rem); }
.annot--brace .annot-note { right: 1rem; top: calc(100% + 0.35rem); }

/* ── CASE RAIL ──────────────────────────────── */
/* Fixed in the left margin while #work is on screen; each track fills with progress through
   its case (main.js sets --p). Only where the margin is wide enough, and only with JS. */
.case-rail { display: none; }
@media (min-width: 1200px) {
  .js .case-rail {
    position: fixed;
    top: 50%;
    left: calc(max(var(--gutter), (100vw - var(--maxw)) / 2) - var(--gutter) / 2);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    background: none;
    transform: translate(-50%, -50%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0s 0.4s;
  }
  .js .case-rail.is-visible { opacity: 1; visibility: visible; transition: opacity 0.4s; }
}
.case-rail a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.35rem;
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--faint);
  transition: color 0.2s;
}
.case-rail a:hover, .case-rail a.is-active { color: var(--accent); }
.case-rail-track {
  width: 2px;
  height: 3.25rem;
  border-radius: 1px;
  background: var(--track);
  overflow: hidden;
}
.case-rail-track::before {
  content: '';
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleY(var(--p, 0));
  transform-origin: top;
}

/* ── MORE CASE STUDIES ──────────────────────── */
.more { padding: clamp(3.5rem, 7vw, 5rem) var(--gutter); }
.more-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.more-toggle-text { display: grid; gap: 0.4rem; }
.more-toggle-title {
  font-family: var(--ff-display);
  font-size: clamp(2.25rem, 5vw, 4rem);
  line-height: 0.95;
  text-transform: uppercase;
  transition: color 0.2s;
}
.more-toggle-sub { color: var(--faint); font-size: 0.95rem; }
.more-toggle:hover .more-toggle-title { color: var(--accent); }
.more-icon {
  position: relative;
  flex-shrink: 0;
  width: 3.25rem; height: 3.25rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: background-color 0.25s, border-color 0.25s, transform 0.45s var(--ease-out);
}
.more-icon::before, .more-icon::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 14px; height: 1.5px;
  background: currentColor;
  transform: translate(-50%, -50%);
}
.more-icon::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform 0.35s var(--ease-out); }
.more-toggle:hover .more-icon { border-color: var(--fg); }
.more-toggle[aria-expanded="true"] .more-icon { transform: rotate(180deg); background: var(--fg); color: var(--bg); border-color: var(--fg); }
.more-toggle[aria-expanded="true"] .more-icon::after { transform: translate(-50%, -50%) rotate(0deg); }

.more-panel { display: grid; grid-template-rows: 1fr; }
.js .more-panel { grid-template-rows: 0fr; transition: grid-template-rows 0.6s var(--ease); }
.js .more-panel.is-open { grid-template-rows: 1fr; }
.more-inner { overflow: hidden; min-height: 0; }
.more-list { display: grid; gap: 1.5rem; padding-top: 2rem; }

.case--compact {
  padding: clamp(1.75rem, 4vw, 3rem);
  border: 1px solid var(--line);
}
.case--compact .case-bar { margin-bottom: 2rem; }
.case--compact .case-title { font-size: clamp(2.75rem, 6vw, 5rem); }
.case--compact .case-lede { font-size: clamp(1.05rem, 1.5vw, 1.2rem); }
.compact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 2.5rem 3.5rem;
  align-items: start;
}
.case--compact .case-head { grid-template-columns: 1fr; gap: 1rem; margin-bottom: 2rem; }
.case--compact .metrics { grid-template-columns: 1fr; margin-bottom: 0; }
.case--compact .metric { display: flex; align-items: baseline; gap: 1.25rem; padding: 1rem 1.25rem; }
.case--compact .metric + .metric { border-left: 0; border-top: 1px solid var(--line); }
.case--compact .metric dt { font-size: 2.5rem; min-width: 5.5rem; }
.case--compact .metric dd { margin-top: 0; }
.case--compact .story { margin-top: 2.5rem; }
.case--compact .story p { font-size: 0.95rem; }

/* ── PROJECTS ───────────────────────────────── */
.projects-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem 4rem;
  align-items: end;
  margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}
.projects-head .section-title { margin-bottom: 0; }
.project-list { border-top: 1px solid var(--line); }
.pi {
  display: block;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.pi-head {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 2rem;
  padding: 1.5rem 0;
}
.pi-num { font-family: var(--ff-mono); font-size: 0.8rem; color: var(--faint); transition: color 0.25s; }
.pi-name-col { display: grid; gap: 0.25rem; min-width: 0; }
.pi-name {
  font-family: var(--ff-display);
  font-size: clamp(2.25rem, 5.5vw, 5rem);
  line-height: 1;
  text-transform: uppercase;
  transition: color 0.25s;
}
.pi-desc { font-size: 0.975rem; color: var(--faint); }
.pi-tag { font-family: var(--ff-mono); font-size: 0.75rem; color: var(--faint); white-space: nowrap; }
.pi-arrow {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--faint);
  transition: transform 0.35s var(--ease-out), color 0.25s;
}
.pi-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.5s var(--ease); }
.pi-body-inner { overflow: hidden; padding-left: 5rem; }
.pi-img { height: 88px; width: auto; margin-bottom: 1.5rem; border-radius: 12px; }
.pi-img--wide { border-radius: 4px; }
.pi:hover .pi-body, .pi:focus-visible .pi-body { grid-template-rows: 1fr; }
.pi:hover :is(.pi-name, .pi-num, .pi-arrow), .pi:focus-visible :is(.pi-name, .pi-num, .pi-arrow) { color: var(--accent); }
.pi:hover .pi-arrow, .pi:focus-visible .pi-arrow { transform: translate(5px, -5px); }
.pi:focus-visible { outline-offset: -2px; }

/* ── OUTSIDE WORK ───────────────────────────── */
.sketch-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.outside-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
}
.sketch-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.25rem 1.5rem;
  border: 1px solid var(--line);
  background: var(--white);
}
.sketch {
  margin: -0.25rem -0.25rem 1rem;
  padding: 0.75rem 0.5rem 0.25rem;
  background-image: radial-gradient(circle, color-mix(in srgb, var(--fg) 16%, transparent) 0.9px, transparent 1.2px);
  background-size: 12px 12px;
}
.sketch svg { width: 100%; height: auto; aspect-ratio: 200 / 140; overflow: visible; }
.sketch .ink, .sketch .notes path, .sketch .trail { filter: url(#sketch-rough); }
.sketch .ink > *, .sketch .notes path, .sketch .trail {
  fill: none;
  stroke: var(--fg);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sketch .ink > .thin { stroke-width: 1; stroke-opacity: 0.8; }
.sketch .ink > .ghost { stroke-opacity: 0.3; stroke-width: 1; }
.sketch .ink > .accent { stroke: var(--accent); stroke-width: 1.5; }
.sketch .notes path { stroke-width: 0.8; stroke-opacity: 0.5; }
.sketch .trail { stroke-width: 1.1; stroke-dasharray: 3 4; stroke-opacity: 0.7; }
.sketch text { font-family: var(--ff-mono); font-size: 7.5px; fill: var(--faint); }
.js .sketch text, .js .sketch .trail { opacity: 0; transition: opacity 0.6s ease 1.2s; }
.js .sketch.is-drawn text, .js .sketch.is-drawn .trail { opacity: 1; }
.sketch-fig { color: var(--faint); font-size: 0.68rem; margin-bottom: 0.35rem; }
.sketch-card h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.5rem; }
.sketch-card > p:last-child { font-size: 0.95rem; line-height: 1.6; color: var(--muted); }
.outside-close {
  margin-top: 2.5rem;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--muted);
}

/* ── TESTIMONIALS (quiet aside, not a featured section) ─── */
.testimonials-band { padding: clamp(2.5rem, 5vw, 3.5rem) var(--gutter); }
.testimonials-label { color: var(--faint); margin-bottom: 1.5rem; }
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem 2.5rem;
}
.testimonial { padding-left: 1rem; border-left: 2px solid var(--line); }
.testimonial p { font-size: 0.95rem; line-height: 1.6; color: var(--muted); }
.testimonial footer {
  margin-top: 0.75rem;
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ── CONTACT ────────────────────────────────── */
.contact {
  min-height: 80svh;
  display: flex;
}
.contact .wrap { display: flex; flex-direction: column; }
.contact-head {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 1.5rem 4rem;
  align-items: end;
  margin-bottom: clamp(3rem, 6vw, 4.5rem);
}
.contact-heading { font-size: clamp(5rem, 14vw, 14rem); line-height: 0.85; }
.contact-lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--muted); max-width: 30rem; padding-bottom: 0.5em; }
.contact-links { margin-top: auto; border-top: 1px solid var(--line); }
.contact-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  font-size: clamp(1.05rem, 2.2vw, 1.5rem);
  transition: color 0.15s;
}
.contact-link-text { position: relative; overflow-wrap: anywhere; }
.contact-link-text::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}
.contact-link:hover { color: var(--accent); }
.contact-link:hover .contact-link-text::after { transform: scaleX(1); }
.contact-link-meta { color: var(--faint); display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
.contact-link:hover .contact-link-meta { color: var(--accent); }
/* Email row: the mailto link plus a sibling copy button (a button can't live inside a link) */
.contact-row { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.contact-row .contact-link { flex: 1; min-width: 0; border-bottom: 0; }
.contact-copy {
  flex-shrink: 0;
  margin-left: 1.25rem;
  padding: 0.6rem 0 0.6rem 1.25rem;
  border-left: 1px solid var(--line);
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--faint);
  transition: color 0.15s;
}
.contact-copy[hidden] { display: none; }
.contact-copy:hover, .contact-copy.is-copied { color: var(--accent); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-top: 3.5rem;
  color: var(--faint);
}

/* ── SCROLL REVEAL ──────────────────────────── */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.js .reveal.visible { opacity: 1; transform: none; }

/* ── RESPONSIVE ─────────────────────────────── */
@media (max-width: 1080px) {
  .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pillar:nth-child(2) { border-right: 0; padding-right: 0; }
  .pillar:nth-child(3) { padding-left: 0; }
  .pillar:nth-child(n+3) { border-top: 1px solid var(--line); }
  .compact-grid { grid-template-columns: 1fr; }
  .outside-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .hero-row, .case-head, .projects-head, .contact-head { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo-wrap { max-width: 22rem; }
  .story { grid-template-columns: 1fr; gap: 2rem; }
  .case-role { grid-template-columns: 1fr; margin-top: -0.5rem; }
  .pi-tag { display: none; }
  .pi-head { grid-template-columns: 2.25rem minmax(0, 1fr) auto; gap: 1rem; }
  .pi-body-inner { padding-left: 3.25rem; }
  .toolkit-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hour-grid { grid-template-columns: 1fr; }
  .ptt-config { grid-template-columns: 1fr 1fr; }
  .ptt-field--dates { grid-column: 1 / -1; }
  .hour-loop { width: min(260px, 80%); margin: 0 auto; }
  .hero-ambient { display: none; }
}
@media (max-width: 640px) {
  :root { --nav-h: 3.75rem; }
  .nav-mono { font-size: 1.35rem; }
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.7rem; letter-spacing: 0.08em; }
  .hero-proof { grid-template-columns: 1fr; gap: 1.1rem; }
  .hero-proof dt { white-space: nowrap; font-size: 2.25rem; }
  .hero-proof dd { margin-top: 0.2rem; }
  .btn { padding: 0.85rem 1.2rem; font-size: 0.75rem; }
  .pillars { grid-template-columns: 1fr; }
  .outside-grid { grid-template-columns: 1fr; }
  .sketch { max-width: 22rem; }
  .toolkit-groups { grid-template-columns: 1fr; gap: 1.5rem; }
  .testimonial-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .pillar, .pillar + .pillar { padding: 1.75rem 0; border-right: 0; }
  .pillar + .pillar { border-top: 1px solid var(--line); }
  .metrics { grid-template-columns: 1fr; }
  .metric { display: flex; align-items: baseline; gap: 1rem; padding: 1rem 1.25rem; }
  .metric dt { min-width: 4.75rem; font-size: 2.5rem; }
  .metric dd { margin-top: 0; }
  .metric + .metric { border-left: 0; border-top: 1px solid var(--line); }
  .case-num { margin-left: 0; }
  .vd-body { grid-template-columns: 46px minmax(0, 1fr); min-height: 380px; }
  .ptt-config { grid-template-columns: 1fr; padding: 1rem 1rem 0; }
  .ptt-progress { margin: 0 -1rem; }
  .ptt-results { padding: 1rem; }
  .ptt-col-win { display: none; }
  .ptt-table td, .ptt-table th { padding-left: 0.55rem; padding-right: 0.55rem; }
  .ptt-stat b { font-size: 1.6rem; }
  .vd-ico { width: 34px; height: 34px; }
  .vd-main { padding: 0.9rem 0.9rem 1rem; }
  .vd-section-sub { display: none; }
  .vd-fly { left: 52px; width: calc(100% - 60px); }
  .vd-table td:first-child { width: 3rem; }
  .vd-table td:nth-child(2) { white-space: nowrap; font-size: 0.72rem; }
  .vd-table th, .vd-table td { padding-right: 0.4rem; }
  .vd-actions { flex-wrap: wrap; justify-content: flex-end; }
  .vd-status { flex-basis: 100%; order: 2; text-align: right; }
  .vd-btn { white-space: nowrap; padding: 0.5rem 0.8rem; }
  .deliv-note span { font-size: 0.62rem; }
  .annot-note { display: none; }
  .annot--ring { width: 3.3rem; height: 2.8rem; bottom: calc(var(--v) - 0.85rem); }
  .cols { grid-template-columns: 2.25rem minmax(0, 1fr); gap: 0 0.5rem; }
  .cols-note { left: 2.75rem; }
  .cols-x { font-size: 0.6rem; }
  .col-label { font-size: 1.1rem; }
  .segs-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .more-icon { width: 2.75rem; height: 2.75rem; }
  .contact-link-meta .eyebrow { display: none; }
}

/* ── REDUCED MOTION ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}

@view-transition { navigation: auto; }
.nav-mono { view-transition-name: brand; }
