/* ---------------------------------------------------------------
   Daniel Yerushalmi — Portfolio · "The Drafting Table"
   Warm cream paper · graphite ink · redline orange.
   Space Grotesk (display) + IBM Plex Mono (utility layer).
   --------------------------------------------------------------- */

:root {
  --paper: #f3ecdd;      /* warm cream drawing paper */
  --paper-2: #eae0cb;    /* deeper cream, card panels */
  --ink: #262019;        /* warm graphite near-black */
  --ink-70: rgba(38, 32, 25, 0.7);
  --ink-45: rgba(38, 32, 25, 0.45);
  --line: rgba(38, 32, 25, 0.16);
  --grid: rgba(38, 32, 25, 0.055);
  --accent: #c4500e;     /* redline marker orange · 4.6:1 on paper */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 18px;
  --pad: clamp(1.25rem, 4vw, 4rem);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; } /* anchor links only — page scroll is native */

body {
  background-color: var(--paper);
  /* the drafting grid — persists across every chapter (background bridge) */
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 72px 72px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
ul, ol { list-style: none; }

.accent { color: var(--accent); }

.u-mono {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-70);
}

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

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

.skip-link {
  position: absolute; left: 1rem; top: -3.5rem; z-index: 200;
  background: var(--ink); color: var(--paper);
  padding: 0.5rem 1rem; border-radius: 999px;
  text-decoration: none; font-size: 0.9rem;
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

/* ------------------------------ Preloader ------------------------------ */

.preloader {
  position: fixed; inset: 0; z-index: 300;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 72px 72px;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.4rem var(--pad);
  will-change: transform;
}
.js .preloader { display: flex; }
.reduced .preloader { display: none !important; }

.pre-top, .pre-bottom {
  display: flex; justify-content: space-between; gap: 1rem;
}
.pre-accent { color: var(--accent); }

.pre-center {
  display: flex; align-items: baseline; gap: 1.4rem;
  margin: auto 0;
}
.pre-count {
  font-size: clamp(5rem, 16vw, 12rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.pre-label { color: var(--ink-45); line-height: 1.7; }

.pre-rule {
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* CAD cursor: site-wide crosshair + live coordinate readout.
   Inverts to cream (.cad--dark) while the pointer is over the contact sheet. */
.cad {
  position: fixed; inset: 0; z-index: 60;
  pointer-events: none;
  opacity: 0; visibility: hidden;
}
.cad-x {
  position: absolute; top: 0; bottom: 0; left: 0;
  width: 1px;
  background: rgba(38, 32, 25, 0.14);
}
.cad-y {
  position: absolute; left: 0; right: 0; top: 0;
  height: 1px;
  background: rgba(38, 32, 25, 0.14);
}
.cad-read {
  position: absolute; top: 0; left: 0;
  color: var(--ink-45);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.cad--dark .cad-x, .cad--dark .cad-y { background: rgba(243, 236, 221, 0.16); }
.cad--dark .cad-read { color: rgba(243, 236, 221, 0.6); }
@media (pointer: coarse) { .cad { display: none; } }

/* Redline progress hairline */
.progress {
  position: fixed; top: 0; left: 0; z-index: 90;
  width: 100%; height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ------------------------------ Nav ------------------------------ */

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem var(--pad);
  pointer-events: none;
}
.nav a { pointer-events: auto; transition: color 0.35s; }

/* Inverted while the dark contact panel is behind the nav (toggled by JS) */
.nav--inverted .nav-brand { color: var(--paper); }
.nav--inverted .nav-links a { color: rgba(243, 236, 221, 0.7); }
.nav--inverted .nav-links a:hover { color: var(--paper); }

.nav-brand {
  font-weight: 700; font-size: 1.2rem; text-decoration: none;
  letter-spacing: 0.01em;
}

.nav-links { display: flex; gap: 1.6rem; }
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-70); text-decoration: none;
  border-bottom: 1px dotted transparent;
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.nav-links a:hover { color: var(--ink); border-bottom-color: var(--accent); }

.scroll-cue {
  position: fixed; bottom: 1.4rem; left: 50%; z-index: 70;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.66rem; font-weight: 500;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-70);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  backdrop-filter: blur(6px);
  padding: 0.45rem 1rem; border-radius: 999px;
  transition: opacity 0.5s;
  pointer-events: none;
}
.scroll-cue.is-hidden { opacity: 0; }
@media (max-width: 719px) { .scroll-cue { display: none; } }

/* ------------------------------ Buttons ------------------------------ */

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-size: 0.95rem; font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  will-change: transform;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #3a3128; }
.btn-ghost { border-color: var(--ink-45); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-cream { background: var(--paper); color: var(--ink); }
.btn-outline { border-color: rgba(243, 236, 221, 0.5); color: var(--paper); }
.btn-outline:hover { border-color: var(--paper); }

/* ------------------------------ Hero ------------------------------ */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column;
  padding: 5.5rem var(--pad) 4.5rem;
}

.hero-top {
  display: flex; justify-content: space-between; gap: 1rem;
  padding-bottom: 2rem;
}
.hero-top span:nth-child(2) { display: none; }
@media (min-width: 720px) { .hero-top span:nth-child(2) { display: block; } }
.hero-top-right { color: var(--accent); }

.hero-mid {
  flex: 1;
  display: flex;
  gap: clamp(1rem, 2.5vw, 2.5rem);
  min-height: 44vh;
}

/* The sliced stage */
.name-stage {
  position: relative;
  flex: 1;
  min-width: 0;
  cursor: crosshair;
}

/* The interactive plotter column */
.hero-3d {
  width: min(35vw, 560px);
  display: flex; flex-direction: column;
  gap: 0.6rem;
}
.plotter-host {
  flex: 1;
  min-height: 0;
  cursor: crosshair;
  touch-action: pan-y;
}
.plotter-host canvas { display: block; width: 100%; height: 100%; }
.hero-3d-cap { color: var(--ink-45); text-align: center; }

@media (max-width: 899px) {
  .hero-mid { flex-direction: column; }
  .hero-3d { width: 100%; order: 2; }
  .plotter-host { min-height: 30vh; }
  .name-stage { min-height: 38vh; }
}

.hero-layer { position: absolute; inset: 0; }
.hero-layer--blueprint { visibility: hidden; } /* revealed only through slices (JS) */

.name-block {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center;
}

.name-line { display: block; overflow: hidden; }
.name-inner {
  display: inline-block;
  font-size: clamp(3rem, 10.2vw, 9.5rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
}
@media (max-width: 899px) {
  .name-inner { font-size: clamp(3rem, 12.5vw, 9.5rem); }
}

.name-block--outline .name-inner {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ink-70);
}
.bp-dot { color: transparent; -webkit-text-stroke: 1.5px var(--accent); }

/* Blueprint furniture (positions relative to the stage) */
.bp-frame {
  position: absolute; inset: 12% 2%;
  border: 1px dashed var(--ink-45);
}
.bp-sq {
  position: absolute; width: 7px; height: 7px;
  background: var(--accent);
}
.bp-sq--tl { top: calc(12% - 4px); left: calc(2% - 4px); }
.bp-sq--tr { top: calc(12% - 4px); right: calc(2% - 4px); }
.bp-sq--bl { bottom: calc(12% - 4px); left: calc(2% - 4px); }
.bp-sq--br { bottom: calc(12% - 4px); right: calc(2% - 4px); }

.bp-note { position: absolute; white-space: nowrap; }
.bp-note--tag { top: 5%; left: 2%; color: var(--accent); }
.bp-note--type { top: 5%; right: 2%; }
.bp-note--dim { bottom: 4%; left: 2%; }
.bp-note--note { bottom: 4%; right: 2%; }
@media (max-width: 719px) {
  .bp-note--type, .bp-note--note { display: none; }
}

/* Slices (built by JS): vertical strips, each holding clones of both layers */
.slice {
  position: absolute; top: 0; height: 100%;
  overflow: hidden;
}
.slice-inner { position: absolute; top: 0; height: 100%; width: 100%; }
.slice .hero-layer { visibility: visible; }
.slice .hero-layer--blueprint {
  clip-path: inset(100% 0 0 0);
  /* opaque draft sheet — the reveal REPLACES the surface, never double-exposes */
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(38, 32, 25, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 32, 25, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
}

.hero-bottom {
  display: flex; flex-wrap: wrap; align-items: flex-end;
  justify-content: space-between; gap: 1.5rem;
  padding-top: 2.5rem;
}
.hero-sub {
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  color: var(--ink-70);
  max-width: 30ch;
  flex: 1 1 260px;
}
.hero-links { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.hero-hint { width: 100%; color: var(--ink-45); }
@media (pointer: coarse) { .hero-hint { display: none; } }

/* ------------------------------ Display type ------------------------------ */

.display {
  font-size: clamp(2.6rem, 8.5vw, 7.5rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.line-mask { display: block; overflow: hidden; }
.line-in { display: inline-block; }
/* NOTE: no CSS initial transform here — GSAP owns .line-in entirely.
   (A CSS translateY(115%) gets baked into GSAP's pixel `y` channel and
   never animates back out; the reveal tween drives yPercent instead.) */

/* ------------------------------ Work (pinned horizontal) ------------------------------ */

.work { position: relative; }

.work-pin {
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 5.5rem 0 2.5rem;
  overflow: hidden;
}

.work-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 0 var(--pad) 2.2rem;
}
.work-annot { color: var(--ink-45); }

.track-wrap { width: 100%; }
.track {
  display: flex; gap: clamp(1rem, 2.5vw, 2rem);
  padding: 0 var(--pad);
  width: max-content;
  will-change: transform;
}

/* Editorial panels — compositions on the paper, not boxes */
.panel {
  width: min(80vw, 980px);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.5rem, 3.5vw, 3.5rem);
  align-items: center;
}
.panel--flip .panel-viz { order: 2; }
.panel--flip .panel-info { order: 1; }

.panel-viz {
  position: relative;
  aspect-ratio: 4 / 3;
  color: var(--ink-70);
  transform-style: preserve-3d;
  will-change: transform;
}
/* second project gets a tinted plate so the two panels read differently */
.panel-viz--plate {
  background: var(--paper-2);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
/* marching dashes on hover */
.panel-viz .bp-svg * { transition: stroke-dashoffset 1.4s ease; stroke-dashoffset: 0; }
.panel-viz:hover .bp-svg * { stroke-dashoffset: 40; }

.bp-svg {
  position: absolute; inset: 6%;
  width: 88%; height: 88%;
  margin: auto;
}
.bp-ctrl { fill: var(--accent); }

.ghost-num {
  position: absolute; top: -0.18em; right: -0.05em;
  font-size: clamp(7rem, 14vw, 12rem);
  font-weight: 700;
  color: rgba(38, 32, 25, 0.07);
  line-height: 1;
  user-select: none;
}

.media-label {
  position: absolute; bottom: 0.4rem; left: 0.6rem;
  color: var(--ink-45);
}

.panel-info { display: flex; flex-direction: column; gap: 0.85rem; }
.panel-kicker { color: var(--accent); }
.panel-title {
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.panel-desc { color: var(--ink-70); max-width: 42ch; }

/* Reserved slots — narrow dashed strips between the work */
.slot {
  position: relative;
  width: clamp(110px, 13vw, 180px);
  border-left: 1px dashed var(--ink-45);
  border-right: 1px dashed var(--ink-45);
  display: flex; flex-direction: column;
  align-items: center; justify-content: space-between;
  padding: 2rem 0;
  gap: 1.5rem;
  cursor: crosshair;
  transform-style: preserve-3d;
  will-change: transform;
}
.slot-num {
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  font-weight: 700;
  color: rgba(38, 32, 25, 0.14);
  line-height: 1;
  transition: color 0.35s;
}
.slot:hover .slot-num { color: var(--accent); }
.slot { text-decoration: none; }
.slot-text {
  writing-mode: vertical-rl;
  color: var(--ink-45);
  letter-spacing: 0.12em;
  transition: opacity 0.35s;
}
.slot:hover .slot-text, .slot:focus-visible .slot-text { opacity: 0; }

/* The empty desk is a CTA: hovering it offers the brief */
.slot-cta {
  position: absolute;
  left: 50%; bottom: 2rem;
  transform: translate(-50%, 8px);
  writing-mode: vertical-rl;
  color: var(--accent);
  letter-spacing: 0.12em;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}
.slot:hover .slot-cta, .slot:focus-visible .slot-cta {
  opacity: 1;
  transform: translate(-50%, 0);
}
.slot:hover { border-color: var(--accent); }

/* Ghost sketch: a future card drawn in when the empty slot is inspected */
.slot-sketch {
  position: absolute; inset: 6%;
  width: 88%; height: 88%;
  color: var(--ink-70);
  pointer-events: none;
}
.slot-sketch .sk {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.slot-sketch .sk-2 { transition-delay: 0.07s; }
.slot-sketch .sk-3 { transition-delay: 0.14s; }
.slot-sketch .sk-4 { transition-delay: 0.21s; }
.slot-sketch .sk-5 { transition-delay: 0.28s; }
.slot-sketch .sk-6 { transition-delay: 0.34s; }
.slot:hover .slot-sketch .sk { opacity: 1; transform: none; }

.tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.tags li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
  white-space: nowrap;
}

.card-links {
  align-self: flex-start;
  display: flex;
  gap: 1.4rem;
}
.card-link {
  align-self: flex-start;
  display: inline-block;
  font-weight: 500; font-size: 0.95rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.card-link:hover { border-bottom-color: var(--accent); }
.card-link.is-soon { color: var(--ink-45); border: 0; cursor: default; }

/* Panels stack on small screens */
@media (max-width: 899px) {
  .panel { grid-template-columns: 1fr; width: 84vw; gap: 1.2rem; }
  .panel--flip .panel-viz { order: 0; }
  .panel--flip .panel-info { order: 1; }
}

/* Reduced-motion / no-JS: track scrolls natively */
.reduced .track-wrap, html:not(.js) .track-wrap { overflow-x: auto; }

/* ------------------------------ Software band (Fig. 01-S) ------------------------------ */

.software {
  padding: clamp(6rem, 16vh, 10rem) var(--pad);
  border-top: 1px solid var(--line);
}

.software-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.4rem;
}
.software-title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.software-annot { color: var(--ink-45); }

.software-intro {
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  line-height: 1.7;
  color: var(--ink-70);
  max-width: 62ch;
  margin-bottom: clamp(2.6rem, 6vh, 4rem);
}

.sw-list { display: flex; flex-direction: column; gap: clamp(1.2rem, 2.5vw, 2rem); }

.sw {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: clamp(1.3rem, 2.6vw, 2.2rem);
  transition: border-color 0.3s;
}
.sw:hover { border-color: var(--ink-45); }

.sw-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.sw-kicker { color: var(--accent); }

/* Status stamp — the drafting-desk rubber stamp */
.sw-stamp {
  border: 1px dashed var(--ink-45);
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  color: var(--ink-45);
  white-space: nowrap;
}
.sw-stamp--dead {
  border-style: solid;
  border-color: var(--accent);
  color: var(--accent);
}
/* the one card whose claims can be checked against a public repo */
.sw-stamp--open {
  border-style: solid;
  border-color: var(--ink-45);
  color: var(--ink);
}

.sw-links {
  margin-top: 0.2rem;
  margin-bottom: 1.5rem;   /* when a probe sits directly below, don't crowd it */
  align-items: baseline;
  gap: 1.2rem;
  flex-wrap: wrap;
}
.sw-links:last-child { margin-top: 1.4rem; margin-bottom: 0; }
.sw-link-note { color: var(--ink-45); }

.sw-name {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 0.7rem;
}
.sw-desc { color: var(--ink-70); max-width: 68ch; margin-bottom: 1.4rem; }

/* Measured metrics — the instrument readout */
.sw-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  padding: 1rem 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  margin-bottom: 1.2rem;
}
.sw-metric dt { color: var(--ink-45); margin-bottom: 0.3rem; }
.sw-metric dd {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
@media (max-width: 619px) { .sw-metrics { grid-template-columns: repeat(2, 1fr); } }

.sw .tags { margin-bottom: 1.4rem; }

/* ---------- Test suite replay (Stir) ---------- */

.suite {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
  padding: 0.9rem 1rem 1rem;
}
.suite-top {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  color: var(--ink-45);
  margin-bottom: 0.7rem;
}
.suite-read { color: var(--accent); display: inline-flex; align-items: center; gap: 0.5em; }
.suite-n { font-variant-numeric: tabular-nums; }
.suite-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-45);
  transition: background 0.3s;
}
.suite.is-done .suite-dot { background: var(--accent); }

/* 188 cells — each one a real test. Capped so it reads as a matrix, not a bar. */
.suite-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11px, 1fr));
  gap: 3px;
  max-width: 660px;
  margin-bottom: 0.9rem;
}
.suite-cell {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  transform: scale(0.7);
  opacity: 0.5;
  transition: background 0.25s ease, transform 0.25s ease, opacity 0.25s ease, border-color 0.25s ease;
}
.suite-cell.is-pass {
  background: var(--accent);
  border-color: var(--accent);
  transform: none;
  opacity: 1;
}

.suite-run {
  font-family: inherit;
  background: none;
  border: 1px solid var(--ink-45);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  color: var(--ink-70);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.suite-run:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Post-mortem disclosure ---------- */

.pm { margin-top: 1.2rem; }
.pm-toggle {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: inherit;
  background: none; border: 0; padding: 0;
  color: var(--accent);
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.pm-toggle:hover { border-bottom-color: var(--accent); }
.pm-mark {
  width: 9px; height: 9px;
  background: var(--accent);
  transition: transform 0.35s cubic-bezier(0.7, 0, 0.2, 1);
}
.pm-toggle[aria-expanded="true"] .pm-mark { transform: rotate(45deg) scale(1.15); }

.pm-body {
  margin-top: 1.3rem;
  padding-left: clamp(0.8rem, 2vw, 1.4rem);
  border-left: 1px dashed var(--ink-45);
}
.pm-steps { display: flex; flex-direction: column; gap: 1.1rem; }
.pm-step-num { display: block; color: var(--accent); margin-bottom: 0.35rem; }
.pm-step p { color: var(--ink-70); max-width: 64ch; line-height: 1.65; }
.pm-verdict {
  margin-top: 1.4rem; padding-top: 1rem;
  border-top: 1px dashed var(--line);
  color: var(--ink-70);
  line-height: 1.6;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.78rem;
}

/* Animated open/close — JS drives an explicit pixel height, then releases to auto.
   [hidden] keeps it out of the a11y tree while closed. */
.js .pm-body.is-animating { overflow: hidden; }
.js .pm-body {
  transition: height 0.5s cubic-bezier(0.7, 0, 0.2, 1), opacity 0.35s ease;
}
.js .pm-body.is-closed { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .js .pm-body { transition-duration: 0.001s; }
}

/* ---------- Approval-policy probe (Jarvis) ---------- */

.probe {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
  padding: 0.9rem 1rem 1rem;
}
.probe-top {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  color: var(--ink-45);
  margin-bottom: 0.8rem;
}
.probe-hint { color: var(--accent); }
.probe-file { color: var(--ink-45); }

.probe-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.probe-chip {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  color: var(--ink-70);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.probe-chip:hover { border-color: var(--ink-45); color: var(--ink); }
.probe-chip.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.probe-out {
  display: flex; align-items: baseline; gap: 0.8rem; flex-wrap: wrap;
  padding: 0.85rem 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  min-height: 3.2rem;
}
.probe-verdict {
  border-radius: 999px;
  padding: 0.22rem 0.8rem;
  white-space: nowrap;
  flex: none;
  transition: background 0.25s, color 0.25s;
}
.probe-verdict[data-state="run"] { background: rgba(38, 32, 25, 0.08); color: var(--ink-70); }
.probe-verdict[data-state="hold"] { background: var(--accent); color: var(--paper); }
.probe-reason { color: var(--ink-70); font-size: 0.92rem; line-height: 1.5; }
.probe-note { color: var(--ink-45); margin-top: 0.8rem; }

/* ---------- Skill chips ---------- */

.skill-chips { display: flex; flex-direction: column; gap: 0; }
.skill-chips li {
  display: flex; align-items: baseline; gap: 0.9rem; flex-wrap: wrap;
  padding: 0.6rem 0.3rem;
  border-top: 1px dashed var(--line);
  color: var(--ink);
  transition: padding-left 0.3s, color 0.3s;
}
.skill-chips li:last-child { border-bottom: 1px dashed var(--line); }
.skill-chips li:hover { padding-left: 1rem; }
.skill-chips i { font-style: normal; color: var(--ink-45); }

/* ------------------------------ Early sheets (Fig. 01-E) ------------------------------ */

.early {
  padding: clamp(6rem, 16vh, 10rem) var(--pad);
  border-top: 1px solid var(--line);
}
.early-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.4rem;
}
.early-title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.early-annot { color: var(--ink-45); }
.early-intro {
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  line-height: 1.7;
  color: var(--ink-70);
  max-width: 56ch;
  margin-bottom: clamp(2.4rem, 5vh, 3.4rem);
}

.rev {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  padding: clamp(1.4rem, 3vw, 2.4rem);
}

.rev-panel { position: relative; min-height: 12.5rem; }
.rev-ghost {
  position: absolute; top: -0.3em; right: -0.02em;
  font-size: clamp(5rem, 11vw, 9rem);
  font-weight: 700;
  color: rgba(38, 32, 25, 0.06);
  line-height: 1;
  user-select: none;
  font-variant-numeric: tabular-nums;
}
.rev-meta { display: flex; gap: 1.2rem; margin-bottom: 0.7rem; }
.rev-stamp { color: var(--accent); }
.rev-date { color: var(--ink-45); }
.rev-name {
  font-size: clamp(1.6rem, 3.6vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin-bottom: 0.6rem;
}
.rev-desc { color: var(--ink-70); max-width: 54ch; margin-bottom: 1.2rem; }
.rev-metrics { display: flex; gap: 2.4rem; flex-wrap: wrap; }
.rev-metrics dt { color: var(--ink-45); margin-bottom: 0.25rem; }
.rev-metrics dd { color: var(--ink); font-variant-numeric: tabular-nums; }

/* the drafting rail */
.rev-rail { position: relative; margin-top: clamp(1.8rem, 4vh, 2.6rem); }
.rev-track {
  position: absolute; top: 9px; left: 0; right: 0;
  height: 2px;
  background: var(--line);
  pointer-events: none;
}
.rev-fill {
  display: block; height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.4s cubic-bezier(0.7, 0, 0.2, 1);
}

.rev-input {
  -webkit-appearance: none; appearance: none;
  position: relative; z-index: 2;
  width: 100%; height: 20px;
  background: transparent;
  cursor: grab;
  margin: 0;
}
.rev-input:active { cursor: grabbing; }
.rev-input::-webkit-slider-runnable-track { height: 20px; background: transparent; }
.rev-input::-moz-range-track { height: 20px; background: transparent; }
.rev-input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--paper-2);
  box-shadow: 0 0 0 1px var(--accent);
  cursor: grab;
  transition: transform 0.2s;
}
.rev-input::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--paper-2);
  box-shadow: 0 0 0 1px var(--accent);
  cursor: grab;
}
.rev-input:hover::-webkit-slider-thumb { transform: scale(1.15); }
.rev-input:focus-visible { outline: none; }
.rev-input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 1px var(--accent), 0 0 0 5px rgba(196, 80, 14, 0.28); }
.rev-input:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 1px var(--accent), 0 0 0 5px rgba(196, 80, 14, 0.28); }

.rev-ticks {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin-top: 0.5rem;
  color: var(--ink-45);
}
.rev-ticks li { position: relative; text-align: center; }
.rev-ticks li::before {
  content: ""; position: absolute; top: -0.75rem; left: 50%;
  width: 1px; height: 6px;
  background: var(--ink-45);
}
.rev-ticks li:first-child { text-align: left; }
.rev-ticks li:first-child::before { left: 2px; }
.rev-ticks li:last-child { text-align: right; }
.rev-ticks li:last-child::before { left: auto; right: 2px; }

/* ------------------------------ Process ------------------------------ */

.process {
  padding: clamp(7rem, 22vh, 13rem) var(--pad);
  position: relative;
}
.section-annot { color: var(--accent); margin-bottom: 2.2rem; }

.statement-line {
  font-size: clamp(2.4rem, 7.5vw, 6.4rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
  will-change: transform;
}
.statement-line--small {
  font-size: clamp(1.1rem, 2.6vw, 1.9rem);
  font-weight: 500;
  color: var(--ink-70);
  margin-top: 1.6rem;
}

.annot {
  position: relative;
  border-bottom: 2px dotted var(--accent);
  cursor: help;
}
.annot::after {
  content: attr(data-note);
  position: absolute; left: 50%; bottom: calc(100% + 0.5em);
  transform: translateX(-50%) translateY(4px);
  font-family: var(--font-mono);
  font-size: 0.62rem; font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--paper);
  background: var(--ink);
  padding: 0.35em 0.8em;
  border-radius: 999px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
.annot:hover::after, .annot:focus::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.process-copy {
  margin-top: clamp(3rem, 8vh, 5rem);
  max-width: 56ch;
  margin-left: auto;
}
.process-copy p {
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  line-height: 1.7;
  color: var(--ink-70);
}
.process-copy p + p { margin-top: 1.2rem; }
.js .reveal-p { opacity: 0; transform: translateY(24px); }
.js.reduced .reveal-p { opacity: 1; transform: none; }

/* ------------------------------ About ------------------------------ */

.about {
  padding: clamp(6rem, 18vh, 11rem) var(--pad);
  border-top: 1px solid var(--line);
}

.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}

.about-title {
  font-size: clamp(1.5rem, 3.2vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.18;
  margin-bottom: 1.8rem;
  max-width: 24ch;
}

.about-copy p {
  font-size: clamp(1.02rem, 1.7vw, 1.2rem);
  line-height: 1.7;
  color: var(--ink-70);
  max-width: 52ch;
}
.about-copy p + p { margin-top: 1.1rem; }

.spec-card {
  position: relative;
  border: 1px solid var(--line);
  background: var(--paper-2);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem 1.6rem;
  transform-style: preserve-3d;
  will-change: transform;
  margin-top: 0.4rem;
}
.spec-title { color: var(--accent); margin-bottom: 1.1rem; }
.spec-list div {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.55rem 0;
  border-top: 1px dashed var(--line);
}
.spec-list dt { color: var(--ink-45); }
.spec-list dd { text-align: right; }
.spec-sq { position: static; display: block; margin-top: 1.1rem; margin-left: auto; }

@media (max-width: 899px) {
  .about-grid { grid-template-columns: 1fr; }
}

/* ------------------------------ Method timeline ------------------------------ */

.method {
  margin-top: clamp(4rem, 10vh, 7rem);
  position: relative;
}

.method-line {
  position: absolute;
  top: 3px; left: 0; right: 0;
  height: 2px;
  background: var(--line);
}
.method-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.method-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.2rem;
}

.method-step { position: relative; padding-top: 1.6rem; }
.method-node {
  position: absolute; top: 0; left: 0;
  width: 8px; height: 8px;
  background: var(--accent);
  transition: transform 0.25s;
}
.method-step:hover .method-node { transform: scale(1.8) rotate(45deg); }
.method-num { color: var(--ink-45); display: block; margin-bottom: 0.3rem; }
.method-name { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.35rem; }
.method-desc { font-size: 0.9rem; color: var(--ink-70); line-height: 1.55; max-width: 24ch; }

@media (max-width: 899px) {
  .method-line { display: none; }
  .method-steps { grid-template-columns: 1fr; gap: 0; }
  .method-step {
    padding: 1.1rem 0 1.1rem 1.4rem;
    border-left: 1px dashed var(--ink-45);
  }
  .method-node { left: -4.5px; top: 1.4rem; }
}

/* ------------------------------ Instruments bench ------------------------------ */

.instruments {
  padding: clamp(6rem, 16vh, 10rem) var(--pad);
  border-top: 1px solid var(--line);
}

.bench-title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2.4rem;
}

.bench-row {
  display: grid;
  grid-template-columns: 3.5rem 1fr auto;
  align-items: baseline;
  gap: 1rem;
  padding: 1.15rem 0.4rem;
  border-top: 1px solid var(--line);
  transition: padding-left 0.3s, background 0.3s;
}
.bench-row:last-child { border-bottom: 1px solid var(--line); }
.bench-row:hover { padding-left: 1.4rem; background: rgba(38, 32, 25, 0.03); }
.bench-num { color: var(--ink-45); transition: color 0.3s; }
.bench-row:hover .bench-num { color: var(--accent); }
.bench-name {
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.bench-spec { color: var(--ink-45); text-align: right; }

/* Dimension callout: measures the instrument on hover (count driven by JS) */
.bench-dim {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 0.55rem;
  height: 0; opacity: 0;
  overflow: hidden;
  transition: height 0.35s ease, opacity 0.3s ease;
}
.bench-row:hover .bench-dim { height: 1.5rem; opacity: 1; }
.bench-dim-tick { width: 1px; height: 10px; background: var(--accent); flex: none; }
.bench-dim-line {
  flex: 1; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.5s ease 0.08s;
}
.bench-dim-line--l { transform-origin: 100% 50%; }
.bench-dim-line--r { transform-origin: 0 50%; }
.bench-row:hover .bench-dim-line { transform: scaleX(1); }
.bench-dim-label { color: var(--accent); white-space: nowrap; }
.bench-dim-count { font-variant-numeric: tabular-nums; }

@media (max-width: 719px) {
  .bench-row { grid-template-columns: 2.4rem 1fr; }
  .bench-spec { grid-column: 2; text-align: left; }
}

/* ------------------------------ Ledger — business coursework deck ------------------------------ */

.ledger {
  padding: clamp(6rem, 16vh, 10rem) var(--pad);
  border-top: 1px solid var(--line);
}

.ledger-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.4rem;
}
.ledger-title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.ledger-annot { color: var(--ink-45); }

.ledger-intro {
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  line-height: 1.7;
  color: var(--ink-70);
  max-width: 62ch;
  margin-bottom: clamp(2.6rem, 6vh, 4rem);
}

/* The credential deck — filed cards that flip to their syllabus back */
.deck {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1rem, 1.8vw, 1.4rem);
}
@media (max-width: 899px) { .deck { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 519px) { .deck { grid-template-columns: 1fr; } }

.deck-card {
  position: relative;
  display: grid;            /* stretches the inner to the row height, so every
                               card in a row fills its cell even when a sibling
                               is taller than its own content */
  perspective: 1400px;      /* renders the child's rotateY flip in 3D */
  cursor: pointer;
  will-change: transform;   /* GSAP owns the hover tilt (data-tilt) */
}
.deck-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--radius); }

/* Both faces share one grid cell, so the card takes the height of the TALLER
   face instead of a fixed min-height. Absolutely-positioned faces couldn't push
   the card open, so a long syllabus back was silently clipped between roughly
   900px and 1150px, where the column is narrow but the card hasn't grown yet. */
.deck-card-inner {
  position: relative;
  display: grid;
  transform-style: preserve-3d;
  transition: transform 0.75s cubic-bezier(0.7, 0, 0.2, 1);
}
/* hover + keyboard focus reveal the back (no-JS safe); tap pins it via .is-flipped (JS) */
.deck-card:hover .deck-card-inner,
.deck-card:focus-visible .deck-card-inner,
.deck-card.is-flipped .deck-card-inner { transform: rotateY(180deg); }

.deck-face {
  grid-area: 1 / 1;          /* stack both faces in the same cell */
  position: relative;
  min-height: clamp(320px, 30vw, 380px);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.35rem 1.4rem;
  overflow: hidden;          /* clips the oversized ghost numeral, not the copy */
}
.deck-face--front { background: var(--paper); }
.deck-face--back { transform: rotateY(180deg); background: var(--paper-2); }

.deck-kicker { color: var(--accent); }

.deck-ghost {
  position: absolute; top: -0.12em; right: 0.04em;
  font-size: clamp(5rem, 9vw, 7.5rem);
  font-weight: 700;
  color: rgba(38, 32, 25, 0.06);
  line-height: 1;
  user-select: none;
}

.deck-icon-wrap {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  margin: 0.4rem 0;
}
/* Capped: the card now sizes to its content, so an uncapped 74%-wide icon would
   drag the whole deck taller on wide screens. */
.deck-icon { width: 74%; max-width: 190px; height: auto; color: var(--ink-70); }
.deck-icon * { transition: stroke-dashoffset 1.4s ease; stroke-dashoffset: 0; }
.deck-card:hover .deck-icon * { stroke-dashoffset: 40; } /* marching dashes, like the work panels */
.deck-icon .bp-ctrl { fill: var(--accent); }

.deck-title {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.05;
}
.deck-flip { margin-top: 0.7rem; color: var(--ink-45); }

.deck-face--back .deck-desc {
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--ink-70);
  margin: 0.6rem 0 auto;
}
.deck-apply { color: var(--accent); margin-bottom: 0.7rem; line-height: 1.5; }
.deck-stamp {
  align-self: flex-start;
  border: 1px dashed var(--ink-45);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  color: var(--ink-45);
}

/* Syosset business track — supporting roster below the college-credit deck.
   Lighter, static cards (no flip): the honest tier below college credit. */
.roster-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  margin: clamp(2.6rem, 6vh, 3.8rem) 0 1.2rem;
}
.roster-kicker { color: var(--accent); }
.roster-note { color: var(--ink-45); }

.roster {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.8rem, 1.6vw, 1.2rem);
}
@media (max-width: 719px) { .roster { grid-template-columns: 1fr; } }

.roster-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 1.15rem 1.25rem 1.3rem;
  transform-style: preserve-3d;
  will-change: transform;
  transition: border-color 0.3s;
}
.roster-card:hover { border-color: var(--ink-45); }
.roster-mark {
  position: absolute; top: 1.1rem; right: 1.1rem;
  width: 7px; height: 7px;
  background: var(--accent);
}
.roster-kick { color: var(--ink-45); margin-bottom: 0.7rem; }
.roster-name {
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.12;
  margin-bottom: 0.5rem;
  max-width: 14ch;
}
.roster-desc { font-size: 0.9rem; color: var(--ink-70); line-height: 1.5; max-width: 32ch; }

/* Transcript strip — the two institutions, registration-marked */
.ledger-strip {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.7rem 2rem;
  margin-top: clamp(2.2rem, 5vh, 3.2rem);
  padding-top: 1.3rem;
  border-top: 1px dashed var(--line);
  color: var(--ink-45);
}
.ledger-entry { display: inline-flex; align-items: center; }
.ledger-balance { margin-left: auto; color: var(--accent); }
@media (max-width: 519px) { .ledger-balance { margin-left: 0; } }

/* Reduced motion: keep the flip legible but drop the long ease */
@media (prefers-reduced-motion: reduce) {
  .deck-card-inner { transition-duration: 0.001s; }
}

/* ------------------------------ Currently drafting ------------------------------ */

.drafting {
  padding: clamp(5rem, 14vh, 9rem) var(--pad);
  border-top: 1px solid var(--line);
}

.order {
  max-width: 640px;
  margin-inline: auto;
  border: 1px dashed var(--ink-45);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem 1.8rem;
  transform-style: preserve-3d;
  will-change: transform;
}

.order-head {
  display: flex; justify-content: space-between; gap: 1rem;
  color: var(--ink-45);
  margin-bottom: 1.6rem;
}
.order-status { color: var(--accent); display: inline-flex; align-items: center; gap: 0.5em; }
.pulse-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  display: inline-block;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .pulse-dot { animation: none; } }

.order-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.9rem;
}
.order-desc { color: var(--ink-70); max-width: 46ch; margin-bottom: 1.6rem; }

/* Redline pen marks: drawn onto the work order as it scrolls into view */
.redline { position: relative; white-space: nowrap; }
.redline svg { position: absolute; overflow: visible; pointer-events: none; }
.redline--circle svg {
  left: -0.55em; top: -0.4em;
  width: calc(100% + 1.1em); height: calc(100% + 0.75em);
}
.redline--underline svg {
  left: -2px; bottom: -0.3em;
  width: calc(100% + 4px); height: 0.4em;
}
.redline path {
  stroke: var(--accent);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.order.is-drawn .redline--underline path {
  transition: stroke-dashoffset 0.7s ease 0.15s;
  stroke-dashoffset: 0;
}
.order.is-drawn .redline--circle path {
  transition: stroke-dashoffset 0.9s ease 0.6s;
  stroke-dashoffset: 0;
}
.reduced .redline path, html:not(.js) .redline path { stroke-dashoffset: 0; }

.order-log li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.55rem 0;
  border-top: 1px dashed var(--line);
  color: var(--ink-70);
}

/* ------------------------------ Skills marquee ------------------------------ */

.skills {
  padding: clamp(3rem, 10vh, 6rem) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.marquee-row { overflow: hidden; white-space: nowrap; }
.marquee-row + .marquee-row { margin-top: 0.6rem; }

.marquee-inner {
  display: inline-flex; align-items: center;
  will-change: transform;
  font-size: clamp(1.4rem, 3.6vw, 2.6rem) !important;
  letter-spacing: 0.02em !important;
  color: var(--ink);
}
.marquee-row--alt .marquee-inner { color: var(--ink-45); }

.marquee-item { padding: 0.35em 0; }
.marquee-sep { color: var(--accent); padding: 0 0.7em; font-size: 0.5em; }

/* ------------------------------ Contact panel ------------------------------ */

.contact { padding: clamp(2rem, 6vh, 5rem) clamp(0.8rem, 2.5vw, 2.5rem); }

.contact-panel {
  position: relative;
  background: var(--ink);
  color: var(--paper);
  border-radius: 28px;
  padding: clamp(4rem, 12vh, 8rem) var(--pad) 2.4rem;
  min-height: 78vh;
  display: flex; flex-direction: column; justify-content: center;
  will-change: transform;
}

.reg {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: rgba(243, 236, 221, 0.4);
  user-select: none;
}
.reg--tl { top: 1rem; left: 1.2rem; }
.reg--tr { top: 1rem; right: 1.2rem; }
.reg--bl { bottom: 1rem; left: 1.2rem; }
.reg--br { bottom: 1rem; right: 1.2rem; }

.contact-annot { color: rgba(243, 236, 221, 0.5); margin-bottom: 2rem; }

.display--contact { color: var(--paper); }
.display--contact .accent { color: #e8763a; } /* brighter redline on ink */

.contact-links {
  display: flex; flex-wrap: wrap; gap: 0.8rem;
  margin-top: 2.8rem;
}

/* The actual address block — what a hiring committee needs */
.contact-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 0 clamp(1.5rem, 4vw, 3.5rem);
  margin-top: clamp(2.6rem, 6vh, 3.6rem);
  max-width: 1100px;
}
.contact-card > div {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.6rem 0;
  border-top: 1px dashed rgba(243, 236, 221, 0.2);
}
.contact-card dt { color: rgba(243, 236, 221, 0.5); }
.contact-card dd { text-align: right; color: var(--paper); }
.contact-card a {
  text-decoration: none;
  border-bottom: 1px solid rgba(243, 236, 221, 0.3);
  transition: border-color 0.2s, color 0.2s;
}
.contact-card a:hover { border-bottom-color: #e8763a; color: #e8763a; }
.contact-card .accent { color: #e8763a; }

.contact-meta {
  display: flex; flex-wrap: wrap; gap: 1rem 2.5rem;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 3rem;
  color: rgba(243, 236, 221, 0.55);
}

/* Work-order log CTA */
.log-cta {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.log-cta:hover { border-bottom-color: var(--accent); }

/* ------------------------------ Motion guards ------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* =====================================================================
   LEGAL SHEETS (privacy, terms)
   Plain documents on the same drawing paper: a sticky index, the text,
   and no motion system. They load without GSAP so they always render.
   ===================================================================== */

.legal-main { padding: clamp(7rem, 14vh, 10rem) var(--pad) 0; }
.legal-head { max-width: 62ch; display: grid; gap: 1rem; }
.legal-head .display { font-size: clamp(2.4rem, 7vw, 5.5rem); }
.legal-lede { font-size: clamp(1.05rem, 1.9vw, 1.35rem); color: var(--ink-70); max-width: 54ch; }

.legal-grid {
  display: grid; grid-template-columns: minmax(170px, 1fr) minmax(0, 2.7fr);
  gap: 2.5rem clamp(2rem, 6vw, 7rem);
  align-items: start;
  padding: clamp(3rem, 8vh, 6rem) 0 clamp(5rem, 12vh, 9rem);
}
.legal-index { position: sticky; top: 5.5rem; }
.legal-index ol { list-style: none; display: grid; gap: 0.7rem; counter-reset: part; }
.legal-index li { counter-increment: part; }
.legal-index a { color: var(--ink-70); text-decoration: none; }
.legal-index a::before { content: counter(part, decimal-leading-zero) "  "; color: var(--accent); white-space: pre; }
.legal-index a:hover { color: var(--ink); }

.legal-body { display: grid; gap: 3.2rem; }
.legal-part { border-top: 1px solid var(--line); padding-top: 1.1rem; display: grid; gap: 0.8rem; scroll-margin-top: 5.5rem; }
.legal-part h2 { font-size: clamp(1.4rem, 3vw, 2.1rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.legal-part p, .legal-part li { color: var(--ink-70); max-width: 64ch; }
.legal-part a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
/* the global reset strips list markers; the legal lists are the one place that wants them back */
.legal-list { list-style: disc; padding-left: 1.2em; display: grid; gap: 0.5rem; }
.legal-list li::marker { color: var(--ink-45); }

.legal-table { overflow-x: auto; }
.legal-table table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.legal-table th {
  text-align: left; font-family: var(--font-mono); font-size: 0.7rem;
  letter-spacing: 0.04em; text-transform: uppercase; font-weight: 500;
  color: var(--ink-45); padding: 0 1rem 0.6rem 0; border-bottom: 1px solid var(--line);
}
.legal-table td { vertical-align: top; padding: 0.75rem 1rem 0.75rem 0; border-bottom: 1px solid var(--line); color: var(--ink-70); }
.legal-table td:first-child { color: var(--ink); font-family: var(--font-mono); font-size: 0.8rem; }

.legal-foot {
  border-top: 1px solid var(--line);
  padding: 1.6rem var(--pad) 2.4rem;
  display: flex; flex-wrap: wrap; gap: 0.6rem 1.6rem; justify-content: space-between;
  color: var(--ink-45);
}
.legal-foot a { color: var(--ink-70); text-decoration: none; border-bottom: 1px dotted var(--line); }
.legal-foot a:hover { color: var(--ink); border-bottom-color: var(--accent); }

/* the legal links added to the main site's contact panel */
.contact-legal { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; }
.contact-legal a { color: rgba(243, 236, 221, 0.7); text-decoration: none; border-bottom: 1px dotted rgba(243, 236, 221, 0.3); }
.contact-legal a:hover { color: var(--paper); border-bottom-color: #e8763a; }

@media (max-width: 859px) {
  .legal-grid { grid-template-columns: 1fr; }
  .legal-index { position: static; }
}
