/* =========================================================
   Alphabet++ — design system
   Monochrome paper/ink, one brass accent, typographic scale.
   ========================================================= */

/* ---------- tokens ---------- */
:root {
  --font-display: "EB Garamond", "Iowan Old Style", Palatino, Georgia, "Times New Roman", serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --step--1: clamp(0.80rem, 0.77rem + 0.15vw, 0.88rem);
  --step-0:  clamp(1.00rem, 0.96rem + 0.20vw, 1.12rem);
  --step-1:  clamp(1.20rem, 1.12rem + 0.40vw, 1.44rem);
  --step-2:  clamp(1.50rem, 1.32rem + 0.90vw, 2.10rem);
  --step-3:  clamp(1.95rem, 1.60rem + 1.70vw, 3.10rem);

  --wrap: 74rem;
  --measure: 38rem;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 0.55s;
}
/* light (default) */
[data-theme="light"] {
  --bg:        #f4f4f2;
  --bg-alt:    #ecebe7;
  --surface:   #ffffff;
  --surface-2: #f8f8f6;
  --ink:       #14141a;
  --ink-soft:  #4e4e58;
  --ink-mute:  #85858f;
  --line:      #dcdcd6;
  --line-soft: #e6e6e1;
  --accent:    #1f52d8;
  --accent-ink:#ffffff;
  --accent-dim:#8fa6e8;
  --glow:      rgba(31, 82, 216, 0.07);
  --dot:       rgba(20, 20, 26, 0.13);
  --shape:     #c9c9c2;
  --grain-op:  0.018;
}
/* dark */
[data-theme="dark"] {
  --bg:        #0d0d10;
  --bg-alt:    #131317;
  --surface:   #17171c;
  --surface-2: #1d1d23;
  --ink:       #ecebe7;
  --ink-soft:  #b0afaa;
  --ink-mute:  #78777f;
  --line:      #292930;
  --line-soft: #1f1f25;
  --shape:     #46464f;
  --accent:    #7f9dff;
  --accent-ink:#0d0d10;
  --accent-dim:#4b5c9e;
  --glow:      rgba(127, 157, 255, 0.10);
  --dot:       rgba(236, 235, 231, 0.09);
  --grain-op:  0.030;
}
/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  font-weight: 350;
  line-height: 1.65;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}
h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.15; letter-spacing: -0.02em; }
p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }
em { font-style: italic; }
b, strong { font-weight: 600; color: var(--ink); }
a { color: inherit; text-decoration: none; }
code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  padding: 0.12em 0.42em;
  color: var(--ink);
  white-space: nowrap;
}
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  top: -100px; left: 1rem;
  z-index: 200;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1rem;
  border-radius: var(--r-sm);
  font-size: var(--step--1);
  font-weight: 600;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1.25rem, 5vw, 3.5rem); }
/* ---------- dotted field ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(ellipse 90% 65% at 50% 32%, #000 40%, transparent 100%);
          mask-image: radial-gradient(ellipse 90% 65% at 50% 32%, #000 40%, transparent 100%);
  transition: background-image 0.4s var(--ease);
}
/* =========================================================
   HEADER
   ========================================================= */
.site-head {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.85rem clamp(1.25rem, 5vw, 3.5rem);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.site-head.is-stuck { border-bottom-color: var(--line); }
.brand { display: inline-flex; align-items: baseline; gap: 0.5rem; margin-right: auto; }
.brand-mark {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--accent);
}
.brand-text {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.brand-text sup,
.foot-inner sup {
  font-size: 0.72em;
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--accent);
  vertical-align: super;
  line-height: 0;
}
.site-nav { display: flex; gap: 1.6rem; }
.site-nav a {
  position: relative;
  font-size: var(--step--1);
  color: var(--ink-mute);
  transition: color 0.25s var(--ease);
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -5px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after,
.site-nav a.is-active::after { transform: scaleX(1); }
.site-nav a.is-active { color: var(--ink); }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); transform: rotate(18deg); }
.theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
@media (max-width: 860px) {
  .site-nav { display: none; }
}
/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  z-index: 2;
  min-height: calc(100svh - 60px);
  display: flex;
  align-items: center;
  padding: clamp(3rem, 9vh, 7rem) clamp(1.25rem, 5vw, 3.5rem) clamp(5rem, 12vh, 8rem);
}
.hero::before {
  content: "";
  position: absolute;
  top: -25%; left: 50%;
  width: min(120vw, 1100px);
  aspect-ratio: 1;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--glow) 0%, transparent 62%);
  pointer-events: none;
  z-index: -1;
}
.hero-inner { width: 100%; max-width: var(--wrap); margin-inline: auto; text-align: center; }
.lede {
  max-width: 24ch;
  margin: 0 auto clamp(2.2rem, 5vh, 3rem);
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
}
/* --- the wordmark --- */
.wordmark {
  margin: 0 0 clamp(1.6rem, 4vh, 2.6rem);
  font-size: clamp(3.8rem, 16.5vw, 14rem);
  font-weight: 600;
  line-height: 0.82;
  letter-spacing: -0.055em;
  white-space: nowrap;
}
.wm-alpha {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.62em;
  line-height: 0;
  letter-spacing: -0.04em;
  color: var(--accent);
  /* optical alignment: the serif alpha sits differently to the grotesque */
  display: inline-block;
  vertical-align: baseline;
  transform: translateY(0.012em);
  margin-right: -0.03em;
}
.wm-rest { font-family: var(--font-sans); }
.wm-plus {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.46em;
  font-weight: 500;
  letter-spacing: -0.06em;
  color: var(--accent);
  margin-left: -0.01em;
  /* raised like an exponent, aligned to the cap height of the grotesque */
  vertical-align: super;
  transform: translateY(-0.24em);
}
/* --- buttons --- */
.cta-row { display: flex; flex-wrap: wrap; gap: 0.85rem; justify-content: center; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease),
              border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--ink); color: var(--bg); transform: translateY(-2px); }
.btn-ghost { border-color: var(--line); color: var(--ink-soft); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn-arrow { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 1.8rem;
  transform: translateX(-50%);
}
.scroll-hint span {
  display: block;
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, transparent, var(--accent));
  animation: drop 2.4s var(--ease) infinite;
}
@keyframes drop {
  0%   { transform: scaleY(0);   transform-origin: top; opacity: 0; }
  40%  { transform: scaleY(1);   transform-origin: top; opacity: 1; }
  60%  { transform: scaleY(1);   transform-origin: bottom; opacity: 1; }
  100% { transform: scaleY(0);   transform-origin: bottom; opacity: 0; }
}
/* =========================================================
   BANDS
   ========================================================= */
.band {
  --band-bg: var(--bg);
  position: relative;
  z-index: 2;
  padding: clamp(4.5rem, 13vh, 9rem) 0;
  border-top: 1px solid var(--line-soft);
}
.band.alt { background: var(--bg-alt); --band-bg: var(--bg-alt); }
.kicker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.4rem;
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.kicker .num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.h2 {
  max-width: 22ch;
  margin: 0 0 1.8rem;
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 400;
  letter-spacing: -0.015em;
}
.h2 em { color: var(--accent); font-style: italic; }
.h3 {
  margin: clamp(3rem, 7vh, 4.5rem) 0 1.2rem;
  font-size: var(--step-1);
  font-weight: 600;
  letter-spacing: -0.015em;
}
.lead-para {
  max-width: 56ch;
  margin: 0 0 2.6rem;
  font-size: var(--step-1);
  font-weight: 300;
  line-height: 1.55;
  color: var(--ink-soft);
}
.lead-para.narrow { max-width: 48ch; }
.lead-para em { color: var(--ink); }
/* two-column prose */
.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: clamp(2rem, 5vw, 4rem);
}
.col { color: var(--ink-soft); }
.col > p { max-width: 46ch; }
.ticks { margin: 0 0 1.3rem; padding: 0; list-style: none; }
.ticks li {
  position: relative;
  padding: 0.55rem 0 0.55rem 1.75rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--step-0);
  color: var(--ink-soft);
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 0; top: 1.28em;
  width: 0.7rem; height: 1px;
  background: var(--accent);
}
.quote {
  margin: 0 0 1.4rem;
  padding: 1.6rem 0 1.6rem 1.6rem;
  border-left: 2px solid var(--accent);
}
.quote blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-style: italic;
  line-height: 1.3;
  color: var(--ink);
}
@media (max-width: 720px) {
}
.note-line {
  margin-top: 1.3rem !important;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line-soft);
  font-size: var(--step--1);
  color: var(--ink-mute);
}
.callout {
  margin-top: 1.4rem;
  padding: 1.5rem 1.7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.callout p { margin: 0; color: var(--ink-soft); font-size: var(--step--1); max-width: 70ch; }
@media (max-width: 780px) {
}
.site-foot {
  position: relative;
  z-index: 2;
  padding: 2.2rem 0;
  border-top: 1px solid var(--line);
  font-size: var(--step--1);
  color: var(--ink-mute);
}
.foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.foot-inner p { margin: 0; }
.foot-mid { color: var(--ink-mute); }
.foot-mark { font-family: var(--font-display); font-style: italic; color: var(--accent); }
.site-foot a { color: var(--ink-soft); border-bottom: 1px solid var(--line); transition: color 0.25s var(--ease), border-color 0.25s var(--ease); }
.site-foot a:hover { color: var(--accent); border-color: var(--accent); }
/* =========================================================
   REVEAL
   Content is visible by default. The hidden state applies only
   when JS has confirmed IntersectionObserver + motion are OK,
   so a failed script can never leave the page blank.
   ========================================================= */
.js-anim .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.js-anim .reveal.is-in { opacity: 1; transform: none; }
.js-anim .reveal[data-delay="1"] { transition-delay: 0.06s; }
.js-anim .reveal[data-delay="2"] { transition-delay: 0.12s; }
.js-anim .reveal[data-delay="3"] { transition-delay: 0.18s; }
.js-anim .reveal[data-delay="4"] { transition-delay: 0.24s; }
.js-anim .reveal[data-delay="5"] { transition-delay: 0.30s; }
@media (prefers-reduced-motion: reduce) {
  .js-anim .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .scroll-hint { display: none; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
/* =========================================================
   VERDICTS (held against the research)
   ========================================================= */
/* =========================================================
   DIAGRAMS
   ========================================================= */
.dg { margin: 2.6rem 0 2.2rem; }
.dg svg { width: 100%; height: auto; display: block; overflow: visible; }
.dg figcaption {
  margin-top: 1.4rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink-mute);
  max-width: 62ch;
}
.dg figcaption em { font-style: italic; color: var(--ink-soft); }
.dg-b { fill: var(--surface); stroke: var(--line); stroke-width: 1.2; }
.dg-b.is-hot { stroke: var(--ink-mute); }
.dg-b.is-one { stroke: var(--accent); stroke-width: 1.6; fill: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.dg text { font-family: var(--font-sans); }
.dg-in {
  font-family: var(--font-mono);
  font-size: 14px;
  fill: var(--ink-soft);
  text-anchor: middle;
}
.dg-in.is-one { font-family: var(--font-display); font-style: italic; font-size: 15px; fill: var(--accent); }
.dg-in.is-work { font-size: 13px; fill: var(--ink-mute); }
.dg-lb {
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  fill: var(--ink-mute);
  text-anchor: middle;
}
.dg-lb.is-mark { fill: var(--accent); font-weight: 600; }
.dg-cap {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  fill: var(--ink-mute);
}
.dg-note { font-size: 11.5px; fill: var(--ink-mute); text-anchor: middle; font-style: italic; }
.dg-shell { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.dg-cut { fill: var(--band-bg, var(--bg)); }
.dg-edge {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  fill: var(--accent);
}
.dg-arrows path { stroke: var(--ink-mute); stroke-width: 1.2; fill: none; }
.dg-bar { fill: var(--surface); stroke: var(--line); stroke-width: 1.2; }
.dg-bar.is-seg { stroke: var(--accent); }
.dg-tick path { stroke: var(--accent); stroke-width: 1.5; }
.dg-chip rect { fill: var(--line); }
.dg-bar.is-seg ~ .dg-chip rect { fill: var(--line); }
@media (max-width: 640px) {
  .dg { margin: 2rem -0.6rem; }
  .dg-lb, .dg-cap { font-size: 13px; }
  .dg-in { font-size: 17px; }
}
.dg-row { pointer-events: none; }
.dg-edge.is-end { font-size: 13.5px; fill: var(--accent); }
/* shapes */
.sh-tri { fill: none; stroke: var(--shape); stroke-width: 1.2; stroke-linejoin: round; }
.sh-tri.is-hit { stroke: var(--accent); stroke-width: 1.7; fill: color-mix(in srgb, var(--accent) 10%, transparent); }
.sh-sq { fill: color-mix(in srgb, var(--accent) 10%, transparent); stroke: var(--accent); stroke-width: 1.7; }
.sh-blob { fill: none; stroke: var(--ink-mute); stroke-width: 1.5; stroke-dasharray: 2.5 2.5; stroke-linejoin: round; }
.dg-panel { fill: var(--surface); stroke: var(--line); stroke-width: 1.2; }
.dg-panel.is-pick { stroke: var(--accent); }
.dg-cap.is-pick { fill: var(--accent); }
.dg-note.is-pick { fill: var(--accent); }
.dg-in.is-mono { font-family: var(--font-mono); font-size: 13px; fill: var(--ink-mute); }

/* decorative shape field ------------------------------------------------ */
.band.has-deco { overflow: hidden; }
.band.has-deco > .wrap { position: relative; z-index: 1; }
.band-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
}
.deco-col {
  position: absolute;
  top: 0;
  height: 100%;
  width: max(0px, calc((100% - var(--wrap)) / 2));
}
.deco-l { left: 0; }
.deco-r { right: 0; transform: scaleX(-1); }
/* the field settles as you scroll: loud and tilted at the top, a plain
   grid by the time the squares are explained */
.hero.has-deco { overflow: hidden; }
.hero.has-deco > .hero-inner { position: relative; z-index: 1; }
.band-deco.is-chaos { opacity: .34; }
.band-deco.is-order { opacity: .32; }
.is-order .deco-col { overflow: hidden; transform: none; }
.deco-s {
  position: absolute;
  width: 21px;
  height: auto;
  overflow: visible;
  translate: -50% -50%;
}
.sh-sq.is-ghost { stroke: var(--shape); }
@media (max-width: 1250px) { .band-deco { display: none; } }

/* marginalia: a verbatim file with notes in the margin ------------------- */
.marg-fig { margin: 2.5rem 0 0; }
.marg-doc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.marg-path {
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .02em;
  color: var(--ink-mute);
  margin: 0;
  padding: .8rem 1.4rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
}
.marg-path strong { color: var(--ink); font-weight: 600; }
.marg {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14rem;
}
.marg-t {
  font-family: var(--font-mono);
  font-size: .72rem;
  line-height: 1.9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  margin: 0;
  padding: 1.15rem 1.4rem;
  border-top: 1px solid var(--line-soft);
}
.marg-t:first-of-type { border-top: 0; }
.marg-t .mk { color: var(--accent); font-weight: 600; }
.marg-n {
  font-family: var(--font-display);
  font-size: .84rem;
  line-height: 1.55;
  color: var(--ink-mute);
  margin: 0;
  padding: 1.15rem 1.4rem;
  border-top: 1px solid var(--line-soft);
  border-left: 1px solid var(--line);
  background: var(--bg-alt);
}
.marg-n:nth-of-type(1) { border-top: 0; }
.marg-n::before {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--accent);
  margin-bottom: .6rem;
  opacity: .85;
}
.marg-n code {
  font-family: var(--font-mono);
  font-size: .88em;
  color: var(--ink-soft);
}
.marg-n em { color: var(--ink-soft); font-style: italic; }
.marg-fig figcaption { margin-top: 1rem; }
@media (max-width: 860px) {
  .marg { grid-template-columns: 1fr; }
  .marg-n { border-left: 0; background: none; padding-top: .4rem; }
  .marg-t { border-top: 1px solid var(--line-soft); }
}

/* footnote --------------------------------------------------------------- */
.fn-ref {
  font-size: .85em;
  vertical-align: super;
  line-height: 0;
  color: var(--accent);
  text-decoration: none;
  padding-inline: .12em;
}
.fn-ref:hover { text-decoration: underline; }
.footnote {
  margin: 1.4rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
  font-size: .82rem;
  line-height: 1.6;
  color: var(--ink-mute);
  max-width: 46rem;
}
.footnote code { font-family: var(--font-mono); font-size: .9em; color: var(--ink-soft); }
.footnote .fn-star { color: var(--accent); }


/* ============================================================
   THE RUN — timeline page (hero stats, phases, timeline, silence)
   ============================================================ */

/* boundary word, globally (looked-up name → accent italic) */
.mk { color: var(--accent); font-style: italic; font-weight: 600; }

/* ---------- hero stats ---------- */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.4rem, 5vw, 3.2rem);
  margin: 2rem 0 2.4rem;
}
.stat { display: flex; flex-direction: column; gap: 0.25rem; }
.stat-n {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.5rem);
  font-weight: 500;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.stat-u { font-size: 0.5em; color: var(--ink-mute); margin: 0 0.05em; }
.stat-l {
  font-family: var(--font-sans);
  font-size: var(--step--1);
  color: var(--ink-mute);
  letter-spacing: 0.01em;
}
.stat.is-hot .stat-n { color: var(--accent); }

/* ---------- phase sections ---------- */
.phase-head {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin: 0 0 1.6rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.phase-rom {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 1.3rem + 2vw, 2.7rem);
  font-style: italic;
  line-height: 0.9;
  color: var(--accent);
  min-width: 1.4ch;
}
.phase-name {
  font-family: var(--font-display);
  font-size: var(--step-2);
  color: var(--ink);
}
.phase-word {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
  align-self: center;
}
.phase-when {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-mute);
  align-self: center;
}
.phase-head.is-silence .phase-name { color: var(--accent); font-style: italic; }

/* ---------- the timeline ---------- */
.tl { list-style: none; margin: 2rem 0 0.5rem; padding: 0; }
.tl > li { position: relative; padding: 0 0 1.9rem 8.5rem; }
.tl > li:last-child { padding-bottom: 0; }

.tl-time {
  position: absolute;
  left: 0; top: 0.15rem;
  width: 5.75rem;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-mute);
  white-space: nowrap;
}
.tl > li::before {
  content: "";
  position: absolute;
  left: 6.75rem; top: 0.34rem;
  width: 9px; height: 9px; margin-left: -5px;
  border-radius: 50%;
  background: var(--band-bg, var(--bg));
  border: 1.6px solid var(--accent);
  z-index: 1;
}
.tl > li::after {
  content: "";
  position: absolute;
  left: 6.75rem; top: 1.05rem; bottom: -0.15rem;
  margin-left: -0.5px;
  border-left: 1px solid var(--line);
}
.tl > li:last-child::after { display: none; }

.tl-head { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.5rem; }
.tl-cmd {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0.14rem 0.5rem;
}
.tl-x { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-mute); }
.tl-flags { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; }
.flag {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--ink-mute);
  background: var(--bg-alt);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  padding: 0.08rem 0.36rem;
}
.flag.is-hot { color: var(--accent); border-color: var(--accent-dim); background: transparent; font-style: italic; }
.tl-meta { margin: 0.5rem 0 0; display: flex; gap: 0.5rem; align-items: center; }
.tl-dur {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-soft);
  background: var(--surface-2, var(--bg-alt));
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 0.08rem 0.5rem;
}
.tl-dur.is-hot { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.tl-ok {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
}
.tl-ok::before { content: "✓ "; color: var(--accent); }
.tl-note {
  margin: 0.5rem 0 0;
  font-size: var(--step--1);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 60ch;
}
/* the one call that proves */
.tl-node.is-proof .tl-body {
  padding: 0.9rem 1.1rem;
  margin-left: -1.1rem;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  border: 1px solid var(--accent-dim);
  border-radius: var(--r-md);
}
.tl-node.is-proof::before { width: 12px; height: 12px; margin-left: -6px; box-shadow: 0 0 0 4px var(--glow); }

/* ---------- one continuous timeline ---------- */
.tl-full { margin-top: 1.25rem; }

/* phase markers sit on the same rail as the commands (node kept at the
   default position so the connecting line is never broken) */
.tl-mark { padding-top: 0.5rem; }
.tl-mark:first-child { padding-top: 0; }
.tl-mark::before {
  width: 13px; height: 13px; margin-left: -7px;
  top: 0.62rem;
  background: var(--accent);
  border-color: var(--accent);
}
.tl-mark:first-child::before { top: 0.34rem; }
.tl-mark::after { top: 1.4rem; }
.tl-mark:first-child::after { top: 1.05rem; }
.tl-mark .tl-time { top: 0.5rem; color: var(--ink-soft); }
.tl-mark:first-child .tl-time { top: 0.15rem; }
.tl-phase-name {
  margin: 0;
  display: flex; align-items: baseline; gap: 0.6rem;
  font-family: var(--font-display);
  font-size: var(--step-1);
  line-height: 1.15;
  color: var(--ink);
}
.tl-rom { font-style: italic; color: var(--accent); font-size: 1.05em; }
.tl-phase-sub {
  margin: 0.4rem 0 0;
  font-size: var(--step--1);
  line-height: 1.6;
  color: var(--ink-mute);
  max-width: 62ch;
}

/* the gap marker + its reconstructed steps are drawn as a dashed segment */
.tl-gaphead { padding-top: 0.6rem; }
.tl-gaphead::before {
  width: 12px; height: 12px; margin-left: -6px;
  top: 0.55rem;
  border-style: dashed;
  border-color: var(--accent-dim);
  background: var(--band-bg, var(--bg));
}
.tl-gaphead::after,
.tl-node.is-ghost::before,
.tl-node.is-ghost::after {
  border-color: var(--accent-dim);
}
.tl-gaphead::after,
.tl-node.is-ghost::after { border-left-style: dashed; }
.tl-node.is-ghost::before {
  border-style: dashed;
  background: var(--band-bg, var(--bg));
}
.tl-node.is-ghost .tl-head { color: var(--ink); }
.tl-node.is-ghost .tl-note { color: var(--ink-mute); }
.tl-kind {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  border: 1px dashed var(--accent-dim);
  border-radius: var(--r-sm);
  padding: 0.1rem 0.42rem;
}

/* ---------- the silence ---------- */
.gap-dur {
  margin: 0.5rem 0 0.6rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem);
  color: var(--accent);
}
.gap-lead {
  margin: 0 0 2rem;
  font-family: var(--font-display);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 60ch;
}
.inv {
  list-style: none; margin: 0 0 0.5rem; padding: 0;
  display: grid; gap: 0.7rem;
}
.inv-step {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.4rem 1.2rem;
  align-items: baseline;
  padding: 0.95rem 1.2rem;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-left: 2px dashed var(--accent-dim);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.inv-step.is-key {
  border-style: solid;
  border-left: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
}
.inv-tag {
  grid-row: span 2;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
  padding-top: 0.1rem;
}
.inv-step.is-key .inv-tag { color: var(--accent); }
.inv-do { margin: 0; font-family: var(--font-display); font-size: var(--step-0); color: var(--ink); }
.inv-out { margin: 0; grid-column: 2; font-size: var(--step--1); line-height: 1.6; color: var(--ink-soft); }

/* ---------- the point: two-up cards ---------- */
.two-up {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.2rem;
  margin: 2rem 0 0.5rem;
}
.up-card {
  padding: 1.5rem 1.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.up-n {
  margin: 0 0 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.up-t { margin: 0 0 0.5rem; font-family: var(--font-display); font-size: var(--step-1); color: var(--ink); }
.up-b { margin: 0; font-size: var(--step--1); line-height: 1.65; color: var(--ink-soft); }

@media (max-width: 34rem) {
  .tl > li { padding-left: 6.9rem; }
  .tl-time { width: 4.5rem; font-size: 0.64rem; }
  .tl > li::before, .tl > li::after { left: 5.4rem; }
  .inv-step { grid-template-columns: 1fr; gap: 0.3rem; padding: 0.9rem 1rem; }
  .inv-tag { grid-row: auto; }
  .inv-out { grid-column: 1; }
  .phase-when { margin-left: 0; width: 100%; }
}
