/* ==============================================================
   ENTRANCE Signal — the homepage's design language on every other
   page. Loaded last, after each page's own stylesheets, and scoped
   to body:not(.hx-home). Night chrome (header, page heroes, footer)
   frames paper sections that pass over the hero on a rounded sheet;
   pills, hairlines, one easing and one type rhythm throughout.
   ============================================================== */

body:not(.hx-home) {
  --sg-night: #121211;
  --sg-night-2: #1a1a18;
  --sg-cream: #f3f2ee;
  --sg-muted-dark: rgba(243, 242, 238, 0.66);
  --sg-faint-dark: rgba(243, 242, 238, 0.42);
  --sg-line-dark: rgba(255, 255, 255, 0.12);
  --sg-paper: var(--paper, var(--dk-bg-fcfcfc, #fcfcfc));
  --sg-mist: var(--dk-bg-f3f3f1, #f3f3f1);
  --sg-ink: var(--dk-fg-141414, #141414);
  --sg-muted: var(--dk-fg-5c5c5a, #5c5c5a);
  --sg-line: var(--dk-ln-e2e2df, #e2e2df);
  --sg-line-strong: var(--dk-ln-cfcfcb, #cfcfcb);
  --sg-orange: var(--orange, #ff6b00);
  --sg-orange-ink: var(--orange-dark, var(--dk-fg-a33d00, #a33d00));
  --sg-orange-rgb: 255, 107, 0;
  --sg-gutter: clamp(20px, 4vw, 56px);
  --sg-sheet: clamp(20px, 2.4vw, 32px);
  --sg-r: 16px;
  --sg-r-sm: 10px;
  --sg-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sg-fast: 220ms;
  background: var(--sg-paper);
  color: var(--sg-ink);
  -webkit-font-smoothing: antialiased;
}

/* below a short page, the canvas continues the night footer rather than a white strip */
html:has(> body:not(.hx-home)) { background: #121211; }

body:not(.hx-home) ::selection { background: rgba(var(--sg-orange-rgb), 0.28); }

body:not(.hx-home) :focus-visible {
  outline: 2px solid var(--sg-orange);
  outline-offset: 3px;
}

/* --------------------------------------------------------------
   Header — night, like the homepage bar; one row on a wide screen
   -------------------------------------------------------------- */

body:not(.hx-home) .site-header {
  border-bottom: 1px solid var(--sg-line-dark);
  background: var(--sg-night);
  color: var(--sg-cream);
}

body:not(.hx-home) .site-header.is-scrolled { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22); }
body:not(.hx-home) .brand-logo { width: clamp(128px, 12vw, 160px); }
body:not(.hx-home) .is-scrolled .brand-logo { width: clamp(124px, 11vw, 150px); }
@media (max-width: 359px) {
  /* Leave room for the live countdown, search and the 44px menu button. */
  body:not(.hx-home) .site-header .brand-logo { width: 104px; }
}
body:not(.hx-home) .site-header .nav { border-top-color: rgba(255, 255, 255, 0.06); }

body:not(.hx-home) .site-header .nav a {
  color: var(--sg-muted-dark);
  font-size: 0.875rem;
  font-weight: 600;
  transition: color var(--sg-fast) var(--sg-ease);
}

@media (min-width: 861px) {
  body:not(.hx-home) .site-header .nav a::after { height: 1px; bottom: 10px; transition: transform 380ms var(--sg-ease); }
}

/* the drawer: the same night as the bar, big editorial links */
@media (max-width: 860px) {
  body.has-nav-toggle:not(.hx-home) .site-header.is-nav-open .nav { background: var(--sg-night); }
  body.has-nav-toggle:not(.hx-home) .site-header.is-nav-open .nav a {
    border-bottom-color: var(--sg-line-dark);
    color: var(--sg-cream);
    font-family: inherit;
    font-size: clamp(1.5rem, 1rem + 2.4vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.04em;
  }
  body.has-nav-toggle:not(.hx-home) .site-header.is-nav-open .nav a:not([aria-current="page"]):not([href="/contact/"]) { color: var(--sg-muted-dark); }
  body.has-nav-toggle:not(.hx-home) .site-header.is-nav-open .nav a:hover { color: var(--sg-cream); }
  body.has-nav-toggle:not(.hx-home) .site-header.is-nav-open .nav a[href="/contact/"] { color: var(--sg-orange); }
  body.has-nav-toggle:not(.hx-home) .site-header.is-nav-open .nav a::before { color: var(--sg-orange); letter-spacing: 0; }
}
body:not(.hx-home) .site-header .nav a:hover,
body:not(.hx-home) .site-header .nav a[aria-current="page"] { color: var(--sg-cream); }
body:not(.hx-home) .site-header .nav a[href="/contact/"] { color: var(--sg-orange); }

body:not(.hx-home) .site-header .nav-toggle {
  border-color: var(--sg-line-dark);
  border-radius: 999px;
  background: transparent;
  transition: border-color var(--sg-fast) var(--sg-ease), background-color var(--sg-fast) var(--sg-ease);
}

body:not(.hx-home) .site-header .nav-toggle:hover { border-color: var(--dk-ln-255-255-255-400, rgba(255, 255, 255, 0.4)); background: rgba(255, 255, 255, 0.06); }

/* phones: the race timer is centred between the brand and the buttons (styles/features.css) */
@media (max-width: 620px) {
  body:not(.hx-home) .site-header .topbar:has(.live-pill-wrap) .brand { margin-right: 0; }
  body:not(.hx-home) .site-header .topbar .live-pill-wrap { margin-inline: auto; }
}

@media (max-width: 1439px) {
  /* the brand pushes the controls right; the search button must not claim half the gap */
  body:not(.hx-home) .site-header .topbar .brand { margin-right: auto; }
  body:not(.hx-home) .site-header .topbar :is(.search-btn, .nav-toggle) { margin-left: 0; }
}

/* The ten primary links, search and account need a full desktop width. */
@media (min-width: 1440px) {
  body:not(.hx-home) .site-header {
    display: flex;
    align-items: center;
    gap: 22px;
    min-height: 64px;
    padding-inline: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
  }

  body:not(.hx-home) .site-header .topbar { display: contents; }
  body:not(.hx-home) .site-header .brand { order: 0; flex: 0 0 auto; }

  body:not(.hx-home) .site-header .nav {
    order: 1;
    flex: 1 1 auto;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    gap: clamp(2px, 0.7vw, 12px);
  }

  body:not(.hx-home) .site-header .nav a { padding: 0 7px; }
  body:not(.hx-home) .site-header .nav a::after { right: 7px; left: 7px; }
  body:not(.hx-home) .site-header .live-pill-wrap { order: 2; margin-left: auto; }
  body:not(.hx-home) .site-header .search-btn { order: 3; }
  body:not(.hx-home) .site-header .account-entry { order: 4; }
  body:not(.hx-home) .site-header .nav-toggle { display: none; }
  body:not(.hx-home) .site-header .nav .nav-account { display: none; }
}

/* --------------------------------------------------------------
   Page hero — a night band; the next surface rises over it as a
   rounded paper sheet
   -------------------------------------------------------------- */

body:not(.hx-home) main > :is(.page-hero, .rw-hero, .rw-fallback) {
  position: relative;
  min-height: 0;
  padding: clamp(36px, 5vw, 80px) 0 calc(var(--sg-sheet) + clamp(30px, 4vw, 60px));
  border: 0;
  background:
    radial-gradient(55% 110% at 88% 0%, rgba(var(--sg-orange-rgb), 0.1), transparent 62%),
    var(--sg-night);
  color: var(--sg-cream);
  isolation: isolate;
  overflow: hidden;
}

body:not(.hx-home) main > :is(.page-hero, .rw-hero, .rw-fallback)::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 88px 88px;
  -webkit-mask-image: radial-gradient(60% 90% at 85% 10%, #000 15%, transparent 75%);
  mask-image: radial-gradient(60% 90% at 85% 10%, #000 15%, transparent 75%);
  pointer-events: none;
}

body:not(.hx-home) main > :is(.page-hero, .rw-hero, .rw-fallback) h1 {
  max-width: 18ch;
  margin: 0.15em 0 0;
  color: var(--sg-cream);
  font-size: clamp(2.5rem, 1.3rem + 4.2vw, 5.5rem);
  font-weight: 740;
  letter-spacing: -0.055em;
  line-height: 0.96;
  text-wrap: balance;
}

body:not(.hx-home) main > :is(.page-hero, .rw-hero, .rw-fallback) p { color: var(--sg-muted-dark); }

body:not(.hx-home) main > :is(.page-hero, .rw-hero, .rw-fallback) .kicker {
  margin-bottom: 6px;
  color: var(--sg-orange);
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-transform: none;
}

body:not(.hx-home) main > :is(.page-hero, .rw-hero, .rw-fallback) a:not(.button):not(.ics-btn) { color: var(--sg-muted-dark); }
body:not(.hx-home) main > :is(.page-hero, .rw-hero, .rw-fallback) a:not(.button):not(.ics-btn):hover { color: var(--sg-cream); }

/* a hero with nothing after it (the 404 page) needs no room for a sheet */
body:not(.hx-home) main > :is(.page-hero, .rw-hero, .rw-fallback):last-child { padding-bottom: clamp(48px, 6vw, 96px); }

/* the sheet: the context panel when there is one, otherwise the first section */
body:not(.hx-home) main > :is(.page-hero, .rw-hero, .rw-fallback) + .sx-panel-sentinel + .sx-panel,
body:not(.hx-home) main > :is(.page-hero, .rw-hero, .rw-fallback) + section {
  position: relative;
  z-index: 2;
  margin-top: calc(var(--sg-sheet) * -1);
  border-radius: var(--sg-sheet) var(--sg-sheet) 0 0;
  background: var(--sg-paper);
}

body:not(.hx-home) main > :is(.page-hero, .rw-hero, .rw-fallback) + .sx-panel-sentinel + .sx-panel { position: sticky; z-index: 40; }
body:not(.hx-home) .sx-panel { transition: border-radius 320ms var(--sg-ease), background-color 240ms var(--sg-ease), box-shadow 240ms var(--sg-ease); }
body:not(.hx-home) .sx-panel.is-stuck { border-radius: 0; }

/* --------------------------------------------------------------
   Type, kickers, section heads with the signal rule
   -------------------------------------------------------------- */

body:not(.hx-home, .stats-product-page, .stats-explorer-page) main h2 { letter-spacing: -0.035em; }
body:not(.hx-home, .stats-product-page, .stats-explorer-page) main :is(h1, h2, h3) { text-wrap: balance; }

body:not(.hx-home, .stats-product-page, .stats-explorer-page) main :is(.kicker, .rc-kicker, .wf-eyebrow) {
  color: var(--sg-orange-ink);
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-transform: none;
}

body:not(.hx-home, .stats-product-page, .stats-explorer-page) .section-head {
  position: relative;
  align-items: flex-end;
  padding-bottom: 16px;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--sg-line);
}

body:not(.hx-home, .stats-product-page, .stats-explorer-page) .section-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: clamp(64px, 14%, 180px);
  height: 2px;
  background: var(--sg-orange);
}

/* the heading and what sits beside it stack from 860px down (styles.css), and then both start at the left */
@media (max-width: 860px) {
  body:not(.hx-home, .stats-product-page, .stats-explorer-page) .section-head { align-items: flex-start; }
}

body:not(.hx-home, .stats-product-page, .stats-explorer-page) .section-head h2 {
  font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.5rem);
  font-weight: 720;
  line-height: 1.05;
  letter-spacing: -0.045em;
}

/* --------------------------------------------------------------
   Buttons and links — pills with a sliding arrow feel
   -------------------------------------------------------------- */

body:not(.hx-home, .stats-product-page, .stats-explorer-page) .button {
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 650;
  box-shadow: none;
  transition: background-color var(--sg-fast) var(--sg-ease), border-color var(--sg-fast), color var(--sg-fast), transform 200ms var(--sg-ease);
}

body:not(.hx-home, .stats-product-page, .stats-explorer-page) .button:hover { box-shadow: none; }

body:not(.hx-home, .stats-product-page, .stats-explorer-page) :is(.ics-btn, .wf-button, .rc-button) {
  border-radius: 999px;
  transition: background-color var(--sg-fast) var(--sg-ease), border-color var(--sg-fast), color var(--sg-fast);
}

body:not(.hx-home, .stats-product-page, .stats-explorer-page) .wf-section :focus-visible { outline: 2px solid var(--sg-orange); outline-offset: 3px; }

/* --------------------------------------------------------------
   Tables — editorial rows, hairlines, big tabular numbers
   -------------------------------------------------------------- */

body:not(.hx-home, .stats-product-page, .stats-explorer-page) main .table {
  border: 0;
  border-radius: var(--sg-r);
  box-shadow: inset 0 0 0 1px var(--sg-line);
  background: var(--sg-paper);
}

body:not(.hx-home, .stats-product-page, .stats-explorer-page) main .table th {
  background: var(--sg-mist);
  color: var(--sg-muted);
  font-size: 0.75rem;
  font-weight: 650;
}

body:not(.hx-home, .stats-product-page, .stats-explorer-page) main .table :is(th, td) { border-bottom-color: var(--sg-line); }
body:not(.hx-home, .stats-product-page, .stats-explorer-page) main .table tbody tr:hover td { background: var(--dk-abg-20-20-20-25, rgba(20, 20, 20, 0.025)); }

body:not(.hx-home, .stats-product-page, .stats-explorer-page) main .table td.cell-pos {
  color: var(--sg-ink);
  font-size: 1.25rem;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

body:not(.hx-home, .stats-product-page, .stats-explorer-page) main .table td.cell-main { font-weight: 650; }
body:not(.hx-home, .stats-product-page, .stats-explorer-page) main .table td.cell-end { font-size: 1.0625rem; font-weight: 720; letter-spacing: -0.02em; }
/* a mobile card row already carries the team bar; the cell would draw it twice */
@media (max-width: 860px) {
  body:not(.hx-home, .stats-product-page, .stats-explorer-page) main .table.mobile-cards .accent-row td:first-child { box-shadow: none; }
}

body:not(.hx-home, .stats-product-page, .stats-explorer-page) main .table tbody tr.accent-row:first-child :is(td.cell-pos, td.cell-end) { color: var(--sg-orange-ink); }

/* --------------------------------------------------------------
   Footer — the homepage's night footer
   -------------------------------------------------------------- */

body:not(.hx-home) .site-footer {
  padding: clamp(44px, 6vw, 76px) 0 28px;
  border-top: 1px solid var(--sg-line-dark);
  background: var(--sg-night);
  color: var(--sg-cream);
}

body:not(.hx-home) .site-footer .footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  grid-template-areas:
    "brand links"
    "contact links"
    "social links"
    "copy copy";
  align-items: start;
  gap: 18px clamp(28px, 6vw, 96px);
}

body:not(.hx-home) .site-footer .footer-brand { grid-area: brand; justify-self: start; }
body:not(.hx-home) .site-footer .footer-brand img { width: 168px; }

body:not(.hx-home) .site-footer .footer-grid > div:not([class]) {
  grid-area: copy;
  justify-self: stretch;
  padding-top: 20px;
  margin-top: clamp(18px, 3vw, 36px);
  border-top: 1px solid var(--sg-line-dark);
  color: var(--sg-faint-dark);
  font-size: 0.8125rem;
}

body:not(.hx-home) .site-footer .footer-contact { grid-area: contact; display: grid; justify-self: start; gap: 4px; color: var(--sg-cream); }
body:not(.hx-home) .site-footer .footer-contact:hover strong { text-decoration: underline; text-underline-offset: 4px; }
body:not(.hx-home) .site-footer .footer-contact span { color: var(--sg-faint-dark); font-size: 0.8125rem; font-weight: 600; }
body:not(.hx-home) .site-footer .footer-contact strong { color: var(--sg-orange); font-family: inherit; font-size: 1rem; font-weight: 650; }

body:not(.hx-home) .site-footer .footer-social { grid-area: social; display: flex; flex-wrap: wrap; gap: 0 20px; }
body:not(.hx-home) .site-footer .footer-social a { min-height: 44px; }

body:not(.hx-home) .site-footer .footer-links {
  grid-area: links;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 2px 24px;
  padding: 0;
  border: 0;
}

body:not(.hx-home) .site-footer .footer-links a { display: inline-flex; align-items: center; justify-self: start; min-height: 40px; }

body:not(.hx-home) .site-footer :is(.footer-social, .footer-links) a {
  color: var(--sg-muted-dark);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color var(--sg-fast) var(--sg-ease), transform var(--sg-fast) var(--sg-ease);
}

body:not(.hx-home) .site-footer :is(.footer-social, .footer-links) a:hover { color: var(--sg-cream); transform: translateX(4px); }

@media (max-width: 760px) {
  body:not(.hx-home) .site-footer .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "brand" "contact" "links" "social" "copy";
  }
}

/* ==============================================================
   Driver and team profiles — the hero lives inside the page wrap, so
   the night band bleeds to the viewport edges with a clipped shadow
   ============================================================== */

.profile-page .profile-wrap { padding-top: 0; }

.profile-page .profile-wrap > :is(.profile-back, .profile-hero) {
  background: var(--sg-night);
  box-shadow: 0 0 0 100vmax var(--sg-night);
  clip-path: inset(0 -100vmax);
  color: var(--sg-cream);
}

.profile-page .profile-wrap > .profile-back {
  display: flex;
  width: 100%;
  padding-top: clamp(20px, 3vw, 40px);
  color: var(--sg-muted-dark);
  font-weight: 600;
}

.profile-page .profile-wrap > .profile-back:hover { color: var(--sg-cream); }

.profile-page .profile-hero {
  position: relative;
  padding: clamp(12px, 2vw, 28px) 0 clamp(36px, 5vw, 72px);
  border-bottom: 0;
  background: var(--sg-night);
  background:
    radial-gradient(38% 90% at 92% 55%, color-mix(in srgb, var(--team-colour) 34%, transparent), transparent 70%),
    var(--sg-night);
}

.profile-page .profile-hero h1 {
  color: var(--sg-cream);
  font-size: clamp(2.5rem, 1.3rem + 4.2vw, 5.5rem);
  font-weight: 740;
  letter-spacing: -0.055em;
  line-height: 0.96;
}

.profile-page .profile-hero .profile-country { color: var(--sg-muted-dark); font-weight: 600; }
.profile-page .profile-hero .profile-affiliation a { color: var(--sg-cream); font-weight: 600; }
.profile-page .profile-hero .profile-affiliation span { color: var(--sg-muted-dark); }

.profile-page .profile-hero .profile-number {
  color: var(--team-colour);
  font-size: clamp(5rem, 12vw, 10rem);
  font-weight: 740;
  text-shadow: 0 0 60px color-mix(in srgb, var(--team-colour) 40%, transparent);
}

.profile-page .profile-nav { position: relative; border-bottom-color: var(--sg-line); }
.profile-page .profile-nav::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: clamp(64px, 14%, 180px);
  height: 2px;
  background: var(--team-colour);
}

.profile-page .profile-metrics { border-radius: var(--sg-r); overflow: hidden; }

/* ==============================================================
   Calendar
   ============================================================== */

.calendar-page main > .calendar-hero .calendar-header { align-items: flex-end; gap: 1.25rem 2rem; padding-bottom: 0; border-bottom: 0; }
html.calendar-positioning .calendar-page .calendar-hero { visibility: hidden; }
.calendar-page main > .calendar-hero .calendar-header-copy p { margin: 0.6rem 0 0; color: var(--sg-muted-dark); font-size: 1.0625rem; }
.calendar-page main > .calendar-hero .ics-btn-season { margin-top: 1.25rem; border-color: var(--sg-line-dark); background: transparent; color: var(--sg-cream); }
.calendar-page main > .calendar-hero .ics-btn-season:hover { border-color: var(--sg-orange); background: var(--sg-orange); color: #141414; }

.calendar-page main > .calendar-hero .calendar-filter { padding: 4px; border-color: var(--sg-line-dark); border-radius: 999px; background: rgba(255, 255, 255, 0.05); }
.calendar-page main > .calendar-hero .calendar-filter button { border-radius: 999px; color: var(--sg-muted-dark); }
.calendar-page main > .calendar-hero .calendar-filter button:hover { background: rgba(255, 255, 255, 0.08); color: var(--sg-cream); }
.calendar-page main > .calendar-hero .calendar-filter button[aria-pressed="true"] { background: var(--sg-cream); color: #141414; }

.calendar-page .calendar-shell { padding-top: clamp(20px, 3vw, 36px); }

.calendar-page .calendar-progress-panel {
  border: 0;
  border-radius: var(--sg-r);
  box-shadow: inset 0 0 0 1px var(--sg-line);
  background: var(--sg-paper);
}

.calendar-page .calendar-progress-panel.is-stuck { border-radius: 0 0 var(--sg-r) var(--sg-r); box-shadow: inset 0 0 0 1px var(--sg-line), 0 12px 28px rgba(16, 16, 16, 0.06); }

.calendar-page .calendar-race-card {
  border: 0;
  border-radius: var(--sg-r);
  background: var(--sg-paper);
  box-shadow: inset 0 0 0 1px var(--sg-line);
  transition: transform 420ms var(--sg-ease), box-shadow var(--sg-fast) var(--sg-ease), background-color var(--sg-fast);
}

.calendar-page .calendar-race-card::after { border-radius: 0 0 var(--sg-r) var(--sg-r); }

@media (hover: hover) and (pointer: fine) {
  .calendar-page .calendar-race-card:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px var(--sg-line-strong), 0 14px 32px rgba(16, 16, 16, 0.07); }
}

.calendar-page .calendar-date-block span { color: var(--sg-muted); font-size: 0.75rem; font-weight: 650; letter-spacing: 0.04em; }
.calendar-page .calendar-date-block strong { font-weight: 720; font-variant-numeric: tabular-nums; letter-spacing: -0.05em; }
.calendar-page .calendar-race-title-line { font-weight: 700; letter-spacing: -0.02em; }
.calendar-page .calendar-race-circuit { color: var(--sg-muted); }
.calendar-page .calendar-round { color: var(--sg-muted); font-weight: 650; font-variant-numeric: tabular-nums; }

/* the next race keeps the calendar's own colour: the brand orange with ink
   type (6.4:1), as it was before the night cards */
.calendar-page .calendar-race-card.is-next {
  background: var(--sg-orange);
  box-shadow: none;
  color: #141414;
}

.calendar-page .calendar-race-card.is-next :is(.calendar-race-title-line, .calendar-date-block strong, .calendar-date-block span, .calendar-race-time, .calendar-race-circuit, .calendar-round, .calendar-round span, .calendar-round strong) { color: inherit; }
.calendar-page .calendar-race-card.is-next .calendar-race-countdown { border-radius: 999px; background: #141414; color: var(--sg-cream); }
.calendar-page .calendar-race-card.is-next .ics-btn { border-color: currentColor; color: inherit; }

/* Results: "Always show results" remembers the reader's choice in this browser */
.results-always-show { display: inline-flex; align-items: center; gap: 12px; margin-top: 18px; color: var(--sg-cream); font-size: 0.9375rem; font-weight: 650; cursor: pointer; }
.results-always-show input { appearance: none; position: relative; flex: none; width: 46px; height: 28px; margin: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.22); cursor: pointer; transition: background-color var(--sg-fast) var(--sg-ease); }
.results-always-show input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--sg-cream); transition: transform 240ms var(--sg-ease); }
.results-always-show input:checked { background: var(--sg-orange); }
.results-always-show input:checked::after { transform: translateX(18px); background: #141414; }
.results-always-show input:disabled { opacity: 0.5; cursor: default; }
.results-always-show input:focus-visible { outline: 2px solid var(--sg-orange); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .results-always-show input, .results-always-show input::after { transition: none; } }
.results-page .result-race-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 4px; color: var(--sg-ink); font-weight: 650; text-underline-offset: 5px; }
.results-page .result-race-link span { transition: transform 260ms var(--sg-ease); }
.results-page .result-race-link:hover span { transform: translateX(5px); }

/* ==============================================================
   Standings
   ============================================================== */

/* the tables arrive a moment after first paint; holding a screen of room
   keeps the sections below from being shoved out from under the reader */
.standings-page tr[data-standings-loading] > td { height: 100vh; height: 100svh; vertical-align: top; }

.standings-page :is(.points-race, .title-fight) {
  padding: clamp(20px, 2.4vw, 32px);
  border-radius: calc(var(--sg-r) + 4px);
  background: var(--sg-paper);
  box-shadow: inset 0 0 0 1px var(--sg-line);
}

.standings-page :is(.points-race-head, .title-fight-head) h2,
.standings-page .wf-heading h2 {
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem);
  font-weight: 720;
  letter-spacing: -0.045em;
}

.standings-page .wf-section {
  border-top: 0;
  background: var(--sg-mist);
}

.standings-page .wf-controls select {
  min-height: 44px;
  border: 1px solid var(--sg-line-strong);
  border-radius: var(--sg-r-sm);
  background: var(--sg-paper);
}

.standings-page .wf-button { border-color: var(--sg-ink); background: transparent; }
.standings-page .wf-button:hover { background: var(--sg-ink); color: var(--sg-paper); }
.standings-page .wf-table-wrap { border-radius: var(--sg-r); box-shadow: inset 0 0 0 1px var(--sg-line); background: var(--sg-paper); }

/* ==============================================================
   Race weekend
   ============================================================== */

/* the weekend renders over its summary; until it does, the summary holds a
   screen so the footer does not flash into view and then jump away */
.race-weekend-page main[data-race-weekend] > .rw-fallback:only-child { min-height: calc(100vh - 64px); min-height: calc(100svh - 64px); }

.race-weekend-page .rw-hero .rw-title { padding-bottom: 0; border-bottom: 0; }
.race-weekend-page .rw-hero .rw-title .kicker { letter-spacing: 0.01em; text-transform: none; }
.race-weekend-page .rw-hero .rw-weekend-date { margin-top: 1rem; color: var(--sg-muted-dark); font-size: 1.0625rem; font-weight: 550; }
.race-weekend-page .rw-hero .rw-back { display: inline-flex; margin-bottom: 1.25rem; font-size: 0.875rem; font-weight: 600; }

.race-weekend-page .rw-weekend { padding-top: clamp(28px, 4vw, 56px); }
.race-weekend-page .rw-weekend-grid { align-items: start; }
@media (min-width: 861px) {
  .race-weekend-page .rw-track-frame svg { max-height: min(640px, 72vh); }
}

.race-weekend-page .rw-schedule-head h2,
.race-weekend-page .rw-circuit-head h2 {
  font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.5rem);
  font-weight: 720;
  letter-spacing: -0.045em;
}

.race-weekend-page .rw-time-toggle { padding: 4px; border-radius: 999px; background: var(--sg-mist); box-shadow: inset 0 0 0 1px var(--sg-line); }
.race-weekend-page .rw-time-toggle button { border-radius: 999px; }
.race-weekend-page .rw-time-toggle button[aria-pressed="true"] { background: var(--sg-ink); color: var(--sg-paper); }

.race-weekend-page .rw-session-list { border-top: 0; display: grid; gap: 8px; }

.race-weekend-page .rw-session-list li {
  border: 0;
  border-radius: var(--sg-r);
  background: var(--sg-paper);
  box-shadow: inset 0 0 0 1px var(--sg-line);
  transition: box-shadow var(--sg-fast) var(--sg-ease), transform 320ms var(--sg-ease);
}

.race-weekend-page .rw-session-list li time strong { font-weight: 720; font-variant-numeric: tabular-nums; letter-spacing: -0.04em; }
.race-weekend-page .rw-session-list li h3 { font-weight: 650; letter-spacing: -0.015em; }
.race-weekend-page .rw-session-list .rw-session-start strong { font-variant-numeric: tabular-nums; }

/* a finished session: a chequered flag by its name, and Finished or a Results link under its time */
.race-weekend-page .rw-session-list li.is-finished h3::before {
  content: "";
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  margin-right: 0.5em;
  vertical-align: -0.1em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 1h1.6v14H2zM4.6 2h3v3h-3zM7.6 5h3v3h-3zM10.6 2H14v3h-3.4zM4.6 8h3v3h-3zM10.6 8H14v3h-3.4z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 1h1.6v14H2zM4.6 2h3v3h-3zM7.6 5h3v3h-3zM10.6 2H14v3h-3.4zM4.6 8h3v3h-3zM10.6 8H14v3h-3.4z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.race-weekend-page .rw-session-finished {
  display: block;
  margin-top: 2px;
  color: var(--sg-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.race-weekend-page a.rw-session-finished {
  color: var(--sg-orange-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.race-weekend-page .rw-session-list li.is-race .rw-session-finished { color: inherit; }
/* a finished row is not dimmed: the flag and the link say it is over */
.sx-ready .race-weekend-page .rw-session-list > li.is-finished { opacity: 1; }

/* the race keeps the brand orange with ink type, as the calendar's next race does */
.race-weekend-page .rw-session-list li.is-race {
  background: var(--sg-orange);
  box-shadow: none;
  color: #141414;
}

.race-weekend-page .rw-session-list li.is-race :is(h3, strong, time span, p, span) { color: inherit; }

@media (hover: hover) and (pointer: fine) {
  .race-weekend-page .rw-session-list li:not(.is-race):hover { box-shadow: inset 0 0 0 1px var(--sg-line-strong), 0 10px 24px rgba(16, 16, 16, 0.06); transform: translateX(4px); }
}

.race-weekend-page .rw-circuit-section { background: var(--sg-mist); }

/* previous and next round close the page, under everything else */
.race-weekend-page .rw-rounds { padding: clamp(8px, 2vw, 24px) 0 clamp(40px, 5vw, 72px); background: var(--sg-paper); }
.race-weekend-page .rw-rounds .rw-round-nav { margin-top: 0; }

/* the links are cards here, so their text needs room inside them, and long names wrap */
.race-weekend-page .rw-round-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.race-weekend-page .rw-round-nav strong { overflow-wrap: anywhere; }

.race-weekend-page .rw-round-nav a {
  min-width: 0;
  padding: 16px 18px;
  border-radius: var(--sg-r);
  box-shadow: inset 0 0 0 1px var(--sg-line);
  background: var(--sg-paper);
  transition: box-shadow var(--sg-fast) var(--sg-ease), transform 320ms var(--sg-ease);
}

@media (hover: hover) and (pointer: fine) {
  .race-weekend-page .rw-round-nav a:hover { box-shadow: inset 0 0 0 1px var(--sg-orange), 0 12px 28px rgba(16, 16, 16, 0.07); transform: translateY(-3px); }
}

/* --------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  body:not(.hx-home) .sx-panel,
  body:not(.hx-home) .button,
  body:not(.hx-home) .site-footer a,
  .calendar-page .calendar-race-card,
  .race-weekend-page .rw-session-list li,
  .race-weekend-page .rw-round-nav a { transition: none !important; }
  .calendar-page .calendar-race-card:hover,
  .race-weekend-page .rw-session-list li:hover,
  .race-weekend-page .rw-round-nav a:hover,
  body:not(.hx-home) .site-footer a:hover { transform: none !important; }
}
