:root {
  color-scheme: dark;
  --bg: #0b0b0b;
  --surface: #131313;
  --text: #f6f6f6;
  --muted: #b0b0b0;
  --accent: #bdbdbd;
  --line: #323232;
  --title: 'Arial Narrow', 'Liberation Sans Narrow', 'Bahnschrift', Arial, sans-serif;
  --display: Impact, 'Arial Narrow', 'Liberation Sans Narrow', sans-serif;
  --body: 'Segoe UI', system-ui, sans-serif;
  --mono: 'Cascadia Mono', Consolas, 'Liberation Mono', monospace;
  --gutter: clamp(1.25rem, 4.65vw, 5rem);
  --header-height: 4.5rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 18rem; margin: 0; background: var(--bg); color: var(--text); font: 400 1rem/1.55 var(--body); }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }
::selection { color: #0d0d0d; background: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
section[id] { scroll-margin-top: var(--header-height); }
.container { width: min(100% - var(--gutter) * 2, 76rem); margin-inline: auto; }

.skip-link { position: fixed; inset: .65rem auto auto .65rem; z-index: 20; padding: .6rem .85rem; transform: translateY(-180%); background: var(--accent); color: #0f0f0f; }
.skip-link:focus { transform: translateY(0); }
.site-header { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid #343434; background: #0b0b0bf5; backdrop-filter: blur(14px); }
.header-inner { min-height: calc(var(--header-height) - 1px); display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { width: max-content; display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; }
.brand img { width: 5.65rem; height: auto; flex: none; }
.brand span { margin-top: .1rem; color: var(--accent); font: 700 .76rem/1 var(--mono); letter-spacing: .13em; }
.site-nav { display: flex; align-items: center; flex: 1; gap: 1rem; }
.nav-links { display: flex; align-items: center; margin-inline: auto; gap: clamp(1.4rem, 3.1vw, 2.8rem); }
.nav-link { position: relative; display: inline-flex; align-items: center; min-height: calc(var(--header-height) - 1px); color: var(--muted); font-size: .91rem; font-weight: 600; text-decoration: none; transition: color .2s; }
.nav-link::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); transform: scaleX(0); transition: transform .25s; }
.nav-link:hover, .nav-link[aria-current] { color: var(--text); }
.nav-link[aria-current]::after { transform: scaleX(1); }
.header-cta { min-height: 2.55rem; display: inline-flex; align-items: center; justify-content: center; padding: .4rem 1rem; border: 1px solid #929292; border-radius: 2px; color: var(--accent); font-size: .89rem; font-weight: 700; text-decoration: none; transition: background .2s, color .2s, border-color .2s; }
.header-cta:hover { border-color: var(--accent); background: var(--accent); color: #0c0c0c; }
.menu-toggle { display: none; }

.hero { position: relative; isolation: isolate; overflow: hidden; background: #0e0e0e; border-bottom: 1px solid #282828; }
.hero-visual, .hero-shade, .hero-racing-line { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.hero-visual { overflow: hidden; animation: visual-enter 1.35s cubic-bezier(.17,.69,.2,1) both; }
.hero-visual img { width: 100%; height: 100%; object-fit: cover; object-position: center 50%; }
.hero-shade {
  background:
    linear-gradient(0deg, #0b0b0b 0%, #0b0b0bda 9%, transparent 29%),
    linear-gradient(90deg, #0b0b0bf5 0%, #0b0b0bdb 21%, #0b0b0b5e 43%, transparent 64%),
    linear-gradient(180deg, #0b0b0b38, transparent 27%);
}
.hero-racing-line { opacity: .35; overflow: hidden; }
.hero-racing-line::before { content: ''; position: absolute; left: 0; top: 55%; width: 34%; height: 1px; background: linear-gradient(90deg, transparent, #bdbdbdaf 73%, transparent); filter: drop-shadow(0 0 .55rem #c2c2c2); animation: racing-line 9s ease-in-out 1.7s infinite both; }
.hero-inner { position: relative; padding-top: clamp(4.75rem, 7.85vw, 8.15rem); padding-bottom: 2rem; }
.hero-content { width: min(100%, 36rem); padding-left: .2rem; }
.hero-content > * { animation: content-enter .7s cubic-bezier(.2,.65,.24,1) both; }
.hero-content h1 { animation-delay: .08s; }
.hero-intro { animation-delay: .16s; }
.hero-actions { animation-delay: .23s; }
.hero-eyebrow { display: flex; align-items: center; gap: .7rem; margin: 0 0 1.3rem; color: #eaeaea; font: 500 .835rem/1.2 var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.hero-eyebrow > span { width: 1.6rem; height: .53rem; background: repeating-linear-gradient(90deg, var(--accent) 0 3px, transparent 3px 7px); transform: skewX(-22deg); box-shadow: 0 0 18px #bdbdbd35; }
.hero h1 { display: grid; justify-items: start; width: max-content; max-width: 100%; margin: 0; font: 800 clamp(6.25rem, 9.8vw, 9.4rem)/.84 var(--display); letter-spacing: -.027em; text-transform: uppercase; }
.hero h1 span { padding: 0 .12em .075em 0; transform: skewX(-9deg) translateX(.045em); }
.hero h1 .hero-accent { color: var(--accent); text-shadow: 0 0 42px #a5a5a526; }
.hero-intro { max-width: 25rem; margin: 1.35rem 0 1.75rem; color: #cbcbcb; font-size: clamp(1rem, 1.45vw, 1.22rem); line-height: 1.55; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; }
.site-button { position: relative; display: inline-flex; min-height: 3.3rem; align-items: center; justify-content: center; padding: .65rem 1.25rem; overflow: hidden; border: 1px solid transparent; border-radius: 2px; font-weight: 750; font-size: .94rem; line-height: 1.25; text-decoration: none; transition: background .2s, border-color .2s, color .2s, translate .2s; }
.site-button:hover { translate: 0 -2px; }
.site-button--primary { background: var(--accent); border-color: var(--accent); color: #0e0e0e; box-shadow: 0 .5rem 1.8rem #85858531; }
.site-button--primary:hover { background: #e0e0e0; border-color: #e0e0e0; }
.site-button--secondary { background: #111111b0; border-color: #747474; color: var(--text); }
.site-button--secondary:hover { background: #252525; border-color: var(--accent); }

.race-feature { position: relative; min-height: 6.15rem; display: grid; grid-template-columns: minmax(14.7rem, 1.25fr) minmax(11.4rem, 1fr) auto auto; align-items: center; gap: clamp(1rem, 2.4vw, 2.2rem); margin-top: clamp(3.2rem, 5.1vw, 5.1rem); padding: 1.05rem clamp(1.05rem, 2.05vw, 1.8rem); border: 1px solid #424242; border-left: 2px solid var(--accent); background: linear-gradient(102deg, #181818f5, #121212f0 60%, #1a1a1af5); box-shadow: 0 .75rem 2rem #00000055; }
.race-feature__identity { display: flex; align-items: center; gap: 1rem; }
.race-feature__flag { width: 2.25rem; height: 1.45rem; flex: none; border: 1px solid #ffffff44; border-radius: 2px; background: linear-gradient(#686868 0 33.333%, #ffffff 33.333% 66.666%, #686868 66.666%); }
.race-feature__label { display: block; color: var(--muted); font: 500 .78rem/1.25 var(--mono); }
.race-feature__identity .race-feature__label { color: var(--accent); }
.race-feature strong { display: block; margin-top: .2rem; font: 800 clamp(1.6rem, 2.3vw, 2rem)/1 var(--title); text-transform: uppercase; letter-spacing: -.015em; }
.race-feature__date { padding-inline-start: clamp(.8rem, 2vw, 1.35rem); border-inline-start: 1px solid #3b3b3b; }
.race-feature__date time { display: block; margin-top: .3rem; font: 650 .92rem/1.25 var(--body); }
.race-clock { display: flex; color: var(--text); }
.race-clock > span { min-width: clamp(2.25rem, 3.85vw, 3.3rem); padding-inline: .18rem; text-align: center; border-right: 1px solid #3b3b3b; }
.race-clock > span:last-child { border-right: 0; }
.race-clock b, .race-clock small { display: block; }
.race-clock b { font: 700 1.35rem/1 var(--mono); font-variant-numeric: tabular-nums; }
.race-clock small { margin-top: .35rem; color: var(--muted); font: 500 .75rem/1 var(--mono); }
.race-feature__link { grid-column: 4; min-height: 2.65rem; padding: .4rem .85rem; border: 1px solid #4d4d4d; border-radius: 2px; background: #222222; color: #e1e1e1; font-size: .88rem; font-weight: 700; cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
.race-feature__link:hover { border-color: var(--accent); background: var(--accent); color: #0e0e0e; }

.site-footer { border-top: 1px solid var(--line); background: #0a0a0a; }
.footer-inner { min-height: 6rem; display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; padding-block: 1.75rem; }
.footer-inner p { margin: 0; color: var(--muted); font-size: .88rem; }
.reveal-in { animation: content-enter .58s cubic-bezier(.2,.65,.24,1) both; }

@keyframes content-enter { from { opacity: .12; translate: 0 1.15rem; } to { opacity: 1; translate: 0 0; } }
@keyframes visual-enter { from { opacity: .58; scale: 1.035; } to { opacity: 1; scale: 1; } }
@keyframes racing-line { 0%, 79%, 100% { opacity: 0; translate: -106% 0; } 84% { opacity: 1; } 92% { opacity: 0; translate: 205% 0; } }

@media (max-width: 64rem) {
  .hero h1 { font-size: clamp(6.2rem, 12.3vw, 8.35rem); }
  .race-feature { gap: 1rem; }
  .race-feature__date { padding-inline-start: .9rem; }
}

@media (max-width: 51rem) {
  .race-feature { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: 1.2rem; }
  .race-feature__date { justify-self: end; width: 100%; max-width: 13.1rem; }
  .race-feature__link { grid-column: 2; justify-self: start; }
  .race-clock { grid-column: 1; }
}

@media (max-width: 43rem) {
  :root { --header-height: 4rem; }
  .header-inner { gap: .8rem; }
  .brand img { width: 5.2rem; }
  .site-header:has(.menu-toggle[hidden]) .header-inner { flex-wrap: wrap; padding-block: .9rem .6rem; }
  .site-header:has(.menu-toggle[hidden]) .site-nav { flex-wrap: wrap; gap: .35rem 1rem; }
  .site-header:has(.menu-toggle[hidden]) .nav-links { flex-wrap: wrap; gap: .35rem 1rem; }
  .site-header:has(.menu-toggle[hidden]) .nav-link { min-height: 2rem; }
  .menu-toggle { width: 2.75rem; height: 2.65rem; display: grid; align-content: center; justify-items: center; gap: .28rem; padding: 0; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); cursor: pointer; }
  .menu-toggle span { width: 1.08rem; height: 2px; background: var(--text); transition: opacity .2s, transform .2s; }
  .menu-toggle[aria-expanded='true'] span:nth-child(1) { transform: translateY(.4rem) rotate(45deg); }
  .menu-toggle[aria-expanded='true'] span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded='true'] span:nth-child(3) { transform: translateY(-.4rem) rotate(-45deg); }
  .site-header:has(.menu-toggle:not([hidden])) .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: .5rem var(--gutter) 1rem; border-bottom: 1px solid var(--line); background: #101010; box-shadow: 0 .8rem 1.8rem #00000066; }
  .site-header:has(.menu-toggle[aria-expanded='true']) .site-nav { display: flex; }
  .site-header:has(.menu-toggle:not([hidden])) .nav-links { width: 100%; flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav .nav-link { min-height: 3rem; border-bottom: 1px solid #333333; }
  .site-nav .nav-link::after { right: auto; width: 2rem; }
  .site-nav .header-cta { margin-top: .9rem; }
  .hero-visual { bottom: auto; height: min(107vw, 29rem); }
  .hero-visual img { object-position: 66% 51%; }
  .hero-shade { background: linear-gradient(0deg, #0b0b0b 0%, #0b0b0b 42%, #0b0b0b99 64%, transparent 88%), linear-gradient(90deg, #0b0b0b29, transparent 80%); }
  .hero-racing-line { display: none; }
  .hero-inner { padding-top: clamp(11.6rem, 54vw, 17rem); padding-bottom: 1.25rem; }
  .hero-content { padding-left: 0; }
  .hero-eyebrow { margin-bottom: .82rem; }
  .hero h1 { font-size: clamp(4.6rem, 15vw, 6.35rem); }
  .hero-intro { max-width: 19rem; margin: .85rem 0 1.2rem; }
  .site-button { min-height: 3rem; padding-inline: .9rem; font-size: .89rem; }
  .hero-actions { gap: .55rem; }
  .race-feature { margin-top: 2rem; padding-inline: .8rem; gap: .9rem .65rem; }
  .race-feature__identity { grid-column: 1 / -1; gap: .7rem; }
  .race-feature__date { justify-self: start; width: auto; padding-inline-start: 0; border: 0; }
  .race-clock { grid-column: 2; grid-row: 2; justify-self: end; }
  .race-clock > span { min-width: clamp(1.8rem, 7.7vw, 2.5rem); }
  .race-clock b { font-size: 1.1rem; }
  .race-feature__link { grid-column: 1 / -1; justify-self: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --text: #fafafa;
  --muted: #b9b9b9;
  --accent: #f4f4f4;
  --line: #3b3b3b;
  --title: 'Bahnschrift', 'Segoe UI', system-ui, sans-serif;
  --display: var(--title);
}

.hero-visual img { filter: grayscale(1) contrast(1.13); }
.hero h1 {
  width: clamp(17rem, 35vw, 30rem);
  gap: .7rem;
  font: 700 clamp(3.9rem, 7.4vw, 7.2rem)/.94 var(--display);
  letter-spacing: .025em;
}
.hero-wordmark { width: 100%; height: auto; }
.hero h1 .hero-accent {
  padding: 0;
  transform: none;
  color: #f8f8f8;
  text-shadow: none;
}
.race-feature__flag, .race-card__country > span { filter: grayscale(1); }
.site-button--primary { color: #0a0a0a; }
.site-button--primary:hover { background: #dedede; border-color: #dedede; }
.league-heading, .race-card__title, .race-dialog__title, .rule-title, .admin-main h1 {
  font-family: var(--title);
  letter-spacing: .012em;
}
.league-heading { text-transform: uppercase; }

@media (max-width: 43rem) {
  .hero h1 { width: min(100%, 17rem); font-size: clamp(3.35rem, 12vw, 4.7rem); }
  .hero-visual img { object-position: 64% 51%; }
}
