/* ===========================================================
   Axon Systems — v2
   Visually rich, awwwards-grade. Dark technical, bold display,
   live canvas atmosphere, custom cursor, smooth scroll.
   =========================================================== */

:root {
  /* Color — dark theme (default) */
  --bg:           #0A0A0B;
  --bg-elev:      #0F0F11;
  --bg-soft:      #0C0C0E;
  --bg-hover:     #14141A;
  --bg-glass:     rgba(10,10,11,0.65);
  --fg:           #F2F0EC;
  --fg-strong:    #FFFFFF;
  --fg-muted:     #8B8A85;
  --fg-faint:     #4F4E4A;
  --rule:         #1F1F22;
  --rule-strong:  #2C2C30;
  --accent:       #C9F26E;
  --accent-soft:  rgba(201, 242, 110, 0.15);
  --accent-warm:  #D9F88C;
  --on-accent:    #0A0A0B;
  --danger:       #FF6B47;
  --shadow-soft:  0 1px 2px rgba(0,0,0,0.4);
  --color-scheme: dark;

  /* Type — theme-invariant */
  --display:  'Bricolage Grotesque', system-ui, sans-serif;
  --body:     'Geist', 'Söhne', system-ui, -apple-system, sans-serif;
  --mono:     'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* Layout — theme-invariant */
  --pad-x:        clamp(1.25rem, 4vw, 4rem);
  --section-pad:  clamp(6rem, 14vh, 12rem);
  --max-w:        1480px;
  --content-w:    1180px;

  /* Motion — theme-invariant */
  --ease:         cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:      cubic-bezier(0.7, 0, 0.84, 0);
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Light theme — color tokens only; type/layout/motion inherit from :root */
:root[data-theme="light"] {
  --bg:           #F4F1EA;
  --bg-elev:      #ECE7D7;
  --bg-soft:      #EFEAD9;
  --bg-hover:     #D2C9A5;
  --bg-glass:     rgba(244, 241, 234, 0.78);
  --fg:           #1A1816;
  --fg-strong:    #0A0908;
  --fg-muted:     #5C5A55;
  --fg-faint:     #8E8C86;
  --rule:         #DCD6C4;
  --rule-strong:  #C5BEA9;
  --accent:       #2E4A0A;
  --accent-soft:  rgba(46, 74, 10, 0.10);
  --accent-warm:  #3D5A14;
  --on-accent:    #F4F1EA;
  --danger:       #B8421C;
  --shadow-soft:  0 1px 2px rgba(31, 27, 18, 0.10);
  --color-scheme: light;
}

/* ----------------------- Reset ----------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; scroll-behavior: smooth; color-scheme: var(--color-scheme); }
img, svg, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; padding: 0; margin: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--bg); }

/* ----------------------- Base ----------------------- */
body {
  font-family: var(--body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  overflow-x: hidden;
  cursor: none;
  transition: background-color 320ms var(--ease), color 320ms var(--ease);
}

/* On touch devices keep native cursor */
@media (hover: none) {
  body { cursor: auto; }
  .cursor { display: none !important; }
}

/* ----------------------- Background canvas ----------------------- */
.bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.7;
}

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

/* ----------------------- Loader ----------------------- */
.loader {
  position: fixed; inset: 0;
  z-index: 200;
  background: var(--bg);
  display: grid;
  place-items: center;
  transition: opacity 700ms var(--ease-out), visibility 0s 1.4s;
}
.loader.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-inner {
  text-align: center;
  display: grid;
  gap: 1.4rem;
  justify-items: center;
  color: var(--accent);
}
.loader-mark { animation: loader-pulse 1.4s ease-in-out infinite; }
@keyframes loader-pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}
.loader-counter {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  color: var(--fg);
  display: flex;
  gap: 0.05em;
}
.loader-pct { color: var(--accent); }
.loader-bar {
  width: 220px;
  height: 1px;
  background: var(--rule);
  overflow: hidden;
}
.loader-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 80ms linear;
}

/* ----------------------- Custom cursor ----------------------- */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 0; height: 0;
  pointer-events: none;
  z-index: 300;
  mix-blend-mode: difference;
  will-change: transform;
}
.cursor-dot {
  position: absolute;
  width: 6px; height: 6px;
  background: var(--fg-strong);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 250ms var(--ease), height 250ms var(--ease), background 200ms var(--ease);
}
.cursor-ring {
  position: absolute;
  width: 38px; height: 38px;
  border: 1px solid var(--fg-strong);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 350ms var(--ease-spring), height 350ms var(--ease-spring), border-color 250ms var(--ease), background 250ms var(--ease);
}
.cursor.hover .cursor-dot { width: 0; height: 0; }
.cursor.hover .cursor-ring {
  width: 76px; height: 76px;
  background: var(--fg-strong);
  border-color: var(--fg-strong);
}
.cursor-label {
  /* Sit below the enlarged ring (38px radius + 16px gap) so the label never
     overlaps the hovered element's own visible text */
  position: absolute;
  top: 54px;
  left: 0;
  transform: translate(-50%, 0);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  /* With mix-blend-mode: difference on the parent, label color = bg yields
     max-contrast inverted text in both themes */
  color: var(--bg);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 200ms var(--ease) 80ms, top 250ms var(--ease);
  font-weight: 500;
}
.cursor.hover .cursor-label { opacity: 1; }

/* ----------------------- Mono labels ----------------------- */
.mono-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}
.mono-label.dim { color: var(--fg-muted); }
.mono-label.accent { color: var(--accent); }

/* ----------------------- Live dot ----------------------- */
.live-dot {
  display: inline-block;
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  position: relative;
  box-shadow: 0 0 12px var(--accent);
}
.live-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: live-pulse 2s ease-out infinite;
}
@keyframes live-pulse {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(2.6); opacity: 0; }
}

/* ----------------------- Italic helper ----------------------- */
.italic {
  font-style: italic;
  font-variation-settings: 'wght' 380, 'wdth' 95;
  font-family: var(--display);
}
.accent { color: var(--accent); }

/* ----------------------- Header ----------------------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: var(--bg-glass);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.05rem var(--pad-x);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2rem;
}
.header-rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rule-strong) 20%, var(--rule-strong) 80%, transparent);
  opacity: 0;
  transition: opacity 300ms var(--ease);
}
.site-header.scrolled .header-rule { opacity: 1; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--fg-strong);
  font-family: var(--display);
}
.logo-mark {
  display: inline-flex;
  color: var(--accent);
  animation: logo-spin 30s linear infinite;
}
@keyframes logo-spin { to { transform: rotate(360deg); } }
.logo-word {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variation-settings: 'wght' 600, 'wdth' 90;
}
.logo-sys {
  color: var(--fg-muted);
  font-weight: 400;
  font-variation-settings: 'wght' 380, 'wdth' 90;
  margin-left: 0.05em;
}

.nav-primary {
  display: flex;
  gap: 1.6rem;
  justify-content: center;
}
.nav-primary a {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  position: relative;
  padding: 0.4rem 0.2rem;
  transition: color 200ms var(--ease);
}
.nav-primary a::before {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 360ms var(--ease-out);
}
.nav-primary a:hover { color: var(--fg-strong); }
.nav-primary a:hover::before { transform: scaleX(1); }
@media (max-width: 880px) {
  .nav-primary { display: none; }
  .header-inner { grid-template-columns: 1fr auto; }
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.95rem 0.55rem 0.65rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg);
  transition: border-color 240ms var(--ease), color 240ms var(--ease), background 240ms var(--ease);
}
.btn-cta:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.btn-cta-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
}

/* ----------------------- Buttons ----------------------- */
.btn-primary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.4rem;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  transition: all 320ms var(--ease);
  position: relative;
  overflow: hidden;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--fg-strong);
  transform: translateY(101%);
  transition: transform 420ms var(--ease-out);
  z-index: 0;
}
.btn-primary > * { position: relative; z-index: 1; }
.btn-primary:hover::before { transform: translateY(0); }
.btn-primary:hover { color: var(--bg); }
.btn-primary .btn-arrow { transition: transform 320ms var(--ease-spring); }
.btn-primary:hover .btn-arrow { transform: translateX(4px); }

.btn-ghost {
  border: 1px solid var(--rule-strong);
  color: var(--fg);
  background: transparent;
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-primary.large, .btn-ghost.large {
  padding: 1.15rem 1.7rem;
  font-size: 0.82rem;
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  padding: clamp(8rem, 16vh, 12rem) var(--pad-x) clamp(4rem, 8vh, 7rem);
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(2rem, 5vh, 4rem);
  max-width: var(--max-w);
  margin: 0 auto;
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.4rem;
}

.hero-headline {
  font-family: var(--display);
  font-size: clamp(3rem, 11vw, 11rem);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.045em;
  color: var(--fg-strong);
  margin: 0;
  font-variation-settings: 'wght' 500, 'wdth' 90, 'opsz' 96;
}
.hero-headline .line {
  display: block;
  overflow: hidden;
}
.hero-headline .word {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  transition: transform 1.1s var(--ease-out), opacity 0.7s var(--ease-out);
}
.hero-headline .word.italic {
  font-style: italic;
  font-variation-settings: 'wght' 400, 'wdth' 85, 'opsz' 96;
  color: var(--fg-muted);
}
/* Only add optical kerning when an italic word is followed by a non-italic word
   (italic-italic adjacency keeps the natural word-space) */
.hero-headline .word.italic:has(+ .word:not(.italic)) { margin-right: 0.32em; }
.hero-headline .word.accent {
  color: var(--accent);
  position: relative;
}
.loaded .hero-headline .word { transform: translateY(0); opacity: 1; }
.loaded .hero-headline .word[data-r="0"] { transition-delay: 0.05s; }
.loaded .hero-headline .word[data-r="1"] { transition-delay: 0.12s; }
.loaded .hero-headline .word[data-r="2"] { transition-delay: 0.20s; }
.loaded .hero-headline .word[data-r="3"] { transition-delay: 0.27s; }
.loaded .hero-headline .word[data-r="4"] { transition-delay: 0.36s; }
.loaded .hero-headline .word[data-r="5"] { transition-delay: 0.46s; }

.hero-foot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: end;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}
@media (max-width: 880px) {
  .hero-foot { grid-template-columns: 1fr; }
}
.hero-foot-l { max-width: 52ch; display: grid; gap: 1rem; }
.hero-sub {
  font-family: var(--display);
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  line-height: 1.45;
  color: var(--fg);
  margin: 0;
  font-variation-settings: 'wght' 380, 'wdth' 100;
  letter-spacing: -0.005em;
}
.hero-foot-r {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.scroll-cue {
  position: absolute;
  bottom: 1.4rem;
  right: var(--pad-x);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: var(--fg-muted);
}
.scroll-line {
  display: block;
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  position: relative;
  overflow: hidden;
}
.scroll-line::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 30%;
  background: var(--fg-strong);
  animation: scroll-cue 2s ease-in-out infinite;
}
@keyframes scroll-cue {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(300%); }
}
@media (max-width: 700px) { .scroll-cue { display: none; } }

/* =========================================================
   MARQUEE
   ========================================================= */
.marquee {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--bg-soft);
  overflow: hidden;
  position: relative;
  padding: 0;
}
.marquee::before, .marquee::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: clamp(40px, 12vw, 120px);
  z-index: 2;
  pointer-events: none;
}
.marquee::before { left: 0; background: linear-gradient(90deg, var(--bg-soft), transparent); }
.marquee::after { right: 0; background: linear-gradient(-90deg, var(--bg-soft), transparent); }

.marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 2.4rem;
  white-space: nowrap;
  padding: 1.4rem 0;
  font-family: var(--display);
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  font-weight: 500;
  font-variation-settings: 'wght' 500, 'wdth' 85;
  color: var(--fg-strong);
  letter-spacing: -0.02em;
  animation: marquee-l 40s linear infinite;
}
.marquee-track[data-dir="right"] { animation: marquee-r 50s linear infinite; }
.marquee-track.sm {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 500;
  border-top: 1px solid var(--rule);
  padding: 0.8rem 0;
}
.m-item { display: inline-block; }
.m-sym { color: var(--accent); font-size: 0.6em; }
.m-mono { display: inline-block; }
.m-sep { color: var(--accent); margin: 0 0.6em; }

@keyframes marquee-l { to { transform: translateX(-50%); } }
@keyframes marquee-r {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

/* =========================================================
   SECTION primitives
   ========================================================= */
.section {
  position: relative;
  padding: var(--section-pad) var(--pad-x);
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-head {
  max-width: var(--content-w);
  margin: 0 0 clamp(3rem, 6vh, 5rem);
  display: grid;
  gap: 1.6rem;
}
.section-head.center { text-align: center; margin-inline: auto; justify-items: center; }
.section-head.center .section-lede { margin-inline: auto; }

.section-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.4rem, 6.5vw, 6rem);
  line-height: 0.96;
  letter-spacing: -0.035em;
  color: var(--fg-strong);
  margin: 0;
  font-variation-settings: 'wght' 500, 'wdth' 90, 'opsz' 96;
}
.section-title.huge {
  font-size: clamp(3rem, 8vw, 8rem);
}
.section-title .italic {
  font-style: italic;
  font-variation-settings: 'wght' 400, 'wdth' 85, 'opsz' 96;
  color: var(--fg-muted);
}
/* Only kern italic→roman; italic→italic uses the natural word-space */
.section-title .italic:has(+ *:not(.italic)) { padding-right: 0.16em; }
.section-title .accent { color: var(--accent); }

.section-lede {
  font-family: var(--display);
  font-weight: 380;
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  line-height: 1.5;
  color: var(--fg-muted);
  max-width: 64ch;
  margin: 0;
  font-variation-settings: 'wght' 380, 'wdth' 100;
}

/* Reveal helpers */
.reveal-word, .reveal-fade {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 1.0s var(--ease-out);
  display: inline-block;
}
.reveal-fade { display: block; }
.in-view .reveal-word, .in-view .reveal-fade { opacity: 1; transform: translateY(0); }
.in-view .reveal-word:nth-child(1) { transition-delay: 0.05s; }
.in-view .reveal-word:nth-child(2) { transition-delay: 0.12s; }
.in-view .reveal-word:nth-child(3) { transition-delay: 0.20s; }
.in-view .reveal-word:nth-child(4) { transition-delay: 0.28s; }
.in-view .reveal-word:nth-child(5) { transition-delay: 0.36s; }
.in-view .reveal-word:nth-child(6) { transition-delay: 0.44s; }

/* =========================================================
   CAPABILITIES
   ========================================================= */
.cap-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
}
@media (max-width: 980px) { .cap-grid { grid-template-columns: 1fr; } }

.cap {
  background: var(--bg-elev);
  display: grid;
  grid-template-rows: auto 1fr;
  position: relative;
  overflow: hidden;
  transition: background 320ms var(--ease);
}
.cap:hover { background: var(--bg-hover); }

.cap-vis {
  height: 220px;
  border-bottom: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at center, rgba(201,242,110,0.05), transparent 70%);
}
.cap-vis canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
}

.cap-body {
  padding: clamp(1.6rem, 2.4vw, 2.4rem);
  display: grid;
  gap: 0.9rem;
  align-content: start;
}
.cap-num {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-weight: 500;
}
.cap-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.4rem, 1.8vw, 1.7rem);
  line-height: 1.1;
  letter-spacing: -0.018em;
  color: var(--fg-strong);
  margin: 0;
  font-variation-settings: 'wght' 500, 'wdth' 92;
}
.cap-desc {
  color: var(--fg-muted);
  font-size: 0.97rem;
  margin: 0;
  line-height: 1.55;
}
.cap-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.6rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--rule);
}
.cap-tags li {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  text-transform: uppercase;
  transition: border-color 240ms var(--ease), color 240ms var(--ease);
}
.cap:hover .cap-tags li { border-color: var(--accent-soft); color: var(--fg); }

/* =========================================================
   WORK / CASE
   ========================================================= */
.section-work { padding-top: clamp(7rem, 16vh, 13rem); }
.case {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1.4fr;
  grid-template-areas:
    "meta stage"
    "narr stage"
    "coda coda";
  column-gap: clamp(2rem, 4vw, 4rem);
  row-gap: clamp(2rem, 4vw, 3.5rem);
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--bg-elev);
  padding: clamp(1.8rem, 3vw, 3rem);
  position: relative;
  overflow: hidden;
}
@media (max-width: 1000px) {
  .case {
    grid-template-columns: 1fr;
    grid-template-areas:
      "meta"
      "stage"
      "narr"
      "coda";
  }
}

.case-meta {
  grid-area: meta;
  display: grid;
  gap: 1.2rem;
  align-self: start;
  border-bottom: 1px solid var(--rule);
  padding-bottom: clamp(1.5rem, 3vw, 2rem);
}
@media (min-width: 1001px) {
  .case-meta {
    grid-template-columns: 1fr 1fr;
    column-gap: 1.4rem;
    row-gap: 1.2rem;
  }
}
.case-meta-row { display: grid; gap: 0.4rem; min-width: 0; }
.case-meta-row span:not(.mono-label) {
  font-family: var(--display);
  font-weight: 480;
  font-size: 1rem;
  color: var(--fg-strong);
  font-variation-settings: 'wght' 480, 'wdth' 95;
  line-height: 1.4;
}
.anon { color: var(--fg-faint); font-style: italic; font-weight: 400; }

.case-stage {
  grid-area: stage;
  position: relative;
  min-height: 480px;
  display: grid;
  place-items: center;
}
.case-diagram {
  width: 100%;
  height: auto;
  max-width: 600px;
  filter: drop-shadow(0 0 60px rgba(201,242,110,0.08));
}
.case-edges line { transition: stroke-opacity 600ms var(--ease); }
.case-nodes circle {
  fill: #0A0A0B;
  stroke: var(--fg-muted);
  stroke-width: 1;
  transition: fill 400ms var(--ease), stroke 400ms var(--ease), r 600ms var(--ease-spring);
}
.case-nodes text {
  font-family: var(--mono);
  font-size: 9px;
  fill: var(--fg-muted);
  letter-spacing: 0.05em;
}

.case-narrative {
  grid-area: narr;
  max-width: 64ch;
}
.case-h {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 2rem 0 0.7rem;
  font-weight: 500;
}
.case-h:first-child { margin-top: 0; }
.case-narrative p {
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--fg);
  margin: 0 0 0.6rem;
}
.case-list { display: grid; gap: 0.6rem; margin-top: 0.4rem; }
.case-list li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--fg);
  font-size: 0.98rem;
  line-height: 1.55;
}
.case-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.7em;
  width: 0.8rem; height: 1px;
  background: var(--accent);
}

.case-metrics {
  grid-area: metrics;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule);
  margin-top: 1rem;
}
@media (max-width: 800px) { .case-metrics { grid-template-columns: repeat(2, 1fr); } }
.metric {
  padding: 1.4rem 1.2rem;
  border-right: 1px solid var(--rule);
  display: grid;
  gap: 0.4rem;
}
.metric:last-child { border-right: 0; }
@media (max-width: 800px) {
  .metric:nth-child(2n) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
}
.metric-num {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2rem, 3.4vw, 3rem);
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--fg-strong);
  font-variation-settings: 'wght' 500, 'wdth' 88;
  display: inline-flex;
  align-items: baseline;
  gap: 0.05em;
}
.metric-num .m-arrow { color: var(--accent); font-style: normal; margin: 0 0.1em; font-weight: 300; }
.metric-num .m-slash, .metric-num .m-pct, .metric-num .m-of { color: var(--fg-muted); font-style: italic; font-weight: 380; }
.metric-num .m-from { color: var(--fg-muted); }
.metric-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  line-height: 1.45;
}

/* =========================================================
   APPROACH — sticky scene + scrolling phases
   ========================================================= */
.section-approach {
  background: var(--bg-soft);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  max-width: none;
  padding-top: clamp(5rem, 12vh, 9rem);
  padding-bottom: clamp(5rem, 12vh, 9rem);
}
.section-approach > .section-head {
  max-width: var(--max-w);
  margin-inline: auto;
  margin-bottom: clamp(2rem, 5vh, 4rem);
}

.approach-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
@media (max-width: 1000px) {
  .approach-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .approach-text { order: 2; }
  .approach-stage { order: 1; }
}

.approach-text { min-width: 0; }
.phases {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule);
}
.phase {
  padding: clamp(2rem, 4vw, 3rem) 0;
  border-bottom: 1px solid var(--rule);
  display: grid;
  gap: 1.2rem;
  position: relative;
  transition: opacity 480ms var(--ease);
  opacity: 0.45;
}
.phase.active { opacity: 1; }
.phase-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.4rem;
  align-items: end;
}
.phase-num {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3rem, 5.5vw, 5.4rem);
  line-height: 0.85;
  color: var(--accent);
  font-variation-settings: 'wght' 360, 'wdth' 78;
  letter-spacing: -0.04em;
  align-self: end;
}
.phase-titles { display: grid; gap: 0.4rem; align-items: end; padding-bottom: 0.3rem; }
.phase-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  letter-spacing: -0.02em;
  color: var(--fg-strong);
  margin: 0;
  font-variation-settings: 'wght' 500, 'wdth' 92;
  line-height: 1;
}
.phase-body { max-width: 56ch; }
.phase-body p {
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--fg);
  margin: 0 0 1rem;
}
.phase-out {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  border-left: 2px solid var(--accent);
  padding-left: 0.8rem;
  line-height: 1.5;
}
.phase-out i { color: var(--accent); font-style: normal; }

/* Sticky stage on the right */
.approach-stage { min-width: 0; position: relative; }
.approach-stage-sticky {
  position: sticky;
  top: 90px;
  height: calc(100vh - 130px);
  min-height: 480px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 50% 60%, rgba(201,242,110,0.06), transparent 60%),
    var(--bg-elev);
  overflow: hidden;
  isolation: isolate;
}
@media (max-width: 1000px) {
  .approach-stage-sticky {
    position: static;
    height: 60vh;
    min-height: 360px;
    margin-bottom: 2rem;
  }
}
canvas#archScene {
  width: 100%;
  height: 100%;
  display: block;
}

.stage-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  z-index: 1;
}
.stage-overlay-top, .stage-overlay-bottom {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}
.stage-overlay-bottom { gap: 1.2rem; }
.stage-overlay-top { justify-content: space-between; }
.stage-coords { font-variant-numeric: tabular-nums; }

.stage-progress {
  flex: 1;
  height: 1px;
  background: var(--rule-strong);
  position: relative;
  overflow: hidden;
}
.stage-progress-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(201,242,110,0.45);
  transition: width 320ms var(--ease-out);
}
#stageState {
  text-transform: lowercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  min-width: 130px;
}
#stagePct {
  font-variant-numeric: tabular-nums;
  min-width: 32px;
  text-align: right;
}

/* =========================================================
   STACK
   ========================================================= */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
}
@media (max-width: 1100px) { .stack-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .stack-grid { grid-template-columns: repeat(2, 1fr); } }
.stack-col {
  background: var(--bg-elev);
  padding: clamp(1.4rem, 2vw, 1.8rem);
  display: grid;
  gap: 1rem;
  align-content: start;
  transition: background 280ms var(--ease);
}
.stack-col:hover { background: var(--bg-hover); }
.stack-col ul {
  display: grid;
  gap: 0.45rem;
}
.stack-col li {
  font-family: var(--display);
  font-weight: 480;
  font-size: 1rem;
  letter-spacing: -0.012em;
  color: var(--fg);
  position: relative;
  padding-left: 1rem;
  font-variation-settings: 'wght' 480, 'wdth' 95;
}
.stack-col li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.55em;
  width: 5px; height: 5px;
  background: var(--accent);
  opacity: 0.5;
  transition: opacity 240ms var(--ease);
}
.stack-col:hover li::before { opacity: 1; }

/* =========================================================
   PRINCIPLES
   ========================================================= */
.section-principles { padding: clamp(8rem, 18vh, 14rem) var(--pad-x); }
.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
}
@media (max-width: 880px) { .principles { grid-template-columns: 1fr; } }
.principle {
  background: var(--bg-elev);
  padding: clamp(2rem, 3.4vw, 3rem);
  display: grid;
  gap: 1rem;
  align-content: start;
  transition: background 280ms var(--ease);
}
.principle:hover { background: var(--bg-hover); }
.principle-num {
  font-family: var(--display);
  font-style: italic;
  font-size: 1rem;
  color: var(--accent);
  letter-spacing: 0.05em;
  font-variation-settings: 'wght' 380;
}
.principle h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.3rem, 1.7vw, 1.55rem);
  letter-spacing: -0.018em;
  color: var(--fg-strong);
  margin: 0;
  line-height: 1.2;
  font-variation-settings: 'wght' 500, 'wdth' 92;
}
.principle p {
  font-size: 0.97rem;
  line-height: 1.6;
  color: var(--fg-muted);
  margin: 0;
}

/* =========================================================
   ENGAGE
   ========================================================= */
.section-engage {
  padding: clamp(7rem, 16vh, 12rem) var(--pad-x);
  position: relative;
  overflow: hidden;
}
.engage-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}
.engage-bg canvas { width: 100%; height: 100%; }
.engage-inner {
  max-width: var(--content-w);
  margin: 0 auto;
  position: relative;
  z-index: 1;
  text-align: center;
  display: grid;
  gap: 2rem;
  justify-items: center;
}
.engage-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.6rem, 7vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--fg-strong);
  margin: 0;
  font-variation-settings: 'wght' 500, 'wdth' 90, 'opsz' 96;
  max-width: 16ch;
}
.engage-title .italic {
  font-style: italic;
  font-variation-settings: 'wght' 400, 'wdth' 85;
  color: var(--accent);
}
.engage-lede {
  font-family: var(--display);
  font-weight: 380;
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--fg-muted);
  max-width: 56ch;
  margin: 0;
  line-height: 1.5;
}
.engage-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.6rem;
}
.engage-fine { margin-top: 1rem; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: clamp(4rem, 8vh, 6rem) var(--pad-x) 2rem;
  background: var(--bg-soft);
}
.footer-mark {
  max-width: var(--max-w);
  margin: 0 auto 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--rule);
}
.footer-logo {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(3.5rem, 12vw, 11rem);
  line-height: 0.9;
  letter-spacing: -0.045em;
  color: var(--fg-strong);
  margin: 0 0 1rem;
  font-variation-settings: 'wght' 500, 'wdth' 85, 'opsz' 96;
}
.footer-tag {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  color: var(--fg-muted);
  font-variation-settings: 'wght' 380, 'wdth' 95;
  margin: 0;
}

.footer-cols {
  max-width: var(--max-w);
  margin: 0 auto 3rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--rule);
}
@media (max-width: 880px) { .footer-cols { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .footer-cols { grid-template-columns: 1fr; } }

.footer-col { display: grid; gap: 0.6rem; align-content: start; }
.footer-col a, .footer-col span:not(.mono-label) {
  font-family: var(--display);
  font-weight: 460;
  font-size: 0.98rem;
  color: var(--fg);
  letter-spacing: -0.005em;
  font-variation-settings: 'wght' 460, 'wdth' 95;
  transition: color 200ms var(--ease);
}
.footer-col a:hover { color: var(--accent); }
.status-row { display: inline-flex; align-items: center; gap: 0.5em; }
.status-row.dim { color: var(--fg-muted); }

.footer-base {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* =========================================================
   LIVE OPS STRIP
   ========================================================= */
.ops-strip {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 30px;
  background: var(--bg);
  border-top: 1px solid var(--rule);
  z-index: 40;
  display: flex;
  align-items: center;
  padding: 0 var(--pad-x) 0 var(--pad-x);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  transform: translateY(0);
  transition: transform 420ms var(--ease);
  overflow: hidden;
}
.ops-strip.hidden { transform: translateY(110%); }

.ops-feed {
  flex: 1;
  position: relative;
  height: 100%;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0, #000 30px, #000 calc(100% - 50px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 30px, #000 calc(100% - 50px), transparent 100%);
}

.ops-line {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  white-space: nowrap;
  position: absolute;
  inset: 0;
  padding-right: 36px;
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 460ms var(--ease-out), transform 520ms var(--ease-out);
  will-change: opacity, transform;
}
.ops-line.in { opacity: 1; transform: translateX(0); }
.ops-line.out { opacity: 0; transform: translateX(14px); }

.ops-line .ops-time {
  color: var(--fg-faint);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.ops-line .ops-tag {
  color: var(--accent);
  opacity: 0.7;
  flex-shrink: 0;
  text-transform: lowercase;
}
.ops-line .ops-tag::before { content: '/ '; opacity: 0.5; }
.ops-line .ops-msg {
  color: var(--fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
}
.ops-line .ops-msg em {
  color: var(--accent);
  font-style: normal;
  font-weight: 500;
  text-shadow: 0 0 12px rgba(201,242,110,0.35);
}

.ops-dismiss {
  position: absolute;
  right: var(--pad-x);
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  display: grid;
  place-items: center;
  color: var(--fg-faint);
  font-size: 16px;
  line-height: 1;
  font-family: var(--mono);
  transition: color 200ms var(--ease);
}
.ops-dismiss:hover { color: var(--fg); }

@media (max-width: 640px) {
  .ops-strip { height: 28px; font-size: 10px; }
  .ops-line .ops-tag { display: none; }
  .ops-line { gap: 0.9rem; }
}

/* =========================================================
   v2 — Header clocks
   ========================================================= */
.header-inner {
  grid-template-columns: auto 1fr auto auto auto;
}
.header-clocks {
  display: inline-flex;
  align-items: center;
  gap: 1.1rem;
  font-family: var(--mono);
  color: var(--fg-muted);
  letter-spacing: 0.06em;
  padding-right: 0.4rem;
}
.hclock {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  position: relative;
}
.hclock + .hclock::before {
  content: '';
  position: absolute;
  left: -0.55rem;
  top: 50%;
  width: 1px;
  height: 10px;
  background: var(--rule-strong);
  transform: translateY(-50%);
}
.hclock-city {
  color: var(--fg-faint);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
}
.hclock-time {
  color: var(--fg);
  font-weight: 500;
}
@media (max-width: 1080px) {
  .header-clocks .hclock:nth-child(3) { display: none; }
}
@media (max-width: 880px) {
  .header-inner { grid-template-columns: 1fr auto; }
  .header-clocks { display: none; }
}

/* =========================================================
   v2 — Partner stack strip
   ========================================================= */
.partners {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--bg-soft);
  padding: clamp(2.4rem, 5vh, 3.8rem) var(--pad-x);
}
.partners-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.partners-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.8rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px dashed var(--rule);
}
.partners-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.partners-col {
  padding: 0.4rem 1.4rem;
  border-right: 1px solid var(--rule);
  display: grid;
  gap: 1.2rem;
  align-content: start;
}
.partners-col:first-child { padding-left: 0; }
.partners-col:last-child { border-right: 0; padding-right: 0; }
.partners-cat {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
}
.partners-row {
  display: grid;
  gap: 0.85rem;
}
.plogo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  padding: 0.45rem 0;
  border-bottom: 1px solid transparent;
  transition: color 240ms var(--ease), border-color 240ms var(--ease), transform 320ms var(--ease);
}
.plogo svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--fg-faint);
  transition: color 240ms var(--ease), transform 360ms var(--ease-spring);
}
.plogo:hover {
  color: var(--fg-strong);
  border-bottom-color: var(--accent);
  transform: translateX(2px);
}
.plogo:hover svg {
  color: var(--accent);
  transform: rotate(-6deg) scale(1.08);
}
.partners-foot {
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px dashed var(--rule);
  text-align: right;
}
@media (max-width: 1080px) {
  .partners-grid { grid-template-columns: repeat(2, 1fr); gap: 1.4rem 0; }
  .partners-col { border-right: 0; padding: 0.4rem 1.2rem; }
  .partners-col:nth-child(odd) { padding-left: 0; border-right: 1px solid var(--rule); }
  .partners-col:nth-child(even) { padding-right: 0; }
}
@media (max-width: 640px) {
  .partners-grid { grid-template-columns: 1fr; }
  .partners-col { border-right: 0 !important; padding: 0 !important; }
  .partners-head { font-size: 0.7rem; }
  .partners-foot { text-align: left; }
}

/* =========================================================
   v2 — Case headline (metric-first)
   ========================================================= */
.case-headline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: clamp(3rem, 6vh, 5rem);
  background: linear-gradient(180deg, var(--bg-soft), transparent 70%);
}
.case-hdr-metric {
  padding: 1.8rem clamp(1rem, 2vw, 1.6rem);
  border-right: 1px solid var(--rule);
  display: grid;
  gap: 0.6rem;
  align-content: start;
  position: relative;
  overflow: hidden;
}
.case-hdr-metric::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.4s var(--ease-out);
}
.case-hdr-metric.in::before { transform: scaleX(1); }
.case-hdr-metric:last-child { border-right: 0; }
.case-hdr-num {
  font-family: var(--display);
  font-size: clamp(2.6rem, 5.6vw, 4.6rem);
  line-height: 0.95;
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--fg-strong);
  font-variation-settings: 'wght' 500, 'wdth' 88, 'opsz' 96;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: baseline;
  gap: 0.05em;
}
.case-hdr-num .case-hdr-slash,
.case-hdr-num .case-hdr-arrow,
.case-hdr-num .case-hdr-pct {
  color: var(--accent);
  margin: 0 0.12em;
  font-weight: 400;
}
.case-hdr-num .case-hdr-slash { font-size: 0.55em; }
.case-hdr-num .case-hdr-arrow { font-size: 0.7em; }
.case-hdr-num .case-hdr-pct { font-size: 0.6em; }
.case-hdr-of { color: var(--fg-muted); font-size: 0.7em; }
.case-hdr-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  line-height: 1.5;
  max-width: 22ch;
}
@media (max-width: 1080px) {
  .case-headline { grid-template-columns: repeat(2, 1fr); }
  .case-hdr-metric:nth-child(2) { border-right: 0; }
  .case-hdr-metric:nth-child(1), .case-hdr-metric:nth-child(2) { border-bottom: 1px solid var(--rule); }
}
@media (max-width: 560px) {
  .case-headline { grid-template-columns: 1fr; }
  .case-hdr-metric { border-right: 0 !important; border-bottom: 1px solid var(--rule); }
  .case-hdr-metric:last-child { border-bottom: 0; }
}

/* =========================================================
   v2.1 — Theme toggle (header)
   ========================================================= */
.theme-toggle {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--rule-strong);
  background: var(--bg-elev);
  padding: 0;
  cursor: none;
  transition: border-color 240ms var(--ease), background 240ms var(--ease);
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle-track {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px;
  pointer-events: none;
}
.theme-icon {
  color: var(--fg-muted);
  transition: color 240ms var(--ease), opacity 240ms var(--ease);
  z-index: 1;
}
.theme-toggle-knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(0);
  transition: transform 380ms var(--ease-spring), background 240ms var(--ease);
  box-shadow: 0 0 8px var(--accent-soft);
}
:root[data-theme="light"] .theme-toggle-knob { transform: translateX(24px); }
:root[data-theme="light"] .theme-icon-moon { opacity: 0.4; }
:root:not([data-theme="light"]) .theme-icon-sun { opacity: 0.4; }
@media (max-width: 880px) {
  .header-inner { grid-template-columns: 1fr auto auto; }
  .theme-toggle { display: none; }
}

/* Mobile: floating theme pill in bottom-right corner */
.theme-toggle-mobile {
  display: none;
}
@media (max-width: 880px) {
  .theme-toggle-mobile {
    display: flex;
    position: fixed;
    bottom: 60px;
    right: 12px;
    z-index: 60;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-elev);
    border: 1px solid var(--rule-strong);
    align-items: center;
    justify-content: center;
    color: var(--fg);
    box-shadow: var(--shadow-soft);
  }
  .theme-toggle-mobile svg { width: 16px; height: 16px; color: var(--accent); }
}

/* =========================================================
   v2.1 — Light-theme refinements
   ========================================================= */
/* Selection colors flip nicely with token swap */
::selection { background: var(--accent); color: var(--on-accent); }

/* In light mode the accent on text needs more visual weight; we kept --accent
   theme-aware (lime → deep moss) so most call-sites work. The btn-primary is
   the only place we need explicit text-on-accent contrast: */
[data-theme="light"] .btn-primary { color: var(--on-accent); }
[data-theme="light"] .btn-primary svg { stroke: var(--on-accent); }

/* CTA dot in header always lime even in light theme */
.btn-cta-dot { background: #C9F26E !important; box-shadow: 0 0 8px rgba(201,242,110,0.6) !important; }
.live-dot { background: #C9F26E !important; box-shadow: 0 0 8px rgba(201,242,110,0.6) !important; }

/* Canvases: in light mode the dark-particle aesthetic doesn't work — fade them to a
   soft, theme-respectful background. We do this with opacity + mix-blend-mode. */
[data-theme="light"] .bg-canvas { opacity: 0.18; mix-blend-mode: multiply; }
[data-theme="light"] .cap-vis canvas { opacity: 0.55; mix-blend-mode: multiply; }
[data-theme="light"] .engage-bg canvas { opacity: 0.35; mix-blend-mode: multiply; }
[data-theme="light"] .case-diagram { filter: none; }
[data-theme="light"] .case-diagram > circle:nth-of-type(2) { stroke: rgba(26,24,22,0.08) !important; }
[data-theme="light"] .case-diagram > circle:nth-of-type(3) { stroke: rgba(26,24,22,0.14) !important; }
[data-theme="light"] .case-nodes circle { fill: var(--bg-elev); stroke: var(--fg-muted); }
[data-theme="light"] .case-nodes text { fill: var(--fg-muted); }
[data-theme="light"] .case-edges { stroke: var(--accent) !important; }
[data-theme="light"] .case-core circle:first-of-type { fill: var(--bg-elev); stroke: var(--accent); }
[data-theme="light"] .case-core circle:last-of-type { fill: var(--accent); }
[data-theme="light"] .case-core text { fill: var(--accent); }

/* Custom cursor uses mix-blend-mode: difference; works in both themes naturally */

/* Header background in light needs the glass effect re-tuned */
[data-theme="light"] .site-header {
  background: rgba(244, 241, 234, 0.78);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
}

/* Loader bg in light mode flips */
[data-theme="light"] .loader { background: var(--bg); }

/* Ops strip text needs to remain readable on light bg */
[data-theme="light"] .ops-strip {
  background: var(--bg-elev);
  border-top: 1px solid var(--rule);
}
[data-theme="light"] .ops-line { color: var(--fg-muted); }

/* Marquee bg flips with --bg-soft, but accent dots work best as lime always */
[data-theme="light"] .m-sym, [data-theme="light"] .m-sep { color: #6E8E1F; }

/* The hero AI-driven word: in light mode, deep moss is the accent — it works. */

/* =========================================================
   v2.1 — Readability fixes
   ========================================================= */
/* Section anchor offset for fixed header */
section[id], #top { scroll-margin-top: 80px; }

/* Case-meta: drop sticky to avoid scroll-overlap with narrative */
.case-meta { position: static !important; top: auto !important; }
.case {
  row-gap: clamp(2.5rem, 5vw, 4rem);
}
@media (max-width: 1000px) {
  .case-meta { padding-bottom: 2rem; }
}

/* Mobile: hide the architecture stage canvas to save space and add a compact phase ribbon instead */
@media (max-width: 720px) {
  .approach-stage { display: none; }
  .approach-grid { grid-template-columns: 1fr !important; gap: 0 !important; }
  .approach-text { order: 1 !important; }
  .desktop-only { display: none; }
}

/* Mobile: bump SVG node-graph labels for legibility */
@media (max-width: 720px) {
  .case-nodes text { font-size: 11px; }
  .case-core text { font-size: 12px !important; }
}

/* Case coda — small footer statement under the case body */
.case-coda {
  grid-column: 1 / -1;
  padding-top: 2rem;
  margin-top: 1rem;
  border-top: 1px dashed var(--rule);
  display: grid;
  gap: 0.5rem;
}
.case-coda p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--fg-muted);
  max-width: 60ch;
  line-height: 1.6;
}

/* =========================================================
   Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-headline .word { transform: none; opacity: 1; }
  .reveal-word, .reveal-fade { transform: none; opacity: 1; }
  .marquee-track { animation: none; }
  .live-dot::after { animation: none; }
  .scroll-line::after { animation: none; }
  .ops-line { transform: none; }
}
