/* Fan Weekender. One light theme: sun and shade are the information. */

:root {
  --cielo: #1e3ae0;
  --cielo-deep: #1529a8;
  --cielo-ink: #0f1d78;
  --sol: #ffc93c;
  --sombra: #bfd2ff;
  --bordillo: #e5322d;
  --tinta: #18204a;
  --tinta-soft: #47507a;
  --cal: #f4f6fc;
  --cal-line: #d5dcf0;
  --white: #ffffff;

  --display: "DIN Condensed", "Bahnschrift Condensed", "Bahnschrift", "Roboto Condensed", "Arial Narrow", sans-serif-condensed, sans-serif;
  --data: "DIN Alternate", "Bahnschrift", "Roboto", "Segoe UI", system-ui, sans-serif;
  --read: Charter, "Bitstream Charter", "Sitka Text", Cambria, "Noto Serif", Georgia, serif;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px; --s9: 112px;
  --gutter: 16px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
}

@media (min-width: 720px) {
  :root { --gutter: 32px; }
}
@media (min-width: 1100px) {
  :root { --gutter: 56px; }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--cal);
  color: var(--tinta);
  font-family: var(--read);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--sol); color: var(--tinta); }

a { color: var(--cielo); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--cielo);
  outline-offset: 3px;
  border-radius: 2px;
}
.on-cielo :focus-visible,
.on-cielo:focus-visible { outline-color: var(--sol); }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  font-stretch: condensed;
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
}

p { margin: 0 0 1em; text-wrap: pretty; }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 50;
  background: var(--sol); color: var(--tinta);
  font-family: var(--data); font-weight: 700;
  padding: var(--s2) var(--s4); border-radius: 4px; text-decoration: none;
}
.skip:focus { top: var(--s3); }

/* Masthead: a cobalt strip shared by both pages. */
.mast {
  position: relative; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s4);
  padding: var(--s3) var(--gutter);
  background: var(--cielo);
  color: var(--white);
}
.mast--float { position: absolute; inset: 0 0 auto 0; background: transparent; }

.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  color: inherit; text-decoration: none;
  font-family: var(--display); font-weight: 700; font-stretch: condensed;
  font-size: 1.5rem; line-height: 1; letter-spacing: -0.005em;
}
.wordmark svg { width: 28px; height: 28px; flex: none; }

.mast nav ul { display: flex; gap: var(--s5); margin: 0; padding: 0; list-style: none; }
.mast nav a {
  color: inherit; text-decoration: none;
  font-family: var(--data); font-size: 1rem; font-weight: 600;
  padding: var(--s2) 0;
  border-bottom: 2px solid transparent;
}
.mast nav a:hover { border-bottom-color: var(--sol); }

/* Buttons. One shape: a ticket stub with a notch. */
.btn {
  --notch: 7px;
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px;
  padding: 12px 22px 12px 20px;
  font-family: var(--data); font-weight: 700; font-size: 1.0625rem; line-height: 1.1;
  text-decoration: none;
  border: 0; cursor: pointer;
  background: var(--sol); color: var(--tinta);
  -webkit-mask: radial-gradient(circle var(--notch) at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle var(--notch) at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle var(--notch) at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle var(--notch) at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat;
  transition: background-color 150ms var(--ease-out), transform 150ms var(--ease-out);
}
.btn:hover { background: #ffd970; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline-offset: 4px; }
.btn--cielo { background: var(--cielo); color: var(--white); }
.btn--cielo:hover { background: var(--cielo-deep); }

.icon { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Footer */
.foot {
  background: var(--cielo-ink);
  color: #dfe6ff;
  padding: var(--s7) var(--gutter) var(--s6);
  font-family: var(--data);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.foot-inner { max-width: 1180px; margin: 0 auto; display: grid; gap: var(--s5); }
.foot .wordmark { color: var(--white); }
.foot p { margin: 0; max-width: 60ch; }
.foot a { color: var(--white); }
.foot small { color: #aebbf3; font-size: 0.875rem; }
@media (min-width: 900px) {
  .foot-inner { grid-template-columns: auto 1fr; column-gap: var(--s8); align-items: start; }
}

/* Circuit drawing, shared by the lap and the article map. Always on cobalt. */
.circuit { display: block; width: 100%; height: 100%; overflow: visible; }
.c-divide { fill: none; stroke: #8da0f5; stroke-width: 1.5; stroke-dasharray: 2 7; stroke-linecap: round; opacity: 0.9; }
.c-edge { fill: none; stroke: var(--white); stroke-width: 15; stroke-linejoin: round; }
.c-tarmac { fill: none; stroke: var(--cielo-ink); stroke-width: 11; stroke-linejoin: round; }
.c-kerb-base { fill: none; stroke: var(--white); stroke-width: 4; }
.c-kerb { fill: none; stroke: var(--bordillo); stroke-width: 4; stroke-dasharray: 5 5; }
.c-startline { stroke: var(--white); stroke-width: 3; stroke-dasharray: 2 2; }
.c-trail { fill: none; stroke: var(--bordillo); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.c-tether { stroke: var(--white); stroke-width: 1.5; opacity: 0.55; }
.c-hit { fill: transparent; }
.c-dot { stroke: var(--cielo-ink); stroke-width: 2.5; }
.is-sun .c-dot { fill: var(--sol); }
.is-roof .c-dot { fill: var(--sombra); }
.c-code {
  font-family: var(--data); font-weight: 700; font-size: 16px; fill: var(--tinta);
  pointer-events: none; font-variant-numeric: tabular-nums;
}
.c-anchor { fill: var(--white); }
.c-label { font-family: var(--data); font-weight: 600; fill: #c9d4ff; }
.c-label-side { font-size: 20px; }
.c-label-corner { font-family: var(--display); font-stretch: condensed; font-size: 24px; font-weight: 700; fill: var(--white); }
.c-label-note { font-size: 15px; }
.c-car { display: none; }
.c-car-ring { fill: var(--white); }
.c-car-dot { fill: var(--bordillo); }

/* Home: the lap stage, the season axis, the method note. */
.lap { position: relative; background: var(--cielo); color: var(--white); }
.js-lap .lap { height: 720vh; height: 720svh; }

.stage {
  position: relative;
  height: 100vh; height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background:
    radial-gradient(120% 70% at 85% 0%, #2a48f0 0%, transparent 60%),
    var(--cielo);
}
.js-lap .stage { position: sticky; top: 0; }

.stage .circuit { position: absolute; inset: 0; }

/* Hero copy sits in the first frame and leaves as the camera dives. */
.hero {
  --out: var(--hero-out, 0);
  position: relative; z-index: 3;
  padding: 84px var(--gutter) 0;
  max-width: 40rem;
  opacity: calc(1 - var(--out));
  transform: translateY(calc(var(--out) * -40px));
  filter: blur(calc(var(--out) * 6px));
}
.is-lapping .hero, .is-done .hero { visibility: hidden; }

.hero h1 {
  font-size: clamp(2.5rem, 11vw, 5.75rem);
  line-height: 0.94;
  letter-spacing: -0.02em;
}
.hero-sub {
  margin: var(--s4) 0 0;
  max-width: 34ch;
  font-size: 1.0625rem; line-height: 1.5;
  color: #e3e9ff;
}
.hero-first {
  margin: var(--s4) 0 0;
  font-family: var(--data); font-weight: 700; font-size: 1rem;
  color: var(--sol);
}
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4) var(--s5); margin-top: var(--s5); }
.hero-link { color: var(--white); font-family: var(--data); font-weight: 600; }
.hint {
  display: none; align-items: center; gap: 8px;
  position: absolute; z-index: 3; left: var(--gutter); bottom: calc(18px + env(safe-area-inset-bottom)); margin: 0;
  font-family: var(--data); font-size: 0.9375rem; font-weight: 600; color: var(--white);
  opacity: calc(1 - var(--hero-out, 0));
}
.is-lapping .hint, .is-done .hint { visibility: hidden; }
.js-lap .hint { display: inline-flex; }
.hint .icon { animation: nudge 1.8s var(--ease-out) infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

@media (min-width: 900px) {
  .hero { padding-top: 132px; padding-left: var(--gutter); max-width: 36rem; }
  .hero h1 { font-size: clamp(3.5rem, 5.4vw, 5.5rem); max-width: 12ch; }
  .hint { left: var(--gutter); bottom: 40px; }
  .hero-sub { font-size: 1.1875rem; }
}

/* Circuit states on the stage */
.stage .c-trail { stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.is-lapping .c-trail, .is-done .c-trail { opacity: 1; }
.is-lapping .c-car { display: inline; }
.stage.is-lapping .c-labels { opacity: 0; transition-delay: 0ms; }
.c-labels { transition: opacity 300ms var(--ease-out); }
.c-stand { transition: opacity 300ms var(--ease-out); }
.c-stand.is-ahead { opacity: 0.35; }
.c-stand.is-current .c-dot { stroke: var(--white); stroke-width: 4; }

/* Opening: the line draws itself in, then the stands land. */
.is-drawing .c-edge, .is-drawing .c-tarmac { stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.is-drawing .c-stand, .is-drawing .c-kerbs, .is-drawing .c-labels, .is-drawing .c-divide { opacity: 0; }
.is-drawn .c-edge, .is-drawn .c-tarmac { stroke-dashoffset: 0; transition: stroke-dashoffset 1100ms cubic-bezier(0.65, 0, 0.35, 1); }
.is-drawn .c-tarmac { transition-delay: 60ms; }
.is-drawn .c-kerbs, .is-drawn .c-divide, .is-drawn .c-labels { opacity: 1; transition: opacity 500ms var(--ease-out) 900ms; }
.is-drawn .c-stand { opacity: 1; transition: opacity 400ms var(--ease-out); }
.is-drawn .c-stand:nth-child(1) { transition-delay: 1000ms; }
.is-drawn .c-stand:nth-child(2) { transition-delay: 1040ms; }
.is-drawn .c-stand:nth-child(3) { transition-delay: 1080ms; }
.is-drawn .c-stand:nth-child(4) { transition-delay: 1120ms; }
.is-drawn .c-stand:nth-child(5) { transition-delay: 1160ms; }
.is-drawn .c-stand:nth-child(6) { transition-delay: 1200ms; }
.is-drawn .c-stand:nth-child(7) { transition-delay: 1240ms; }
.is-drawn .c-stand:nth-child(8) { transition-delay: 1280ms; }
.is-drawn .c-stand:nth-child(9) { transition-delay: 1320ms; }
.is-drawn .c-stand:nth-child(10) { transition-delay: 1360ms; }
.is-drawn .c-stand:nth-child(11) { transition-delay: 1400ms; }
.is-drawn .c-stand:nth-child(12) { transition-delay: 1440ms; }
.is-drawn .c-stand.is-ahead { opacity: 0.35; transition-delay: 0ms; }

/* HUD: a lap rail with a tick for each stand. */
.hud {
  position: absolute; z-index: 3;
  left: var(--gutter); right: var(--gutter); top: 70px;
  opacity: 0; transition: opacity 300ms var(--ease-out);
}
.is-lapping .hud { opacity: 1; }
.rail { position: relative; height: 4px; background: rgba(255, 255, 255, 0.22); border-radius: 2px; }
.rail-fill { position: absolute; inset: 0; background: var(--bordillo); transform-origin: 0 50%; transform: scaleX(0); border-radius: 2px; }
.rail-tick { position: absolute; top: -4px; width: 4px; height: 12px; margin-left: -2px; border-radius: 1px; }
.rail-tick.is-sun { background: var(--sol); }
.rail-tick.is-roof { background: var(--sombra); }
.hud-label { margin: 10px 0 0; font-family: var(--data); font-size: 0.8125rem; color: #c9d4ff; }

/* Lower-third captions. Two cards swap with a horizontal wipe. */
.captions {
  position: absolute; z-index: 4;
  left: var(--gutter); right: var(--gutter);
  bottom: calc(20px + env(safe-area-inset-bottom));
  height: 0;
}
.cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: auto 1fr; align-items: stretch;
  max-width: 34rem;
  background: var(--white); color: var(--tinta);
  border-radius: 4px;
  box-shadow: 0 18px 40px -18px rgba(8, 16, 70, 0.55);
  clip-path: inset(0 100% 0 0);
  transition: clip-path 420ms var(--ease-out);
}
.cap.is-in { clip-path: inset(0 0 0 0); transition-delay: 90ms; }
.cap:not(.is-in) { clip-path: inset(0 0 0 100%); transition-duration: 260ms; }
.cap-code {
  margin: 0;
  display: flex; align-items: center; justify-content: center;
  min-width: 4.25rem; padding: 0 var(--s3);
  font-family: var(--display); font-stretch: condensed; font-weight: 700;
  font-size: 2.1rem; line-height: 1;
  border-radius: 4px 0 0 4px;
}
.cap.is-sun .cap-code { background: var(--sol); }
.cap.is-roof .cap-code { background: var(--sombra); }
.cap.is-note .cap-code { background: var(--cielo-ink); color: var(--white); font-size: 1.5rem; }
.cap-text { padding: var(--s3) var(--s4) var(--s3); min-width: 0; }
.cap-title { margin: 0; font-family: var(--display); font-stretch: condensed; font-weight: 700; font-size: 1.5rem; line-height: 1.05; }
.cap-body { margin: 4px 0 0; font-size: 0.9375rem; line-height: 1.4; color: var(--tinta-soft); }
.cap-facts { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 10px 0 0; font-family: var(--data); font-size: 0.8125rem; font-weight: 600; }
.cap-facts:empty { display: none; }
.cap-facts span { padding: 2px 7px; border: 1px solid var(--cal-line); border-radius: 3px; font-variant-numeric: tabular-nums; }
.cap-facts .price { background: var(--tinta); border-color: var(--tinta); color: var(--white); }
.cap-facts .sold { background: var(--bordillo); border-color: var(--bordillo); }

@media (min-width: 900px) {
  .captions { bottom: 48px; }
  .cap-code { min-width: 6rem; font-size: 3rem; }
  .cap.is-note .cap-code { font-size: 2rem; }
  .cap-title { font-size: 1.875rem; }
  .cap-body { font-size: 1.0625rem; }
  .cap-facts { font-size: 0.875rem; }
  .hud { top: auto; bottom: 56px; left: auto; right: var(--gutter); width: min(40vw, 460px); }
}

/* Finale: the camera has pulled back; all 12 stands are lit. */
.finale {
  position: absolute; z-index: 4;
  left: var(--gutter); right: var(--gutter); bottom: calc(24px + env(safe-area-inset-bottom));
  max-width: 34rem;
  opacity: 0; transform: translateY(16px);
  transition: opacity 400ms var(--ease-out), transform 500ms var(--ease-out);
  visibility: hidden;
}
.is-done .finale { opacity: 1; transform: none; visibility: visible; }
.finale-title { font-size: clamp(1.75rem, 7vw, 2.75rem); line-height: 1; max-width: 18ch; }
.legend { list-style: none; margin: var(--s4) 0 var(--s5); padding: 0; display: grid; gap: 6px; font-family: var(--data); font-size: 0.9375rem; color: #e3e9ff; }
.legend li { display: flex; gap: 10px; align-items: baseline; }
.finale-picks { list-style: none; margin: var(--s3) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px var(--s4); font-family: var(--data); font-size: 0.9375rem; font-weight: 600; }
.finale-picks a { color: var(--white); }
.key { width: 12px; height: 12px; border-radius: 50%; flex: none; transform: translateY(1px); border: 2px solid var(--cielo-ink); }
.key-roof { background: var(--sombra); }
.key-sun { background: var(--sol); }

@media (min-width: 900px) {
  .finale { left: var(--gutter); bottom: auto; top: 50%; transform: translateY(calc(-50% + 16px)); max-width: 26rem; }
  .is-done .finale { transform: translateY(-50%); }
}

/* Without the lap (reduced motion, no JS): one still frame plus the finale copy below it. */
html:not(.js-lap) .stage { height: auto; min-height: 0; display: grid; }
html:not(.js-lap) .stage .circuit { position: relative; inset: auto; height: 70vw; max-height: 520px; min-height: 280px; order: 2; }
html:not(.js-lap) .hero { order: 1; }
html:not(.js-lap) .finale { position: relative; inset: auto; order: 3; opacity: 1; transform: none; visibility: visible; padding: 0 var(--gutter) var(--s7); max-width: 40rem; }
html:not(.js-ready) .stage .circuit { display: none; }
html:not(.js-lap) .hud, html:not(.js-lap) .captions, html:not(.js-lap) .hint { display: none; }

/* Season: a true time axis on wide screens, a list on phones. */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }

.season { padding: var(--s8) 0 var(--s7); }
.season h2, .method h2 { font-size: clamp(2.25rem, 8vw, 3.75rem); max-width: 16ch; }
.season-lede { margin: var(--s3) 0 var(--s6); max-width: 46ch; font-size: 1.125rem; color: var(--tinta-soft); }

.calendar { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--tinta); }
.race {
  display: grid; grid-template-columns: 7.5rem 1fr auto; align-items: baseline; gap: var(--s3);
  padding: 14px 0;
  border-bottom: 1px solid var(--cal-line);
  font-family: var(--data);
}
.race time { font-weight: 700; font-variant-numeric: tabular-nums; }
.race-name { font-family: var(--display); font-stretch: condensed; font-weight: 700; font-size: 1.375rem; line-height: 1.1; }
.race-state { font-size: 0.875rem; color: var(--tinta-soft); }
.race.is-live { background: var(--cielo); color: var(--white); margin: 0 calc(var(--gutter) * -1); padding: 18px var(--gutter); border-bottom-color: var(--cielo); }
.race.is-live a { color: var(--white); text-decoration-color: var(--sol); text-decoration-thickness: 2px; }
.race.is-live .race-state { color: var(--sol); font-weight: 700; }
.season-note { margin: var(--s4) 0 0; font-family: var(--data); font-size: 0.875rem; color: var(--tinta-soft); }

@media (min-width: 960px) {
  .calendar {
    --days: 132;
    display: grid;
    grid-template-columns: repeat(var(--days), minmax(0, 1fr));
    grid-template-rows: auto 52px auto;
    border-top: 0;
    position: relative;
    padding-top: 0;
  }
  .calendar::before {
    content: ""; grid-row: 2; grid-column: 1 / -1;
    align-self: center; height: 2px; background: var(--tinta);
  }
  .race {
    grid-template-columns: 1fr; gap: 2px;
    padding: 0 0 0 12px; border: 0;
    position: relative;
    grid-column: var(--at) / span 19;
  }
  .race::before {
    content: ""; position: absolute; left: 0; width: 2px; background: var(--tinta);
  }
  .race::after {
    content: ""; position: absolute; left: -5px; width: 12px; height: 12px; border-radius: 50%;
    background: var(--cal); border: 2px solid var(--tinta);
  }
  .race:nth-child(odd) { grid-row: 1; align-self: end; padding-bottom: 14px; }
  .race:nth-child(odd)::before { top: 0; bottom: -26px; }
  .race:nth-child(odd)::after { bottom: -32px; }
  .race:nth-child(even) { grid-row: 3; align-self: start; padding-top: 14px; }
  .race:nth-child(even)::before { bottom: 0; top: -26px; }
  .race:nth-child(even)::after { top: -32px; }
  .race:nth-child(1) { --at: 4; }
  .race:nth-child(2) { --at: 18; }
  .race:nth-child(3) { --at: 32; }
  .race:nth-child(4) { --at: 39; }
  .race:nth-child(5) { --at: 53; }
  .race:nth-child(6) { --at: 60; }
  .race:nth-child(7) { --at: 95; }
  .race:nth-child(8) { --at: 102; }
  .race:nth-child(9) { --at: 116; }
  .race:nth-child(10) { --at: 123; grid-column: 112 / span 21; text-align: right; padding: 14px 12px 0 0; }
  .race:nth-child(10)::before { left: auto; right: 0; }
  .race:nth-child(10)::after { left: auto; right: -5px; }
  .race.is-live { margin: 0; padding: 14px 12px 12px 14px; background: var(--cielo); border-radius: 4px; }
  .race.is-live::before { background: var(--cielo); top: -26px; width: 3px; left: -1px; }
  .race.is-live::after { background: var(--sol); border-color: var(--cielo); top: -33px; width: 14px; height: 14px; left: -6px; }
  .race-name { font-size: 1.5rem; }
  .season .months { display: grid; }
}

.months { display: none; grid-template-columns: repeat(132, minmax(0, 1fr)); margin-bottom: var(--s5); font-family: var(--data); font-size: 0.875rem; font-weight: 700; color: var(--tinta-soft); }
.months span:nth-child(1) { grid-column: 1 / span 20; }
.months span:nth-child(2) { grid-column: 31 / span 20; }
.months span:nth-child(3) { grid-column: 62 / span 20; }
.months span:nth-child(4) { grid-column: 93 / span 20; }
.months span:nth-child(5) { grid-column: 123 / span 10; }

/* Method */
.method { padding: var(--s7) 0 var(--s9); }
.method-text { margin-top: var(--s5); max-width: 62ch; font-size: 1.125rem; }
@media (min-width: 960px) {
  .method .wrap { display: grid; grid-template-columns: 5fr 7fr; gap: var(--s8); align-items: start; }
  .method-text { margin-top: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .hint .icon { animation: none; }
  .cap, .finale, .c-stand, .c-labels { transition: none; }
}

/* Plain pages: guides list, 404. */
.page { max-width: 1180px; margin: 0 auto; padding: var(--s7) var(--gutter) var(--s9); min-height: 50vh; }
.page h1 { font-size: clamp(2.5rem, 10vw, 4.5rem); line-height: 0.98; }
.page-lead { margin: var(--s4) 0 var(--s6); max-width: 44ch; font-size: 1.125rem; color: var(--tinta-soft); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 3px; background: var(--sol); font-family: var(--data); font-weight: 700; }
.empty-state { color: var(--tinta-soft); }
.guide-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--tinta); }
.guide-card { display: grid; gap: 6px; padding: var(--s5) 0; border-bottom: 1px solid var(--cal-line); }
.guide-card p { margin: 0; max-width: 60ch; }
.guide-card h2 { font-size: clamp(1.625rem, 5vw, 2.25rem); max-width: 30ch; }
.guide-card h2 a { color: var(--tinta); text-decoration: none; }
.guide-card h2 a:hover { color: var(--cielo); text-decoration: underline; text-decoration-thickness: 2px; }
.article-eyebrow, .article-meta { font-family: var(--data); font-size: 0.9375rem; font-weight: 600; color: var(--tinta-soft); }

/* Article: a calm reading column inside a cobalt frame. */
.doc { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter) var(--s9); }

.opener { padding: var(--s7) 0 var(--s5); }
.crumb { margin: 0 0 var(--s4); font-family: var(--data); font-size: 0.9375rem; color: var(--tinta-soft); }
.crumb a { color: inherit; }
.crumb span { margin: 0 4px; }
.opener h1 {
  font-size: clamp(2.25rem, 9vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  max-width: 19ch;
  color: var(--tinta);
}
.meta { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: var(--s4) 0 0; font-family: var(--data); font-size: 0.9375rem; font-weight: 600; color: var(--tinta-soft); }
.disclosure { margin: var(--s4) 0 0; max-width: 60ch; font-family: var(--data); font-size: 0.875rem; color: var(--tinta-soft); }

/* The opener's tally: one segment per stand, shade or sun. */
.tally { margin: var(--s5) 0 0; max-width: 30rem; }
.tally-bar { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; height: 14px; }
.tally-bar i { background: var(--sol); border-radius: 2px; }
.tally-bar i.r { background: var(--sombra); box-shadow: inset 0 0 0 1px #8ea6ee; }
.tally-key { display: flex; justify-content: space-between; gap: var(--s3); margin: 8px 0 0; font-family: var(--data); font-size: 0.875rem; font-weight: 600; color: var(--tinta-soft); }

/* Contents */
.toc { margin: var(--s6) 0 var(--s5); }
.toc-box { border-top: 2px solid var(--tinta); border-bottom: 1px solid var(--cal-line); }
.toc summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
  min-height: 48px;
  font-family: var(--data); font-weight: 700; font-size: 1rem;
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "+"; font-size: 1.5rem; line-height: 1; font-weight: 400; }
.toc-box[open] summary::after { content: "\2212"; }
.toc ol { list-style: none; margin: 0 0 var(--s4); padding: 0; }
.toc li a {
  display: block; padding: 7px 0;
  font-family: var(--data); font-size: 0.9375rem; line-height: 1.35;
  color: var(--tinta); text-decoration: none;
}
.toc li a:hover { color: var(--cielo); text-decoration: underline; }
.toc li a.is-here { color: var(--cielo); font-weight: 700; }

/* Reading column */
.lead { max-width: 40rem; font-size: 1.1875rem; line-height: 1.58; }
.lead p:last-child { font-size: 1rem; color: var(--tinta-soft); }
.article-body > p, .article-body > ul, .article-body > ol { max-width: 40rem; }
.article-body h2 {
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  line-height: 1.02;
  margin: var(--s7) 0 var(--s4);
  max-width: 22ch;
}
.article-body h2:first-child { margin-top: var(--s5); }
.article-body h3 { font-size: 1.5rem; margin: var(--s6) 0 var(--s3); }

@media (min-width: 1100px) {
  .doc { display: grid; grid-template-columns: 200px minmax(0, 1fr); column-gap: 72px; }
  .opener { grid-column: 2; padding-top: var(--s8); }
  .lead { grid-column: 2; }
  .finder { grid-column: 1 / -1; }
  .toc { grid-column: 1; margin: var(--s7) 0 0; }
  .toc-box { position: sticky; top: var(--s5); }
  .toc summary { pointer-events: none; }
  .toc summary::after, .toc-box[open] summary::after { content: none; }
  .col { grid-column: 2; min-width: 0; margin-top: var(--s5); }
  .doc:not(:has(.finder)) .lead { margin-bottom: 0; }
}

/* The stand finder: the circuit always sits on cobalt. */
.finder {
  --fd-gap: var(--s4);
  margin: var(--s6) calc(var(--gutter) * -1) 0;
  padding: var(--s5) var(--gutter);
  background: var(--cielo);
  color: var(--white);
  font-family: var(--data);
  display: grid; gap: var(--fd-gap);
  scroll-margin-top: 0;
}
.fd-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s2) var(--s4); }
.fd-head h2 { font-size: clamp(2rem, 8vw, 3rem); }
.fd-count { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--sol); }
.fd-noscript { margin: 0; }

.fd-controls { display: grid; gap: var(--s3); }
.fd-picks { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter); }
.fd-picks::-webkit-scrollbar { display: none; }
.fd-pick {
  flex: none; min-height: 44px; padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.45); border-radius: 22px; cursor: pointer;
  background: transparent; color: var(--white);
  font: 700 0.9375rem/1 var(--data);
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}
.fd-pick:hover { border-color: var(--white); }
.fd-pick[aria-pressed="true"] { background: var(--sol); border-color: var(--sol); color: var(--tinta); }

.fd-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); }
.fd-seg { display: inline-flex; padding: 3px; border-radius: 6px; background: var(--cielo-ink); }
.fd-seg button {
  min-height: 38px; padding: 0 12px;
  border: 0; border-radius: 4px; cursor: pointer;
  background: transparent; color: #dfe6ff;
  font: 700 0.9375rem/1 var(--data);
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}
.fd-seg button[aria-pressed="true"] { background: var(--white); color: var(--tinta); }
.fd-seg--small button { min-height: 32px; padding: 0 10px; font-size: 0.875rem; }

.fd-range { display: grid; gap: 2px; flex: 1 1 180px; max-width: 280px; font-size: 0.875rem; font-weight: 600; }
.fd-range output { font-weight: 700; font-variant-numeric: tabular-nums; }
.fd-range input { width: 100%; height: 28px; margin: 0; accent-color: var(--sol); cursor: pointer; }
.fd-tickets { display: flex; align-items: center; gap: var(--s2); font-size: 0.875rem; font-weight: 600; }
.fd-stepper { display: inline-flex; align-items: center; border-radius: 6px; background: var(--cielo-ink); padding: 3px; }
.fd-stepper button { width: 38px; height: 38px; border: 0; border-radius: 4px; cursor: pointer; background: transparent; color: var(--white); font: 700 1.25rem/1 var(--data); }
.fd-stepper button:hover { background: var(--cielo); }
.fd-stepper output { min-width: 26px; text-align: center; font-weight: 700; font-size: 1rem; font-variant-numeric: tabular-nums; }
.fd-reset { min-height: 38px; padding: 0 4px; border: 0; background: none; color: var(--white); font: 600 0.9375rem/1 var(--data); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.fd-layout { display: grid; gap: var(--fd-gap); min-width: 0; }
.fd-mapcol, .fd-sidecol { display: grid; gap: var(--s3); min-width: 0; align-content: start; }
.fd-mapbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); }
.fd-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.875rem; color: #e3e9ff; }
.fd-legend li { display: flex; align-items: center; gap: 8px; }
.key-bronze { background: var(--white); }
.key-silver { background: #93a6f6; }
.key-gold { background: var(--cielo-ink); border-color: var(--white); }

.fd-canvas { position: relative; margin: 0 calc(var(--gutter) * -0.5); }
.fd-canvas .circuit { width: 100%; height: auto; aspect-ratio: 1150 / 710; overflow: hidden; }
.finder .c-stand { cursor: pointer; transition: opacity 200ms var(--ease-out); }
.finder .c-face { transform-box: fill-box; transform-origin: center; transition: transform 200ms var(--ease-out); }
.finder .c-stand:hover .c-dot { stroke: var(--white); }
.finder .c-stand.is-picked .c-face { transform: scale(1.25); }
.finder .c-stand.is-picked .c-dot { stroke: var(--white); stroke-width: 4; }
.finder .c-stand.is-picked .c-tether { opacity: 1; stroke-width: 3; }
.finder .c-stand.is-out { opacity: 0.22; }
.finder .c-stand.is-sold .c-dot { stroke-dasharray: 5 4; }
[data-mode="price"] .tier-bronze .c-dot { fill: var(--white); }
[data-mode="price"] .tier-silver .c-dot { fill: #93a6f6; }
[data-mode="price"] .tier-gold .c-dot { fill: var(--cielo-ink); stroke: var(--white); }
[data-mode="price"] .tier-gold .c-code { fill: var(--white); }
.fd-whole {
  position: absolute; right: 8px; top: 8px;
  min-height: 40px; padding: 0 12px;
  border: 0; border-radius: 4px; cursor: pointer;
  background: var(--white); color: var(--tinta);
  font: 700 0.875rem/1 var(--data);
}

/* Stand panel: the same lower-third card as the home lap. */
.sd-empty { margin: 0; padding: var(--s4); border: 1px dashed #7d91f2; border-radius: 4px; font-family: var(--read); font-size: 1rem; color: #e3e9ff; }
.sd-card { border-radius: 4px; overflow: hidden; background: var(--white); color: var(--tinta); }
.sd-head { display: grid; grid-template-columns: auto 1fr; }
.sd-code {
  margin: 0; display: flex; align-items: center; justify-content: center;
  min-width: 4.5rem; padding: 0 var(--s3);
  font-family: var(--display); font-stretch: condensed; font-weight: 700; font-size: 2.25rem; line-height: 1;
}
.sd-head.is-sun .sd-code { background: var(--sol); }
.sd-head.is-roof .sd-code { background: var(--sombra); }
.sd-head > div { padding: var(--s3) var(--s4); min-width: 0; }
.sd-name { font-size: 1.5rem; }
.sd-where { margin: 4px 0 0; font-size: 0.9375rem; color: var(--tinta-soft); }
.sd-facts { margin: 0; padding: var(--s3) var(--s4); display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3) var(--s4); border-top: 1px solid var(--cal-line); }
.sd-facts div { min-width: 0; }
.sd-facts .sd-wide { grid-column: 1 / -1; }
.sd-facts dt { font-size: 0.8125rem; font-weight: 700; color: var(--tinta-soft); }
.sd-facts dd { margin: 2px 0 0; font-family: var(--read); font-size: 1rem; line-height: 1.4; }
.sd-price, .sd-total { font-family: var(--data); font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.sd-release { font-family: var(--data); font-size: 0.875rem; color: var(--tinta-soft); }
.sd-release.is-sold { color: #b3201b; font-weight: 700; }
.sd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); padding: 0 var(--s4) var(--s3); }
.sd-buy { margin: 0; flex: 1 1 100%; }
.sd-buy a, .next-link a, .fd-bar a {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 20px;
  border-radius: 4px; background: var(--sol); color: var(--tinta);
  font: 700 1.0625rem/1.1 var(--data); text-decoration: none;
  transition: background-color 150ms var(--ease-out);
}
.sd-buy a { width: 100%; background: var(--cielo); color: var(--white); }
.sd-buy a:hover { background: var(--cielo-deep); }
.next-link a:hover, .fd-bar a:hover { background: #ffd970; }
.sd-compare, .sd-share {
  flex: 1 1 0; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--cal-line); border-radius: 4px; cursor: pointer;
  background: var(--white); color: var(--tinta);
  font: 700 0.9375rem/1 var(--data);
}
.sd-compare:hover:not(:disabled), .sd-share:hover { border-color: var(--tinta); }
.sd-compare[aria-pressed="true"] { background: var(--tinta); border-color: var(--tinta); color: var(--white); }
.sd-compare:disabled { opacity: 0.45; cursor: default; }
.sd-more { display: flex; flex-wrap: wrap; gap: 4px var(--s4); margin: 0; padding: 0 var(--s4) var(--s3); font-size: 0.9375rem; }

/* Stand list */
.fd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.fd-row {
  display: grid; grid-template-columns: 3rem 1fr auto; grid-template-rows: auto auto; column-gap: var(--s3); align-items: center;
  width: 100%; min-height: 52px; padding: 6px 12px 6px 6px;
  border: 1px solid transparent; border-radius: 4px; cursor: pointer; text-align: left;
  background: rgba(15, 29, 120, 0.55); color: var(--white);
  font-family: var(--data);
  transition: background-color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}
.fd-row:hover { border-color: rgba(255, 255, 255, 0.6); }
.fd-row[aria-pressed="true"] { background: var(--white); color: var(--tinta); }
.fd-row-code {
  grid-row: 1 / span 2; display: flex; align-items: center; justify-content: center;
  height: 40px; border-radius: 3px; color: var(--tinta);
  font-family: var(--display); font-stretch: condensed; font-weight: 700; font-size: 1.375rem; line-height: 1;
}
.fd-row.is-sun .fd-row-code { background: var(--sol); }
.fd-row.is-roof .fd-row-code { background: var(--sombra); }
[data-mode="price"] .fd-row .fd-row-code { background: var(--white); }
.fd-row-name { grid-column: 2; font-weight: 700; font-size: 1rem; line-height: 1.2; }
.fd-row-sub { grid-column: 2; font-size: 0.8125rem; line-height: 1.2; color: #c9d4ff; }
.fd-row[aria-pressed="true"] .fd-row-sub { color: var(--tinta-soft); }
.fd-row-price { grid-column: 3; grid-row: 1 / span 2; font-weight: 700; font-size: 1.0625rem; font-variant-numeric: tabular-nums; }
.fd-row.is-sold .fd-row-price { font-size: 0.875rem; color: #ffc1be; }
.fd-row.is-sold[aria-pressed="true"] .fd-row-price { color: #b3201b; }
.fd-none { margin: 0; padding: var(--s4); font-family: var(--read); background: rgba(15, 29, 120, 0.55); border-radius: 4px; }

/* Side by side */
.fd-tray { background: var(--white); color: var(--tinta); border-radius: 4px; padding: var(--s3) var(--s4) var(--s4); }
.fd-tray-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.fd-tray-head h3 { font-size: 1.5rem; }
.fd-tray-clear { min-height: 40px; border: 0; background: none; color: var(--cielo); font: 600 0.9375rem/1 var(--data); text-decoration: underline; cursor: pointer; }
.fd-tray-table { overflow-x: auto; }
.fd-tray-table table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 420px; font-size: 0.9375rem; line-height: 1.35; }
.fd-tray-table th, .fd-tray-table td { padding: 8px 10px 8px 0; text-align: left; vertical-align: top; border-top: 1px solid var(--cal-line); font-family: var(--read); }
.fd-tray-table thead td, .fd-tray-table thead th { border-top: 0; }
.fd-tray-table thead th { font-family: var(--display); font-stretch: condensed; font-size: 1.5rem; line-height: 1; padding-left: 8px; }
.fd-tray-table thead th.is-sun { background: var(--sol); }
.fd-tray-table thead th.is-roof { background: var(--sombra); }
.fd-tray-table tbody th { width: 6rem; font-family: var(--data); font-size: 0.8125rem; color: var(--tinta-soft); }
.fd-tray-table tbody td { padding-left: 8px; }

.fd-note { margin: 0; max-width: 72ch; font-size: 0.8125rem; line-height: 1.5; color: #c9d4ff; }

/* The sticky bar on the way through the article */
.fd-bar {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: var(--s3);
  padding: 8px var(--gutter) calc(8px + env(safe-area-inset-bottom));
  background: var(--cielo-ink); color: var(--white);
  box-shadow: 0 -10px 30px -14px rgba(8, 16, 70, 0.6);
}
.fd-bar-text { margin: 0; flex: 1 1 auto; min-width: 0; font: 700 1rem/1.2 var(--data); font-variant-numeric: tabular-nums; }
.fd-bar a { min-height: 44px; padding: 8px 14px; font-size: 1rem; white-space: nowrap; }
.fd-bar-close { width: 40px; height: 40px; flex: none; border: 0; background: none; color: var(--white); font: 400 1.5rem/1 var(--data); cursor: pointer; }

@media (min-width: 760px) {
  .finder { margin-left: 0; margin-right: 0; border-radius: 6px; padding: var(--s5); }
  .fd-canvas { margin: 0; }
  .fd-picks { margin: 0; padding: 2px; flex-wrap: wrap; overflow: visible; }
  .sd-buy { flex: 1 1 100%; }
}
@media (min-width: 1100px) {
  .finder { --fd-gap: var(--s5); padding: var(--s6); margin-top: var(--s7); }
  .fd-layout { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: var(--s4) var(--s6); align-items: start; }
  .fd-mapcol { grid-column: 1; grid-row: 1; }
  .fd-listcol { grid-column: 1; grid-row: 2; }
  .fd-sidecol { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: var(--s4); }
  .fd-list { grid-template-columns: 1fr 1fr; }
  .fd-bar { left: auto; right: var(--gutter); bottom: var(--s4); width: 25rem; border-radius: 6px; padding: 8px 8px 8px 16px; }
}

/* Comparison table: a true table on wide screens, stacked rows on phones. */
.table-wrap { margin: var(--s5) 0; overflow-x: auto; }
.article-body table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.45; }
.article-body th, .article-body td { text-align: left; vertical-align: top; padding: 10px var(--s3) 10px 0; border-bottom: 1px solid var(--cal-line); }
.article-body thead th { font-family: var(--data); font-size: 0.8125rem; font-weight: 700; color: var(--tinta-soft); border-bottom: 2px solid var(--tinta); }
.stands tbody th { font-family: var(--data); font-weight: 700; font-size: 1rem; }
.stands tbody th::before {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%;
  border: 2px solid var(--tinta); vertical-align: 0;
}
.stands tr.is-sun th::before { background: var(--sol); }
.stands tr.is-roof th::before { background: var(--sombra); }
.stands .num { font-family: var(--data); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stands .sold { color: #b3201b; font-weight: 700; }
.stands tr:target { background: #fff3cc; }
.stands tr { scroll-margin-top: 24px; }

@media (max-width: 759px) {
  .stands thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .stands, .stands tbody, .stands tr, .stands th, .stands td { display: block; }
  .stands tr { padding: var(--s3) 0 var(--s4); border-top: 1px solid var(--cal-line); }
  .stands tr:first-child { border-top: 2px solid var(--tinta); }
  .article-body .stands th, .article-body .stands td { padding: 3px 0; border: 0; }
  .stands tbody th { font-size: 1.125rem; margin-bottom: 6px; }
  .stands td { display: grid; grid-template-columns: 7.5rem 1fr; gap: var(--s3); }
  .stands td::before { content: attr(data-label); font-family: var(--data); font-size: 0.8125rem; font-weight: 700; color: var(--tinta-soft); padding-top: 2px; }
  .stands .num { white-space: normal; }
}
@media (min-width: 760px) {
  .stands th:last-child, .stands td:last-child { text-align: right; padding-right: 0; }
  .stands tbody th { width: 13rem; }
  .stands td.roof { width: 9rem; }
}

/* Inline figures (kept for articles that use the figure slot). */
.article-figure { margin: var(--s5) 0; }
.figure-canvas { padding: var(--s3); background: var(--white); border: 1px solid var(--cal-line); border-radius: 4px; }
.figure-svg { display: block; width: 100%; height: auto; }
.fig-track, .fig-line { fill: none; stroke: var(--tinta); stroke-width: 3; }
.fig-stand { fill: var(--sombra); }
.fig-highlight { fill: var(--cielo); }
.fig-muted { fill: var(--cal-line); }
.fig-label { font-family: var(--data); font-size: 13px; fill: var(--tinta); }
.fig-label-strong { font-weight: 700; }
.fig-label-small { font-size: 11px; fill: var(--tinta-soft); }
.figure-caption, .figure-note { margin: 8px 0 0; font-family: var(--data); font-size: 0.875rem; color: var(--tinta-soft); }

/* Closing call to action and related guides */
.next {
  margin: var(--s8) calc(var(--gutter) * -1) 0;
  padding: var(--s6) var(--gutter);
  background: var(--cielo); color: var(--white);
}
.next h2 { font-size: clamp(1.75rem, 6vw, 2.5rem); margin: 0 0 var(--s3); }
.next p { color: #e3e9ff; max-width: 40ch; }
.next .next-link { margin: 0; }
.related { margin-top: var(--s7); font-family: var(--data); }
.related h2 { font-size: 1.75rem; margin-bottom: var(--s3); }
.related ul { list-style: none; margin: 0 0 var(--s3); padding: 0; }
.related li { padding: 8px 0; border-top: 1px solid var(--cal-line); }
@media (min-width: 760px) {
  .next { margin-left: 0; margin-right: 0; border-radius: 6px; padding: var(--s6); max-width: 40rem; }
}

@media (prefers-reduced-motion: reduce) {
  .finder .c-face, .finder .c-stand, .fd-row, .fd-pick, .fd-seg button { transition: none; }
}

/* Prose pages */
.prose { max-width: 40rem; }
.prose h2 { font-size: 1.75rem; margin: var(--s6) 0 var(--s3); }
