/* ============================================================
   R2 Digital LLC — AI-Powered Hybrid FSO-FSP Strategy
   Design system: "Ink & Signal" — editorial blueprint
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;

  /* Ground */
  --ink-900: #070a0e;
  --ink-850: #0a0e14;
  --ink-800: #0d131b;
  --ink-700: #121a24;
  --ink-600: #17212d;

  /* Lines */
  --line: rgba(133, 163, 196, 0.16);
  --line-soft: rgba(133, 163, 196, 0.09);
  --line-strong: rgba(133, 163, 196, 0.32);
  --grid: rgba(120, 155, 195, 0.055);

  /* Type */
  --text: #e9eef5;
  --text-2: #b6c4d4;
  --muted: #7d8ea3;
  --faint: #56657a;

  /* Semantic delivery-model language */
  --fso: #57a8ff;        /* Full Service Outsourcing — cool */
  --fso-dim: rgba(87, 168, 255, 0.14);
  --fsp: #ff5a36;        /* Functional Service Provider — warm (R2 brand) */
  --fsp-dim: rgba(255, 90, 54, 0.14);
  --hybrid: #f5b942;     /* The fusion — gold */
  --hybrid-dim: rgba(245, 185, 66, 0.14);
  --ai: #4ee0c8;         /* AI layer — signal teal */
  --ai-dim: rgba(78, 224, 200, 0.13);

  --risk: #ff5f6d;
  --good: #46d19a;

  --accent: var(--fsp);

  /* Type scale */
  --f-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --f-sans: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --rail: 264px;
  --pad: clamp(1.25rem, 3.2vw, 3.5rem);
  --maxw: 1260px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
}

* { box-sizing: border-box; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--ink-900);
  color: var(--text);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.62;
  font-feature-settings: "cv05" 1, "ss01" 1;
  overflow-x: hidden;
}

/* Atmospheric ground: blueprint grid + light wells + grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 78% -6%, rgba(255, 90, 54, 0.13), transparent 62%),
    radial-gradient(760px 620px at 4% 22%, rgba(87, 168, 255, 0.10), transparent 60%),
    radial-gradient(900px 700px at 60% 108%, rgba(78, 224, 200, 0.07), transparent 62%),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: auto, auto, auto, 64px 64px, 64px 64px;
}
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
}

/* ---------- Typography primitives ---------- */
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
p { margin: 0 0 1em; }
a { color: inherit; }

.eyebrow {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--accent);
  flex: none;
}
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.lede {
  font-size: clamp(1.02rem, 1.35vw, 1.2rem);
  color: var(--text-2);
  line-height: 1.68;
  max-width: 62ch;
}
.small { font-size: 0.85rem; color: var(--muted); line-height: 1.6; }
.tiny { font-size: 0.74rem; color: var(--faint); line-height: 1.55; }
strong, b { font-weight: 600; color: #fff; }
mark {
  background: linear-gradient(transparent 58%, rgba(255, 90, 54, 0.3) 58%);
  color: inherit;
  padding: 0 0.1em;
}

/* ============================================================
   Shell
   ============================================================ */
.shell { position: relative; z-index: 2; }

/* ---------- Masthead ---------- */
.masthead {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 clamp(1rem, 3vw, 2rem);
  background: rgba(7, 10, 14, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.brand-mark {
  width: 40px; height: 30px; flex: none;
  border-radius: 3px;
  display: block;
  box-shadow: 0 0 0 1px rgba(133, 163, 196, 0.22);
}
.brand-name {
  font-family: var(--f-display);
  font-size: 1.06rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
}
.brand-sub {
  font-family: var(--f-mono);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  display: block;
  margin-top: 3px;
}
.masthead-actions { display: flex; align-items: center; gap: 0.55rem; flex: none; }
.lbl-short { display: none; }

/* Reading progress */
.progress {
  position: absolute;
  left: 0; bottom: -1px;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--fso), var(--hybrid) 52%, var(--fsp));
  box-shadow: 0 0 14px rgba(255, 90, 54, 0.55);
  transition: width 0.1s linear;
}

/* ---------- Buttons ---------- */
.btn {
  --bg: transparent;
  --bd: var(--line-strong);
  --fg: var(--text);
  appearance: none;
  border: 1px solid var(--bd);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.72rem 1.15rem;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease),
              color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.3s var(--ease);
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent); color: #fff; }
.btn-primary {
  --bg: var(--accent);
  --bd: var(--accent);
  --fg: #140602;
  font-weight: 600;
  box-shadow: 0 10px 34px -12px rgba(255, 90, 54, 0.85);
}
.btn-primary:hover { --bg: #ff7a55; --bd: #ff7a55; --fg: #140602; box-shadow: 0 16px 44px -12px rgba(255, 90, 54, 0.95); }
.btn-sm { padding: 0.5rem 0.85rem; font-size: 0.66rem; }
.btn .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Side rail nav ---------- */
.rail {
  position: fixed;
  top: 62px;
  left: 0;
  bottom: 0;
  width: var(--rail);
  z-index: 50;
  padding: 1.6rem 0 2rem 1.4rem;
  overflow-y: auto;
  border-right: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(10, 14, 20, 0.6), rgba(7, 10, 14, 0.3));
  backdrop-filter: blur(10px);
}
.rail-title {
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 1rem;
}
.rail-list { list-style: none; margin: 0; padding: 0; position: relative; }
.rail-list::before {
  content: "";
  position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 1px;
  background: var(--line-soft);
}
.rail-link {
  display: grid;
  grid-template-columns: 15px 1fr;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.42rem 0.5rem 0.42rem 0;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  border-radius: 2px;
  transition: color 0.22s var(--ease);
  position: relative;
}
.rail-link .rail-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ink-600);
  border: 1px solid var(--line-strong);
  margin-left: 4px;
  transform: translateY(-1px);
  transition: all 0.28s var(--ease);
}
.rail-link:hover { color: var(--text-2); }
.rail-link.active { color: #fff; }
.rail-link.active .rail-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 90, 54, 0.16);
}
.rail-num {
  font-family: var(--f-mono);
  font-size: 0.62rem;
  color: var(--faint);
  display: block;
  letter-spacing: 0.1em;
}
.rail-foot {
  margin-top: 1.8rem;
  padding: 0.9rem 1rem 0.9rem 0;
  border-top: 1px solid var(--line-soft);
}

/* ---------- Mobile nav ---------- */
.nav-toggle { display: none; }
.mobile-scrim {
  position: fixed; inset: 0; z-index: 45;
  background: rgba(4, 6, 9, 0.7);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
body.nav-open .mobile-scrim { opacity: 1; pointer-events: auto; }

/* ---------- Main ---------- */
.main {
  margin-left: var(--rail);
  padding-top: 62px;
  min-width: 0;
}
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}
section[id] { scroll-margin-top: 78px; }
.band { padding: clamp(4rem, 8vw, 7.5rem) 0; border-top: 1px solid var(--line-soft); position: relative; }
.band:first-of-type { border-top: 0; }
.band-alt { background: linear-gradient(180deg, rgba(13, 19, 27, 0.72), rgba(7, 10, 14, 0)); }

.sec-head { margin-bottom: clamp(2rem, 4vw, 3.2rem); }
.sec-head h2 {
  font-family: var(--f-display);
  font-size: clamp(1.85rem, 3.6vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  margin: 0.85rem 0 0.9rem;
  max-width: 22ch;
}
.sec-head h2 em { font-style: italic; color: var(--hybrid); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: calc(100svh - 62px);
  display: flex;
  align-items: center;
  padding: clamp(3rem, 7vw, 6rem) 0 clamp(3rem, 6vw, 5rem);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  width: 100%;
}
.hero h1 {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(2.3rem, 4.2vw, 3.7rem);
  letter-spacing: -0.038em;
  line-height: 1.02;
  margin: 1.2rem 0 1.3rem;
  text-wrap: balance;
}
.hero h1 .l2 { display: block; }
.hero h1 em {
  font-style: italic;
  background: linear-gradient(100deg, var(--fso) 4%, var(--hybrid) 46%, var(--fsp) 88%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.byline {
  font-family: var(--f-mono);
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-2);
  margin: -0.5rem 0 1.35rem;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.8rem; }
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.8rem;
  margin-top: 2rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--line-soft);
}
.hero-meta div { min-width: 90px; }
.hero-meta .k {
  font-family: var(--f-mono);
  font-size: 1.42rem;
  color: #fff;
  letter-spacing: -0.02em;
  display: block;
  line-height: 1.2;
}
.hero-meta .k span { color: var(--accent); }
.hero-meta .v {
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.hero-visual { position: relative; }
.hero-visual svg { width: 100%; height: auto; display: block; overflow: visible; }

.scroll-hint {
  position: absolute;
  bottom: 1.5rem;
  left: var(--pad);
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--faint);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.scroll-hint i {
  display: block;
  width: 1px; height: 30px;
  background: linear-gradient(var(--accent), transparent);
  animation: drop 2.2s var(--ease-io) infinite;
}
@keyframes drop { 0%, 100% { transform: scaleY(0.35); transform-origin: top; opacity: 0.4; } 45% { transform: scaleY(1); opacity: 1; } }

/* ============================================================
   Disclaimer band
   ============================================================ */
/* Legal small print: deliberately recessive — it should be findable, not read first. */
.disclaimer-band { border-top: 1px solid var(--line-soft); padding: 1.2rem 0 0; }
.disclaimer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  background: rgba(13, 19, 27, 0.34);
  padding: 0.8rem 1rem;
}
.disclaimer .d-tag {
  font-family: var(--f-mono);
  font-size: 0.53rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #4d545e;
  white-space: nowrap;
  padding-top: 0.1rem;
}
.disclaimer p { font-size: 0.7rem; color: #5f6773; line-height: 1.55; margin: 0; }
.disclaimer p + p { margin-top: 0.4rem; }
.disclaimer strong { color: #6b7280; font-weight: 600; }

/* ============================================================
   Agentic workflow cards
   ============================================================ */
.wf {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: linear-gradient(165deg, rgba(23, 33, 45, 0.55), rgba(10, 14, 20, 0.42));
  overflow: hidden;
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease);
}
.wf:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.wf-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
  padding: 1.05rem 1.2rem;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(13, 19, 27, 0.6);
}
.wf-n {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 1.7rem;
  line-height: 1;
  color: var(--ai);
  opacity: 0.85;
}
.wf-head h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; }
.wf-head .wf-sub { font-size: 0.8rem; color: var(--muted); line-height: 1.5; }
.wf-body { padding: 1.05rem 1.2rem 1.2rem; }

.wf-steps { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0.4rem; margin-bottom: 1rem; }
.wf-step {
  flex: 1 1 128px;
  min-width: 118px;
  border: 1px solid var(--line-soft);
  border-top: 2px solid rgba(78, 224, 200, 0.45);
  border-radius: 2px;
  background: rgba(23, 33, 45, 0.5);
  padding: 0.6rem 0.7rem;
  position: relative;
}
.wf-step .s-n {
  font-family: var(--f-mono);
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  color: var(--faint);
  display: block;
  margin-bottom: 0.28rem;
}
.wf-step .s-t { font-size: 0.775rem; color: var(--text-2); line-height: 1.4; display: block; }
.wf-step.is-gate {
  border-top-color: var(--hybrid);
  background: rgba(245, 185, 66, 0.07);
}
.wf-step.is-gate .s-n { color: var(--hybrid); }
.wf-step.is-gate .s-t { color: #fff; }

.wf-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--line-soft);
}
.wf-foot .wf-eff { font-family: var(--f-mono); font-size: 0.8rem; color: var(--good); }
.wf-foot .wf-eff span { color: var(--faint); letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.6rem; margin-right: 0.5rem; }

/* ============================================================
   Cards & surfaces
   ============================================================ */
.card {
  background: linear-gradient(165deg, rgba(23, 33, 45, 0.62), rgba(10, 14, 20, 0.45));
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: clamp(1.15rem, 2vw, 1.65rem);
  position: relative;
  overflow: hidden;
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.card::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: 0 22px 50px -30px rgba(0, 0, 0, 0.9); }
.card:hover::after { opacity: 1; }
.card h3 { font-size: 1.06rem; font-weight: 600; letter-spacing: -0.012em; margin-bottom: 0.5rem; }
.card p:last-child { margin-bottom: 0; }

.card-num {
  font-family: var(--f-mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  color: var(--faint);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.grid { display: grid; gap: clamp(0.85rem, 1.6vw, 1.15rem); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }

/* Stat tiles */
.stat { padding: 1.15rem 1.2rem; border-left: 2px solid var(--accent); background: rgba(23, 33, 45, 0.4); border-radius: 0 3px 3px 0; }
.stat .n {
  font-family: var(--f-mono);
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.1;
  display: block;
}
.stat .n sup { font-size: 0.5em; color: var(--accent); top: -0.7em; }
.stat .l { font-size: 0.8rem; color: var(--muted); margin-top: 0.35rem; display: block; line-height: 1.45; }
.stat.c-fso { border-color: var(--fso); }
.stat.c-fsp { border-color: var(--fsp); }
.stat.c-hyb { border-color: var(--hybrid); }
.stat.c-ai { border-color: var(--ai); }

/* Tag chips */
.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag {
  font-family: var(--f-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
  padding: 0.24rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--muted);
  max-width: 100%;
}
.tag.t-fso { color: var(--fso); border-color: rgba(87, 168, 255, 0.32); background: var(--fso-dim); }
.tag.t-fsp { color: var(--fsp); border-color: rgba(255, 90, 54, 0.32); background: var(--fsp-dim); }
.tag.t-hyb { color: var(--hybrid); border-color: rgba(245, 185, 66, 0.32); background: var(--hybrid-dim); }
.tag.t-ai  { color: var(--ai);  border-color: rgba(78, 224, 200, 0.32); background: var(--ai-dim); }

/* Figure frame for diagrams */
.figure {
  border: 1px solid var(--line);
  border-radius: 4px;
  background:
    linear-gradient(rgba(120, 155, 195, 0.04) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(120, 155, 195, 0.04) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(165deg, rgba(18, 26, 36, 0.85), rgba(8, 11, 16, 0.7));
  padding: clamp(1rem, 2.4vw, 1.9rem);
  position: relative;
}
.figure > svg,
.figure .fig-scroll > svg { width: 100%; height: auto; display: block; overflow: visible; }
.figcap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line-soft);
  font-family: var(--f-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--faint);
}
.legend { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; }
.legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend i { width: 9px; height: 9px; border-radius: 2px; display: block; }

/* SVG shared */
.svg-label { font-family: "IBM Plex Sans", sans-serif; font-size: 12px; fill: var(--text-2); }
.svg-mono { font-family: "IBM Plex Mono", monospace; letter-spacing: 0.1em; }
.svg-tiny { font-size: 9.5px; fill: var(--faint); }
.svg-head { font-size: 13px; font-weight: 600; fill: #fff; }

/* Draw-in animation for SVG paths */
.draw { stroke-dasharray: var(--len, 600); stroke-dashoffset: var(--len, 600); }
.in-view .draw { animation: draw 1.5s var(--ease-io) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.flow-dot { opacity: 0; }
.in-view .flow-dot { animation: flow 3.2s linear infinite; }
@keyframes flow { 0% { opacity: 0; offset-distance: 0%; } 10%, 88% { opacity: 1; } 100% { opacity: 0; offset-distance: 100%; } }

/* ============================================================
   Reveal on scroll
   ============================================================ */
.rv { opacity: 0; transform: translateY(22px); transition: opacity 0.75s var(--ease), transform 0.75s var(--ease); }
.rv.in-view { opacity: 1; transform: none; }
.rv-stagger > * { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.rv-stagger.in-view > * { opacity: 1; transform: none; }
.rv-stagger.in-view > *:nth-child(1) { transition-delay: 0.04s; }
.rv-stagger.in-view > *:nth-child(2) { transition-delay: 0.10s; }
.rv-stagger.in-view > *:nth-child(3) { transition-delay: 0.16s; }
.rv-stagger.in-view > *:nth-child(4) { transition-delay: 0.22s; }
.rv-stagger.in-view > *:nth-child(5) { transition-delay: 0.28s; }
.rv-stagger.in-view > *:nth-child(6) { transition-delay: 0.34s; }
.rv-stagger.in-view > *:nth-child(7) { transition-delay: 0.40s; }
.rv-stagger.in-view > *:nth-child(8) { transition-delay: 0.46s; }

/* ============================================================
   Anatomy: two-pole model comparison
   ============================================================ */
.poles { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pole { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: rgba(13, 19, 27, 0.55); }
.pole-head { padding: 1rem 1.2rem; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 0.7rem; }
.pole-head .badge {
  font-family: var(--f-mono); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.14em;
  padding: 0.3rem 0.55rem; border-radius: 2px;
}
.pole.p-fso { border-top: 2px solid var(--fso); }
.pole.p-fso .badge { background: var(--fso-dim); color: var(--fso); }
.pole.p-fsp { border-top: 2px solid var(--fsp); }
.pole.p-fsp .badge { background: var(--fsp-dim); color: var(--fsp); }
.pole-head h3 { font-size: 0.95rem; font-weight: 500; color: var(--text-2); }
.pole-body { padding: 1.1rem 1.2rem 1.3rem; }
.role-group + .role-group { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px dashed var(--line-soft); }
.role-group h4 {
  font-family: var(--f-mono); font-size: 0.63rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 0.55rem;
}
.role-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.role-list li {
  font-size: 0.78rem; color: var(--text-2);
  padding: 0.26rem 0.55rem; border: 1px solid var(--line-soft); border-radius: 2px;
  background: rgba(23, 33, 45, 0.5);
}

/* ============================================================
   Pain point ledger
   ============================================================ */
.ledger { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.ledger-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1.05fr) minmax(0, 1.5fr) 132px;
  gap: 1rem;
  align-items: start;
  padding: 1rem 1.15rem;
  border-top: 1px solid var(--line-soft);
  transition: background 0.3s var(--ease);
}
.ledger-row:first-child { border-top: 0; }
.ledger-row:hover { background: rgba(23, 33, 45, 0.45); }
.ledger-head {
  background: rgba(13, 19, 27, 0.8);
  font-family: var(--f-mono); font-size: 0.6rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--faint);
}
.zid {
  font-family: var(--f-display); font-size: 1.35rem; line-height: 1;
  color: var(--hybrid); font-style: italic;
}
.ledger-row h4 { font-size: 0.92rem; font-weight: 600; margin-bottom: 0.15rem; }
.ledger-row .desc { font-size: 0.83rem; color: var(--muted); line-height: 1.55; }
.leak {
  font-family: var(--f-mono); font-size: 0.98rem; color: var(--risk); text-align: right;
  letter-spacing: -0.01em; white-space: nowrap;
}
.leak small { display: block; font-size: 0.6rem; color: var(--faint); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 2px; }

/* ============================================================
   Zone explorer (tabbed redesign)
   ============================================================ */
.zx { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: rgba(10, 14, 20, 0.5); }
.zx-tabs {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 19, 27, 0.9);
  scrollbar-width: none;
}
.zx-tabs::-webkit-scrollbar { display: none; }
.zx-tab {
  appearance: none; background: none; border: 0; border-right: 1px solid var(--line-soft);
  color: var(--muted); cursor: pointer; padding: 0.85rem 1.05rem; text-align: left;
  font-family: var(--f-sans); font-size: 0.78rem; line-height: 1.25; white-space: nowrap;
  position: relative; transition: color 0.25s var(--ease), background 0.25s var(--ease);
  flex: 1 0 auto;
}
.zx-tab b { display: block; font-family: var(--f-mono); font-size: 0.62rem; letter-spacing: 0.16em; color: var(--faint); font-weight: 500; margin-bottom: 0.2rem; transition: color 0.25s var(--ease); }
.zx-tab:hover { color: var(--text); background: rgba(23, 33, 45, 0.5); }
.zx-tab[aria-selected="true"] { color: #fff; background: rgba(23, 33, 45, 0.75); }
.zx-tab[aria-selected="true"] b { color: var(--accent); }
.zx-tab[aria-selected="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent);
}
.zx-panel { padding: clamp(1.15rem, 2.4vw, 2rem); }
.zx-panel[hidden] { display: none; }
.zx-top { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 1.5rem; align-items: start; margin-bottom: 1.5rem; }
.zx-panel h3 { font-family: var(--f-display); font-size: clamp(1.3rem, 2.4vw, 1.8rem); font-weight: 400; letter-spacing: -0.028em; margin-bottom: 0.6rem; }
.zx-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem; }
.zx-col { border: 1px solid var(--line-soft); border-radius: 3px; padding: 0.95rem 1rem; background: rgba(23, 33, 45, 0.35); }
.zx-col h5 {
  font-family: var(--f-mono); font-size: 0.6rem; letter-spacing: 0.18em; text-transform: uppercase;
  margin: 0 0 0.65rem; display: flex; align-items: center; gap: 0.45rem;
}
.zx-col.k-now h5 { color: var(--risk); }
.zx-col.k-ai h5 { color: var(--ai); }
.zx-col.k-next h5 { color: var(--good); }
.zx-col ul { list-style: none; margin: 0; padding: 0; }
.zx-col li { font-size: 0.815rem; color: var(--text-2); line-height: 1.5; padding-left: 0.9rem; position: relative; margin-bottom: 0.45rem; }
.zx-col li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 4px; height: 1px; background: currentColor; opacity: 0.5; }
.zx-col li:last-child { margin-bottom: 0; }
.zx-metrics { display: grid; gap: 0.55rem; }
.zx-metric {
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem;
  padding: 0.55rem 0.7rem; border: 1px solid var(--line-soft); border-radius: 2px;
  background: rgba(23, 33, 45, 0.4);
}
.zx-metric .m-l { font-size: 0.76rem; color: var(--muted); line-height: 1.35; }
.zx-metric .m-v { font-family: var(--f-mono); font-size: 0.9rem; color: var(--good); white-space: nowrap; }

/* ============================================================
   Value model / calculator
   ============================================================ */
.calc { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: clamp(1rem, 2.5vw, 2rem); align-items: start; }
.calc-panel { border: 1px solid var(--line); border-radius: 4px; padding: 1.3rem; background: rgba(13, 19, 27, 0.7); position: sticky; top: 80px; }
.field { margin-bottom: 1.35rem; }
.field:last-of-type { margin-bottom: 1rem; }
.field label {
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem;
  font-family: var(--f-mono); font-size: 0.63rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--faint);
  margin-bottom: 0.6rem;
}
.field label output { font-size: 0.95rem; color: #fff; letter-spacing: 0; text-transform: none; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 2px; background: var(--line-strong);
  border-radius: 2px; outline: none; margin: 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 15px; height: 15px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: 2px solid var(--ink-900);
  box-shadow: 0 0 0 3px rgba(255, 90, 54, 0.2); transition: box-shadow 0.2s var(--ease);
}
input[type="range"]::-webkit-slider-thumb:hover { box-shadow: 0 0 0 6px rgba(255, 90, 54, 0.25); }
input[type="range"]::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: 50%; background: var(--accent); cursor: pointer;
  border: 2px solid var(--ink-900); box-shadow: 0 0 0 3px rgba(255, 90, 54, 0.2);
}
.calc-total {
  border-top: 1px solid var(--line); padding-top: 1.1rem; margin-top: 0.4rem;
}
.calc-total .n {
  font-family: var(--f-mono); font-size: clamp(1.9rem, 3.6vw, 2.5rem); letter-spacing: -0.035em; line-height: 1;
  color: var(--hybrid); display: block;
}
.calc-total .l { font-family: var(--f-mono); font-size: 0.6rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); margin-top: 0.5rem; display: block; }

.bars { display: grid; gap: 0.6rem; }
.bar-row { display: grid; grid-template-columns: 190px minmax(0, 1fr) 96px; gap: 0.9rem; align-items: center; }
.bar-row .b-l { font-size: 0.83rem; color: var(--text-2); display: flex; align-items: baseline; gap: 0.5rem; }
.bar-row .b-l i { font-family: var(--f-display); font-style: italic; color: var(--hybrid); font-size: 0.95rem; }
.bar-track { height: 22px; background: rgba(23, 33, 45, 0.6); border-radius: 2px; overflow: hidden; position: relative; border: 1px solid var(--line-soft); }
.bar-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, rgba(255, 90, 54, 0.28), var(--accent));
  border-right: 1px solid #ff9d80;
  transition: width 0.9s var(--ease);
}
.bar-row .b-v { font-family: var(--f-mono); font-size: 0.86rem; color: #fff; text-align: right; }

/* ============================================================
   Roadmap
   ============================================================ */
.rm { display: grid; gap: 1rem; }
.rm-phase {
  border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
  background: linear-gradient(165deg, rgba(23, 33, 45, 0.5), rgba(10, 14, 20, 0.4));
  transition: border-color 0.3s var(--ease);
}
.rm-phase:hover { border-color: var(--line-strong); }
.rm-head {
  display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 1.1rem; align-items: center;
  padding: 1.05rem 1.25rem; border-bottom: 1px solid var(--line-soft);
  background: rgba(13, 19, 27, 0.6);
}
.rm-h-num {
  font-family: var(--f-display); font-style: italic; font-size: 2.1rem; line-height: 1;
  color: var(--ink-600); -webkit-text-stroke: 1px var(--line-strong);
}
.rm-phase[data-h="1"] .rm-h-num { color: rgba(87, 168, 255, 0.2); -webkit-text-stroke-color: var(--fso); }
.rm-phase[data-h="2"] .rm-h-num { color: rgba(245, 185, 66, 0.2); -webkit-text-stroke-color: var(--hybrid); }
.rm-phase[data-h="3"] .rm-h-num { color: rgba(255, 90, 54, 0.2); -webkit-text-stroke-color: var(--fsp); }
.rm-phase[data-h="4"] .rm-h-num { color: rgba(78, 224, 200, 0.2); -webkit-text-stroke-color: var(--ai); }
.rm-head h3 { font-size: 1.05rem; font-weight: 600; }
.rm-head .when {
  font-family: var(--f-mono); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--faint); padding: 0.3rem 0.6rem; border: 1px solid var(--line); border-radius: 2px; white-space: nowrap;
}
.rm-body { padding: 0.35rem 0; }
.init {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) 120px; gap: 1rem; align-items: baseline;
  padding: 0.8rem 1.25rem; border-top: 1px solid var(--line-soft);
}
.rm-body .init:first-child { border-top: 0; }
.init .i-t { font-size: 0.87rem; color: var(--text); }
.init .i-t span { display: block; font-size: 0.76rem; color: var(--muted); margin-top: 0.15rem; line-height: 1.45; }
.init .i-o { font-size: 0.79rem; color: var(--ai); font-family: var(--f-mono); letter-spacing: 0.02em; }
.init .i-e {
  font-family: var(--f-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase;
  text-align: right; color: var(--faint);
}
.init .i-e b { color: var(--good); font-weight: 500; }

/* ============================================================
   TOM
   ============================================================ */
.tom-layer {
  display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 1.1rem; align-items: stretch;
  border: 1px solid var(--line); border-radius: 4px; margin-bottom: 0.7rem; overflow: hidden;
  background: rgba(13, 19, 27, 0.5); transition: transform 0.35s var(--ease), border-color 0.35s var(--ease);
}
.tom-layer:hover { transform: translateX(4px); border-color: var(--line-strong); }
.tom-l-head { padding: 1.05rem 1.1rem; border-right: 1px solid var(--line-soft); background: rgba(23, 33, 45, 0.5); }
.tom-l-head .n {
  font-family: var(--f-mono); font-size: 0.58rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--faint); display: block; margin-bottom: 0.3rem;
}
.tom-l-head h4 { font-size: 0.93rem; font-weight: 600; letter-spacing: -0.01em; }
.tom-cells { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: var(--line-soft); }
.tom-cell { padding: 0.85rem 0.95rem; background: rgba(10, 14, 20, 0.6); }
.tom-cell b { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text); margin-bottom: 0.2rem; }
.tom-cell span { font-size: 0.73rem; color: var(--muted); line-height: 1.45; display: block; }
.tom-layer[data-accent="ai"] { border-left: 2px solid var(--ai); }
.tom-layer[data-accent="hyb"] { border-left: 2px solid var(--hybrid); }
.tom-layer[data-accent="fso"] { border-left: 2px solid var(--fso); }
.tom-layer[data-accent="fsp"] { border-left: 2px solid var(--fsp); }
.tom-layer[data-accent="line"] { border-left: 2px solid var(--line-strong); }

/* ============================================================
   CTA
   ============================================================ */
.cta {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: clamp(1.8rem, 5vw, 3.6rem);
  background:
    radial-gradient(720px 320px at 88% 8%, rgba(255, 90, 54, 0.16), transparent 62%),
    radial-gradient(620px 340px at 4% 96%, rgba(78, 224, 200, 0.1), transparent 62%),
    linear-gradient(160deg, rgba(23, 33, 45, 0.85), rgba(8, 11, 16, 0.85));
  position: relative;
  overflow: hidden;
}
.cta h2 {
  font-family: var(--f-display); font-weight: 300;
  font-size: clamp(1.7rem, 4.2vw, 3rem); letter-spacing: -0.035em; margin: 0.9rem 0 1rem; max-width: 20ch;
}
.cta h2 em { font-style: italic; color: var(--hybrid); }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 1rem;
  background: rgba(4, 6, 9, 0.82);
  backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.modal.open { opacity: 1; pointer-events: auto; }
.modal-box {
  width: min(600px, 100%);
  max-height: min(88svh, 780px);
  overflow-y: auto;
  background: linear-gradient(165deg, #131b25, #0a0e14);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: clamp(1.3rem, 3vw, 2.2rem);
  transform: translateY(16px) scale(0.985);
  transition: transform 0.35s var(--ease);
  position: relative;
}
.modal.open .modal-box { transform: none; }
.modal-box h3 { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.4rem, 3vw, 1.9rem); letter-spacing: -0.03em; margin: 0.7rem 0 0.5rem; }
.modal-close {
  position: absolute; top: 0.85rem; right: 0.85rem;
  width: 32px; height: 32px; display: grid; place-items: center;
  background: none; border: 1px solid var(--line); border-radius: 2px; color: var(--muted); cursor: pointer;
  transition: all 0.25s var(--ease);
}
.modal-close:hover { color: #fff; border-color: var(--accent); }

.form-field { margin-bottom: 1.05rem; }
.form-field > label {
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem;
  font-family: var(--f-mono); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 0.45rem;
}
.form-field input, .form-field textarea, .form-field select {
  width: 100%; background: rgba(7, 10, 14, 0.75); border: 1px solid var(--line);
  border-radius: 3px; color: var(--text); padding: 0.72rem 0.85rem;
  font-family: var(--f-sans); font-size: 0.9rem; line-height: 1.5;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.form-field textarea { resize: vertical; min-height: 132px; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 90, 54, 0.13);
}
.form-field input::placeholder, .form-field textarea::placeholder { color: var(--faint); }
.counter { font-family: var(--f-mono); font-size: 0.62rem; color: var(--faint); letter-spacing: 0.08em; }
.counter.over { color: var(--risk); }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 1.2rem; }
.form-note {
  font-size: 0.74rem; color: var(--faint); line-height: 1.5; margin-top: 1rem;
  padding-top: 0.9rem; border-top: 1px solid var(--line-soft);
}
.form-note a { color: var(--accent); }
.err { color: var(--risk); font-size: 0.74rem; margin-top: 0.35rem; display: none; }
.form-field.invalid input, .form-field.invalid textarea { border-color: var(--risk); }
.form-field.invalid .err { display: block; }
.toast {
  position: fixed; left: 50%; bottom: 1.6rem; transform: translate(-50%, 130%);
  background: #0d131b; border: 1px solid var(--good); color: var(--text);
  padding: 0.75rem 1.15rem; border-radius: 3px; z-index: 120;
  font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.08em;
  transition: transform 0.45s var(--ease); box-shadow: 0 20px 50px -20px #000;
}
.toast.show { transform: translate(-50%, 0); }

/* ============================================================
   References
   ============================================================ */
.refs { display: grid; gap: 0; border-top: 1px solid var(--line-soft); }
.ref {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) 130px; gap: 1rem; align-items: baseline;
  padding: 0.85rem 0.5rem; border-bottom: 1px solid var(--line-soft);
  transition: background 0.25s var(--ease);
}
.ref:hover { background: rgba(23, 33, 45, 0.4); }
.ref .r-n { font-family: var(--f-mono); font-size: 0.68rem; color: var(--faint); }
.ref a { color: var(--text); text-decoration: none; font-size: 0.88rem; line-height: 1.45; border-bottom: 1px solid transparent; transition: border-color 0.25s var(--ease), color 0.25s var(--ease); }
.ref a:hover { color: #fff; border-bottom-color: var(--accent); }
.ref .r-s { font-family: var(--f-mono); font-size: 0.65rem; color: var(--muted); letter-spacing: 0.05em; }
.ref .r-src { display: block; font-size: 0.74rem; color: var(--faint); margin-top: 0.15rem; }

/* ---------- Footer ---------- */
.foot {
  border-top: 1px solid var(--line); padding: 2.5rem 0 3rem;
  display: flex; flex-wrap: wrap; gap: 1.2rem; justify-content: space-between; align-items: flex-end;
}
.foot .f-brand { font-family: var(--f-display); font-size: 1.15rem; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1180px) {
  :root { --rail: 226px; }
  .zx-top { grid-template-columns: minmax(0, 1fr) 220px; }
  .calc { grid-template-columns: 270px minmax(0, 1fr); }
}

@media (max-width: 1000px) {
  :root { --rail: 0px; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 34px; background: none; border: 1px solid var(--line-strong);
    border-radius: 2px; color: var(--text); cursor: pointer;
  }
  .rail {
    width: 280px; transform: translateX(-100%);
    transition: transform 0.4s var(--ease);
    background: #0a0e14; padding-left: 1.4rem;
  }
  body.nav-open .rail { transform: none; }
  .main { margin-left: 0; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-visual { order: -1; max-width: 520px; }
  .g4, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-2-1, .g-1-2 { grid-template-columns: minmax(0, 1fr); }
  .calc { grid-template-columns: minmax(0, 1fr); }
  .calc-panel { position: static; }
  .zx-flow { grid-template-columns: minmax(0, 1fr); }
  .zx-top { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 620px) {
  .masthead { padding: 0 0.8rem; gap: 0.5rem; }
  .brand-sub { display: none; }
  .brand-name { font-size: 0.98rem; }
  .lbl-full { display: none; }
  .lbl-short { display: inline; }
  .masthead .btn-sm { padding: 0.5rem 0.7rem; }
}

@media (max-width: 760px) {
  .g2, .g3, .g4, .g5 { grid-template-columns: minmax(0, 1fr); }
  .poles { grid-template-columns: minmax(0, 1fr); }
  .ledger-row { grid-template-columns: 34px minmax(0, 1fr); gap: 0.7rem; }
  .ledger-row .desc-cell { grid-column: 2; }
  .ledger-row .leak { grid-column: 2; text-align: left; }
  .ledger-head { display: none; }
  .init { grid-template-columns: minmax(0, 1fr); gap: 0.35rem; }
  .init .i-e { text-align: left; }
  .rm-head { grid-template-columns: 44px minmax(0, 1fr); }
  .rm-head .when { grid-column: 2; justify-self: start; }
  .tom-layer { grid-template-columns: minmax(0, 1fr); }
  .tom-l-head { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .bar-row { grid-template-columns: minmax(0, 1fr) 84px; }
  .bar-row .b-l { grid-column: 1 / -1; }
  .ref { grid-template-columns: 28px minmax(0, 1fr); }
  .ref .r-s { grid-column: 2; }
  .hero-meta { gap: 1rem 1.4rem; }

  /* Wide diagrams stay legible by panning inside their own frame
     rather than shrinking their labels below readability. */
  .figure { padding: 0.9rem 0.9rem 0.75rem; }
  .fig-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
  .fig-scroll > svg { min-width: 620px; }
  .figure .figcap::after {
    content: "↔ swipe to pan";
    font-size: 0.62rem;
    color: var(--faint);
    letter-spacing: 0.08em;
  }
  .hero-visual .figcap::after { content: none; }
}

/* Print */
@media print {
  .rail, .masthead, .modal, .scroll-hint, .nav-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .main { margin: 0; padding: 0; }
}
