/* Home: the pinned scroll stage */
.quick nav > a::after { display: none; }
#journey { height: 900vh; position: relative; }
#stage { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; background: var(--night); }
#sky { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.layer { position: absolute; left: 0; top: 0; max-width: none; will-change: transform; pointer-events: none; user-select: none; }
#black { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; }

/* lab */
#labWrap { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
#labWrap.live { pointer-events: auto; }
#lab { position: absolute; transform-origin: 0 0; }
#lab.zooming { transition: transform .9s cubic-bezier(.7, 0, .2, 1); }
#lab.unzoom { transition: transform 1.1s cubic-bezier(.2, .7, .1, 1); }
#lab > img { width: 100%; height: 100%; max-width: none; }
#hot { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#hot a { cursor: pointer; outline: none; }
#hot polygon.hit { fill: transparent; stroke: none; }
#hot polygon.edge {
  fill: none; stroke: #fff; stroke-width: 1; vector-effect: non-scaling-stroke;
  stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; pointer-events: none;
  transition: stroke-dashoffset .38s cubic-bezier(.6, 0, .2, 1), opacity .12s;
}
#hot a.on polygon.edge { stroke-dashoffset: 0; opacity: 1; }
#lab.editing #hot polygon.edge { opacity: .9; stroke-dashoffset: 0; stroke: #4dff9a; stroke-dasharray: 4 3; }

.telemetry {
  position: absolute; font-family: var(--f-mono); font-size: clamp(11px, .78vw, 14px); line-height: 1.5;
  color: var(--signal); white-space: pre; pointer-events: none; text-shadow: 0 0 8px rgba(77, 255, 154, .45);
  opacity: 0; transition: opacity .1s;
  background: rgba(2, 6, 10, .78); padding: 8px 12px; border-left: 1px solid var(--signal);
}
.telemetry.on { opacity: 1; }
.telemetry .lbl { color: #fff; text-shadow: none; letter-spacing: .12em; text-transform: uppercase; }
.telemetry .cur { display: inline-block; width: .6em; background: var(--signal); animation: blink .7s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* hero */
#hero {
  position: absolute; left: var(--gutter); right: var(--gutter); top: 30vh;
  display: grid; gap: 22px; max-width: 920px; pointer-events: none;
}
#hero .wordmark { font-size: var(--step-4); line-height: .95; letter-spacing: .2em; font-weight: 200; }
#hero .wordmark span { display: inline-block; opacity: 0; transform: translateY(14px); animation: rise .9s cubic-bezier(.2, .7, .1, 1) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
#hero .disciplines { font-family: var(--f-mono); font-size: var(--step--1); letter-spacing: .16em; text-transform: uppercase; color: var(--rigel); }
#hero .tag { font-size: var(--step-1); color: #c9d1ea; max-width: 34ch; }

/* captions */
.cap { position: absolute; left: var(--gutter); top: 34vh; max-width: 30rem; display: grid; gap: 12px; opacity: 0; pointer-events: none; }
.cap.right { left: auto; right: calc(var(--gutter) + 170px); text-align: right; }
.cap h2 { font-family: var(--f-display); font-stretch: 112%; font-weight: 300; font-size: var(--step-3); line-height: 1.05; }
.cap p { color: #c9d1ea; font-size: var(--step-1); }

/* time scale (time slider readout) */
#timescale {
  position: absolute; right: calc(var(--gutter) + 4px); top: 26vh; height: 46vh; width: 120px;
  font-family: var(--f-mono); font-size: 11px; color: var(--faint); pointer-events: none;
}
#timescale .rail { position: absolute; right: 0; top: 0; bottom: 0; width: 1px; background: var(--line); }
#timescale .tick { position: absolute; right: 0; width: 6px; height: 1px; background: var(--faint); }
#timescale .tick.h { width: 12px; }
#timescale .tick span { position: absolute; right: 18px; top: -7px; }
#timescale .mark { position: absolute; right: -4px; width: 9px; height: 9px; border-radius: 50%; background: var(--star); box-shadow: 0 0 12px var(--rigel); transform: translateY(-50%); }
#timescale .read { position: absolute; right: 18px; transform: translateY(-50%); color: var(--star); white-space: nowrap; text-align: right; line-height: 1.35; }
#timescale .read small { display: block; color: var(--dim); font-size: 10px; }

/* scroll cue */
#cue {
  position: absolute; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) scale(var(--cue-scale, 1));
  transform-origin: 50% 100%; display: grid; justify-items: center; gap: 12px; pointer-events: none; text-align: center;
}
#cue .mouse { width: 30px; height: 48px; border: 1.5px solid var(--star); border-radius: 16px; position: relative; }
#cue .mouse::after { content: ""; position: absolute; left: 50%; top: 9px; width: 3px; height: 8px; margin-left: -1.5px; border-radius: 2px; background: var(--star); animation: wheel 1.6s ease-in-out infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }
#cue .label { font-family: var(--f-mono); font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--star); }
#cue .label small { display: block; color: var(--dim); letter-spacing: .1em; text-transform: none; font-size: 12px; margin-top: 4px; }
#cue .chev { width: 18px; height: 18px; border-right: 1.5px solid var(--star); border-bottom: 1.5px solid var(--star); transform: rotate(45deg); animation: chev 1.6s ease-in-out infinite; }
@keyframes chev { 0%, 100% { transform: translateY(-4px) rotate(45deg); opacity: .3; } 50% { transform: translateY(4px) rotate(45deg); opacity: 1; } }
#cue.nudge .mouse { box-shadow: 0 0 0 0 rgba(238, 242, 255, .5); animation: ping 1.8s ease-out infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(238, 242, 255, .45); } 100% { box-shadow: 0 0 0 26px rgba(238, 242, 255, 0); } }

#labHint {
  position: absolute; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--star);
  opacity: 0; pointer-events: none; text-align: center; background: rgba(6, 9, 20, .7); padding: 10px 16px; border: 1px solid var(--line);
}
#labHint small { color: var(--dim); letter-spacing: .06em; text-transform: none; margin-left: 10px; }

/* station index below the journey (also the phone experience) */
#stations { padding: 96px var(--gutter) 96px; max-width: 1180px; margin: 0 auto; display: grid; gap: 28px; }
#stations h2 { font-family: var(--f-display); font-stretch: 112%; font-weight: 300; font-size: var(--step-2); }
#stations .grid a { text-decoration: none; }
#stations .card:hover { border-color: var(--star); }

/* edit panel */
#editPanel {
  position: fixed; right: 16px; bottom: 16px; z-index: 60; width: min(380px, calc(100vw - 32px));
  background: rgba(6, 9, 20, .94); border: 1px solid var(--signal); padding: 14px; font-family: var(--f-mono); font-size: 12px; color: var(--signal); display: grid; gap: 10px;
}
#editPanel textarea { width: 100%; height: 90px; background: #000; color: var(--signal); border: 1px solid #1f5a3a; font: inherit; }
#editPanel .row { display: flex; gap: 8px; flex-wrap: wrap; }
#editPanel button { font: inherit; background: transparent; color: var(--signal); border: 1px solid var(--signal); padding: 6px 10px; cursor: pointer; }
#editCursor { position: absolute; pointer-events: none; font-family: var(--f-mono); font-size: 11px; color: var(--signal); }

/* phone / small screen: drop the journey, keep the brand */
#liteHero { display: none; }
html.lite #journey { display: none; }
html.lite #liteHero { display: grid; position: relative; min-height: 78vh; align-content: end; gap: 18px; padding: 120px var(--gutter) 40px; overflow: hidden; }
html.lite #liteHero canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
html.lite #liteHero > :not(canvas) { position: relative; z-index: 1; }
html.lite #liteHero .wordmark { font-size: clamp(2rem, 9vw, 3.2rem); letter-spacing: .18em; font-weight: 200; line-height: 1; }
html.lite #liteHero p { color: #c9d1ea; }
html.lite .quick { position: absolute; }
