/* ═══════════════════════════════════════════════════════════════════
   COMPTEUR DE TIERCES · POC
   Louis Moinet · 1816
   ═══════════════════════════════════════════════════════════════════ */

/* ── Fixed tokens (no theming) ── */
:root {
  --font-display: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;

  --max:          1440px;
  --wrap-pad:     clamp(24px, 6vw, 96px);

  /* Observatory/night-sky diagrams always stay dark regardless of mode */
  --diagram-stage:  #0a0a0b;
  --diagram-border: rgba(232, 228, 220, 0.12);
}

/* ── Dark Mode (default) ── */
[data-theme="dark"] {
  --bg:           #0a0a0b;
  --bg-2:         #111114;
  --bg-3:         #17171b;
  --ink:          #e8e4dc;
  --ink-dim:      #a8a398;
  --ink-mute:     #6b6659;
  --brass:        #c9a255;
  --brass-hi:     #f5d88e;
  --brass-lo:     #7a5e21;
  --steel:        #7a8a9a;
  --rule:         rgba(232, 228, 220, 0.12);
  --rule-soft:    rgba(232, 228, 220, 0.06);
  --grain-opacity: 0.5;
  --nav-bg-from:  rgba(10, 10, 11, 0.88);
  --nav-bg-to:    rgba(10, 10, 11, 0);
}

/* ── Light Mode ── */
[data-theme="light"] {
  --bg:           #f5f0e8;
  --bg-2:         #eae4d6;
  --bg-3:         #e2daca;
  --ink:          #1a100a;
  --ink-dim:      #6a5040;
  --ink-mute:     #a89070;
  --brass:        #8a5a08;
  --brass-hi:     #b07218;
  --brass-lo:     #c8a060;
  --steel:        #556070;
  --rule:         rgba(26, 16, 10, 0.12);
  --rule-soft:    rgba(26, 16, 10, 0.06);
  --grain-opacity: 0;
  --nav-bg-from:  rgba(245, 240, 232, 0.92);
  --nav-bg-to:    rgba(245, 240, 232, 0);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(15px, 0.9vw + 10px, 17px);
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Subtle film grain noise overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  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.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.9 0 0 0 0 0.88 0 0 0 0 0.82 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: var(--grain-opacity);
  z-index: 1000;
  mix-blend-mode: overlay;
  transition: opacity 0.3s ease;
}

::selection { background: var(--brass); color: var(--bg); }

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

.mono {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.78em;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--wrap-pad);
}
.wrap-narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--wrap-pad);
}

/* ═══════════════════════════════════════════════════════════════════
   NAV
   ═══════════════════════════════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--wrap-pad);
  z-index: 100;
  mix-blend-mode: normal;
  backdrop-filter: blur(8px);
  background: linear-gradient(to bottom, var(--nav-bg-from), var(--nav-bg-to));
  transition: background 0.3s;
}
.nav-brand .mono { color: var(--brass); }
.nav-links {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0; padding: 0;
}
.nav-links a {
  color: var(--ink-dim);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: color 0.2s;
  position: relative;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -6px;
  height: 1px;
  background: var(--brass);
}
.nav-progress {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: var(--rule-soft);
}
.nav-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brass);
  transition: width 0.1s linear;
}

@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 64px;
  padding: 120px var(--wrap-pad) 100px;
  overflow: hidden;
}
.hero-grid-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, var(--rule-soft) 1px, transparent 1px) 0 0 / 80px 100%,
    linear-gradient(to bottom, var(--rule-soft) 1px, transparent 1px) 0 0 / 100% 80px;
  opacity: 0.5;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

.hero-watch {
  position: relative;
  width: min(100%, 580px);
  aspect-ratio: 1;
  justify-self: center;
  will-change: transform;
}
.hero-watch-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  filter: contrast(1.05) brightness(0.95) saturate(0.9);
  box-shadow:
    inset 0 0 0 1px rgba(201,162,85,0.2),
    0 40px 120px rgba(0,0,0,0.8),
    0 0 60px rgba(201,162,85,0.08);
  mask-image: radial-gradient(circle at center, black 60%, transparent 95%);
}
.hero-watch-ring {
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  pointer-events: none;
}
.hero-watch-ring::before {
  content: "";
  position: absolute;
  inset: 30px;
  border-radius: 50%;
  border: 1px solid var(--rule-soft);
}

.hero-copy {
  max-width: 560px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
  color: var(--brass);
}
.eyebrow-rule {
  flex: 0 0 60px;
  height: 1px;
  background: var(--brass);
  opacity: 0.5;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(48px, 7vw, 112px);
  line-height: 0.95;
  margin: 0 0 28px;
  letter-spacing: -0.015em;
}
.hero-title-line { display: block; }
.hero-title-italic {
  font-style: italic;
  font-weight: 300;
  color: var(--brass);
  margin-left: 0.1em;
}
.hero-sub {
  font-family: var(--font-display);
  font-size: clamp(18px, 1.4vw, 24px);
  line-height: 1.4;
  color: var(--ink-dim);
  margin: 0 0 56px;
  font-weight: 300;
}
.hero-sub span { display: block; }

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}
.hero-meta-label { color: var(--ink-mute); margin-bottom: 8px; }
.hero-meta-value {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 400;
  line-height: 1;
  color: var(--ink);
}
.hero-meta-unit {
  font-size: 0.5em;
  color: var(--ink-dim);
  font-style: italic;
  letter-spacing: 0;
  margin-left: 2px;
}

.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--ink-mute);
  font-size: 10px;
}
.hero-scroll-line {
  display: block;
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--brass), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { transform: scaleY(1); transform-origin: top; opacity: 1; }
  50% { transform: scaleY(0.4); transform-origin: top; opacity: 0.3; }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 48px;
    padding-top: 100px;
  }
  .hero-watch { max-width: 400px; order: 2; }
  .hero-copy { order: 1; }
}

/* ═══════════════════════════════════════════════════════════════════
   PROLOGUE
   ═══════════════════════════════════════════════════════════════════ */
.prologue {
  padding: 160px 0 140px;
  text-align: left;
  position: relative;
}
.prologue::before {
  content: "";
  position: absolute;
  top: 80px; left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--brass), transparent);
}
.prologue-kicker {
  color: var(--brass);
  margin-bottom: 48px;
}
.prologue-lede {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(32px, 3.6vw, 56px);
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 56px;
  letter-spacing: -0.01em;
}
.prologue-lede em {
  font-style: italic;
  color: var(--brass);
}
.prologue-body {
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink-dim);
  max-width: 560px;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   SECTION HEADS (shared)
   ═══════════════════════════════════════════════════════════════════ */
.section-head {
  margin-bottom: 80px;
  max-width: 820px;
}
.section-num {
  display: inline-block;
  color: var(--brass);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--brass);
}
.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 5vw, 72px);
  line-height: 1.05;
  margin: 0 0 24px;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.section-dek {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(18px, 1.4vw, 22px);
  line-height: 1.5;
  color: var(--ink-dim);
  margin: 0;
  max-width: 640px;
}

/* ═══════════════════════════════════════════════════════════════════
   PURPOSE
   ═══════════════════════════════════════════════════════════════════ */
.purpose {
  padding: 120px 0 140px;
  border-top: 1px solid var(--rule);
}
.purpose-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}
.purpose-diagram {
  margin: 0;
  position: sticky;
  top: 120px;
  padding: 40px;
  border: 1px solid var(--diagram-border);
  background: var(--diagram-stage);
}
.purpose-svg { width: 100%; height: auto; }
.purpose-meridian {
  stroke-linecap: round;
}
.purpose-flash { mix-blend-mode: screen; }
.purpose-body p { margin: 0 0 24px; color: var(--ink-dim); }
.purpose-body .drop-cap::first-letter {
  font-family: var(--font-display);
  font-size: 5em;
  float: left;
  line-height: 0.85;
  padding: 0.05em 0.12em 0 0;
  color: var(--brass);
  font-weight: 400;
}
.purpose-body strong {
  color: var(--ink);
  font-weight: 500;
}
.purpose-body em {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--brass);
}

.purpose-facts {
  margin: 48px 0 0;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}
.purpose-facts > div {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.purpose-facts > div:last-child { border-bottom: none; }
.purpose-facts dt {
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  padding-top: 4px;
}
.purpose-facts dd {
  margin: 0;
  color: var(--ink-dim);
  font-size: 15px;
  line-height: 1.6;
}
.purpose-facts dd em {
  color: var(--brass);
  font-style: italic;
}

@media (max-width: 900px) {
  .purpose-grid { grid-template-columns: 1fr; gap: 48px; }
  .purpose-diagram { position: static; }
  .purpose-facts > div { grid-template-columns: 1fr; gap: 8px; }
}

/* ═══════════════════════════════════════════════════════════════════
   ANATOMY — pinned exploded view
   ═══════════════════════════════════════════════════════════════════ */
.anatomy {
  position: relative;
  background: var(--bg-2);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.anatomy-pin {
  min-height: 100vh;
  position: relative;
}
.anatomy-stage {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 80px var(--wrap-pad) 60px;
}
.anatomy-head {
  margin-bottom: 20px;
  max-width: 600px;
}
.anatomy-head .section-title { font-size: clamp(28px, 3.2vw, 44px); margin-bottom: 8px; }
.anatomy-head .section-dek   { font-size: 15px; }

.anatomy-viewport {
  flex: 1;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px 320px;
  gap: 48px;
  min-height: 0;
}
.anatomy-stack {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.anatomy-layer {
  position: absolute;
  width: min(440px, 60vh);
  height: min(440px, 60vh);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
  filter: drop-shadow(0 10px 30px rgba(0,0,0,0.6));
}
/* Stacking — case back at bottom, hands at top when assembled */
.anatomy-layer[data-layer="5"] { z-index: 1; }
.anatomy-layer[data-layer="4"] { z-index: 2; }
.anatomy-layer[data-layer="3"] { z-index: 3; }
.anatomy-layer[data-layer="2"] { z-index: 4; }
.anatomy-layer[data-layer="1"] { z-index: 5; }
.anatomy-layer[data-layer="0"] { z-index: 6; }
.layer-svg { width: 100%; height: 100%; }
.anatomy-gear-secondary {
  opacity: 0.88;
}

.anatomy-functional {
  align-self: end;
  padding: 28px;
  border: 1px solid var(--rule);
  background:
    linear-gradient(180deg, rgba(201,162,85,0.08), transparent),
    var(--bg-2);
  box-shadow: 0 24px 60px rgba(0,0,0,0.2);
}
.anatomy-functional-kicker {
  color: var(--brass);
  margin-bottom: 12px;
}
.anatomy-functional-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.05;
  color: var(--ink);
}
.anatomy-functional-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-dim);
}
.anatomy-functional-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}
.anatomy-functional-metrics span {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-mute);
}
.anatomy-functional-metrics strong {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
}

.anatomy-labels {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding-left: 16px;
  border-left: 1px solid var(--rule);
  overflow: hidden;
}
.anatomy-label {
  display: grid;
  grid-template-columns: 24px 32px 1fr;
  gap: 10px;
  align-items: start;
  padding: 8px 0;
  opacity: 0.25;
  transition: opacity 0.4s;
}
.anatomy-label.is-active { opacity: 1; }
.label-rule {
  height: 1px;
  width: 100%;
  background: var(--brass);
  margin-top: 10px;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.5s ease;
}
.anatomy-label.is-active .label-rule { transform: scaleX(1); }
.label-num { color: var(--brass); font-size: 11px; padding-top: 2px; }
.label-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  color: var(--ink);
  margin-bottom: 2px;
}
.label-sub {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-mute);
}

.anatomy-progress {
  display: grid;
  grid-template-columns: 120px 1fr 60px;
  align-items: center;
  gap: 20px;
  padding-top: 20px;
  margin-top: 16px;
  border-top: 1px solid var(--rule-soft);
  color: var(--ink-mute);
  font-size: 11px;
}
#anatomyStage { color: var(--brass); }
.anatomy-progress-bar {
  height: 2px;
  background: var(--rule);
  position: relative;
  overflow: hidden;
}
.anatomy-progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--brass);
  transition: width 0.1s linear;
}

@media (max-width: 900px) {
  .anatomy-viewport { grid-template-columns: 1fr; }
  .anatomy-labels { display: none; }
  .anatomy-functional { order: 3; }
}

/* ═══════════════════════════════════════════════════════════════════
   BEAT — 1 vs 4 vs 30 Hz
   ═══════════════════════════════════════════════════════════════════ */
.beat {
  padding: 140px 0 140px;
  border-top: 1px solid var(--rule);
}
.beat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  margin: 40px 0;
}
.beat-cell {
  padding: 48px 32px;
  border: 1px solid var(--rule);
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: border-color 0.3s, transform 0.3s;
  position: relative;
}
.beat-cell--moinet {
  border-color: rgba(201,162,85,0.3);
  background: linear-gradient(180deg, rgba(201,162,85,0.04), var(--bg-2));
}
.beat-cell--moinet::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 60px rgba(201,162,85,0.08);
}
.beat-vis { width: 180px; height: 180px; margin-bottom: 24px; position: relative; }
.beat-svg { width: 100%; height: 100%; }
.beat-pulse { transform-origin: center; }

.beat-hz {
  color: var(--brass);
  font-size: 14px;
  margin-bottom: 12px;
}
.beat-cell--moinet .beat-hz { color: var(--brass-hi); font-size: 16px; }
.beat-name {
  font-family: var(--font-display);
  font-size: 22px;
  margin-bottom: 16px;
  color: var(--ink);
}
.beat-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-mute);
}
.beat-footnote {
  text-align: center;
  color: var(--ink-mute);
  font-size: 10px;
  margin-top: 32px;
}
.beat-footnote span:first-child { color: var(--brass); margin-right: 8px; }

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

/* ═══════════════════════════════════════════════════════════════════
   SHUTTLE — interactive
   ═══════════════════════════════════════════════════════════════════ */
.shuttle {
  padding: 140px 0 140px;
  background: var(--bg-2);
  border-top: 1px solid var(--rule);
}
.shuttle-stage {
  display: grid;
  grid-template-columns: 200px 1fr 300px;
  gap: 64px;
  align-items: start;
  margin-top: 40px;
}
.shuttle-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.shuttle-btn {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}
.shuttle-btn:hover {
  border-color: var(--brass);
  color: var(--brass);
  transform: translateX(4px);
}
.shuttle-btn.is-active {
  background: rgba(201,162,85,0.1);
  border-color: var(--brass);
  color: var(--brass-hi);
}
.shuttle-btn .mono:first-child { color: var(--brass); }

.shuttle-diagram {
  width: 100%;
  aspect-ratio: 680 / 400;
  justify-self: stretch;
  position: relative;
  margin-top: 10px;
}
.shuttle-svg { width: 100%; height: 100%; display: block; }
/* labels never catch pointer events */
.shuttle-labels text { pointer-events: none; letter-spacing: 0.12em; }
.shuttle-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 20px 60px rgba(0,0,0,0.4));
}
/* Rotation pivots for shuttle components are set via GSAP's svgOrigin,
   which works in the SVG document's coordinate system (SVG user units)
   and correctly accounts for parent transforms. No CSS pivot needed. */

.shuttle-legend {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 18px;
}
.shuttle-legend-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.shuttle-legend-item:last-child { border-bottom: none; }
.shuttle-legend-step { color: var(--brass); padding-top: 2px; }
.shuttle-legend-item p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-dim);
}
.shuttle-legend-item strong {
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 11px;
  font-family: var(--font-mono);
}

@media (max-width: 1100px) {
  .shuttle-stage { grid-template-columns: 1fr; gap: 32px; }
  .shuttle-controls { flex-direction: row; flex-wrap: wrap; }
  .shuttle-legend { padding-top: 0; }
}

/* ═══════════════════════════════════════════════════════════════════
   DIAL — annotated
   ═══════════════════════════════════════════════════════════════════ */
.dial { padding: 140px 0; border-top: 1px solid var(--rule); }
.dial-stage {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 64px;
  align-items: center;
  margin-top: 40px;
}
.dial-photo-wrap {
  position: relative;
  width: min(100%, 560px);
  aspect-ratio: 1;
  justify-self: center;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 40px 120px rgba(0,0,0,0.6);
}
.dial-photo {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: contrast(1.05) saturate(0.9);
}
.dial-overlay {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.dial-spot {
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 0.3s, filter 0.3s;
  opacity: 1;
}
.dial-spot > circle:first-child {
  transform-origin: center;
  transform-box: fill-box;
  fill: rgba(245, 216, 142, 0.55);
  stroke: #fff1c8;
  stroke-width: 3.2;
  animation: dialPulse 2.2s ease-in-out infinite;
  filter:
    drop-shadow(0 0 4px rgba(255, 255, 255, 1))
    drop-shadow(0 0 18px rgba(245, 216, 142, 1))
    drop-shadow(0 0 30px rgba(201, 162, 85, 0.8));
}
.dial-spot > line {
  stroke: #f5d88e;
  stroke-opacity: 0.95;
  stroke-width: 1.2;
}
.dial-spot[data-spot="seconds"] > circle:first-child   { animation-delay: 0.35s; }
.dial-spot[data-spot="hours"] > circle:first-child     { animation-delay: 0.7s; }
.dial-spot[data-spot="minutes"] > circle:first-child   { animation-delay: 1.05s; }
.dial-spot[data-spot="scale"] > circle:first-child     { animation-delay: 1.4s; }
.dial-spot:hover > circle:first-child,
.dial-spot.is-active > circle:first-child {
  animation: none;
  fill: rgba(245, 216, 142, 0.6);
  stroke: #fff1c8;
  stroke-width: 3.2;
}
.dial-spot:hover, .dial-spot.is-active {
  opacity: 1;
  filter: drop-shadow(0 0 26px rgba(245, 216, 142, 1));
}
.dial-spot.is-active > line,
.dial-spot:hover > line {
  stroke-opacity: 1;
  stroke-width: 1.2;
}

@keyframes dialPulse {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%      { transform: scale(1.32); opacity: 0.55; }
}

.dial-callouts {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dial-callout {
  padding: 20px 24px;
  border-left: 2px solid var(--rule);
  border-radius: 0 18px 18px 0;
  transition: border-color 0.3s, background 0.3s, transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}
.dial-callout:hover,
.dial-callout.is-active {
  border-left-color: var(--brass);
  background: linear-gradient(90deg, rgba(201,162,85,0.12), rgba(201,162,85,0.04));
  transform: translateX(4px);
  box-shadow: inset 0 0 0 1px rgba(201,162,85,0.12);
}
.dial-callout-num { color: var(--brass); margin-bottom: 8px; font-size: 10px; }
.dial-callout-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--ink);
}
.dial-callout-body {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-mute);
}

@media (max-width: 1000px) {
  .dial-stage { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════
   LEGACY — timeline
   ═══════════════════════════════════════════════════════════════════ */
.legacy {
  padding: 140px 0;
  background: var(--bg-2);
  border-top: 1px solid var(--rule);
}
.legacy .wrap {
  position: relative;
}
.timeline {
  list-style: none;
  padding: 0;
  margin: 40px 0 0;
  position: relative;
}
.timeline-progress {
  position: absolute;
  left: 140px;
  top: 20px;
  bottom: 20px;
  width: 1px;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}
.timeline-progress span {
  display: block;
  width: 100%;
  height: 0%;
  background: linear-gradient(to bottom, rgba(245,216,142,0), rgba(245,216,142,1), rgba(245,216,142,0.25));
  box-shadow: 0 0 10px rgba(245,216,142,0.6);
}
.timeline::before {
  content: "";
  position: absolute;
  left: 140px;
  top: 20px; bottom: 20px;
  width: 1px;
  background: var(--rule);
}
.timeline::after {
  content: "";
  position: absolute;
  left: 140px;
  top: 20px;
  width: 1px;
  height: var(--timeline-progress, 0%);
  background: linear-gradient(to bottom, rgba(245,216,142,0), rgba(245,216,142,1) 20%, rgba(245,216,142,0.35));
  box-shadow: 0 0 10px rgba(245,216,142,0.6);
  pointer-events: none;
  z-index: 2;
  transition: height 0.08s linear;
}
.timeline-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 40px;
  padding: 32px 0;
  position: relative;
  opacity: 0.82;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.timeline-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: 135px; top: 44px;
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 1px solid var(--brass);
  background: var(--bg-2);
}
.timeline-item--key::before {
  background: var(--brass);
  box-shadow: 0 0 0 4px rgba(201,162,85,0.15);
}
.timeline-year {
  color: var(--brass);
  font-family: var(--font-mono);
  font-size: 13px;
  padding-top: 14px;
  letter-spacing: 0.1em;
}
.timeline-body { padding-left: 40px; }
.timeline-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  margin: 0 0 12px;
  color: var(--ink);
}
.timeline-item--key .timeline-title { color: var(--brass-hi); }
.timeline-body p {
  margin: 0;
  color: var(--ink-dim);
  line-height: 1.65;
  max-width: 640px;
}
.timeline-body .mono { color: var(--brass); }

@media (max-width: 720px) {
  .timeline::before, .timeline-item::before, .timeline-progress { display: none; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px; }
  .timeline-body { padding-left: 0; }
}

/* ═══════════════════════════════════════════════════════════════════
   FOOT
   ═══════════════════════════════════════════════════════════════════ */
.foot {
  padding: 80px 0 60px;
  border-top: 1px solid var(--rule);
  color: var(--ink-mute);
}
.foot-sig {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--brass);
  margin-bottom: 24px;
}
.foot-ornament { color: var(--brass); }
.foot-note {
  max-width: 560px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-mute);
  margin: 0 0 32px;
}
.foot-mono {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid var(--rule-soft);
  font-size: 10px;
  color: var(--ink-mute);
}

/* ═══════════════════════════════════════════════════════════════════
   THEME TOGGLE
   ═══════════════════════════════════════════════════════════════════ */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--brass); }
.theme-icon { font-size: 14px; line-height: 1; }
[data-theme="dark"]  .theme-icon::after { content: '☀'; }
[data-theme="light"] .theme-icon::after { content: '☾'; }

/* ── Smooth theme transitions ── */
body, .nav, .beat-cell, .dial-callout, .shuttle-btn,
.anatomy-functional, .legacy, .anatomy, .shuttle, .beat, .dial,
.purpose, .prologue, .foot, .timeline-item::before {
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease;
}

/* ═══════════════════════════════════════════════════════════════════
   REVEAL UTILITIES
   ═══════════════════════════════════════════════════════════════════ */
[data-split] {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s cubic-bezier(.2,.7,.2,1), transform 0.9s cubic-bezier(.2,.7,.2,1);
}
.reveal.is-in { opacity: 1; transform: none; }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
