/* All Rally. Colors and type follow the logo kit: orange #F07A1A, night #14171A, Avenir Next. */

:root {
  color-scheme: light dark;
  --orange: #F07A1A;
  --night: #14171A;
  --night-2: #1C2025;
  --night-3: #2A3037;
  --on-night: #FFFFFF;
  --on-night-2: #C9CED5;
  --on-night-3: #A3AAB4;

  --paper: #FFFFFF;
  --wash: #F5F3EF;
  --card: #FFFFFF;
  --ink: #14171A;
  --ink-2: #2B3036;
  --muted: #5B636D;
  --line: #D9DDE2;
  --line-2: #B9C0C8;
  --ctl: #7C858F;
  --ctl-night: #808B96;
  --underline: #CF5F08;
  --accent-text: #A34800;
  --accent-bg: #FDF0E4;
  --tile-1: #FBD7B8;
  --tile-2: #F6A45A;
  --tile-3: #F07A1A;
  --tile-fg: #14171A;
  --alert: #B3261E;
  --focus: #14171A;

  --r: 14px;
  --r-s: 9px;
  --wrap: 1180px;
  --font: "Avenir Next", Avenir, "Segoe UI", "Helvetica Neue", Roboto, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14171A;
    --wash: #1A1E22;
    --card: #1E2328;
    --ink: #F2F3F5;
    --ink-2: #D8DCE1;
    --muted: #A3AAB4;
    --line: #2F363D;
    --line-2: #46505A;
    --ctl: #808B96;
    --underline: #F07A1A;
    --accent-text: #F7964A;
    --accent-bg: #2B2117;
    --tile-1: #5B3413;
    --tile-2: #A85A12;
    --tile-3: #F07A1A;
    --tile-fg: #FFFFFF;
    --alert: #FF8A80;
    --focus: #FFFFFF;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
img { height: auto; display: block; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration-color: var(--underline); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
button, input, select { font: inherit; color: inherit; }
strong { font-weight: 700; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
:target { scroll-margin-top: 20px; }

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
html:not(.js) .js-only { display: none; }
.sub { color: var(--muted); font-size: .92em; font-weight: 400; }
.fine { color: var(--muted); font-size: .88rem; }
.ico { flex: none; vertical-align: -0.22em; }
.ext { white-space: normal; }
.ext .ico, .lcard__name .ico { width: .95em; height: .95em; margin-left: .3em; opacity: .75; }
.plain > li { padding: 5px 0; }
.more { margin-top: 22px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; background: var(--orange); color: var(--night); padding: 10px 16px; border-radius: 8px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

/* The display voice: heavy, slanted, upper case, like the wordmark. */
.hero__t, .sec__title, .next__name, .rp__t, .series__t, .spot__t, .guide__sec > h2, .sgroup > h2, .month__title, .driver__pos {
  font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: -.012em; line-height: 1.02;
}

/* ---- buttons and chips ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px; border-radius: 999px; border: 2px solid transparent;
  font-weight: 700; text-decoration: none; cursor: pointer; line-height: 1.2; text-align: center;
}
.btn--primary { background: var(--orange); color: var(--night); }
.btn--primary:hover { background: #FF8D33; }
.btn--ghost { border-color: var(--ctl-night); color: var(--on-night); background: transparent; }
.btn--ghost:hover { border-color: var(--on-night); }
.btn--line { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--line:hover { background: var(--ink); color: var(--paper); }
.btn--small { min-height: 42px; padding: 8px 16px; border-color: var(--ctl); background: var(--card); color: var(--ink); font-size: .95rem; }
.btn--small:hover { border-color: var(--ink); }
.btn--small[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.linkbtn { background: none; border: 0; padding: 8px 4px; cursor: pointer; text-decoration: underline; text-decoration-color: var(--underline); text-decoration-thickness: 2px; text-underline-offset: 3px; font-weight: 600; }

.chip {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; border: 1.5px solid transparent;
  font-size: .72rem; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; line-height: 1.35; font-style: normal;
}
.chip--national { background: var(--orange); color: var(--night); }
.chip--super { background: var(--accent-bg); border-color: var(--orange); color: var(--ink); }
.chip--regional { border-color: var(--line-2); color: var(--ink-2); }
.chip--sprint { border-color: var(--line-2); border-style: dashed; color: var(--ink-2); }
.chip--other { border-color: var(--line-2); color: var(--ink-2); }
.chip--world { background: var(--ink); color: var(--paper); }
.chip--plain { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink-2); }
.chip--alert { border-color: var(--alert); color: var(--alert); }
.chip--onnight { border-color: var(--ctl-night); color: var(--on-night); }

/* ---- header ---- */
.top { background: var(--night); color: var(--on-night); --focus: #FFFFFF; --underline: #F07A1A; }
.top__in { display: flex; align-items: center; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; padding: 14px 0 0; }
.top__logo { display: block; padding: 2px 0 12px; }
.top__nav { min-width: 0; max-width: 100%; }
.top__nav ul { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 -8px; padding: 0 8px; }
.top__nav ul::-webkit-scrollbar { display: none; }
.top__nav a { display: block; padding: 10px 11px 13px; white-space: nowrap; text-decoration: none; font-weight: 600; font-size: .97rem; color: var(--on-night-2); border-bottom: 3px solid transparent; }
.top__nav a:hover { color: var(--on-night); border-bottom-color: var(--ctl-night); }
.top__nav a[aria-current="page"] { color: var(--on-night); border-bottom-color: var(--orange); }
@media (max-width: 859px) {
  .top__nav { width: 100%; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .top__nav ul { padding-right: 40px; }
  .top__logo { padding-bottom: 4px; }
}

/* ---- hero ---- */
.hero { position: relative; overflow: hidden; background: var(--night); color: var(--on-night); --focus: #FFFFFF; --underline: #F07A1A; }
.hero__art { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero__grid { position: relative; display: grid; gap: 22px; padding: clamp(24px, 6vw, 72px) 0 clamp(32px, 6vw, 76px); }
.hero__k, .spot__k { color: var(--orange); font-weight: 700; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; }
.hero__t { font-size: clamp(2.15rem, 7.2vw, 4.3rem); margin-top: 10px; text-wrap: balance; }
.hero__t span { color: var(--orange); display: block; }
.hero__more { display: grid; gap: 20px; }
.hero__d { color: var(--on-night-2); max-width: 35em; font-size: 1.06em; }
.hero__a { display: flex; flex-wrap: wrap; gap: 12px; }
@media (min-width: 980px) {
  .hero__grid { grid-template-columns: minmax(0, 1.12fr) minmax(360px, .88fr); gap: 0 56px; }
  .hero__head { grid-column: 1; grid-row: 1; align-self: end; }
  .hero__more { grid-column: 1; grid-row: 2; align-self: start; margin-top: 20px; gap: 26px; }
  .hero .next { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}

.next { background: color-mix(in srgb, var(--night-2) 94%, transparent); border: 1px solid var(--night-3); border-radius: 18px; padding: clamp(18px, 3vw, 26px); backdrop-filter: blur(3px); }
.next__label { display: inline-flex; align-items: center; gap: 8px; color: var(--orange); font-weight: 700; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; }
.next__label::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--orange); }
.next[data-live] .next__label::before { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.next__name { display: block; margin-top: 10px; font-size: clamp(1.55rem, 4.6vw, 2.15rem); color: var(--on-night); text-decoration: none; text-wrap: balance; }
a.next__name:hover { text-decoration: underline; text-decoration-color: var(--underline); }
.next__meta { margin-top: 8px; color: var(--on-night-2); font-weight: 600; }
.next__badge { margin-top: 10px; }
.next__note { margin-top: 10px; color: var(--on-night-3); font-size: .84rem; }
.next__then { margin-top: 18px; padding-top: 14px; border-top: 1px dashed #46505A; }
.next__then-h { font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--on-night-3); }
.then li + li { border-top: 1px solid var(--night-3); }
.then a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; text-decoration: none; }
.then a:hover .then__name { text-decoration: underline; text-decoration-color: var(--underline); }
.then__name { font-weight: 700; }
.then__meta { grid-column: 1; color: var(--on-night-3); font-size: .9rem; }
.then__rel { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--orange); font-weight: 700; font-size: .92rem; white-space: nowrap; }

/* The countdown, drawn like a tripmeter. It always sits on night. */
.trip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 16px; max-width: 460px; }
.trip__cell { background: #0C0E10; border: 1px solid var(--night-3); border-radius: 12px; padding: 10px 4px 8px; text-align: center; }
.trip__n { display: block; font-size: clamp(1.7rem, 7vw, 2.6rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--on-night); letter-spacing: -.01em; }
.trip__cell:first-child .trip__n { color: var(--orange); }
.trip__l { display: block; margin-top: 6px; font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--on-night-3); }

/* ---- quick paths ---- */
.quick { background: var(--wash); border-bottom: 1px solid var(--line); }
.quick__grid { display: grid; gap: 12px; padding: 20px 0; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.quick__a { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; height: 100%; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; }
.quick__a:hover { border-color: var(--ink); }
.quick__a .ico { grid-row: 1 / span 2; width: 26px; height: 26px; margin-top: 2px; color: var(--accent-text); }
.quick__t { font-weight: 700; line-height: 1.25; }
.quick__d { grid-column: 2; color: var(--muted); font-size: .9rem; line-height: 1.4; }
@media (max-width: 559px) {
  .quick__grid { grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px 0; }
  .quick__a { padding: 11px 12px; gap: 0 9px; align-items: center; }
  .quick__a .ico { grid-row: auto; width: 22px; height: 22px; margin: 0; }
  .quick__t { font-size: .92rem; }
  .quick__d { display: none; }
}

/* ---- sections ---- */
.sec { padding: clamp(40px, 7vw, 84px) 0; }
.sec--wash { background: var(--wash); border-block: 1px solid var(--line); }
.sec__head { margin-bottom: 24px; }
.sec__ss { display: inline-block; margin-bottom: 10px; padding: 2px 10px; border: 1.5px solid var(--orange); border-radius: 6px; color: var(--accent-text); font-weight: 800; font-style: italic; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.sec__title { font-size: clamp(1.75rem, 4.4vw, 2.7rem); text-wrap: balance; }
.sec__lede { margin-top: 10px; color: var(--muted); max-width: 46em; font-size: 1.04em; }
.two { display: grid; gap: 48px; }
@media (min-width: 920px) { .two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; } }

/* ---- the calendar ---- */
.cal__controls { display: grid; gap: 12px; margin-bottom: 8px; }
.cal__controls fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.seg { display: inline-flex; justify-self: start; padding: 4px; background: var(--card); border: 1.5px solid var(--ctl); border-radius: 999px; max-width: 100%; }
.seg label, .pick label { position: relative; cursor: pointer; }
.seg input, .pick input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 8px clamp(12px, 3.4vw, 20px); border-radius: 999px; font-weight: 700; font-size: .95rem; white-space: nowrap; }
.seg input:checked + span { background: var(--ink); color: var(--paper); }
.seg input:focus-visible + span, .pick input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick span { display: block; padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--ctl); background: var(--card); font-weight: 600; font-size: .92rem; white-space: nowrap; }
.pick label:hover span { border-color: var(--ink); }
.pick input:checked + span { background: var(--accent-bg); border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 700; }
@media (max-width: 699px) {
  .pick { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding: 3px 16px; -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent); mask-image: linear-gradient(90deg, #000 90%, transparent); }
  .pick::-webkit-scrollbar { display: none; }
  .pick label:last-child { margin-right: 28px; }
}
.cal__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.sel { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .95rem; }
.sel select, .sel input {
  min-height: 42px; padding: 8px 12px; border: 2px solid var(--ctl); border-radius: 999px; background-color: var(--card);
}
.sel select { padding-right: 36px; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238A929B' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px; }
.sel--wide { display: grid; gap: 6px; max-width: 460px; }
@media (max-width: 559px) {
  .cal__row .sel { flex: 1 1 130px; }
  .cal__row .sel select { width: 100%; }
  .cal__row .btn { flex: 1 1 150px; padding-inline: 10px; }
}
.sel--wide input { width: 100%; padding-inline: 18px; }
.cal__msg { color: var(--muted); font-size: .92rem; }
.cal__count { color: var(--muted); font-size: .92rem; margin-top: 10px; min-height: 1.5em; }
.cal__layout { display: grid; gap: 36px; }
.cal__main { min-width: 0; }
@media (min-width: 1020px) {
  .cal__layout { grid-template-columns: minmax(0, 1fr) 330px; gap: 48px; align-items: start; }
  .cal__side { position: sticky; top: 18px; }
}
.cal__side { display: grid; gap: 22px; }
.cal__side-h { font-size: 1.05rem; font-weight: 700; }
.cal__side-p { color: var(--muted); font-size: .9rem; margin: 4px 0 12px; }
.cal__fine { color: var(--muted); font-size: .84rem; border-top: 1px solid var(--line); padding-top: 14px; }
.cal__empty { margin-top: 24px; padding: 22px; border: 1px dashed var(--line-2); border-radius: var(--r); color: var(--muted); text-align: center; }
.feed { padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.feed__alt { margin-top: 10px; color: var(--muted); font-size: .84rem; }
.feed__url { font-weight: 600; color: var(--ink-2); overflow-wrap: anywhere; }

.month { margin-top: 26px; }
.month:first-child { margin-top: 8px; }
.month__title { font-size: 1.02rem; letter-spacing: .02em; padding-bottom: 7px; border-bottom: 2px solid var(--ink); }
.month--tba .month__title { border-bottom-style: dashed; }
.month__note { color: var(--muted); font-size: .9rem; margin: 8px 0 2px; max-width: 46em; }

.rally__link { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 14px; align-items: center; padding: 13px 6px; border-bottom: 1px solid var(--line); text-decoration: none; }
.rally__link:hover { background: color-mix(in srgb, var(--orange) 9%, transparent); }
.rally__date { grid-row: 1 / span 2; align-self: start; display: grid; text-align: center; border: 1.5px solid var(--ink); border-radius: 10px; overflow: hidden; background: var(--card); line-height: 1.15; }
.rally__mon { background: var(--ink); color: var(--paper); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 0 2px; }
.rally__days { font-size: 1.12rem; font-weight: 800; padding: 5px 2px 0; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.rally__yr { font-size: .66rem; font-weight: 600; color: var(--muted); padding: 1px 0 4px; }
.rally__date--tba { border-style: dashed; border-color: var(--line-2); }
.rally__date--tba .rally__mon { background: transparent; color: var(--muted); }
.rally__date--tba .rally__days { font-size: .98rem; color: var(--muted); }
.rally__main { display: grid; gap: 2px; min-width: 0; }
.rally__name { font-weight: 700; font-size: 1.08rem; line-height: 1.22; }
.rally__link:hover .rally__name { text-decoration: underline; text-decoration-color: var(--underline); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.rally__meta { color: var(--muted); font-size: .92rem; }
.rally__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.rally__side { grid-column: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; font-size: .92rem; }
.rally__when { font-weight: 700; color: var(--accent-text); white-space: nowrap; }
.rally__when:empty { display: none; }
.rally__result { color: var(--muted); }
.rally__result-k { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-right: 3px; }
.rally__dist { color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.rally[data-when="live"] .rally__when { background: var(--orange); color: var(--night); padding: 1px 10px; border-radius: 999px; }
.rally[data-when="past"] .rally__date { border-color: var(--line-2); }
.rally[data-when="past"] .rally__mon { background: var(--line-2); color: var(--ink); }
@media (min-width: 700px) {
  .rally__link { grid-template-columns: 70px minmax(0, 1fr) minmax(120px, auto); gap: 4px 18px; padding: 15px 10px; }
  .rally__date { grid-row: auto; align-self: center; }
  .rally__side { grid-column: 3; display: grid; justify-items: end; text-align: right; max-width: 260px; }
}
.rally--compact .rally__link { grid-template-columns: 58px minmax(0, 1fr); padding: 10px 2px; }
.rally--compact .rally__tags, .rally--compact .rally__side { display: none; }
.rally--compact .rally__date { grid-row: auto; align-self: center; }
.month__list--mini .rally:last-child .rally__link { border-bottom: 0; }

/* The state tile map: 11 columns, 8 rows. */
.tiles { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 3px; max-width: 420px; }
.tile { aspect-ratio: 1; min-width: 0; padding: 0; border: 0; border-radius: 5px; display: grid; place-items: center; font-size: .66rem; font-weight: 800; letter-spacing: .01em; cursor: pointer; background: var(--tile-1); color: var(--tile-fg); }
.tile[data-level="2"] { background: var(--tile-2); }
.tile[data-level="3"] { background: var(--tile-3); color: #14171A; }
.tile:disabled { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); cursor: default; }
.tile:not(:disabled):hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.tile[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.tile__n { display: none; }
.c0 { grid-column: 1; } .c1 { grid-column: 2; } .c2 { grid-column: 3; } .c3 { grid-column: 4; } .c4 { grid-column: 5; } .c5 { grid-column: 6; }
.c6 { grid-column: 7; } .c7 { grid-column: 8; } .c8 { grid-column: 9; } .c9 { grid-column: 10; } .c10 { grid-column: 11; }
.r0 { grid-row: 1; } .r1 { grid-row: 2; } .r2 { grid-row: 3; } .r3 { grid-row: 4; } .r4 { grid-row: 5; } .r5 { grid-row: 6; } .r6 { grid-row: 7; } .r7 { grid-row: 8; }

/* ---- spotlight band ---- */
.spot { background: var(--night); color: var(--on-night); border-top: 4px solid var(--orange); --focus: #FFFFFF; --underline: #F07A1A; }
.spot__in { display: grid; gap: 28px; padding: clamp(36px, 6vw, 64px) 0; align-items: center; }
.spot__t { font-size: clamp(1.7rem, 4.6vw, 2.8rem); margin-top: 10px; text-wrap: balance; }
.spot__d { margin-top: 14px; color: var(--on-night-2); max-width: 40em; }
.spot__a { margin-top: 22px; }
.spot__dates { font-weight: 800; font-style: italic; text-transform: uppercase; font-size: 1.35rem; line-height: 1.2; }
.spot__dates span { font-weight: 600; font-style: normal; text-transform: none; font-size: 1rem; color: var(--on-night-2); }
@media (min-width: 920px) { .spot__in { grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); gap: 56px; } }

/* ---- cards ---- */
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
@media (min-width: 560px) { .cards--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1020px) { .cards--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.card:hover { border-color: var(--ink); }
.card__k { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.card__k .ico { color: var(--accent-text); }
.card__t { font-size: 1.22rem; font-weight: 700; line-height: 1.2; }
.card__t a { text-decoration: none; }
.card__t a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r); }
.card__t a:hover { text-decoration: underline; text-decoration-color: var(--underline); }
.card__d { color: var(--muted); font-size: .95rem; }
.card__facts { margin-top: auto; padding-top: 12px; display: grid; gap: 8px; border-top: 1px solid var(--line); font-size: .92rem; }
.card__facts dt { color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.card__facts dd { font-weight: 600; }
.card--wide { grid-column: 1 / -1; }
.card--accent { background: var(--accent-bg); border-color: var(--orange); }
.vlinks { position: relative; z-index: 1; display: grid; gap: 10px 24px; margin-top: 8px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.vlinks a { font-weight: 700; }
.vlinks__d { display: block; color: var(--muted); font-size: .9rem; }

/* ---- standings snapshot and drivers list ---- */
.podium__row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 0 10px; border-bottom: 1px solid var(--line); }
.podium__pos { font-weight: 800; font-style: italic; font-size: 1.5rem; line-height: 1; color: var(--muted); }
.podium__row:first-child .podium__pos { color: var(--accent-text); }
.podium__who { display: grid; }
.podium__name { font-weight: 700; }
.podium__car { color: var(--muted); font-size: .9rem; }
.podium__pts { font-weight: 800; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.podium__bar { grid-column: 1 / -1; width: 100%; height: 4px; background: var(--line); border-radius: 2px; }
.podium__bar rect { fill: var(--underline); }
.dmini li { border-bottom: 1px solid var(--line); }
.dmini a { display: grid; padding: 11px 0; text-decoration: none; }
.dmini a:hover .dmini__name { text-decoration: underline; text-decoration-color: var(--underline); }
.dmini__name { font-weight: 700; }
.dmini__meta { color: var(--muted); font-size: .9rem; }

/* ---- inner pages ---- */
.phead { background: var(--night); color: var(--on-night); padding: clamp(28px, 5vw, 56px) 0 clamp(22px, 4vw, 40px); --focus: #FFFFFF; --underline: #F07A1A; }
.phead--tall { padding-block: clamp(56px, 12vw, 140px); }
.phead .sec__head { margin-bottom: 0; }
.phead .sec__title { font-size: clamp(2rem, 6vw, 3.4rem); }
.phead .sec__lede { color: var(--on-night-2); }
.phead .sec__ss { color: var(--orange); }
.jump { margin-top: 22px; }
.jump ul { display: flex; flex-wrap: wrap; gap: 8px; }
.jump a { display: block; padding: 7px 14px; border: 1.5px solid var(--ctl-night); border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .92rem; }
.jump a:hover { border-color: var(--orange); }
.prose-wide { padding-bottom: 56px; }
.guide { padding-bottom: 56px; }
.guide__sec { max-width: 980px; }
.guide__sec, .series, .sgroup { padding: clamp(30px, 5vw, 48px) 0; border-bottom: 1px solid var(--line); }
.guide__sec:last-child, .series:last-child, .sgroup:last-child { border-bottom: 0; }
.guide__sec > h2, .series__t, .sgroup > h2 { font-size: clamp(1.5rem, 3.6vw, 2.1rem); }
.guide__sec h3, .series h3, .sgroup h3 { font-size: 1.12rem; font-weight: 700; margin: 26px 0 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.guide__sec p, .series p, .sgroup p { margin-top: 12px; max-width: 46em; }
.series__k { color: var(--accent-text); font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-top: 0 !important; margin-bottom: 8px; }
.series__more { font-weight: 700; }
.lead { font-size: 1.14em; color: var(--ink-2); }
.callout { padding: 14px 16px; border-left: 4px solid var(--orange); background: var(--accent-bg); border-radius: 0 var(--r-s) var(--r-s) 0; max-width: 52em !important; margin-top: 18px !important; }
.twocol { display: grid; gap: 8px 40px; }
@media (min-width: 800px) { .twocol { grid-template-columns: 1fr 1fr; } }

.steps { counter-reset: s; display: grid; gap: 12px; margin-top: 16px; }
.steps > li { counter-increment: s; position: relative; padding-left: 46px; min-height: 34px; max-width: 46em; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--orange); color: var(--night); font-weight: 800; font-style: italic; font-size: .95rem; }
.steps--big { gap: 16px; }
.checks { display: grid; gap: 8px; margin-top: 10px; }
.checks > li { position: relative; padding-left: 28px; max-width: 44em; }
.checks > li::before { content: ""; position: absolute; left: 3px; top: .42em; width: 13px; height: 7px; border-left: 3px solid var(--orange); border-bottom: 3px solid var(--orange); transform: rotate(-45deg); }
.checks--plain > li::before { width: 8px; height: 8px; top: .55em; left: 6px; border: 0; background: var(--orange); border-radius: 50%; transform: none; }

.facts { display: grid; gap: 0; margin-top: 14px; border-top: 1px solid var(--line); }
.facts > div { display: grid; grid-template-columns: minmax(96px, 150px) minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; padding-top: .22em; }
.facts--tight { max-width: 46em; }
.glossary { display: grid; gap: 0 40px; margin-top: 14px; }
@media (min-width: 800px) { .glossary { grid-template-columns: 1fr 1fr; } }
.glossary > div { padding: 12px 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.glossary dt { font-weight: 700; }
.glossary dd { color: var(--ink-2); font-size: .96rem; }

.lcards { display: grid; gap: 12px; margin-top: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.lcard__a { display: grid; gap: 4px; height: 100%; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; }
.lcard__a:hover { border-color: var(--ink); }
.lcard__name { font-weight: 700; line-height: 1.25; }
.lcard__what { color: var(--muted); font-size: .92rem; line-height: 1.42; }
.lcard__meta { color: var(--accent-text); font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; margin-top: 2px; align-self: end; }

.vsys { display: grid; gap: 16px; margin-top: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.vsys__item { display: flex; flex-direction: column; gap: 4px; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.vsys__item:first-child { border-color: var(--orange); background: var(--accent-bg); }
.vsys__item h3 { margin: 0; font-size: 1.25rem; }
.vsys__item p:last-child { margin-top: auto; padding-top: 14px; }
.vsys__k { color: var(--muted); font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-top: 2px !important; }

.tablewrap { overflow-x: auto; margin-top: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl th, .tbl td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.tbl tbody tr:last-child > * { border-bottom: 0; }
.tbl thead th { font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); white-space: nowrap; background: color-mix(in srgb, var(--ink) 4%, transparent); }
.tbl tbody th { font-weight: 600; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td.num:first-child, .tbl th.num:first-child { text-align: center; width: 3.2em; }
.tbl .is-first > * { background: var(--accent-bg); }
.tbl .is-unranked > * { color: var(--muted); }
.tbl .is-unranked strong { font-weight: 600; }
@media (max-width: 559px) { .tbl--stand .col-car { display: none; } }
.sgrid { display: grid; gap: 8px 32px; }
@media (min-width: 900px) { .sgrid { grid-template-columns: 1fr 1fr; align-items: start; } .sgrid > .stable:first-child:last-child, .sgrid > .stable--wide { grid-column: 1 / -1; } }
.stable { min-width: 0; }
.fold { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.fold > summary { padding: 13px 16px; font-weight: 700; cursor: pointer; }
.fold > .month__list { padding: 0 10px 6px; border-top: 1px solid var(--line); }

/* ---- rally page ---- */
.rp__hero { background: var(--night); color: var(--on-night); padding: 18px 0 clamp(28px, 5vw, 48px); --focus: #FFFFFF; --underline: #F07A1A; }
.crumbs a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; color: var(--on-night-2); font-weight: 600; font-size: .92rem; text-decoration: none; }
.crumbs a:hover { color: var(--on-night); }
.rp__season { margin-top: clamp(12px, 3vw, 28px); color: var(--orange); font-weight: 700; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; }
.rp__t { margin-top: 8px; font-size: clamp(2.1rem, 7vw, 3.9rem); text-wrap: balance; }
.rp__place { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 1.12rem; font-weight: 600; color: var(--on-night-2); }
.rp__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.rp__hero .chip--regional, .rp__hero .chip--sprint, .rp__hero .chip--other { border-color: var(--ctl-night); color: var(--on-night); }
.rp__hero .chip--super { background: transparent; color: var(--on-night); }
.rp__hero .chip--plain { background: #2A3037; color: var(--on-night-2); }
.rp__hero .chip--world { background: var(--on-night); color: var(--night); }
.rp__hero .chip--alert { border-color: #FF8A80; color: #FF8A80; }
.rp__when { margin-top: 22px; padding-top: 18px; border-top: 1px dashed #46505A; }
.rp__dates { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: clamp(1.1rem, 3vw, 1.35rem); font-weight: 700; }
.rp__pre { margin-top: 16px; color: var(--on-night-3); font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.rp__pre + .trip { margin-top: 8px; }
.rp__note { margin-top: 10px; color: var(--on-night-3); font-size: .84rem; }
.rp__live { margin-top: 14px; display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--orange); color: var(--night); font-weight: 800; }
.rp__won { margin-top: 14px; font-size: 1.15rem; font-weight: 700; }
.rp__won span { display: inline-block; margin-right: 8px; padding: 2px 10px; border-radius: 999px; background: var(--orange); color: var(--night); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; vertical-align: .12em; }
.rp__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.rp__body { display: grid; gap: 28px; padding-block: clamp(26px, 4vw, 44px); }
@media (min-width: 980px) { .rp__body { grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; align-items: start; } }
.rp__sec + .rp__sec { margin-top: 34px; }
.rp__sec h2, .rp__box h2 { font-size: 1.3rem; font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: -.005em; }
.rp__sec p { margin-top: 12px; max-width: 46em; }
.rp__sec h3 { font-size: 1.05rem; font-weight: 700; margin: 24px 0 0; }
.rp__aside { display: grid; gap: 16px; }
.rp__box { padding: 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.rp__box h2 { font-size: 1.05rem; margin-bottom: 8px; }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-bottom: 48px; }
.pn__a { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; background: var(--card); min-width: 0; }
.pn__a:hover { border-color: var(--ink); }
.pn__a--next { text-align: right; justify-items: end; }
.pn__k { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.pn__n { font-weight: 700; line-height: 1.25; }
.pn__d { color: var(--muted); font-size: .9rem; }

/* ---- drivers ---- */
.dsearch { margin-top: 22px; }
.dsearch .sel__l { color: var(--on-night-2); }
.dsearch input { background: var(--night-2); border-color: var(--ctl-night); color: var(--on-night); }
.dsearch input::placeholder { color: var(--on-night-3); opacity: 1; }
.dsearch .cal__count { color: var(--on-night-3); }
.drivers { display: grid; gap: 16px; padding-block: 28px 20px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.driver { padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.driver:target { border-color: var(--orange); box-shadow: 0 0 0 3px var(--accent-bg); }
.driver__head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; }
.driver__pos { min-width: 1.5em; font-size: 2.3rem; color: var(--accent-text); text-align: center; }
.driver__pos--star { font-style: normal; font-size: 1.7rem; }
.driver__name { font-size: 1.28rem; font-weight: 700; line-height: 1.2; }
.driver__hl { color: var(--accent-text); font-weight: 700; font-size: .9rem; margin-top: 2px; }
.driver__facts { display: grid; gap: 0; margin-top: 14px; border-top: 1px solid var(--line); font-size: .93rem; }
.driver__facts > div { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.driver__facts dt { color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; padding-top: .25em; }
.driver__notes { display: grid; gap: 6px; margin-top: 12px; font-size: .93rem; color: var(--ink-2); }
.driver__notes li { position: relative; padding-left: 16px; }
.driver__notes li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }

/* ---- footer ---- */
.foot { background: var(--night); color: var(--on-night-2); padding: 44px 0 30px; --focus: #FFFFFF; --underline: #F07A1A; font-size: .95rem; }
.foot__grid { display: grid; gap: 32px; }
@media (min-width: 820px) { .foot__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 56px; } }
.foot__brand p { margin-top: 12px; max-width: 24em; }
.foot__nav { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.foot__nav h2 { color: var(--on-night); font-size: .76rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px; }
.foot__nav a { display: inline-block; padding: 5px 0; text-decoration: none; }
.foot__nav a:hover { color: var(--on-night); text-decoration: underline; text-decoration-color: var(--underline); }
.foot__fine { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--night-3); color: var(--on-night-3); font-size: .84rem; display: grid; gap: 8px; }
.foot__fine p { max-width: 70em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  .top__nav, .quick, .cal__controls, .cal__side, .hero__art, .hero__a, .foot__nav, .skip, .jump, .rp__actions, .pn, .more { display: none !important; }
  .top, .hero, .phead, .rp__hero, .spot, .foot { background: none !important; color: #000 !important; }
  .hero__t span, .hero__k, .hero__d, .phead .sec__lede, .rp__place, .foot, .foot__fine { color: #000 !important; }
  .next, .trip { display: none !important; }
  .rally[hidden], .month[hidden] { display: block !important; }
  a { text-decoration: none; }
  .rally__link { break-inside: avoid; }
}
