:root {
  --night: #120a1f;
  --surface: #1c1030;
  --surface-2: #251640;
  --ink: #fff3ee;
  --ink-2: #d9c8e3;
  --muted: #a993bb;
  --grid: #34244b;
  --hair: #3f2d58;
  /* data colors (validated, dark surface) */
  --pink: #f0428c;
  --cyan: #1aa5b8;
  --orange: #d9771f;
  --base: #8a7a9e;
  /* decorative neons (never data) */
  --neon-pink: #ff4fa3;
  --neon-orange: #ffa24a;
  --neon-teal: #3ff0dc;
  --up: #ff6aa8;
  --down: #57d3e3;
  --radius: 14px;
  --display: "Anton", "Impact", "Arial Narrow Bold", sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  overflow-x: hidden;
}
.grain {
  pointer-events: none; position: fixed; inset: 0; z-index: 50; opacity: .07;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.5) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

/* ---------- hero ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; padding: 18px 16px 22px; }
.sky {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, #1a0b33 0%, #4a1259 30%, #a3205f 58%, #f0573f 80%, #ffae4a 100%);
}
.sun {
  position: absolute; left: 50%; bottom: 60px; width: min(420px, 80vw); aspect-ratio: 1;
  transform: translateX(-50%); border-radius: 50%;
  background: linear-gradient(180deg, #ffe08a 0%, #ff9a3c 45%, #ff4f7a 100%);
  -webkit-mask: repeating-linear-gradient(180deg, #000 0 14px, transparent 14px 20px) bottom / 100% 55% no-repeat, linear-gradient(#000,#000) top / 100% 45% no-repeat;
          mask: repeating-linear-gradient(180deg, #000 0 14px, transparent 14px 20px) bottom / 100% 55% no-repeat, linear-gradient(#000,#000) top / 100% 45% no-repeat;
  opacity: .9;
}
@media (min-width: 900px) { .sun { left: 78%; } }
.hero .sun { width: min(200px, 46vw); bottom: 16px; }
.skyline { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 90px; }
.skyline .city { fill: #12081f; }
.palms path { fill: none; stroke: #12081f; stroke-width: 7; stroke-linecap: round; }
.palms-art { position: absolute; right: max(8px, 3vw); bottom: 0; height: 118px; width: auto; }
@media (max-width: 600px) {
  /* phones: the countdown spans the width, so leave room for the skyline below it */
  .hero { padding-bottom: 78px; }
  .skyline { height: 72px; }
  .palms-art { height: 80px; right: 6px; }
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 40px; z-index: -1;
  background: linear-gradient(180deg, transparent, var(--night));
}
.hero-inner { max-width: 1120px; margin: 0 auto; }
.kicker {
  display: inline-block; margin: 0 0 4px; padding: 3px 9px; border-radius: 999px;
  background: rgba(18,8,31,.55); color: var(--ink); font-size: 10.5px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
}
h1 { margin: 6px 0 0; padding: 4px 0 6px; line-height: 0; }
.title-art {
  display: block; width: min(100%, 500px); height: auto; overflow: visible;
  filter: drop-shadow(0 5px 0 #2a0c3d) drop-shadow(0 0 18px rgba(26,7,40,.55));
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sub { max-width: 620px; font-size: 15px; color: var(--ink); margin: 4px 0 12px; font-weight: 500;
  text-shadow: 0 1px 2px rgba(12,4,22,.95), 0 0 10px rgba(12,4,22,.85), 0 0 22px rgba(12,4,22,.6); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: 420px; }

.card {
  background: rgba(28,16,48,.92); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: 18px 18px 14px; position: relative; min-width: 0;
  box-shadow: 0 0 0 1px rgba(255,79,163,.06), 0 10px 30px rgba(0,0,0,.35);
}
.hero .card { backdrop-filter: blur(6px); background: rgba(18,8,31,.78); }
.label.with-logo { display: flex; align-items: center; }
.label .logo { flex: none; margin-right: 10px; }
.label { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.meta { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.clock-row {
  display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; max-width: 100%;
  padding: 8px 14px; border-radius: 12px; border: 1px solid var(--hair);
  background: rgba(18,8,31,.78); backdrop-filter: blur(6px);
}
.clock-row .meta { margin: 0; flex-basis: 100%; } /* launch date on its own line */
.clock-value { font: 400 clamp(24px, 6vw, 30px)/1.1 var(--display); white-space: nowrap; letter-spacing: .02em; }

/* ---------- controls ---------- */
.controls {
  position: relative; z-index: 20; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  max-width: 1152px; margin: 0 auto; padding: 12px 16px;
  background: rgba(18,10,31,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--grid);
}
.seg { display: inline-flex; border: 1px solid var(--hair); border-radius: 999px; padding: 3px; }
.seg button {
  font: 600 13px var(--sans); color: var(--ink-2); background: none; border: 0; border-radius: 999px;
  padding: 6px 12px; cursor: pointer; min-height: 32px;
}
.seg button[aria-checked="true"] { background: var(--neon-pink); color: #1a0716; }
.seg button:focus-visible { outline: 2px solid var(--neon-teal); outline-offset: 2px; }
#updated { margin: 0 0 0 auto; }

/* ---------- sections ---------- */
main { max-width: 1152px; margin: 0 auto; padding: 8px 16px 40px; }
section { margin-top: 40px; }
h2 {
  font: 400 clamp(30px, 6vw, 44px)/1 var(--display); text-transform: uppercase; margin: 0;
  display: flex; align-items: baseline; gap: 12px; letter-spacing: .02em;
}
h2 span {
  font-size: .5em; color: #1a0716; background: var(--neon-orange); padding: 3px 8px 2px;
  transform: skewX(-12deg); display: inline-block;
}
.section-sub { color: var(--muted); margin: 6px 0 16px; max-width: 720px; }
.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card.wide { grid-column: 1 / -1; }

.stat-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 6px 0 2px; }
.value { font-size: 34px; font-weight: 700; line-height: 1.1; letter-spacing: -.01em; }
.delta { font-size: 13px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink); white-space: nowrap; }
.delta .arrow { margin-right: 3px; }
.delta.slack .arrow { color: var(--up); }
.delta.work .arrow { color: var(--down); }
.card .note { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.card.pending .value { color: var(--muted); font-size: 22px; font-weight: 600; }

.chart { width: 100%; height: auto; display: block; margin-top: 10px; touch-action: pan-y; }
.zoom-note { margin: 8px 0 -4px; font-size: 12.5px; color: var(--muted); }
.chart text { fill: var(--muted); font: 11px var(--sans); font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: 6px; border-radius: 2px; }
.legend i.dash { height: 0; border-top: 2px dashed; border-radius: 0; opacity: .7; }

.list { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13.5px; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--grid); }
.list li:first-child { border-top: 0; }
.list .name { color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.list .num { font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; font-weight: 600; }
.list .num small { color: var(--muted); font-weight: 500; margin-left: 6px; }

details.table { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
details.table summary { cursor: pointer; }
details.table table { width: 100%; border-collapse: collapse; margin-top: 6px; font-variant-numeric: tabular-nums; }
details.table td, details.table th { text-align: right; padding: 3px 4px; border-top: 1px solid var(--grid); }
details.table td:first-child, details.table th:first-child { text-align: left; }
details.table .scroll { max-height: 200px; overflow: auto; }

.tip {
  position: fixed; z-index: 60; pointer-events: none; min-width: 140px;
  background: #0d0617; border: 1px solid var(--hair); border-radius: 10px; padding: 8px 10px;
  font-size: 12.5px; box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.tip .t { color: var(--muted); margin-bottom: 4px; }
.tip .r { display: flex; align-items: center; gap: 8px; }
.tip .r b { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.tip .r i { width: 12px; height: 2px; border-radius: 2px; display: inline-block; }
.tip .r span { color: var(--ink-2); }

footer { max-width: 1152px; margin: 0 auto; padding: 24px 16px 48px; border-top: 1px solid var(--grid); color: var(--muted); font-size: 13px; }
footer strong { color: var(--ink-2); }
.credit { margin-top: 20px; font-size: 14px; color: var(--ink-2); }
.credit a { color: var(--neon-pink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.credit a:hover { color: var(--neon-orange); }
.credit a:focus-visible { outline: 2px solid var(--neon-teal); outline-offset: 2px; border-radius: 2px; }

.loading main { opacity: .6; transition: opacity .2s; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* sentence headline: the number sits inside the sentence */
.headline { margin: 0 0 2px; font: 600 15px/1.4 var(--sans); color: var(--ink-2); display: flex; gap: 8px; align-items: flex-start; }
.headline .value { font-size: 30px; line-height: 1; color: var(--ink); margin-right: 6px; vertical-align: -3px; letter-spacing: -.01em; }
.headline > span { min-width: 0; }


/* share prices: green cash lettering */
.headline .value.cash-value {
  font: 400 clamp(30px, 5.4vw, 38px)/1 var(--display); letter-spacing: .02em;
  color: #4be38a; text-shadow: 0 0 14px rgba(75,227,138,.35), 0 3px 0 #0d3a22;
  font-variant-numeric: tabular-nums;
}

/* wanted-level stars next to section headings */
h2 { flex-wrap: wrap; }
.wanted { display: flex; gap: 4px; margin: 0 0 6px; }
.wanted svg { width: clamp(18px, 3.6vw, 24px); height: auto; }
.wanted path { stroke: #2a0c3d; stroke-width: 1.6; stroke-linejoin: round; }
.wanted .on path { fill: #ffd27a; }
.wanted svg.on { filter: drop-shadow(0 0 4px rgba(255,210,122,.55)); overflow: visible; }
.wanted .off path { fill: rgba(255,255,255,.08); stroke: rgba(255,243,238,.35); }

/* finale: five stars + "Busted" */
.busted { max-width: 1152px; margin: 24px auto 8px; padding: 32px 16px 40px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.busted .wanted { margin: 0; justify-content: center; }
.busted .wanted svg { width: clamp(30px, 7vw, 46px); }
.busted-art { width: min(80%, 420px); height: auto; overflow: visible;
  filter: drop-shadow(0 5px 0 #2a0c3d) drop-shadow(0 0 22px rgba(240,66,140,.45)); }
@media (prefers-reduced-motion: no-preference) {
  .busted .wanted svg { animation: star-flash 1.2s ease-in-out infinite; }
  .busted .wanted svg:nth-child(even) { animation-delay: .6s; }
}
@keyframes star-flash { 50% { opacity: .45; } }

/* neon section titles */
main h2 {
  color: #fff0f7;
  text-shadow:
    0 0 1px rgba(255,255,255,.6),
    0 0 6px rgba(255,79,163,.6),
    0 0 16px rgba(255,79,163,.35),
    0 0 30px rgba(255,79,163,.18);
}

/* radar minimap (top right) */
.radar { position: fixed; top: 64px; right: 16px; z-index: 30; width: 120px; height: 120px; border-radius: 50%;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,.55)); transition: opacity .25s, transform .25s; }
.radar-svg { width: 100%; height: 100%; display: block; }
.radar-arrow { transition: transform .15s ease-out; }
.radar-blip { cursor: pointer; }
.radar-blip:hover circle, .radar-blip:focus-visible circle { stroke: var(--neon-pink); stroke-width: 1.2; }
.radar-cash { font: 800 6.4px/1 system-ui, sans-serif; fill: #3dff8a; }
.radar-cops { fill: #ff3b5c; animation: radar-siren 1s steps(1) infinite; }
@keyframes radar-siren { 50% { fill: #3b7bff; } }
.radar-n { font: 800 5px/1 system-ui, sans-serif; fill: #fff; }
@media (max-width: 760px) {
  .radar { width: 84px; height: 84px; right: 10px; opacity: 0; transform: scale(.8); pointer-events: none; }
  .radar.shown { opacity: 1; transform: none; pointer-events: auto; }
}
@media (prefers-reduced-motion: reduce) { .radar-arrow { transition: none; } .radar-cops { animation: none; } }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* cash pickups next to the Money title (click the title for more) */
section.has-cash { position: relative; }
.cash-layer { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.cash-title { cursor: pointer; user-select: none; display: inline-block; }
.cash-title:active { transform: translateY(1px); }
.cash-title:focus-visible { outline: 2px solid var(--neon-pink); outline-offset: 4px; border-radius: 4px; }
.cash-pickup { position: absolute; width: 44px; height: 34px; perspective: 200px; filter: drop-shadow(0 0 6px rgba(76,210,122,.65));
  animation: cash-out .8s linear both; }
.cash-spin { display: block; width: 100%; height: 100%; animation: cash-spin 2.4s linear infinite; animation-delay: var(--d, 0s); }
.cash-spin svg { width: 100%; height: 100%; display: block; }
.cash-pop { position: absolute; font: 800 15px/1 system-ui, sans-serif; color: #3dff8a; text-shadow: 0 0 6px rgba(61,255,138,.7), 0 2px 0 #0b2a15;
  pointer-events: none; animation: cash-pop .9s ease-out forwards; }
/* out of the word: pop up from its centre, arc over, land with a small bounce */
@keyframes cash-out {
  0%   { transform: translate(var(--fx), var(--fy)) scale(.2); opacity: 0; animation-timing-function: ease-out; }
  15%  { opacity: 1; }
  45%  { transform: translate(calc(var(--fx) * .45), var(--peak)) scale(1.1); animation-timing-function: ease-in; }
  85%  { transform: translate(0, 0) scale(1); animation-timing-function: ease-out; }
  92%  { transform: translate(0, -6px); }
  100% { transform: none; }
}
@keyframes cash-spin { to { transform: rotateY(360deg); } }
@keyframes cash-pop { to { transform: translateY(-34px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cash-pickup, .cash-spin, .cash-pop { animation: none; } }
main section, .busted { scroll-margin-top: var(--bar-h, 56px); }
