/* ==========================================================================
   /vizualizacija-podataka/ — the live examples
   --------------------------------------------------------------------------
   Chart colours (checked with the data-viz palette validator against white):
     blue   #2a78d6  series / sequential hue / "more"
     orange #eb6834  holidays              (blue↔orange CVD ΔE 24.7)
     red    #e34948  "less" (diverging pole, neutral grey midpoint)
   Marks: bars ≤ 24px with 4px rounded data ends, 2px surface gaps between
   touching cells, hairline grid. Text stays in the ink tokens, never in a
   series colour.
   ========================================================================== */
.viz-card {
  --v-blue: #2a78d6;
  --v-blue-l: #86b6ef;
  --v-orange: #eb6834;
  --v-red: #e34948;
  --v-grey: #d9d8d2;
  --v-grey-l: #f0efec;
  --v-axis: #c3c2b7;
  --v-grid: #e8e7e1;
  --v-muted: #6b6a66;
}

/* ── Example card ──────────────────────────────────────────────────────── */
.viz-card {
  position: relative;
  margin-top: clamp(2rem, 4vw, 3rem);
  padding: clamp(1.1rem, 3vw, 2rem);
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 0;
}

/* Reserved chart heights (2026-11-09). Until viz.js draws a chart, its box
   holds the height the drawing will have, from the same formulas as viz.js
   (100cqw = the box's width); the numbers that depend on the data (rows,
   the map's proportions, the calendar's widest run of weeks) are written
   on the box by scripts/viz/prefill.py. So a chart drawn after a jump, an
   anchor link or a back navigation moves nothing. */
.viz-chart { container-type: inline-size; }
.viz-card[data-state="loading"] .viz-chart::before { content: ""; display: block; height: var(--viz-h, 220px); }
.viz-chart[data-chart="heat"] { --viz-h: calc(22px + 7 * clamp(24px, .62 * min(64px, (100cqw - 40px) / 7), 34px)); }
.viz-chart[data-chart="months"] { --viz-h: 230px; }
.viz-chart[data-chart="diff"] { --viz-h: 270px; }
.viz-chart[data-chart="map"] { --viz-h: min(100cqw * var(--ar, 1.4), 640px); }
.viz-chart[data-chart="rank"] { --viz-h: calc(max(1, var(--n, 9)) * 34px); }
.viz-chart[data-chart="price"] { --viz-h: calc(48px + var(--n, 5) * 70px); }
.viz-chart[data-chart="sun"] { --viz-h: 360px; }
.viz-chart[data-chart="year"] { --viz-h: calc(44px + 7 * clamp(10px, round(down, (100cqw - 96px) / var(--w1, 61), 1px), 22px)); }
@container (width < 1000px) {
  .viz-chart[data-chart="year"]::before { --viz-h: calc(2 * (44px + 7 * clamp(10px, round(down, (100cqw - 60px) / var(--w2, 31), 1px), 22px)) + 1.4rem); }
}
@container (width < 560px) {
  .viz-chart[data-chart="year"]::before { --viz-h: calc(4 * (44px + 7 * clamp(10px, round(down, (100cqw - 42px) / var(--w4, 16), 1px), 22px)) + 3 * 1.4rem); }
}
@container (width < 520px) {
  .viz-chart[data-chart="price"]::before { --viz-h: calc(48px + var(--n, 5) * 76px); }
  .viz-chart[data-chart="sun"]::before { --viz-h: 300px; }
}

/* Without JavaScript: the figures in the tiles are in the page
   (prefill.py), the charts and their controls are hidden and each card's
   data table (a <noscript> copy) stands in their place. */
html:not(.mk-js) :is(.viz-chart, .viz-legend, .viz-scale, .viz-filters, .viz-play, .viz-toggle, details.viz-table) { display: none; }
.viz-table--static { margin-top: 1.6rem; padding-top: 1rem; border-top: 1px solid var(--hairline); }
.viz-table--static table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .85rem; }
.viz-table--static th, .viz-table--static td { padding: .45rem .6rem; border-bottom: 1px solid var(--hairline); text-align: right; white-space: nowrap; }
.viz-table--static th:first-child, .viz-table--static td:first-child { text-align: left; }
.viz-table--static caption { text-align: left; font-weight: 500; padding-bottom: .4rem; }
.viz-card[data-state="error"] .viz-chart::before {
  content: "Primjer se nije učitao. Osvježite stranicu.";
  color: var(--muted);
  font-size: .9rem;
}

/* filters: one row above everything they scope */
.viz-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem 2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--hairline);
}

.viz-filter {
  display: flex;
  align-items: center;
  gap: .7rem;
  flex-wrap: wrap;
}

.viz-filter__label {
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.viz-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.viz-pills button {
  font: inherit;
  font-size: .88rem;
  padding: .42rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}

.viz-pills button:hover { background: var(--wash); }

.viz-pills button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.viz-pills button:focus-visible,
.viz-card [tabindex="0"]:focus-visible {
  outline: 2px solid var(--v-blue);
  outline-offset: 2px;
}

/* stat tiles */
.viz-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: 1px;
  margin: 1.4rem 0;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: 0;
  overflow: hidden;
}

.viz-tile {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: 1rem 1.1rem;
  background: var(--paper);
}

.viz-tile__label {
  font-size: .82rem;
  color: var(--muted);
}

.viz-tile strong {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.viz-tile span:last-child:not(.viz-tile__label) {
  font-size: .82rem;
  color: var(--muted);
}

/* three tiles on two columns: the last one takes the whole row */
@media (max-width: 519px) {
  .viz-tiles--three { grid-template-columns: 1fr 1fr; }
  .viz-tiles--three .viz-tile:last-child { grid-column: 1 / -1; }
}

/* charts */
.viz-grid {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
}

@media (min-width: 1000px) {
  .viz-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

.viz-fig { margin: 0; min-width: 0; }

.viz-fig figcaption {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  margin-bottom: .9rem;
}

.viz-fig figcaption strong { font-size: 1rem; font-weight: 500; }
.viz-fig figcaption span { font-size: .85rem; color: var(--muted); }

.viz-chart {
  position: relative;
  min-width: 0;
  transition: opacity .25s var(--ease);
}

.viz-chart svg {
  display: block;
  overflow: visible;
  font-family: var(--font);
}

.viz-chart text { fill: var(--v-muted); font-size: 12px; }
.viz-chart .t-ink { fill: var(--ink); font-weight: 600; font-size: 13px; }
.viz-chart .grid { stroke: var(--v-grid); stroke-width: 1; }
.viz-chart .axis { stroke: var(--v-axis); stroke-width: 1; }
.viz-chart .m { cursor: default; transition: opacity .15s; }
.viz-chart .hit { fill: transparent; }
.viz-chart g.on .m { opacity: .8; }
.viz-chart g.on .cell { opacity: 1; stroke: var(--ink); stroke-width: 1.5; }

.viz-empty {
  padding: 3rem 0;
  text-align: center;
  color: var(--muted);
  font-size: .95rem;
}

/* legends: the mark beside plain text */
.viz-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.2rem;
  margin: 0 0 .9rem;
  font-size: .85rem;
  color: var(--muted);
}

.viz-legend span { display: inline-flex; align-items: center; gap: .45rem; }

.key {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.key--past, .key--up, .key--br { background: var(--v-blue); }
.key--next { background: var(--v-blue-l); }
.key--hol { background: var(--v-orange); }
.key--down { background: var(--v-red); }
.key--day { background: var(--v-grey); }
.key--we { background: var(--v-grey-l); box-shadow: inset 0 0 0 1px var(--v-grid); }

.viz-scale {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-top: .8rem;
  font-size: .8rem;
  color: var(--muted);
}

.viz-scale i {
  display: block;
  width: 140px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #cde2fb, #6da7ec, #2a78d6, #184f95, #0d366b);
}

/* tooltip */
.viz-tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  min-width: 140px;
  max-width: 260px;
  padding: .6rem .75rem;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .3);
  font-size: .82rem;
  line-height: 1.35;
  color: var(--muted);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .12s, transform .12s;
}

.viz-tip.on { opacity: 1; transform: none; }
.viz-tip b { display: block; color: var(--ink); font-size: 1rem; font-weight: 600; }
.viz-tip .row { display: flex; align-items: center; gap: .45rem; }
.viz-tip .row i { width: 10px; height: 2px; border-radius: 1px; flex: none; }

/* year strip */
.viz-chart--year { margin-top: .4rem; }
.viz-chart--year .seg + .seg { margin-top: 1.4rem; }
.viz-chart--year .d-day { fill: var(--v-grey); }
.viz-chart--year .d-we { fill: var(--v-grey-l); }
.viz-chart--year .d-hol { fill: var(--v-orange); }
.viz-chart--year .d-br { fill: var(--v-blue); }
.viz-chart--year .mname { fill: var(--ink); font-size: 13px; font-weight: 500; }

/* table view */
.viz-table {
  margin-top: 1.6rem;
  border-top: 1px solid var(--hairline);
  padding-top: 1rem;
}

/* the system's disclosure marker (as the FAQ): a plus that turns into a
   minus, not the browser's triangle */
.viz-table summary {
  position: relative;
  list-style: none;
  cursor: pointer;
  padding-right: 2rem;
  font-size: .9rem;
  font-weight: 500;
}
.viz-table summary::-webkit-details-marker { display: none; }
.viz-table summary::before,
.viz-table summary::after {
  content: "";
  position: absolute;
  right: .4rem;
  top: 50%;
  width: 2px;
  height: .8rem;
  margin-top: -.4rem;
  background: currentColor;
  transition: transform .24s var(--ease);
}
.viz-table summary::before { transform: rotate(90deg); }
.viz-table[open] summary::after { transform: rotate(90deg); }

.viz-table .table-scroll { margin-top: 1rem; }

.viz-table table {
  border-collapse: collapse;
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
}

.viz-table th,
.viz-table td {
  padding: .4rem .7rem;
  border-bottom: 1px solid var(--hairline);
  text-align: right;
  white-space: nowrap;
}

.viz-table th:first-child,
.viz-table td:first-child { text-align: left; }
.viz-table thead th { color: var(--muted); font-weight: 500; }
.viz-table caption { text-align: left; font-weight: 500; padding-bottom: .4rem; }

.viz-source {
  margin-top: 1.2rem;
  font-size: .8rem;
  color: var(--muted);
}

.viz-source a { color: inherit; }
.viz-noscript { margin-top: 1rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .viz-chart, .viz-tip, .viz-pills button { transition: none; }
}

/* ── Map, prices, sun (examples 2–4) ───────────────────────────────────── */
.viz-play {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font: inherit;
  font-size: .88rem;
  font-weight: 500;
  padding: .42rem .95rem;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.viz-play[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.viz-play:focus-visible { outline: 2px solid var(--v-blue); outline-offset: 2px; }

@media (min-width: 1000px) {
  .viz-grid--map { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
}

.viz-chart--map svg { margin-inline: auto; }
.viz-chart--map .sea { fill: #eef4fb; }
.viz-chart--map .land { fill: #fbfaf7; stroke: #c9d3de; stroke-width: .8; stroke-linejoin: round; }
.viz-chart .bubble { fill: var(--v-blue); fill-opacity: .82; stroke: #fff; stroke-width: 2; }
.viz-chart g.on .bubble { fill-opacity: 1; stroke: var(--ink); stroke-width: 2; }
.viz-chart .lbl {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 500;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 3px;
  stroke-linejoin: round;
  transition: opacity .3s;
}

.viz-chart .dot { fill: var(--v-blue); stroke: #fff; stroke-width: 2; }
.viz-chart g.on .dot { fill: var(--ink); }
.viz-chart .median { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }

.key--dot { background: var(--v-blue); border-radius: 50%; }
.key--med { width: 3px; height: 14px; border-radius: 2px; background: var(--ink); }
.key--rise, .key--set { width: 16px; height: 2px; border-radius: 1px; background: var(--v-orange); }
.key--set { background: var(--v-blue); }
.key--daylight { background: #fff1dc; box-shadow: inset 0 0 0 1px #f3d9b4; }

.viz-chart .night { fill: #eef2f8; }
.viz-chart .daylight { fill: #fff1dc; }
.viz-chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-chart .line--rise { stroke: var(--v-orange); }
.viz-chart .line--set { stroke: var(--v-blue); }
.viz-chart .shift { stroke: var(--v-axis); stroke-width: 1; }
.viz-chart .cross { stroke: var(--ink); stroke-width: 1; opacity: 0; }
.viz-chart .cdot { stroke: #fff; stroke-width: 2; opacity: 0; }
.viz-chart .cdot--rise { fill: var(--v-orange); }
.viz-chart .cdot--set { fill: var(--v-blue); }
.viz-chart svg.is-cross .cross,
.viz-chart svg.is-cross .cdot { opacity: 1; }
.viz-chart svg[tabindex="0"]:focus-visible { outline: 2px solid var(--v-blue); outline-offset: 4px; border-radius: 6px; }

/* ── The dark part of the page ─────────────────────────────────────────── */
/* Everything from the opening to the last example sits on the site's tokens,
   flipped, so the shared components (bands, buttons, steps) follow along. */
.viz-night {
  /* the mark system's night (/docs/mark-system.md), the charts keep their
     own blue and orange */
  --ink: #f3f1ea;
  --paper: #0c0e13;
  --muted: rgba(243, 241, 234, .68);
  --hairline: rgba(243, 241, 234, .12);
  --wash: #0c0e13;
  background: #060709;
  color: var(--ink);
}

.viz-night .band { background: #060709; }
.viz-night .band--wash { background: var(--wash); }
.viz-night a { color: inherit; }
.viz-night .btn--solid { background: var(--n-ink, #f3f1ea); border-color: var(--n-ink, #f3f1ea); color: #060709; }
.viz-night .btn--ghost { border-color: rgba(255, 255, 255, .5); color: #fff; }
.viz-night .btn--ghost:hover { background: var(--n-ink, #f3f1ea); color: #060709; }
.viz-night .viz-card {
  --v-blue: #4d9bff;
  --v-blue-l: #1f4f8f;
  --v-orange: #ff7a3d;
  --v-red: #ff5a59;
  --v-grey: #3a4252;
  --v-grey-l: #171d29;
  --v-axis: #434c5e;
  --v-grid: #1f2633;
  --v-muted: #a3adbd;
}

.viz-night .viz-card {
  background: linear-gradient(180deg, #101218, #0b0d11);
  box-shadow: 0 40px 90px -50px rgba(252, 212, 163, .16), inset 0 1px 0 rgba(255, 255, 255, .06);
}

.viz-night .viz-tile { background: #10151f; }
.viz-night .viz-tile strong { color: var(--ink); }
.viz-night .viz-tip { background: #161d2a; border-color: rgba(255, 255, 255, .16); box-shadow: 0 16px 40px -14px #000; }
.viz-night .viz-pills button { background: transparent; }
.viz-night .viz-pills button:hover { background: rgba(255, 255, 255, .08); }
.viz-night .viz-pills button[aria-pressed="true"], .viz-night .viz-play[aria-pressed="true"] { background: #fff; border-color: #fff; color: #05070c; }
.viz-night .viz-play { background: transparent; border-color: rgba(255, 255, 255, .55); }
.viz-night .viz-scale i { background: linear-gradient(90deg, #16325a, #1c5cab, #3f93f0, #b4d9ff, #fff); }
.viz-night .viz-chart--map .sea { fill: #0a1120; }
.viz-night .viz-chart--map .land { fill: #171e2c; stroke: #3b4a63; }
.viz-night .viz-chart .bubble { stroke: #0e1219; }
.viz-night .viz-chart g.on .bubble { stroke: #fff; }
.viz-night .viz-chart .lbl { stroke: #0a1120; }
.viz-night .viz-chart .dot { stroke: #0e1219; }
.viz-night .viz-chart g.on .dot { fill: #fff; }
.viz-night .viz-chart .night { fill: #0b1120; }
.viz-night .viz-chart .daylight { fill: #3a2a1c; }
.viz-night .viz-chart .cdot { stroke: #0e1219; }
.viz-night .key--we { box-shadow: inset 0 0 0 1px #2b3342; }
.viz-night .key--daylight { background: #3a2a1c; box-shadow: none; }

/* rise in */
.rise { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.rise.in { opacity: 1; transform: none; }

/* ── The stage ─────────────────────────────────────────────────────────── */
.stage { position: relative; background: #060709; color: #fff; }
.stage.is-story { height: 620vh; }
.stage__sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.stage.is-story .stage__sticky { cursor: grab; }
.stage__sticky.is-drag { cursor: grabbing; }
.stage__poster, .stage__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage__poster { object-fit: cover; }
.stage__canvas { opacity: 0; transition: opacity 1.1s var(--ease); touch-action: pan-y; }
.stage[data-state="live"] .stage__canvas { opacity: 1; }
.stage__shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7, 10, 16, .78), rgba(7, 10, 16, 0) 58%),
    linear-gradient(0deg, rgba(7, 10, 16, .8), rgba(7, 10, 16, 0) 28%);
}

.stage__copy {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding-top: calc(var(--nav-h) + 1.5rem);
  transition: opacity .5s var(--ease), transform .7s var(--ease);
  pointer-events: none;
}
.stage__copy a { pointer-events: auto; }
.stage__copy.off { opacity: 0; transform: translateY(-24px); }
.stage__copy.off a { pointer-events: none; }
.stage__copy .crumbs { position: absolute; top: calc(var(--nav-h) + 2.2rem); }
.stage__copy .crumbs, .stage__copy .crumbs a, .stage__copy .crumbs span { color: rgba(255, 255, 255, .72); }
.stage__copy .eyebrow { color: #fcd4a3; }
.stage__copy h1 {
  margin-top: .6rem;
  font-size: clamp(3rem, 9.4vw, 8.6rem);
  line-height: .98;
  letter-spacing: -0.045em;
  font-weight: 500;
  color: #fff;
  max-width: 11ch;
  text-shadow: 0 6px 60px rgba(7, 10, 16, .8);
}
/* the system's warm highlight; gradients stay off text (mark system §5) */
.stage__copy h1 span { display: block; color: #fcd4a3; }
.stage__copy .lede { margin-top: 1.4rem; max-width: 34rem; color: rgba(255, 255, 255, .86); }
.stage__copy .btn-row { margin-top: 1.8rem; }

.stage__labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.stage__label {
  position: absolute; left: 0; top: 0; white-space: nowrap; opacity: 0;
  padding: .22rem .6rem; border-radius: 999px; font-size: .78rem; color: #fff;
  background: rgba(10, 15, 25, .62); border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: opacity .35s;
}
.stage__label b { font-weight: 600; color: #ffc98f; font-variant-numeric: tabular-nums; }

.stage__steps p {
  position: absolute; z-index: 3; left: max(var(--gutter), calc((100vw - var(--shell)) / 2 + var(--gutter)));
  top: 50%; max-width: min(34rem, calc(100vw - 2 * var(--gutter)));
  margin: 0; font-size: clamp(1.9rem, 4.6vw, 3.6rem); line-height: 1.05; letter-spacing: -0.03em; font-weight: 500;
  opacity: 0; transform: translateY(calc(-50% + 22px)); transition: opacity .55s var(--ease), transform .8s var(--ease);
  text-shadow: 0 4px 40px rgba(7, 10, 16, .9); pointer-events: none;
}
.stage__steps p.on { opacity: 1; transform: translateY(-50%); }
.stage__steps small { display: block; margin-top: .8rem; font-size: clamp(1rem, 1.6vw, 1.2rem); line-height: 1.4; letter-spacing: 0; font-weight: 400; color: rgba(255, 255, 255, .78); }

.stage__hud {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0;
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: .8rem 2.4rem;
  padding: 0 max(var(--gutter), calc((100vw - var(--shell)) / 2 + var(--gutter))) 1.6rem;
  opacity: 0; transform: translateY(14px); transition: opacity .5s, transform .7s var(--ease); pointer-events: none;
}
.stage.show-hud .stage__hud { opacity: 1; transform: none; }
.stage__month { font-size: clamp(1.3rem, 2.6vw, 2rem); letter-spacing: -0.02em; font-weight: 500; min-width: 11ch; }
.stage__hud dl { display: flex; gap: 1.8rem; margin: 0; }
.stage__hud dt { font-size: .74rem; color: rgba(255, 255, 255, .62); }
.stage__hud dd { margin: 0; font-size: clamp(1.3rem, 2.6vw, 2rem); font-weight: 600; font-variant-numeric: tabular-nums; }
.stage__genres { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: 0 0 .2rem auto; padding: 0; list-style: none; font-size: .8rem; color: rgba(255, 255, 255, .78); }
.stage__genres li { display: inline-flex; align-items: center; gap: .4rem; }
.stage__genres i { width: 10px; height: 10px; border-radius: 2px; }

.stage__skip {
  position: absolute; z-index: 4; right: max(var(--gutter), calc((100vw - var(--shell)) / 2 + var(--gutter))); top: calc(var(--nav-h) + 1.4rem);
  font-size: .8rem; color: rgba(255, 255, 255, .8); text-decoration: underline; opacity: 0; pointer-events: none; transition: opacity .4s;
}
.stage.is-story .stage__skip { opacity: 1; pointer-events: auto; }
/* phones and narrow tablets: under the breadcrumb, not beside it (they ran
   into each other at 390), on a night backing so the terrain can't eat it */
@media (max-width: 700px) {
  .stage__skip {
    top: calc(var(--nav-h) + 3.3rem); padding: .3rem .55rem; background: rgba(6, 7, 9, .72);
  }
}

.stage__credit { margin: 0; padding: .9rem 0; font-size: .74rem; color: rgba(226, 233, 245, .5); background: #060709; }
.stage__credit span { display: block; }
.stage__credit a { text-decoration: underline; }

/* ── 3D in the cards ───────────────────────────────────────────────────── */
.viz3d { margin-bottom: 2.4rem; }
.viz3d__stage, .viz3d__city {
  position: relative; width: 100%; border-radius: 0; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 10%, #111b2e, #060709 70%);
  cursor: grab; touch-action: pan-y;
}
.viz3d__stage { height: clamp(320px, 52vw, 620px); }
.viz3d__city { height: clamp(280px, 30vw, 420px); }
.viz3d__stage.is-drag, .viz3d__city.is-drag { cursor: grabbing; }
.viz3d__canvas { display: block; width: 100%; height: 100%; }
.viz3d__tip {
  position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; white-space: nowrap;
  padding: .3rem .6rem; border-radius: 8px; font-size: .8rem; color: #fff;
  background: rgba(10, 15, 25, .86); border: 1px solid rgba(255, 255, 255, .16);
}
.viz3d__read { display: grid; gap: 1rem; margin-top: 1rem; }
.viz3d__day { display: grid; gap: .3rem; font-size: .82rem; color: var(--muted); }
.viz3d__day input { width: 100%; accent-color: #ffb37a; }
.viz3d__read dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .6rem 1rem; margin: 0; }
.viz3d__read dt { font-size: .78rem; color: var(--muted); }
.viz3d__read dd { margin: 0; font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.viz-toggle { display: inline-flex; gap: .3rem; margin-bottom: .8rem; }
.viz-toggle[hidden], .viz3d__city[hidden], .viz3d[hidden], [data-flat][hidden] { display: none; }
.viz-toggle button {
  font: inherit; font-size: .82rem; padding: .3rem .75rem; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--ink); border: 1px solid var(--hairline);
}
.viz-toggle button[aria-pressed="true"] { background: #fff; border-color: #fff; color: #05070c; }

@media (max-width: 700px) {
  .stage.is-story { height: 520vh; }
  /* a night scrim behind the copy (the heading, sentence and buttons sit
     in the lower two thirds): the contours stay visible above it */
  .stage__shade { background: linear-gradient(0deg, rgba(6, 7, 9, .92), rgba(6, 7, 9, .84) 30%, rgba(6, 7, 9, .78) 62%, rgba(6, 7, 9, .3) 84%, rgba(6, 7, 9, .55)); }
  .stage__steps p { top: auto; bottom: 34%; transform: translateY(22px); }
  .stage__steps p.on { transform: none; }
  .stage__genres { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .rise { opacity: 1; transform: none; transition: none; }
  .stage__canvas, .stage__copy { transition: none; }
}
@media (pointer: coarse) { .for-mouse { display: none; } }

/* ── No story: JS off, or reduced motion ──────────────────────────────────
   The scroll story needs JS and motion. Without them the stage is the
   poster with the heading, and the story's sentences follow below it as
   plain text instead of staying hidden. html.mk-js is set in <head>
   before the first paint, so with JS on nothing here ever applies and
   nothing moves when viz.js starts. */
html:not(.mk-js) :is(.stage__skip, .stage__hud) {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .stage__skip,
  .stage__hud { display: none; }
}

html:not(.mk-js) .stage__sticky { position: relative; height: auto; overflow: visible; }
html:not(.mk-js) .stage__poster,
html:not(.mk-js) .stage__canvas,
html:not(.mk-js) .stage__labels,
html:not(.mk-js) .stage__shade { height: 100vh; height: 100svh; bottom: auto; }
html:not(.mk-js) .stage__copy { position: relative; inset: auto; min-height: 100vh; min-height: 100svh; }
html:not(.mk-js) .stage__steps {
  position: relative; z-index: 3; display: grid; gap: 2.2rem;
  padding: 1rem max(var(--gutter), calc((100vw - var(--shell)) / 2 + var(--gutter))) 4.5rem;
}
html:not(.mk-js) .stage__steps p {
  position: static; max-width: 34rem; opacity: 1; transform: none; text-shadow: none;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
}

@media (prefers-reduced-motion: reduce) {
  .stage__sticky { position: relative; height: auto; overflow: visible; }
  .stage__poster,
  .stage__canvas,
  .stage__labels,
  .stage__shade { height: 100vh; height: 100svh; bottom: auto; }
  .stage__copy { position: relative; inset: auto; min-height: 100vh; min-height: 100svh; }
  .stage__steps {
    position: relative; z-index: 3; display: grid; gap: 2.2rem;
    padding: 1rem max(var(--gutter), calc((100vw - var(--shell)) / 2 + var(--gutter))) 4.5rem;
  }
  .stage__steps p {
    position: static; max-width: 34rem; opacity: 1; transform: none; text-shadow: none;
    font-size: clamp(1.4rem, 2.6vw, 2rem);
  }
}
