:root {
  --accent: #8fc4ff;
  --ink: #eef3ff;
  --dim: rgba(226, 236, 255, .68);
  --glass: rgba(5, 8, 18, .58);
  --line: rgba(255, 255, 255, .14);
  --sans: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { background: #02040c; }
body { margin: 0; color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button { font: inherit; color: inherit; }

#world, #fallback { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
#fallback { background: linear-gradient(#02040c, #0a2a6b); transition: background 1s; }
.shade { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, .35)); }

#track { position: relative; z-index: 2; width: 100%; }

/* ---------- HUD ---------- */
.top { position: fixed; z-index: 10; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center;
  padding: 18px 28px 18px 60px; pointer-events: none; }
.brand { display: flex; align-items: baseline; gap: 12px; }
.brand b { font-weight: 700; letter-spacing: .32em; font-size: 13px; }
.brand span { font-size: 12px; color: var(--dim); letter-spacing: .04em; }
.tools { pointer-events: auto; display: flex; gap: 8px; margin-right: 56px; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 11px; border-radius: 99px; cursor: pointer;
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: 12.5px; letter-spacing: .03em; transition: border-color .3s, background .3s; }
.pill:hover, .pill:focus-visible { border-color: var(--accent); outline: none; }
.pill svg .x { display: inline; } .pill svg .w1, .pill svg .w2 { display: none; }
.pill[aria-pressed="true"] svg .x { display: none; } .pill[aria-pressed="true"] svg .w1, .pill[aria-pressed="true"] svg .w2 { display: inline; }
.pill:not([aria-pressed="true"]) { animation: nudge 2.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { box-shadow: 0 0 0 0 rgba(143, 196, 255, 0); } 50% { box-shadow: 0 0 0 6px rgba(143, 196, 255, .16); } }

.counter { position: fixed; z-index: 10; left: 60px; top: 62px; pointer-events: none; text-shadow: 0 1px 3px rgba(0, 0, 0, .5), 0 2px 18px rgba(0, 0, 0, .55); }
.counter::before { content: ''; position: absolute; z-index: -1; inset: -34px -80px -30px -70px; background: radial-gradient(closest-side, rgba(3, 5, 12, .5), rgba(3, 5, 12, 0)); pointer-events: none; }
.c-label { font-size: 11.5px; letter-spacing: .28em; color: var(--accent); display: flex; gap: 12px; align-items: baseline; transition: color .8s; }
.c-label i { font-style: normal; letter-spacing: .04em; color: var(--dim); font-size: 12px; }
.c-value { font-family: var(--mono); font-weight: 500; font-size: clamp(40px, 6.4vw, 86px); line-height: 1.02; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin: 4px 0 2px; }
.c-sub { font-family: var(--mono); font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; }
.zone { margin-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.zone b { font-size: 17px; font-weight: 600; color: var(--accent); transition: color .8s; }
.zone span { font-size: 12.5px; color: var(--dim); }
.prog { margin-top: 10px; font-family: var(--mono); font-size: 11.5px; color: var(--dim); }

.vitals { position: fixed; z-index: 10; right: 122px; bottom: 26px; display: flex; gap: 0; pointer-events: none;
  background: var(--glass); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.vitals div { padding: 10px 16px; min-width: 118px; }
.vitals div + div { border-left: 1px solid var(--line); }
.vitals label { display: block; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); margin-bottom: 3px; }
.vitals b { font-family: var(--mono); font-weight: 500; font-size: 15px; font-variant-numeric: tabular-nums; }

/* true-scale gauge */
.gauge { position: fixed; z-index: 10; right: 26px; top: 96px; bottom: 96px; width: 96px; display: flex; flex-direction: column; pointer-events: none; }
.g-title { font-size: 9.5px; letter-spacing: .24em; color: var(--dim); text-align: right; margin-bottom: 8px; }
.g-body { position: relative; flex: 1; display: flex; justify-content: flex-end; gap: 8px; }
.g-labels { position: relative; flex: 1; margin-right: 16px; }
.g-labels span { position: absolute; right: 0; transform: translateY(-50%); font-family: var(--mono); font-size: 10px; color: var(--dim); white-space: nowrap; text-shadow: 0 1px 8px #000; }
.g-bar { position: relative; width: 12px; border-radius: 6px; overflow: visible; box-shadow: 0 0 0 1px rgba(255, 255, 255, .25), 0 0 24px rgba(0, 0, 0, .4); }
.g-bar .seg { position: absolute; left: 0; right: 0; }
.g-bar .seg:first-child { border-radius: 6px 6px 0 0; } .g-bar .seg:last-of-type { border-radius: 0 0 6px 6px; }
.g-bar .tick { position: absolute; left: -3px; width: 18px; height: 1px; background: rgba(255, 255, 255, .8); }
.g-you { position: absolute; left: -9px; width: 30px; height: 2px; background: #fff; box-shadow: 0 0 12px 3px var(--accent), 0 0 3px #fff; transform: translateY(-1px); }
.g-you::after { content: ''; position: absolute; left: -7px; top: -4px; border: 5px solid transparent; border-left-color: #fff; }

.rail { position: fixed; z-index: 10; left: 20px; top: 50%; transform: translateY(-50%); height: min(62vh, 560px); width: 22px; }
.rail::before { content: ''; position: absolute; left: 10px; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, .22); }
.rail button { position: absolute; left: 5px; width: 11px; height: 11px; margin-top: -5px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: transparent; }
.rail button::before { content: ''; position: absolute; left: 3px; top: 3px; width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, .55); transition: all .3s; }
.rail button:hover::before, .rail button:focus-visible::before, .rail button.on::before { background: var(--accent); transform: scale(1.7); box-shadow: 0 0 10px var(--accent); }
.rail button::after { content: attr(data-label); position: absolute; left: 22px; top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 12px; padding: 4px 9px; border-radius: 8px;
  background: rgba(5, 8, 18, .8); border: 1px solid var(--line); opacity: 0; pointer-events: none; transition: opacity .2s; }
.rail button:hover::after, .rail button:focus-visible::after { opacity: 1; }
.rail button:focus-visible { outline: none; }
.rail .me { position: absolute; left: 8px; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px 2px var(--accent); pointer-events: none; }

/* ---------- scale note ---------- */
.note { position: fixed; z-index: 11; left: 60px; bottom: 26px; width: min(372px, calc(100vw - 120px)); padding: 12px 16px 12px; border-radius: 16px;
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 12.5px; line-height: 1.5; color: var(--dim); }
.n-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.n-head b { color: var(--ink); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.n-head button { background: none; border: 1px solid var(--line); border-radius: 99px; padding: 2px 11px; font-size: 11.5px; cursor: pointer; color: var(--accent); }
.n-head button:hover, .n-head button:focus-visible { border-color: var(--accent); outline: none; }
.note p { margin: 0 0 6px; }
.note .detail { display: none; max-height: 42vh; overflow: auto; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.note.open .detail { display: block; }
.note.open .lead { display: none; }
.note b { color: var(--ink); font-weight: 600; }
.note .fine { font-size: 11px; opacity: .8; }
.live { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--ink); }
.live b { color: var(--accent); font-weight: 500; }

/* ---------- hero ---------- */
.hero { position: absolute; left: 60px; top: calc(50vh - 92px); width: min(520px, calc(100vw - 120px)); text-shadow: 0 2px 30px rgba(0, 0, 0, .6); will-change: opacity, transform; }
.eyebrow { font-size: 11.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--accent); margin: 0 0 6px; }
.hero h1 { font-size: clamp(56px, 9vw, 132px); line-height: .9; margin: 0 0 14px; font-weight: 700; letter-spacing: -.04em;
  background: linear-gradient(180deg, #fff 30%, #9cc8ff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 4px 24px rgba(60, 130, 255, .45)); }
.lede { font-size: clamp(15px, 1.6vw, 19px); line-height: 1.45; margin: 0 0 20px; color: #dbe8ff; max-width: 34ch; }
.cue { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--dim); margin: 0; }
.cue kbd { font-family: var(--mono); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; background: rgba(255, 255, 255, .06); }
.mouse { width: 18px; height: 28px; border: 1.5px solid rgba(255, 255, 255, .7); border-radius: 10px; position: relative; flex: none; }
.mouse::after { content: ''; position: absolute; left: 50%; top: 5px; width: 2px; height: 6px; margin-left: -1px; border-radius: 2px; background: #fff; animation: wheel 1.6s ease-in-out infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(9px); opacity: 0; } 100% { opacity: 0; } }

/* ---------- landmark cards ---------- */
.lm { position: absolute; left: 0; right: 0; transform: translateY(-50%); display: flex; padding: 0 152px 0 90px; pointer-events: none; visibility: hidden; }
.lm .in { display: flex; align-items: center; gap: 20px; will-change: transform, opacity; }
.lm.r { justify-content: flex-end; }
.lm.r .in { flex-direction: row-reverse; }
.lm .art { width: 316px; height: 206px; flex: none; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: rgba(0, 0, 0, .25);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .04) inset; }
.lm .art svg { width: 100%; height: 100%; display: block; }
.lm .txt { width: 336px; padding: 17px 20px 18px; border-radius: 20px; background: linear-gradient(180deg, rgba(6, 9, 20, .68), rgba(6, 9, 20, .56)); border: 1px solid var(--line);
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.kind { font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.lm h2 { margin: 0 0 4px; font-size: 21px; line-height: 1.15; font-weight: 600; letter-spacing: -.01em; }
.fig { font-family: var(--mono); font-size: 27px; font-weight: 500; letter-spacing: -.03em; margin: 2px 0 8px; color: #fff; font-variant-numeric: tabular-nums; }
.lm p { margin: 0; font-size: 14.5px; line-height: 1.48; color: rgba(236, 242, 255, .86); }
.lm.hero-lm .art { width: 380px; height: 248px; }

/* SVG art animation */
.art svg * { transform-box: fill-box; transform-origin: center; }
.tw { animation: tw 3.2s ease-in-out infinite; }
@keyframes tw { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.drift { animation: drift 7s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate(-6px, 2px) rotate(-.6deg); } to { transform: translate(6px, -3px) rotate(.6deg); } }
.float { animation: fl 5s ease-in-out infinite alternate; }
@keyframes fl { from { transform: translateY(-5px); } to { transform: translateY(5px); } }
.sway { animation: sway 6s ease-in-out infinite alternate; }
@keyframes sway { from { transform: skewX(-6deg) scaleY(.94); opacity: .8; } to { transform: skewX(7deg) scaleY(1.04); opacity: 1; } }
.streak { animation: streak 3.4s ease-in infinite; }
@keyframes streak { 0% { transform: translate(-90px, -45px); opacity: 0; } 15% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translate(40px, 20px); opacity: 0; } }
.wave { animation: wave 5s ease-in-out infinite alternate; }
.wave2 { animation: wave 7s ease-in-out infinite alternate-reverse; }
@keyframes wave { from { transform: translateX(-16px); } to { transform: translateX(16px); } }
.snow { animation: snow 6s linear infinite; }
@keyframes snow { from { transform: translateY(-6px); opacity: 0; } 30% { opacity: .9; } to { transform: translateY(26px); opacity: 0; } }
.ring { animation: ring 2.4s ease-out infinite; }
@keyframes ring { from { transform: scale(.2); opacity: .9; } to { transform: scale(1.1); opacity: 0; } }
.conv { stroke-dasharray: 7 9; animation: dash 1.6s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -32; } }
.ray { stroke-dasharray: 8 6; animation: dash 1.2s linear infinite; }
.plume { animation: plume 4s ease-in-out infinite alternate; }
@keyframes plume { from { transform: translateX(-4px); opacity: .3; } to { transform: translateX(10px); opacity: .7; } }
.lift { animation: lift 6s ease-in-out infinite alternate; }
@keyframes lift { from { transform: translateY(-40px); } to { transform: translateY(46px); } }
.pulse { animation: pulse 3.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
.quake { animation: quake .6s linear infinite; }
@keyframes quake { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(1px, -1px); } 75% { transform: translate(-1px, 1px); } }

.foot { margin-top: 12px; }
.foot button { background: rgba(255, 255, 255, .1); border: 1px solid var(--line); border-radius: 99px; padding: 7px 16px; cursor: pointer; font-size: 13px; pointer-events: auto; }
.foot button:hover, .foot button:focus-visible { border-color: var(--accent); outline: none; }

/* ---------- small screens ---------- */
@media (max-width: 1100px) {
  .lm { padding: 0 96px 0 76px; }
  .lm .art { width: 260px; height: 170px; } .lm .txt { width: 300px; }
  .vitals { right: 100px; }
}
@media (max-width: 820px) {
  .top { padding: 12px 16px; } .brand span { display: none; } .tools { margin-right: 0; }
  .counter { left: 16px; top: 52px; }
  .note { left: 12px; }
  .c-value { font-size: clamp(38px, 12vw, 58px); }
  .zone { margin-top: 6px; } .prog { display: none; }
  .zone b { font-size: 15px; }
  .vitals { left: 16px; right: 34px; bottom: auto; top: 206px; justify-content: space-between; background: var(--glass); }
  .vitals div { min-width: 0; flex: 1; padding: 7px 10px; } .vitals label { font-size: 8.5px; letter-spacing: .12em; } .vitals b { font-size: 12.5px; }
  .gauge { right: 8px; top: 268px; bottom: 170px; width: 14px; }
  .g-title, .g-labels { display: none; } .g-bar { width: 7px; }
  .g-you { left: -7px; width: 21px; }
  .rail { display: none; }
  .note { left: 12px; right: 12px; bottom: 12px; width: auto; padding: 9px 13px; font-size: 12px; }
  .note .lead { font-size: 11.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 2px; }
  .note .live { margin-top: 3px; padding-top: 4px; font-size: 11.5px; }
  .n-head { margin-bottom: 1px; } .n-head button { padding: 1px 10px; }
  .lm { padding: 0 34px 0 16px; }
  .lm .in { flex-direction: column !important; align-items: stretch; gap: 10px; width: 100%; }
  .lm .in { margin-top: 46px; }
  .lm .art, .lm.hero-lm .art { width: 100%; height: auto; aspect-ratio: 400 / 236; border-radius: 16px; }
  .lm .txt { width: 100%; padding: 12px 15px 13px; border-radius: 16px; }
  .lm h2 { font-size: 18px; } .fig { font-size: 22px; margin-bottom: 5px; } .lm p { font-size: 13px; line-height: 1.42; }
  .kind { font-size: 9.5px; margin-bottom: 3px; }
  .hero { left: 16px; top: 33vh; width: calc(100vw - 50px); }
}
@media (max-height: 640px) and (max-width: 820px) { .vitals { display: none; } .gauge { top: 190px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; }
}
