/* Launch Pulse: the v2 look (design 16.5). Our own colours and fonts; nothing from Rockstar. */

@font-face { font-family: "Anton"; src: url("/static/fonts/anton-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/static/fonts/barlow-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/static/fonts/barlow-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("/static/fonts/barlow-condensed-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("/static/fonts/barlow-condensed-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Permanent Marker"; src: url("/static/fonts/permanent-marker-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --night: #120C2A;
  --panel: #1B1238;
  --panel-2: #241848;
  --cream: #F4EBDD;
  --paper: #FFF8EE;
  --border: #F7EFE3;
  --ink: #1B1238;
  --ink-2: #5B4E7A;
  --sand: #F7EFE3;
  --lavender: #A79CC4;
  --magenta: #E8467E;
  --cobalt: #2D4BD8;
  --sunset: #FF8A3D;
  --teal: #22C7C1;
  --shadow: 12px 14px 0 rgba(0, 0, 0, 0.5);
  --display: "Anton", Impact, sans-serif;
  --text: "Barlow", system-ui, sans-serif;
  --cond: "Barlow Condensed", "Barlow", sans-serif;
  --marker: "Permanent Marker", cursive;
}

* { box-sizing: border-box; }
html { background: var(--night); }
body {
  margin: 0; background: var(--night); color: var(--sand);
  font-family: var(--text); font-size: 16px; line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
.page { position: relative; overflow: hidden; }
.page::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50;
  background-image: url("/static/grain.png"); opacity: 0.55; mix-blend-mode: overlay;
}
a { color: #FF8FB1; }
a:hover { color: #FFC2D4; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- sky, masthead, city */

.sky {
  position: relative;
  /* Deep violet behind the title (cream text stays above 9:1); the scene paints its own dusk
     sky from this violet down to a peach horizon. Our colours, after the game's key-art mood. */
  background: linear-gradient(180deg, #2B1856 0%, #4A2A80 100%);
}
.masthead {
  max-width: 1360px; margin: 0 auto; padding: 24px 24px 0;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  position: relative; z-index: 2;
}
.brand { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.wordmark {
  font-family: var(--display); font-size: 34px; letter-spacing: 1px;
  background: linear-gradient(90deg, #6F8BFF, #E8467E 55%, #FF8A3D);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(2px 2px 0 #1B1238);
}
.tagline { font-family: var(--cond); font-weight: 600; letter-spacing: 1px; color: #FFE6EE; font-size: 15px; }
.sticker {
  display: inline-block; font-family: var(--marker); font-size: 22px; line-height: 1;
  padding: 6px 12px 4px; background: var(--teal); color: #0B1F2A; transform: rotate(-4deg);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.45);
}
.sticker.delayed { background: var(--sunset); }
.sticker.small { font-size: 15px; background: var(--magenta); color: var(--paper); transform: rotate(-2deg); }
.live-stats {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  font-family: var(--cond); font-weight: 600; letter-spacing: 1px; color: #FFE6EE; font-size: 15px;
}
.rate { font-size: 18px; }
.sources { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.sources li {
  display: flex; align-items: center; gap: 6px; padding: 4px 10px;
  background: rgba(18, 12, 42, 0.55); border: 2px solid rgba(247, 239, 227, 0.5);
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 6px var(--teal); }
.dot.stale { background: var(--sunset); box-shadow: 0 0 6px var(--sunset); }
.updated { color: #FFD9E4; font-weight: 600; }

.hero { max-width: 1360px; margin: 0 auto; padding: 28px 24px 0; position: relative; z-index: 2; }
.hero h1 {
  margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(44px, 7vw, 104px);
  line-height: 0.92; letter-spacing: 0.5px; color: #FFF1E2;
  text-shadow: 2px 2px 0 #FF5C8A, 4px 4px 0 #E8467E, 6px 6px 0 #9B3BD0, 8px 8px 0 #2D1660;
}
.lede { max-width: 560px; margin: 14px 0 0; color: #FFF1E2; font-size: 17px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.city { margin-top: 8px; }
.city svg { display: block; width: 100%; height: auto; }

/* The heartbeat band: one beat per complete minute, the spike is the posts collected in it.
   A cursor redraws the lit trace over the dim one, like a monitor. */
.monitor {
  width: min(1312px, calc(100% - 48px)); margin: 14px auto 0; position: relative; z-index: 2;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 10px 14px; background: rgba(12, 8, 30, 0.72); border: 3px solid var(--border);
  box-shadow: 6px 7px 0 rgba(0, 0, 0, 0.5); transform: rotate(-0.4deg);
}
.monitor-label {
  font-family: var(--cond); font-weight: 700; font-size: 13px; letter-spacing: 1.5px; line-height: 1.25;
  color: var(--lavender); max-width: 9em;
}
.monitor-screen { position: relative; height: 64px; }
.monitor-screen svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.monitor-screen path { fill: none; stroke: var(--teal); stroke-width: 2.2px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.monitor-screen .trace-dim { stroke-opacity: 0.28; }
.monitor-screen .trace-lit { filter: drop-shadow(0 0 3px rgba(34, 199, 193, 0.9)); }
.monitor-sweep, .monitor-cursor, .monitor-dot { position: absolute; pointer-events: none; }
.monitor-sweep { inset: 0; animation: lp-sweep 6s linear infinite; }
.monitor-cursor { top: 0; bottom: 0; width: 3px; margin-left: -1px; background: #B8FFFB; opacity: 0.85; animation: lp-cursor 6s linear infinite; }
.monitor-dot {
  width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: #B8FFFB;
  box-shadow: 0 0 8px var(--teal); animation: lp-beat 1s ease-in-out infinite;
}
.monitor-now { display: flex; flex-direction: column; align-items: flex-end; }
.monitor-now .rate {
  font-family: var(--display); font-size: 34px; line-height: 1; color: var(--teal);
  text-shadow: 0 0 10px rgba(34, 199, 193, 0.6);
}
.monitor-now small { font-family: var(--cond); font-weight: 600; font-size: 13px; letter-spacing: 1px; color: #FFE6EE; }
@keyframes lp-sweep { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes lp-cursor { from { left: 0; } to { left: 100%; } }
@keyframes lp-beat { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.7); opacity: 0.55; } }

/* The moving scene. Transforms on SVG elements are in user units. */
@keyframes lp-sway { from { transform: rotate(-1.6deg); } to { transform: rotate(2.2deg); } }
@keyframes lp-fly { from { transform: translateX(-320px); } to { transform: translateX(1900px); } }
@keyframes lp-shimmer { from { transform: translateX(-14px); opacity: 0.12; } to { transform: translateX(16px); opacity: 0.75; } }
@keyframes lp-wave { from { transform: translateX(0); } to { transform: translateX(-40px); } }
@keyframes lp-turn { to { transform: rotate(360deg); } }
@keyframes lp-glow { from { transform: scale(1); opacity: 0.85; } to { transform: scale(1.06); opacity: 1; } }
@keyframes lp-twinkle { 0%, 64% { opacity: 0.15; } 70%, 100% { opacity: 0.95; } }
.city .palm { transform-box: fill-box; transform-origin: 50% 100%; animation: lp-sway 7s ease-in-out infinite alternate; }
.city .palm:nth-of-type(even) { animation-duration: 9s; animation-delay: -3s; }
.city .bird { animation: lp-fly 46s linear infinite; }
.city .shimmer { animation: lp-shimmer 6s ease-in-out infinite alternate; }
.city .wave { animation: lp-wave 5s ease-in-out infinite alternate; }
.city .wheel { transform-box: fill-box; transform-origin: 50% 50%; animation: lp-turn 90s linear infinite; }
.city .sun { transform-box: fill-box; transform-origin: 50% 50%; animation: lp-glow 10s ease-in-out infinite alternate; }
.city .twinkle { animation: lp-twinkle 7s steps(1) infinite; }
.city .narrow-only { display: none; }
@media (max-width: 720px) { .city .narrow-only { display: inline; } }
.city .building, .city .sign { cursor: pointer; }
.city .building:focus-visible { outline: none; }
.city .building:focus-visible polygon:nth-child(5), .city .building.on polygon:nth-child(5) { stroke: #FFF4E0; stroke-width: 2.5; }
.city .sign.on rect { stroke-width: 4; }
.city .sign text { font-family: var(--cond); font-weight: 700; font-size: 15px; letter-spacing: 1px; }

/* ---------------------------------------------------------------- the collage board */

.board {
  max-width: 1360px; margin: 0 auto; padding: 56px 24px 64px;
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 44px 32px;
}
.panel {
  flex: 1 1 520px; min-width: 0; padding: 22px 24px; border: 10px solid var(--border);
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px;
}
.panel.wide { flex-basis: 100%; }
.panel.night { background: var(--panel); color: var(--sand); }
.panel.cream { background: var(--cream); color: var(--ink); outline: 2px solid var(--ink); outline-offset: -12px; }
.tilt-r { transform: rotate(0.8deg); }
.tilt-l { transform: rotate(-0.8deg); }
.tilt-s { transform: rotate(0.4deg); }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.panel h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 40px; line-height: 1; letter-spacing: 0.5px; }
.panel.night h2 { color: #FFF1E2; }
.panel h3 { margin: 6px 0 0; font-family: var(--cond); font-weight: 700; font-size: 20px; letter-spacing: 1px; }
.note { margin: 0; font-size: 14px; color: var(--lavender); }
.panel.cream .note { color: var(--ink-2); }
.empty { margin: 0; font-style: italic; }
.toggle {
  border: 2px solid currentColor; background: transparent; padding: 6px 12px; min-height: 40px;
  font-family: var(--cond); font-weight: 600; letter-spacing: 1px; cursor: pointer;
}

/* trending list */
.trending { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.trending li { display: flex; align-items: stretch; gap: 6px; }
.row {
  flex: 1; min-width: 0; display: grid; align-items: center; gap: 10px;
  grid-template-columns: 28px 12px minmax(0, 1fr) 64px 84px 70px;
  min-height: 48px; padding: 4px 10px; border: 2px solid transparent; background: var(--paper);
  color: var(--ink); text-align: left; cursor: pointer;
}
.row:hover, .row.on { border-color: var(--ink); }
.rank { font-family: var(--cond); font-weight: 700; font-size: 18px; }
.chip { width: 12px; height: 12px; border-radius: 3px; }
.name { display: flex; flex-direction: column; min-width: 0; }
.name strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name span { font-size: 13px; color: var(--ink-2); }
.spark { width: 64px; height: 22px; color: var(--ink); }
.value { text-align: right; font-family: var(--cond); font-weight: 700; font-size: 17px; }
.trend { text-align: right; font-family: var(--cond); font-weight: 600; font-size: 15px; }
.trend.rising { color: #B0245A; }
.trend.cooling { color: var(--ink-2); }
.new {
  font-family: var(--marker); font-size: 13px; background: var(--magenta); color: var(--paper);
  padding: 1px 6px; transform: rotate(-3deg); display: inline-block; margin-left: 6px;
}
.reveal {
  min-width: 76px; min-height: 48px; border: 2px solid var(--ink); background: var(--ink); color: var(--paper);
  font-family: var(--cond); font-weight: 700; letter-spacing: 1px; cursor: pointer;
}

/* detail */
.detail h2 { overflow-wrap: anywhere; }
.chart { margin: 0; }
.chart figcaption { font-family: var(--cond); font-weight: 600; letter-spacing: 1px; font-size: 14px; color: var(--lavender); }
.plot { position: relative; }
.plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.axis text { font-family: var(--cond); font-size: 12px; fill: var(--lavender); }
.axis line { stroke: rgba(247, 239, 227, 0.14); }
.by-source { display: grid; grid-template-columns: 90px minmax(0, 1fr) 64px; gap: 6px 10px; align-items: center; font-size: 14px; }
.by-source .bar { height: 10px; background: var(--sand); border-radius: 0 4px 4px 0; }
.say { font-family: var(--display) !important; font-weight: 400 !important; font-size: 30px !important; letter-spacing: 0.5px !important; color: #FFF1E2; }
.quotes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.quote {
  position: relative; background: var(--paper); color: var(--ink); padding: 16px 16px 10px;
  box-shadow: 5px 6px 0 rgba(0, 0, 0, 0.45); transform: rotate(-0.6deg);
}
.quote:nth-child(even) { transform: rotate(0.7deg); }
.quote::before {
  content: ""; position: absolute; top: -10px; left: 50%; width: 84px; height: 20px; margin-left: -42px;
  background: rgba(255, 214, 150, 0.85); transform: rotate(-3deg);
}
.quote p { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.quote .meta { margin-top: 6px; font-size: 13px; color: var(--ink-2); display: flex; gap: 10px; }
.quote a { color: #9C1F52; }

/* legends, tables, bars */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.table-wrap { overflow-x: auto; }
.table-wrap table { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.table-wrap th, .table-wrap td { padding: 4px 8px; border-bottom: 1px solid rgba(247, 239, 227, 0.2); text-align: right; white-space: nowrap; }
.table-wrap th:first-child, .table-wrap td:first-child { text-align: left; }
.bars { display: grid; grid-template-columns: minmax(110px, 160px) minmax(0, 1fr) 56px; gap: 6px 10px; align-items: center; font-size: 15px; }
.bars .bar { height: 14px; background: var(--ink); border-radius: 0 4px 4px 0; }
.bars .pct { text-align: right; font-family: var(--cond); font-weight: 700; }

/* how it works */
.pipeline { margin: 0; padding-left: 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px 28px; }
.pipeline li { color: #E9E1F4; }
.pipeline strong { color: #FFF1E2; font-family: var(--cond); letter-spacing: 1px; font-size: 18px; }
.numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 24px; margin: 8px 0 0; }
.numbers div { border-top: 2px solid rgba(247, 239, 227, 0.3); padding-top: 6px; }
.numbers dt { font-family: var(--cond); font-weight: 600; letter-spacing: 1px; color: var(--lavender); font-size: 14px; }
.numbers dd { margin: 0; font-family: var(--cond); font-weight: 700; font-size: 22px; }
.eval table { border-collapse: collapse; font-size: 14px; width: 100%; }
.eval th, .eval td { padding: 6px 8px; border-bottom: 1px solid rgba(247, 239, 227, 0.2); text-align: right; }
.eval th:first-child, .eval td:first-child { text-align: left; }
.eval p { margin: 6px 0 0; color: var(--lavender); font-size: 14px; }

/* tooltip */
.tooltip {
  position: fixed; z-index: 60; pointer-events: none; max-width: 280px;
  background: var(--cream); color: var(--ink); border: 2px solid var(--ink);
  box-shadow: 5px 6px 0 rgba(0, 0, 0, 0.5); padding: 8px 10px; font-size: 14px;
}
.tooltip div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tooltip strong { font-family: var(--cond); letter-spacing: 1px; }

.foot {
  max-width: 1360px; margin: 0 auto; padding: 0 24px 40px; display: flex; flex-wrap: wrap; gap: 8px 32px;
  justify-content: space-between; color: var(--lavender); font-size: 14px;
}

@media (max-width: 720px) {
  .masthead, .hero, .board, .foot { padding-left: 16px; padding-right: 16px; }
  .monitor { grid-template-columns: minmax(0, 1fr) auto; width: calc(100% - 32px); margin-top: 12px; gap: 12px; padding: 8px 10px; }
  .monitor-label { display: none; }
  .board { gap: 28px; padding-top: 32px; }
  .panel { flex-basis: 100%; padding: 16px; border-width: 6px; }
  .tilt-r, .tilt-l, .tilt-s { transform: none; }
  .panel h2 { font-size: 30px; }
  .row { grid-template-columns: 22px 10px minmax(0, 1fr) 64px; }
  .row .spark, .row .trend { display: none; }
  .bars { grid-template-columns: 100px minmax(0, 1fr) 48px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  /* The scene holds still: .palm .bird .shimmer .wave .wheel .sun .twinkle */
  .city .palm, .city .bird, .city .shimmer, .city .wave, .city .wheel, .city .sun, .city .twinkle { animation: none; }
  /* The heartbeat holds still: the lit trace shows whole, no cursor, no pulse. */
  .monitor-sweep, .monitor-cursor, .monitor-dot { animation: none; }
  .monitor-cursor { display: none; }
}
