/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black:   #0A0A0A;
  --white:   #F2EFE9;
  --yellow:  #E8C84A;
  --gray:    #B0A99A;
  --mid:     #2A2A2A;
  --rule:    rgba(242,239,233,0.10);
  --side-w:  88px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Barlow', sans-serif;
  background: var(--black);
  color: var(--white);
  overflow-x: hidden;
  display: flex;
}

/* ════════════════════════════════════
   SIDE NAV
════════════════════════════════════ */
.side-nav {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--side-w);
  background: rgba(10,10,10,0.96);
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 0;
  z-index: 200;
  gap: 0;
}

.side-logo {
  font-size: 1.4rem;
  color: var(--yellow);
  text-decoration: none;
  margin-bottom: 2.5rem;
  display: block;
}

.side-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  width: 100%;
}

.side-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 0.75rem 0;
  width: 100%;
  text-decoration: none;
  color: var(--gray);
  transition: color 0.2s;
  position: relative;
}

.side-link:hover,
.side-link.active { color: var(--yellow); }

.side-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 2px; height: 24px;
  background: var(--yellow);
  border-radius: 0 2px 2px 0;
}

.side-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  transition: transform 0.2s;
}

.side-link:hover .side-dot,
.side-link.active .side-dot { transform: scale(1.6); }

.side-label {
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.2;
}


/* ════════════════════════════════════
   MAIN CONTENT
════════════════════════════════════ */
.main-content {
  margin-left: var(--side-w);
  flex: 1;
  min-height: 100vh;
}

/* ════════════════════════════════════
   HERO
════════════════════════════════════ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 3rem;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}

.hero-sun {
  position: absolute;
  top: -120px; left: 50%; transform: translateX(-50%);
  width: 480px; height: 480px; border-radius: 50%;
  background: radial-gradient(circle, #FFFBE0 0%, #E8C84A 35%, #C8920A 65%, transparent 100%);
  animation: pulse-sun 5s ease-in-out infinite;
  pointer-events: none; z-index: 0;
}

@keyframes pulse-sun {
  0%,100% { box-shadow: 0 0 100px 40px rgba(232,200,74,0.22), 0 0 200px 80px rgba(232,200,74,0.07); }
  50%      { box-shadow: 0 0 140px 60px rgba(232,200,74,0.36), 0 0 280px 120px rgba(232,200,74,0.12); }
}

.hero-inner { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; margin-top: clamp(200px, 28vh, 280px); }

.hero-eyebrow {
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--yellow); margin-bottom: 1.4rem;
}

.hero h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(4.5rem, 11vw, 10rem);
  line-height: 0.92; letter-spacing: 0.01em;
  margin-bottom: 1.6rem;
  background: linear-gradient(135deg, #fff 30%, var(--yellow) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.hero h1 em {
  font-style: italic; font-family: 'Barlow', sans-serif; font-weight: 400;
  font-size: 0.42em; letter-spacing: 0.03em; display: block;
  color: var(--gray); margin-bottom: 0.2em;
  -webkit-text-fill-color: var(--gray);
}

.hero-sub {
  font-size: 1rem; font-weight: 400;
  line-height: 1.8; color: var(--gray);
  max-width: 500px; margin: 0 auto;
}

.scroll-cue {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gray); animation: nudge 2.4s ease-in-out infinite; z-index: 1;
}
@keyframes nudge { 0%,100%{transform:translateX(-50%) translateY(0)} 50%{transform:translateX(-50%) translateY(7px)} }

/* ════════════════════════════════════
   CHAPTERS — CENTRED LAYOUT
════════════════════════════════════ */
.chapter {
  max-width: 860px;
  margin: 0 auto;
  padding: 7rem 3rem;
  border-bottom: 1px solid var(--rule);
  position: relative;
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  text-align: center;
}
.chapter.visible { opacity: 1; transform: translateY(0); }

.chapter-meta {
  display: flex; align-items: center; justify-content: center;
  gap: 1.2rem; margin-bottom: 3rem;
}
.chapter-num { font-family:'Bebas Neue',sans-serif; font-size:.85rem; letter-spacing:.2em; color:var(--yellow); }
.chapter-rule { width: 40px; height:1px; background:var(--rule); }
.chapter-tag { font-size:11px; font-weight:500; letter-spacing:.18em; text-transform:uppercase; color:var(--gray); }

.chapter h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3.5rem, 8vw, 7rem);
  line-height: 0.95; letter-spacing: 0.01em;
  margin-bottom: 2.5rem;
}
.chapter h2 span { color: var(--yellow); }

.chapter-body {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 2.5rem; max-width: 780px; margin: 0 auto;
  text-align: left;
}
.chapter-body p { font-size:1rem; font-weight:400; line-height:1.85; color:#C8C1B4; }
.chapter-body p strong { font-weight:500; color:var(--white); }

.chapter-ghost {
  position: absolute; top: 4rem; left: 50%; transform: translateX(-50%);
  font-family:'Bebas Neue',sans-serif; font-size:clamp(10rem,22vw,20rem);
  color:rgba(242,239,233,0.025); line-height:1; user-select:none; pointer-events:none;
  white-space: nowrap;
}

/* ── PULL QUOTE ── */
.pull-quote {
  margin: 3rem auto 0;
  padding-top: 2.5rem; border-top: 1px solid var(--rule);
  max-width: 640px;
}
.pull-quote p { font-family:'Barlow',sans-serif; font-style:italic; font-weight:400; font-size:clamp(1.2rem,2.2vw,1.6rem); line-height:1.5; color:var(--white); }
.pull-quote cite { display:block; margin-top:.8rem; font-size:11px; font-style:normal; font-weight:500; letter-spacing:.16em; text-transform:uppercase; color:var(--yellow); }

/* ── STAT ROW ── */
.stat-row {
  display: flex; gap:0; margin: 3rem auto 0;
  border-top:1px solid var(--rule); border-left:1px solid var(--rule);
  max-width: 760px;
}
.stat { flex:1; padding:1.8rem 2rem; border-right:1px solid var(--rule); border-bottom:1px solid var(--rule); text-align:center; }
.stat-num { font-family:'Bebas Neue',sans-serif; font-size:clamp(2rem,4vw,3.2rem); color:var(--yellow); line-height:1; margin-bottom:.3rem; }
.stat-label { font-size:12px; font-weight:400; letter-spacing:.06em; color:var(--gray); line-height:1.5; }

/* ── SHARED INTERACTIVE BOX ── */
.ix-box, .photon-interactive {
  margin: 3rem auto 0;
  border-top: 1px solid var(--rule);
  padding-top: 2.5rem;
  max-width: 820px;
  width: 100%;
}

.ix-label, .photon-header .chapter-tag {
  display: block;
  font-size: 11px; font-weight:500; letter-spacing:.18em; text-transform:uppercase;
  color:var(--gray); margin-bottom:1.5rem; text-align:left;
}

.ix-note, .photon-note {
  margin-top:.9rem; padding:.8rem 1rem;
  background:rgba(255,255,255,0.03); border:1px solid var(--rule); border-radius:4px;
  font-size:13px; font-weight:400; font-style:italic; color:var(--gray); min-height:40px;
}

/* ════════════════════════════════════
   PHOTON RAIN — TALLER WITH ZONES
════════════════════════════════════ */
.photon-stage {
  position: relative; width:100%; height:560px;
  background: #06080F;
  border: 1px solid var(--rule); border-radius:4px; overflow:hidden;
}

/* cloud midpoint marker line */
.cloud-zone-marker {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 1px;
  background: rgba(232,200,74,0.15);
  border-top: 1px dashed rgba(232,200,74,0.2);
  pointer-events: none;
  z-index: 5;
}

.zone-label {
  position: absolute; z-index: 6;
  font-size: 10px; font-weight:500; letter-spacing:.14em; text-transform:uppercase;
  pointer-events: none;
}
.zone-sky   { top:14px; left:14px; color:rgba(255,243,176,0.35); }
.zone-panel { bottom:70px; left:14px; color:rgba(232,200,74,0.35); }

.photon-ground {
  position:absolute; bottom:0; left:0; right:0;
  height:56px; background:#0C0C0C; border-top:1px solid var(--rule); z-index:2;
}

.photon-panel-wrap {
  position: absolute;
  bottom: 56px; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center;
  z-index: 3; pointer-events: none;
  padding: 0 10px;
}

.panel-array {
  display: flex; gap: 10px;
  width: 100%;
  transform: perspective(900px) rotateX(22deg);
  transform-origin: bottom center;
}

.photon-panel-face {
  flex: 1;
  height: 90px;
  background: #1A3A6A; border: 1.5px solid #2A5AB8; border-radius: 3px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 2px; padding: 3px;
  position: relative;
}

.photon-panel-face .cell {
  background: #1E4D9C; border-radius: 1px;
  transition: background 0.06s, box-shadow 0.06s;
}

.photon-panel-face .cell.flash {
  background: #E8C84A;
  box-shadow: 0 0 8px 3px rgba(232,200,74,0.85);
}

/* bus bar lines */
.photon-panel-face::after {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, transparent 32%, rgba(200,180,90,0.3) 32%, rgba(200,180,90,0.3) 34%, transparent 34%),
    linear-gradient(90deg, transparent 65%, rgba(200,180,90,0.3) 65%, rgba(200,180,90,0.3) 67%, transparent 67%);
  pointer-events: none; border-radius: 3px;
}

.photon-pole { width: 3px; height: 30px; background: var(--gray); border-radius: 2px; }

.photon-clouds {
  position:absolute; top:0; left:0; right:0; bottom:0;
  width:100%; height:100%;
  pointer-events:none; z-index:4; overflow:visible;
}

.cloud-control {
  display:flex; align-items:center; gap:1rem; margin-top:1.2rem; flex-wrap:wrap;
}
.cloud-control label { font-size:11px; font-weight:500; letter-spacing:.14em; text-transform:uppercase; color:var(--gray); white-space:nowrap; }
.cloud-control input[type=range] { flex:1; min-width:140px; accent-color:var(--yellow); cursor:pointer; }
.cloud-val { font-family:'Bebas Neue',sans-serif; font-size:1.4rem; color:var(--yellow); min-width:52px; text-align:right; }

.photon-readout {
  display:flex; gap:0; margin-top:1.2rem;
  border-left:1px solid var(--rule); border-top:1px solid var(--rule);
}
.photon-stat { flex:1; padding:1.1rem 1.4rem; border-right:1px solid var(--rule); border-bottom:1px solid var(--rule); }
.photon-stat:last-child { border-right:none; }
.photon-stat-label { font-size:10px; font-weight:500; letter-spacing:.14em; text-transform:uppercase; color:var(--gray); margin-bottom:5px; }
.photon-stat-value { font-family:'Bebas Neue',sans-serif; font-size:1.8rem; line-height:1; color:var(--yellow); transition:color .4s; }
.photon-stat-value.low { color:var(--gray); }
.photon-power-track { height:4px; background:var(--mid); border-radius:2px; margin-top:7px; overflow:hidden; }
.photon-power-fill { height:100%; background:var(--yellow); border-radius:2px; transition:width .4s ease,background .4s; }

/* ════════════════════════════════════
   CH2 — CELL LAYER JOURNEY
════════════════════════════════════ */
.journey-stage {
  position: relative;
  width: 100%; height: 420px;
  background: #06080F;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
}

.journey-labels {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 3;
}

/* horizontal slider */
.journey-slider-wrap {
  display: flex; align-items: center; gap: 1rem;
  margin-top: 1.4rem;
}

.journey-slider-hint {
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gray); white-space: nowrap;
}

.journey-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: var(--mid);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.journey-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 10px 3px rgba(232,200,74,0.5);
  cursor: grab;
  transition: transform 0.15s;
}

.journey-slider::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.2); }

/* info panel */
.journey-info {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 2rem;
  margin-top: 1.4rem; padding: 1.2rem 1.5rem;
  background: var(--bg3, #161822);
  border: 1px solid var(--rule); border-radius: 4px;
}

.journey-layer-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem; letter-spacing: 0.04em;
  color: var(--yellow); margin-bottom: 0.4rem;
  transition: color 0.3s;
}

.journey-layer-desc {
  font-size: 13px; font-weight: 400; line-height: 1.7;
  color: var(--gray); max-width: 520px;
  transition: opacity 0.3s;
}

.journey-info-right { text-align: right; flex-shrink: 0; }

.journey-depth-label {
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gray); margin-bottom: 4px;
}

.journey-depth-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem; color: var(--yellow);
}

/* ════════════════════════════════════
   CH5 — DAY IN THE LIFE TIMELINE
════════════════════════════════════ */
.grid-stage {
  position: relative;
  width: 100%; height: 420px;
  background: #06080E;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  user-select: none;
}

.timeline-drag-hint {
  position: absolute;
  bottom: 12px; left: 50%;
  transform: translateX(-50%);
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(242,239,233,0.2);
  pointer-events: none; z-index: 5;
  white-space: nowrap;
  transition: opacity 0.4s;
}

.timeline-drag-hint.hidden { opacity: 0; }

/* info strip */
.timeline-info-strip {
  display: flex; gap: 0;
  margin-top: 1.2rem;
  border-left: 1px solid var(--rule);
  border-top: 1px solid var(--rule);
}

.tl-info-block {
  flex: 1; padding: 1rem 1.2rem;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.tl-info-block:last-child { border-right: none; }

.tl-info-label {
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gray); margin-bottom: 5px;
}

.tl-info-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem; line-height: 1;
  color: var(--yellow);
  transition: color 0.3s;
}

/* explainer block */
.tl-explainer {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.2rem;
  padding: 1.6rem 2rem;
  background: var(--bg3, #161822);
  border: 1px solid var(--rule);
  border-radius: 6px;
  min-height: 100px;
  transition: border-color 0.4s, background 0.4s;
}

.tl-explainer.exporting {
  border-color: rgba(52,211,153,0.3);
  background: rgba(52,211,153,0.04);
}

.tl-explainer.importing {
  border-color: rgba(56,189,248,0.3);
  background: rgba(56,189,248,0.04);
}

.tl-explainer.nosolar {
  border-color: rgba(242,239,233,0.08);
  background: rgba(242,239,233,0.02);
}

.tl-explainer-icon {
  font-size: 2.8rem;
  flex-shrink: 0;
  line-height: 1;
  transition: opacity 0.3s;
  width: 48px;
  text-align: center;
}

.tl-explainer-body {
  flex: 1;
}

.tl-explainer-status {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  color: var(--white);
  margin-bottom: 0.5rem;
  transition: color 0.3s;
}

.tl-explainer-text {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.75;
  color: #C8C1B4;
  transition: opacity 0.3s;
}

.tl-explainer-net {
  flex-shrink: 0;
  text-align: right;
  padding-left: 1.5rem;
  border-left: 1px solid var(--rule);
}

.tl-explainer-net-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 6px;
}

.tl-explainer-net-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.2rem;
  line-height: 1;
  color: var(--yellow);
  transition: color 0.3s;
}

@media (max-width: 600px) {
  .tl-explainer { flex-wrap: wrap; }
  .tl-explainer-net { border-left: none; border-top: 1px solid var(--rule); padding-left: 0; padding-top: 0.8rem; text-align: left; width: 100%; }
  .timeline-info-strip { flex-wrap: wrap; }
  .tl-info-block { min-width: 45%; }
}

/* ════════════════════════════════════
   RESPONSIVE
════════════════════════════════════ */
@media (max-width: 700px) {
  :root { --side-w: 56px; }
  .side-label { display: none; }
  .cable-house-label { display: none; }
  .chapter { padding: 5rem 1.5rem; }
  .chapter-body { grid-template-columns: 1fr; gap: 1.5rem; }
  .stat-row { flex-direction: column; }
  .chapter-ghost { display: none; }
  .hero { padding: 3rem 1.5rem; }
  footer { padding: 3rem 1.5rem; flex-direction: column; }
  .footer-meta { text-align: left; }
}