@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@300;400;500&family=Manrope:wght@400;500;600&family=Newsreader:ital,opsz,wght@1,6..72,400&display=swap');

:root {
  --ink: #0a1b20;
  --ink-soft: #183138;
  --paper: #f0eee5;
  --paper-deep: #e5e0d3;
  --acid: #d8ff5f;
  --mist: #c6d5cf;
  --line: rgba(10, 27, 32, 0.18);
  --mono: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Manrope', system-ui, sans-serif;
  --serif: 'Newsreader', Georgia, serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--ink);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
button { font: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 1rem;
  left: 1rem;
  padding: .7rem 1rem;
  background: var(--acid);
  transform: translateY(-180%);
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  position: absolute;
  z-index: 10;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.65rem clamp(1.2rem, 4vw, 4.5rem);
  color: var(--paper);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: -.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 5px);
  gap: 3px;
  padding: 6px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.brand-mark span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.site-header nav { display: flex; gap: 2rem; }
.site-header nav a {
  font-family: var(--mono);
  font-size: .67rem;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
  opacity: .72;
  transition: opacity .2s ease;
}
.site-header nav a:hover { opacity: 1; }

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(360px, .94fr);
  align-items: center;
  overflow: hidden;
  padding: 8rem clamp(1.2rem, 4vw, 4.5rem) 5rem;
  color: var(--paper);
  background:
    radial-gradient(circle at 76% 52%, rgba(85, 125, 124, .24), transparent 25%),
    linear-gradient(130deg, #07161b 0%, #0b2026 54%, #102a2f 100%);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}

.hero-copy { position: relative; z-index: 2; max-width: 780px; }
.eyebrow {
  width: min(100%, 620px);
  display: flex;
  justify-content: space-between;
  margin: 0 0 2.4rem;
  padding-top: .8rem;
  border-top: 1px solid rgba(240, 238, 229, .28);
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .68;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 850px;
  margin-bottom: 2rem;
  font-size: clamp(4rem, 8.1vw, 9.4rem);
  font-weight: 500;
  line-height: .84;
  letter-spacing: -.075em;
}

h1 em, h2 i, .big-statement i {
  font-family: var(--serif);
  font-weight: 400;
}

h1 em { color: var(--acid); }

.hero-intro {
  max-width: 590px;
  margin-bottom: 2.25rem;
  font-size: clamp(1rem, 1.3vw, 1.23rem);
  line-height: 1.65;
  color: rgba(240, 238, 229, .72);
}

.primary-action {
  display: inline-flex;
  align-items: center;
  gap: 2.5rem;
  padding: .95rem 1.05rem .95rem 1.3rem;
  color: var(--ink);
  background: var(--acid);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: .69rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-decoration: none;
  text-transform: uppercase;
  transition: gap .25s ease, background .25s ease;
}

.primary-action:hover { gap: 3rem; background: #e4ff8e; }
.primary-action svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.5; }

.hero-observatory {
  position: relative;
  z-index: 1;
  justify-self: center;
  width: min(42vw, 580px);
  aspect-ratio: 1;
}

.orbit {
  position: absolute;
  inset: 8%;
  border: 1px solid rgba(240, 238, 229, .14);
  border-radius: 50%;
}

.orbit-two { inset: 24%; }
.orbit-one::after, .orbit-two::after {
  content: '';
  position: absolute;
  top: 50%;
  left: -3px;
  width: 6px;
  height: 6px;
  background: var(--acid);
  border-radius: 50%;
  box-shadow: 0 0 16px var(--acid);
}
.orbit-one::after { transform-origin: calc(21vw + 3px) 0; animation: orbit 14s linear infinite; }
.orbit-two::after { top: 16%; left: 82%; animation: pulse 2.6s ease-in-out infinite; }

.planet {
  position: absolute;
  inset: 32%;
  overflow: hidden;
  border: 1px solid rgba(216, 255, 95, .42);
  border-radius: 50%;
  background: radial-gradient(circle at 33% 28%, #738e83 0%, #2b4a4b 36%, #102329 73%);
  box-shadow: inset -32px -16px 50px rgba(0, 0, 0, .5), 0 0 70px rgba(84, 134, 123, .12);
}

.planet-shade { position: absolute; inset: -15% -65% -15% 42%; background: rgba(3, 13, 17, .8); filter: blur(7px); }
.planet-line { position: absolute; width: 130%; height: 35%; left: -15%; border: 1px solid rgba(216,255,95,.15); border-radius: 50%; transform: rotate(-13deg); }
.planet-line-one { top: 22%; }
.planet-line-two { bottom: 12%; }
.observation-dot { position: absolute; top: 32%; right: 30%; width: 9px; height: 9px; border: 2px solid var(--acid); border-radius: 50%; animation: pulse 2s ease-in-out infinite; }
.orbit-label { position: absolute; top: 45%; right: 5%; margin: 0; font: .58rem var(--mono); letter-spacing: .15em; transform: rotate(90deg); opacity: .55; }

.coordinate { position: absolute; font: .55rem/1.6 var(--mono); letter-spacing: .09em; opacity: .38; }
.coordinate-top { top: 2%; left: 8%; }
.coordinate-bottom { right: 5%; bottom: 7%; }
.scroll-note { position: absolute; left: clamp(1.2rem, 4vw, 4.5rem); bottom: 1.6rem; display: flex; align-items: center; gap: .65rem; margin: 0; font: .57rem var(--mono); letter-spacing: .1em; text-transform: uppercase; opacity: .44; }
.scroll-note span { display: block; width: 28px; height: 1px; background: currentColor; }

@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .25; transform: scale(.72); } }

.approach {
  padding: 7rem clamp(1.2rem, 6vw, 7rem) 8rem;
  border-bottom: 1px solid var(--line);
}

.section-index, .kicker {
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.section-index { padding-bottom: 1rem; border-bottom: 1px solid var(--line); color: rgba(10, 27, 32, .48); }
.approach-heading { display: grid; grid-template-columns: 1fr 2fr; padding: 5.5rem 0 6rem; }
.kicker { color: rgba(10, 27, 32, .55); }
.kicker.light { color: rgba(240, 238, 229, .54); }

.approach h2, .story-header h2 {
  margin: 0;
  font-size: clamp(3.5rem, 7.2vw, 8.1rem);
  font-weight: 500;
  line-height: .88;
  letter-spacing: -.07em;
}

.approach h2 i { color: #50716d; }
.principles { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.principle { min-height: 250px; padding: 1.6rem 2rem 1rem 0; border-right: 1px solid var(--line); }
.principle + .principle { padding-left: 2rem; }
.principle:last-child { border-right: 0; }
.principle > span { font: .63rem var(--mono); color: #617b77; }
.principle h3 { margin: 5.2rem 0 .65rem; font-size: 1.15rem; font-weight: 600; letter-spacing: -.03em; }
.principle p { max-width: 340px; margin: 0; font-size: .9rem; color: rgba(10, 27, 32, .62); }

.field-note {
  padding: 7rem clamp(1.2rem, 6vw, 7rem) 4rem;
  color: var(--paper);
  background: var(--ink);
}

.story-header { display: grid; grid-template-columns: 1.2fr .8fr; align-items: end; gap: 5vw; padding-bottom: 5rem; }
.story-header h2 i { color: var(--acid); }
.story-deck { max-width: 490px; margin: 0 0 .55rem; font-size: clamp(1rem, 1.5vw, 1.24rem); line-height: 1.65; color: rgba(240, 238, 229, .68); }

.lightning-lab { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, .6fr); min-height: 690px; border: 1px solid rgba(240, 238, 229, .18); }
.storm-scene { position: relative; min-height: 620px; overflow: hidden; border-right: 1px solid rgba(240, 238, 229, .18); background: #17343a; }
.storm-scene svg { width: 100%; height: 100%; display: block; object-fit: cover; }
.terrain.far { fill: #183439; }
.terrain.near { fill: #091a1f; }
.tower { fill: none; stroke: #0b1c21; stroke-width: 5; stroke-linejoin: round; }
.cloud { opacity: .72; filter: drop-shadow(0 14px 25px rgba(0,0,0,.38)); }
.cloud-charge-glow { opacity: 0; transition: opacity .5s ease; }
.charges { font: 28px var(--mono); opacity: 0; transition: opacity .5s ease; }
.charges.negative { fill: #b9e9ff; }
.charges.positive { fill: var(--acid); }
.scene-label, .direction-label { font: 10px var(--mono); letter-spacing: .14em; fill: rgba(240,238,229,.45); }
.direction-label { opacity: 0; transition: opacity .3s ease; fill: var(--acid); }

.leader-group, .streamer-group, .return-group { opacity: 0; }
.leader, .branch { stroke-dasharray: 900; stroke-dashoffset: 900; }
.leader.glow-line { stroke: #97d9ec; stroke-width: 9; opacity: .3; }
.leader.main-line, .branch { stroke: #c8f1ff; stroke-width: 2; }
.streamer-group path { stroke: var(--acid); stroke-width: 2.2; stroke-dasharray: 120; stroke-dashoffset: 120; }
.return-group path { stroke-dasharray: 900; stroke-dashoffset: 900; }
.return-glow { stroke: #d8ff5f; stroke-width: 16; opacity: .68; }
.return-core { stroke: #fff; stroke-width: 3.5; }
.connection-flare { opacity: 0; }

.storm-scene[data-stage="0"] .cloud-charge-glow,
.storm-scene[data-stage="0"] .charges { opacity: 1; }
.storm-scene[data-stage="1"] .leader-group,
.storm-scene[data-stage="2"] .leader-group,
.storm-scene[data-stage="3"] .leader-group { opacity: 1; }
.storm-scene[data-stage="1"] .leader,
.storm-scene[data-stage="1"] .branch,
.storm-scene[data-stage="2"] .leader,
.storm-scene[data-stage="2"] .branch,
.storm-scene[data-stage="3"] .leader,
.storm-scene[data-stage="3"] .branch { animation: draw-down 1.2s ease-out forwards; }
.storm-scene[data-stage="1"] .down-label { opacity: 1; }
.storm-scene[data-stage="2"] .streamer-group,
.storm-scene[data-stage="3"] .streamer-group { opacity: 1; }
.storm-scene[data-stage="2"] .streamer-group path,
.storm-scene[data-stage="3"] .streamer-group path { animation: draw-up .65s ease-out forwards; }
.storm-scene[data-stage="3"] .connection-flare { animation: flare .8s ease-out forwards; }
.storm-scene[data-stage="4"] .return-group { opacity: 1; }
.storm-scene[data-stage="4"] .return-group path { animation: return-up .32s cubic-bezier(.2,.8,.2,1) forwards, flash-flicker 1s .35s ease-out; }
.storm-scene[data-stage="4"] .connection-flare { animation: flare .7s ease-out forwards; }
.storm-scene[data-stage="4"] .up-label { opacity: 1; }

@keyframes draw-down { to { stroke-dashoffset: 0; } }
@keyframes draw-up { to { stroke-dashoffset: 0; } }
@keyframes return-up { to { stroke-dashoffset: 0; } }
@keyframes flare { 0% { opacity: 0; transform: scale(.2); transform-origin: 357px 590px; } 35% { opacity: 1; } 100% { opacity: 0; transform: scale(6); transform-origin: 357px 590px; } }
@keyframes flash-flicker { 20%, 65% { opacity: .15; } 35%, 80% { opacity: 1; } }

.stage-badge { position: absolute; top: 1.2rem; right: 1.2rem; display: flex; align-items: baseline; gap: .38rem; padding: .48rem .7rem; color: rgba(240,238,229,.65); background: rgba(7,24,30,.6); backdrop-filter: blur(10px); font: .57rem var(--mono); text-transform: uppercase; }
.stage-badge strong { color: var(--acid); font-size: 1rem; font-weight: 400; }
.lab-controls { display: flex; flex-direction: column; padding: clamp(1.5rem, 3vw, 3rem); background: #0d2228; }
.control-readout { min-height: 260px; }
.readout-index { margin-bottom: 1.2rem; color: var(--acid); font: .61rem var(--mono); letter-spacing: .08em; }
.control-readout h3 { margin-bottom: 1.2rem; font-size: clamp(1.6rem, 2.4vw, 2.4rem); font-weight: 500; line-height: 1.08; letter-spacing: -.05em; }
.control-readout > p:last-child { max-width: 430px; color: rgba(240,238,229,.6); font-size: .9rem; }
.stage-list { list-style: none; display: grid; gap: 0; margin: auto 0 2rem; padding: 0; border-top: 1px solid rgba(240,238,229,.14); }
.stage-list li { border-bottom: 1px solid rgba(240,238,229,.14); }
.stage-button { width: 100%; display: flex; align-items: center; gap: 1rem; padding: .8rem 0; color: rgba(240,238,229,.44); border: 0; background: none; cursor: pointer; text-align: left; font-size: .76rem; transition: color .2s ease, padding .2s ease; }
.stage-button span { font: .55rem var(--mono); }
.stage-button::after { content: ''; width: 0; height: 1px; margin-left: auto; background: var(--acid); transition: width .3s ease; }
.stage-button:hover, .stage-button.is-active { color: var(--paper); padding-left: .35rem; }
.stage-button.is-active::after { width: 24px; }
.sequence-button { display: flex; align-items: center; justify-content: center; gap: .8rem; width: 100%; padding: .85rem; color: var(--ink); border: 1px solid var(--acid); background: var(--acid); cursor: pointer; font: .64rem var(--mono); letter-spacing: .06em; text-transform: uppercase; transition: background .2s ease, color .2s ease; }
.sequence-button:hover { color: var(--acid); background: transparent; }
.sequence-button.is-running .play-icon { animation: blink .6s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.explanation-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); margin: 7rem 0 0; border-top: 1px solid rgba(240,238,229,.18); border-bottom: 1px solid rgba(240,238,229,.18); }
.key-idea, .fact-card { min-height: 300px; padding: 2rem 2rem 2rem 0; border-right: 1px solid rgba(240,238,229,.18); }
.fact-card { display: flex; flex-direction: column; justify-content: space-between; padding-left: 2rem; }
.fact-card:last-child { border-right: 0; }
.big-statement { max-width: 610px; margin-top: 3.3rem; font-size: clamp(1.8rem, 3vw, 3.2rem); line-height: 1.08; letter-spacing: -.045em; }
.big-statement i { color: var(--acid); }
.fact-card span { font: clamp(1.5rem, 2.5vw, 2.6rem) var(--mono); letter-spacing: -.07em; color: var(--acid); }
.fact-card p { margin: 0; color: rgba(240,238,229,.56); font-size: .82rem; line-height: 1.55; }
.research-note { display: grid; grid-template-columns: 1fr 1fr; gap: 8vw; margin-top: 5rem; padding: 2rem 0 3rem; }
.research-note > div > p:last-child { max-width: 560px; color: rgba(240,238,229,.58); }
.sources { display: flex; flex-direction: column; align-items: flex-start; }
.sources span { margin-bottom: 1rem; color: rgba(240,238,229,.38); font: .6rem var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.sources a { padding: .5rem 0; color: rgba(240,238,229,.72); border-bottom: 1px solid rgba(240,238,229,.18); font-size: .82rem; text-decoration: none; }
.sources a:hover { color: var(--acid); }

footer { display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; padding: 2rem clamp(1.2rem, 6vw, 7rem); color: rgba(240,238,229,.55); background: #061318; border-top: 1px solid rgba(240,238,229,.12); font: .62rem var(--mono); letter-spacing: .05em; text-transform: uppercase; }
footer p { margin: 0; text-align: center; }
footer p:last-child { text-align: right; }
.footer-brand { color: var(--paper); font-family: var(--sans); font-size: .8rem; text-transform: none; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.65,.25,1); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 9rem; }
  .hero-copy { align-self: end; }
  .hero-observatory { position: absolute; right: -15vw; bottom: -8vw; width: 60vw; opacity: .55; }
  .approach-heading { grid-template-columns: 1fr; gap: 2rem; }
  .story-header { grid-template-columns: 1fr; }
  .story-deck { margin-top: 1.5rem; }
  .lightning-lab { grid-template-columns: 1fr; }
  .storm-scene { min-height: 580px; border-right: 0; border-bottom: 1px solid rgba(240,238,229,.18); }
  .control-readout { min-height: 220px; }
  .explanation-grid { grid-template-columns: repeat(3, 1fr); }
  .key-idea { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid rgba(240,238,229,.18); }
}

@media (max-width: 680px) {
  .site-header nav a:first-child { display: none; }
  .site-header nav { gap: 1rem; }
  .hero { min-height: 820px; }
  .hero-observatory { width: 92vw; right: -40vw; bottom: 2rem; }
  .eyebrow span:last-child { display: none; }
  .approach, .field-note { padding-top: 5rem; padding-bottom: 5rem; }
  .approach-heading { padding: 4rem 0; }
  .principles { grid-template-columns: 1fr; }
  .principle, .principle + .principle { min-height: 0; padding: 1.5rem 0 2rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .principle h3 { margin-top: 2rem; }
  .story-header { padding-bottom: 3rem; }
  .storm-scene { min-height: 440px; }
  .storm-scene svg { transform: scale(1.08); }
  .lab-controls { min-height: 560px; }
  .explanation-grid { grid-template-columns: 1fr; margin-top: 5rem; }
  .key-idea, .fact-card { grid-column: auto; min-height: 210px; padding: 1.7rem 0; border-right: 0; border-bottom: 1px solid rgba(240,238,229,.18); }
  .fact-card { padding-left: 0; }
  .research-note { grid-template-columns: 1fr; }
  footer { grid-template-columns: 1fr; gap: 1.2rem; text-align: left; }
  footer p, footer p:last-child { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

.not-found-page { background: var(--ink); }
.not-found {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.5rem, 5vw, 5rem);
  color: var(--paper);
  background:
    radial-gradient(circle at 75% 35%, rgba(85, 125, 124, .22), transparent 24%),
    linear-gradient(130deg, #07161b, #102a2f);
}
.not-found > div { width: min(100%, 980px); }
.not-found h1 { margin-bottom: 2rem; }
.not-found .eyebrow { margin-bottom: 2rem; }
.not-found > .coordinate { position: static; margin: 0; }
