/* ─────────────────────────────────────────────
   Critical Path Initiative — stylesheet
   Aesthetic: editorial-technical · cream paper
   Type:  Fraunces · Onest · JetBrains Mono
   Accent: vermillion (#CC3825)
   ───────────────────────────────────────────── */

:root {
  --paper:        #F2EDE0;   /* warm cream — body */
  --paper-2:      #E5DCC4;   /* darker cream — diagram & cards (now distinctly separate) */
  --ink:          #1A1714;   /* warm near-black */
  --ink-soft:     #3D3733;
  --ink-mute:     #6E665B;
  --ink-faint:    #9A9285;
  --rule:         rgba(26, 23, 20, 0.12);
  --rule-strong:  rgba(26, 23, 20, 0.32);
  --accent:       #CC3825;   /* vermillion */
  --accent-deep:  #A82817;
  --accent-tint:  rgba(204, 56, 37, 0.08);

  --serif: "Fraunces", "Georgia", "Times New Roman", serif;
  --sans:  "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --max-w: 1280px;
  --pad-x: clamp(24px, 5vw, 80px);

  --ease: cubic-bezier(0.7, 0.05, 0.25, 1);
  --ease-soft: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--ink-faint) var(--paper);
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01", "kern";
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
}

::selection {
  background: var(--accent);
  color: var(--paper);
}

a {
  color: inherit;
  text-decoration: none;
}

img, svg { display: block; max-width: 100%; }

/* ─────────────  ATMOSPHERE  ───────────── */

/* paper grain overlay (subtle SVG noise) */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.09  0 0 0 0 0.08  0 0 0 0.18 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
}

/* graph-paper grid, faded at the edges */
.paper-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, var(--rule) 1px, transparent 1px),
    linear-gradient(to bottom, var(--rule) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: -1px -1px;
  opacity: 0.55;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 90%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 90%);
}

main, header, footer { position: relative; z-index: 2; }

/* ─────────────  TOP BAR  ───────────── */

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px 24px;
  flex-wrap: wrap;
  padding: 22px var(--pad-x);
  border-bottom: 1px solid var(--rule-strong);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 50;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--rule);
  background: var(--paper-2);
  color: var(--ink);
  border-radius: 2px;
  transition: transform 0.5s var(--ease-soft), border-color 0.3s ease;
}
.logo:hover .logo-mark {
  transform: rotate(-6deg);
  border-color: var(--ink);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.02em;
  font-optical-sizing: auto;
}
.logo-line-2 {
  font-style: italic;
  font-weight: 400;
  color: var(--ink-soft);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  font-weight: 500;
  flex-wrap: wrap;
}
.top-nav a {
  position: relative;
  color: var(--ink-soft);
  transition: color 0.2s ease;
  padding: 6px 0;
}
.top-nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-soft);
}
.top-nav a:hover { color: var(--ink); }
.top-nav a:hover::after { transform: scaleX(1); }

/* Editorial tag — sharp corners, no pulse */
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--ink-soft);
  background: var(--paper);
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ──  Top-bar mobile  ── */
@media (max-width: 880px) {
  .top-bar {
    padding: 18px var(--pad-x);
    gap: 14px 20px;
  }
  .top-nav { gap: 22px; font-size: 13.5px; }
  .top-nav .status-tag { display: none; }
}

@media (max-width: 720px) {
  .top-bar {
    padding: 16px var(--pad-x);
  }
  .top-bar .logo-text { font-size: 17px; }
  .top-bar .logo-mark { width: 36px; height: 36px; }
  .top-nav {
    width: 100%;
    gap: 18px;
    font-size: 13px;
    padding-top: 8px;
    border-top: 1px solid var(--rule);
  }
  .top-nav a { padding: 4px 0; }
}

@media (max-width: 380px) {
  .top-nav { gap: 14px; font-size: 12px; }
}

/* ─────────────  TYPOGRAPHY HELPERS  ───────────── */

.section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 16px;
}
.section-num {
  color: var(--accent);
  font-weight: 500;
}
.section-rule {
  flex: 1;
  height: 1px;
  background: var(--rule);
  max-width: 96px;
}
.section-label { font-weight: 500; }

.section-deck {
  font-family: var(--serif);
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 400;
  font-style: italic;
  color: var(--ink-soft);
  font-optical-sizing: auto;
  max-width: 760px;
  margin-bottom: 64px;
}

/* ─────────────  HERO  ───────────── */

.hero {
  padding: clamp(60px, 9vh, 110px) var(--pad-x) clamp(60px, 8vh, 100px);
  max-width: var(--max-w);
  margin: 0 auto;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.meta-divider {
  width: 24px;
  height: 1px;
  background: var(--rule-strong);
}

.hero-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(72px, 13.5vw, 220px);
  line-height: 0.92;
  letter-spacing: -0.045em;
  font-optical-sizing: auto;
  color: var(--ink);
  margin-bottom: clamp(64px, 8vh, 96px);
}
.hero-title .line {
  display: block;
  opacity: 0;
  transform: translateY(28px);
  animation: hero-rise 1.1s var(--ease-soft) forwards;
}
.hero-title .line-1 { animation-delay: 0.1s; }
.hero-title .line-2 { animation-delay: 0.32s; padding-left: clamp(32px, 6vw, 120px); }
.hero-title .line-3 { animation-delay: 0.54s; padding-left: clamp(64px, 12vw, 240px); }

.hero-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  font-optical-sizing: auto;
  position: relative;
  margin: 0 0.04em;
}
.hero-title em::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0.04em;
  width: 100%; height: 0.04em;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  animation: underline-grow 1s var(--ease-soft) 1.1s forwards;
}
.hero-title .period { color: var(--accent); }

@keyframes hero-rise {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes underline-grow {
  to { transform: scaleX(1); }
}

.hero-foot {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  opacity: 0;
  animation: hero-rise 1s var(--ease-soft) 0.95s forwards;
}

.hero-lede {
  font-family: var(--serif);
  font-size: clamp(20px, 2.1vw, 26px);
  line-height: 1.4;
  letter-spacing: -0.012em;
  color: var(--ink);
  font-weight: 400;
  font-optical-sizing: auto;
  max-width: 640px;
}

/* Pure serif italic citation (no mono mixing) */
.hero-citation {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.55;
  color: var(--ink-soft);
  font-optical-sizing: auto;
  padding-left: 16px;
  border-left: 1px solid var(--rule-strong);
}
.hero-citation em {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
}
.cit-attr {
  display: block;
  font-style: normal;
  font-variant-caps: small-caps;
  font-feature-settings: "smcp", "kern";
  letter-spacing: 0.06em;
  font-size: 0.82em;
  color: var(--ink-mute);
}
.cit-attr::before {
  content: '— ';
  font-variant-caps: normal;
  letter-spacing: 0;
}

@media (max-width: 720px) {
  .hero-foot { grid-template-columns: 1fr; gap: 28px; }
  .hero-title .line-2 { padding-left: 24px; }
  .hero-title .line-3 { padding-left: 48px; }
}

/* ─────────────  CPM DIAGRAM  ───────────── */

.cpm-diagram {
  margin-top: clamp(60px, 9vh, 96px);
  opacity: 0;
  animation: hero-rise 1.2s var(--ease-soft) 1.3s forwards;
}

.figure-caption {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.fig-num {
  color: var(--accent);
  font-weight: 500;
}
.fig-text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--ink-soft);
  font-optical-sizing: auto;
}

.diagram-frame {
  background:
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent 39px,
      var(--rule) 39px,
      var(--rule) 40px
    ),
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 39px,
      var(--rule) 39px,
      var(--rule) 40px
    ),
    var(--paper-2);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 24px;
  position: relative;
}

/* All four corner crosshairs */
.frame-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid var(--ink);
  background: var(--paper);
}
.frame-corner-tl { top: -7px; left: -7px; }
.frame-corner-tr { top: -7px; right: -7px; }
.frame-corner-bl { bottom: -7px; left: -7px; }
.frame-corner-br { bottom: -7px; right: -7px; }

.cpm-diagram svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

/* Mobile vertical stack — hidden on desktop */
.cpm-stack { display: none; }

/* Edges */
.cpm-diagram .edge {
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 1300;
  stroke-dashoffset: 1300;
}
.in-view .cpm-diagram .edge {
  animation: draw 1.2s var(--ease) forwards;
}

.cpm-diagram .edge.critical {
  stroke: var(--accent);
  stroke-width: 2.6;
}
.cpm-diagram .edges-critical .edge:nth-child(1) { animation-delay: 0.4s; }

.cpm-diagram .edge.slack {
  stroke: var(--ink-mute);
  stroke-width: 1.2;
  stroke-dasharray: 4 5;
  opacity: 0;
  animation: fade-in 0.9s var(--ease) forwards;
}
.cpm-diagram .edges-slack .edge:nth-child(1) { animation-delay: 1.7s; }
.cpm-diagram .edges-slack .edge:nth-child(2) { animation-delay: 1.85s; }

@keyframes draw {
  to { stroke-dashoffset: 0; }
}
@keyframes fade-in {
  to { opacity: 1; }
}

.cpm-diagram .slack-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  fill: var(--ink-mute);
  opacity: 0;
  animation: fade-in 0.6s var(--ease) 2.0s forwards;
}

/* nodes */
.cpm-diagram .node circle {
  fill: var(--paper-2);
  stroke: var(--ink);
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0);
  animation: pop 0.55s var(--ease-soft) forwards;
}
.cpm-diagram .node-critical circle {
  fill: var(--paper);
  stroke: var(--accent);
  stroke-width: 2;
}
.cpm-diagram .node-terminal circle {
  fill: var(--ink);
  stroke: var(--ink);
}

.cpm-diagram .node-glyph {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  fill: var(--ink);
  text-anchor: middle;
  dominant-baseline: central;
  opacity: 0;
  animation: fade-in 0.5s var(--ease) forwards;
}
.cpm-diagram .node-critical .node-glyph { fill: var(--accent); font-weight: 600; }
.cpm-diagram .node-terminal .node-glyph { fill: var(--paper); font-weight: 500; }

.cpm-diagram .node-label {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  font-weight: 500;
  fill: var(--ink-soft);
  text-anchor: middle;
  font-optical-sizing: auto;
  opacity: 0;
  animation: fade-in 0.6s var(--ease) forwards;
}
.cpm-diagram .node-critical .node-label { fill: var(--accent); }

/*
  Node pop-in delays — synced to the critical-path stroke sweep.
  Path strokes from x=78 to x=1122 (length 1044) over 1.2s, starting at 0.4s.
  Each node pops the moment the sweep reaches its x-coordinate.

  Node order (1-indexed among siblings of the SVG):
    1=ticks, 2=edges-slack, 3=slack-labels, 4=edges-critical,
    5=B (terminal),
    6=01 (x=240),
    7=02 (x=420),
    8=03 (x=600),
    9=04 (x=780),
    10=05 (x=960),
    11=D (terminal, x=1140),
    12=legend
*/
.cpm-diagram .node:nth-child(5)  circle,
.cpm-diagram .node:nth-child(5)  .node-glyph,
.cpm-diagram .node:nth-child(5)  .node-label { animation-delay: 0.30s; }
.cpm-diagram .node:nth-child(6)  circle,
.cpm-diagram .node:nth-child(6)  .node-glyph,
.cpm-diagram .node:nth-child(6)  .node-label { animation-delay: 0.59s; }
.cpm-diagram .node:nth-child(7)  circle,
.cpm-diagram .node:nth-child(7)  .node-glyph,
.cpm-diagram .node:nth-child(7)  .node-label { animation-delay: 0.79s; }
.cpm-diagram .node:nth-child(8)  circle,
.cpm-diagram .node:nth-child(8)  .node-glyph,
.cpm-diagram .node:nth-child(8)  .node-label { animation-delay: 1.00s; }
.cpm-diagram .node:nth-child(9)  circle,
.cpm-diagram .node:nth-child(9)  .node-glyph,
.cpm-diagram .node:nth-child(9)  .node-label { animation-delay: 1.21s; }
.cpm-diagram .node:nth-child(10) circle,
.cpm-diagram .node:nth-child(10) .node-glyph,
.cpm-diagram .node:nth-child(10) .node-label { animation-delay: 1.41s; }
.cpm-diagram .node:nth-child(11) circle,
.cpm-diagram .node:nth-child(11) .node-glyph,
.cpm-diagram .node:nth-child(11) .node-label { animation-delay: 1.62s; }

@keyframes pop {
  0%   { transform: scale(0); }
  60%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* ticks & legend */
.cpm-diagram .tick-label,
.cpm-diagram .legend-label {
  font-family: var(--mono);
  font-size: 11px;
  fill: var(--ink-mute);
  letter-spacing: 0.06em;
}
.cpm-diagram .legend-label { dominant-baseline: middle; }

/* ──  Mobile fallback  ── */
@media (max-width: 720px) {
  .cpm-diagram .diagram-frame { display: none; }
  .figure-caption { margin-bottom: 24px; }

  .cpm-stack {
    display: block;
    list-style: none;
    position: relative;
    padding: 12px 0 12px 32px;
    margin: 0;
  }
  .cpm-stack::before {
    content: '';
    position: absolute;
    left: 28px;
    top: 32px;
    bottom: 32px;
    width: 2px;
    background: var(--accent);
  }

  .stack-node {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 10px 0;
    position: relative;
  }

  .stack-glyph {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background: var(--paper);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    position: relative;
    z-index: 1;
    margin-left: -16px;
  }

  .stack-terminal .stack-glyph {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
    font-weight: 500;
  }

  .stack-label {
    font-family: var(--serif);
    font-style: italic;
    font-size: 18px;
    color: var(--ink);
    font-optical-sizing: auto;
  }
}

/* ─────────────  MANIFESTO  ───────────── */

.manifesto {
  padding: clamp(80px, 12vh, 140px) var(--pad-x) clamp(80px, 10vh, 120px);
  max-width: var(--max-w);
  margin: 0 auto;
  border-top: 1px solid var(--rule);
}

.manifesto-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: clamp(48px, 8vw, 120px);
  align-items: start;
}

.manifesto-body {
  font-family: var(--serif);
  font-size: clamp(17px, 1.4vw, 19px);
  line-height: 1.65;
  font-weight: 400;
  font-optical-sizing: auto;
  color: var(--ink);
  max-width: 640px;
}

.manifesto-body p { margin-bottom: 1.2em; }
.manifesto-body em {
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
}

.manifesto-body .lede-large {
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.28;
  letter-spacing: -0.018em;
  font-weight: 500;
  margin-bottom: 1.4em;
}

.manifesto-body .lede-large::first-letter {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 3.2em;
  line-height: 0.9;
  float: left;
  padding: 0.05em 0.1em 0 0;
  color: var(--accent);
}

.pull-quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink);
  font-optical-sizing: auto;
  font-weight: 400;
  margin: 1.6em 0;
  padding: 24px 0 24px 36px;
  border-left: 2px solid var(--accent);
  position: relative;
}
.pull-quote em {
  display: block;
  margin-top: 0.3em;
  color: var(--ink-soft);
}
.pull-quote .quote-mark {
  position: absolute;
  left: 16px; top: 4px;
  font-style: italic;
  font-size: 60px;
  color: var(--accent);
  line-height: 1;
  opacity: 0.45;
}

.margin-note {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-mute);
  border-top: 1px solid var(--rule-strong);
  padding-top: 12px;
  position: relative;
  margin-top: 8px;
}
.margin-note .note-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 8px;
}
.margin-note p { font-style: italic; font-family: var(--serif); font-size: 16px; font-optical-sizing: auto; }

@media (max-width: 880px) {
  .manifesto-grid { grid-template-columns: 1fr; gap: 40px; }
  .margin-note {
    border-top: none;
    border-left: 2px solid var(--accent);
    padding: 8px 0 8px 16px;
  }
}

/* ─────────────  SERVICES  ───────────── */

.services {
  padding: clamp(80px, 12vh, 140px) var(--pad-x);
  max-width: var(--max-w);
  margin: 0 auto;
  border-top: 1px solid var(--rule);
}

.service-list {
  list-style: none;
  position: relative;
  margin-top: 16px;
}

.service-node {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 64px);
  padding: 56px 0;
  border-bottom: 1px solid var(--rule);
  position: relative;
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s var(--ease-soft),
    transform 0.7s var(--ease-soft);
  transition-delay: calc(var(--i, 1) * 0.06s);
}
.service-node.in-view,
.service-list.in-view .service-node {
  opacity: 1;
  transform: translateY(0);
}
.service-node:last-child { border-bottom: none; }

.node-marker {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-top: 6px;
}

/* Single continuous vermillion spine — same color, same width through all 5 nodes */
.node-marker::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -56px;
  bottom: -56px;
  width: 2px;
  background: var(--accent);
  transform: translateX(-50%);
  z-index: 0;
}
.service-node:first-child .node-marker::before { top: 50%; }
.service-node:last-child  .node-marker::before { bottom: 50%; }

.node-num {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--paper);
  color: var(--accent);
  z-index: 1;
  font-optical-sizing: auto;
  letter-spacing: -0.02em;
  transition: transform 0.4s var(--ease-soft);
}
.service-node:hover .node-num {
  transform: scale(1.05) rotate(-3deg);
}

.node-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  background: var(--paper);
  padding: 0 6px;
  z-index: 1;
}

.node-body { padding-top: 4px; }

.node-name {
  font-family: var(--serif);
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.025em;
  font-optical-sizing: auto;
  margin-bottom: 18px;
  color: var(--ink);
}

.node-desc {
  font-family: var(--serif);
  font-size: clamp(17px, 1.45vw, 19px);
  line-height: 1.55;
  font-weight: 400;
  color: var(--ink-soft);
  font-optical-sizing: auto;
  max-width: 640px;
  margin-bottom: 28px;
}

.node-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px 32px;
  padding-top: 20px;
  border-top: 1px dashed var(--rule-strong);
}
.node-meta div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.node-meta dt {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}
.node-meta dd {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
}

@media (max-width: 720px) {
  .service-node {
    grid-template-columns: 56px 1fr;
    gap: 18px;
    padding: 40px 0;
  }
  .node-num { width: 48px; height: 48px; font-size: 20px; }
  .node-tag { display: none; }
  .node-name { margin-bottom: 14px; }
  .node-desc { margin-bottom: 22px; }

  /* Single-column meta — 220px minmax was forcing overflow */
  .node-meta {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-top: 16px;
  }
}

/* ─────────────  METHOD  ───────────── */

.method {
  padding: clamp(80px, 12vh, 140px) var(--pad-x);
  max-width: var(--max-w);
  margin: 0 auto;
  border-top: 1px solid var(--rule);
}

.method-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  position: relative;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
}

/* The path spine sweeps across the top */
.method-list::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.6s var(--ease-soft) 0.2s;
}
.method.in-view .method-list::before { transform: scaleX(1); }

.phase {
  padding: 40px 28px 36px;
  border-right: 1px solid var(--rule);
  position: relative;
  background: var(--paper);
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.7s var(--ease-soft),
    transform 0.7s var(--ease-soft);
}
.method.in-view .phase {
  opacity: 1;
  transform: translateY(0);
}

/* Phase content fade-in delays — synced with sweep position
   Sweep: 1.6s duration, 0.2s start delay
   Each phase column is 20% wide; bullets sit at 28px from column-left
   Approximate sweep-arrival time for each bullet:
     Phase 1: ~6% of sweep  → 0.20 + 0.10 = 0.30s
     Phase 2: ~26%          → 0.20 + 0.42 = 0.62s
     Phase 3: ~46%          → 0.20 + 0.74 = 0.94s
     Phase 4: ~66%          → 0.20 + 1.06 = 1.26s
     Phase 5: ~86%          → 0.20 + 1.38 = 1.58s
*/
.method.in-view .phase:nth-child(1) { transition-delay: 0.30s; }
.method.in-view .phase:nth-child(2) { transition-delay: 0.62s; }
.method.in-view .phase:nth-child(3) { transition-delay: 0.94s; }
.method.in-view .phase:nth-child(4) { transition-delay: 1.26s; }
.method.in-view .phase:nth-child(5) { transition-delay: 1.58s; }

.phase:last-child { border-right: none; }

/* node bullet at top of each phase, sitting on the spine */
.phase::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 28px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--accent);
  z-index: 2;
  transform: scale(0);
  transform-origin: center;
  transition: transform 0.4s var(--ease-soft);
}
.method.in-view .phase:nth-child(1)::before { transition-delay: 0.30s; }
.method.in-view .phase:nth-child(2)::before { transition-delay: 0.62s; }
.method.in-view .phase:nth-child(3)::before { transition-delay: 0.94s; }
.method.in-view .phase:nth-child(4)::before { transition-delay: 1.26s; }
.method.in-view .phase:nth-child(5)::before { transition-delay: 1.58s; }
.method.in-view .phase::before { transform: scale(1); }

.phase-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}
.phase-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}
.phase-name {
  font-family: var(--serif);
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 500;
  letter-spacing: -0.02em;
  font-optical-sizing: auto;
  color: var(--ink);
}

.phase-desc {
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.55;
  font-weight: 400;
  color: var(--ink-soft);
  font-optical-sizing: auto;
}

@media (max-width: 880px) {
  .method-list {
    grid-template-columns: 1fr;
    border-top: none;
    border-bottom: none;
  }
  .method-list::before {
    width: 2px; height: 100%; left: 28px; right: auto;
    transform: scaleY(0);
    transform-origin: top;
  }
  .method.in-view .method-list::before { transform: scaleY(1); }

  .phase {
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding: 32px 0 32px 56px;
  }
  .phase:last-child { border-bottom: none; }
  .phase::before {
    top: 36px;
    left: 22px;
  }
}

/* ─────────────  COORDINATES (CONTACT PLACEHOLDER)  ───────────── */

.coordinates {
  padding: clamp(80px, 12vh, 140px) var(--pad-x) clamp(80px, 12vh, 140px);
  max-width: var(--max-w);
  margin: 0 auto;
  border-top: 1px solid var(--rule);
}

.coords-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(48px, 8vw, 120px);
  align-items: start;
}

.coords-title {
  font-family: var(--serif);
  font-size: clamp(54px, 7vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-weight: 500;
  font-optical-sizing: auto;
  color: var(--ink);
}
.coords-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.coords-title .comma { color: var(--accent); }

.coords-body {
  padding-top: clamp(8px, 2vw, 24px);
  font-family: var(--serif);
  font-size: clamp(17px, 1.4vw, 19px);
  line-height: 1.6;
  color: var(--ink-soft);
  font-optical-sizing: auto;
  max-width: 480px;
}
.coords-body p { margin-bottom: 1em; }

.coords-filing {
  margin-top: clamp(48px, 8vh, 80px);
  padding-top: 16px;
  border-top: 1px dashed var(--rule-strong);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.filing-mark {
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 880px) {
  .coords-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ─────────────  FOOTER  ───────────── */

.site-footer {
  padding: 40px var(--pad-x);
  border-top: 1px solid var(--rule);
  background: var(--paper-2);
}

.footer-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px 64px;
  align-items: start;
}

.footer-id {
  display: flex;
  align-items: center;
  gap: 14px;
}
.footer-id-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.foot-mark {
  color: var(--ink);
  display: inline-flex;
}

/* Footer text registers */
.foot-text {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.foot-text-strong { color: var(--ink); }
.foot-text-mono { font-feature-settings: "tnum"; text-transform: lowercase; }
.foot-fade { color: var(--ink-faint); }

/* Colophon — print-style key/value list */
.footer-colophon {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  border-left: 1px solid var(--rule-strong);
  padding-left: 24px;
}
.colo-row {
  display: flex;
  gap: 12px;
  align-items: baseline;
}
.colo-row dt {
  width: 64px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  font-size: 10px;
}
.colo-row dd {
  color: var(--ink-soft);
  text-transform: lowercase;
}

.footer-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

@media (max-width: 880px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .footer-colophon {
    border-left: none;
    border-top: 1px solid var(--rule-strong);
    padding-left: 0;
    padding-top: 16px;
  }
  .footer-meta {
    align-items: flex-start;
    border-top: 1px solid var(--rule-strong);
    padding-top: 16px;
  }
}

/* ─────────────  REDUCED MOTION  ───────────── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .hero-title .line { opacity: 1; transform: none; }
  .hero-foot, .cpm-diagram { opacity: 1; }
  .method-list::before { transform: scaleX(1); }
  .method .phase::before { transform: scale(1); }
}
