:root {
  color-scheme: dark;
  --bg: #0b0c0f;
  --bg-alt: #11131a;
  --surface: rgba(20, 22, 28, 0.92);
  --surface-strong: #171a21;
  --surface-glow: rgba(225, 6, 0, 0.18);
  --accent: #e10600;
  --accent-2: #ffb703;
  --accent-3: #2ec4b6;
  --text: #f8f9fb;
  --muted: #a8b0bc;
  --border: rgba(255, 255, 255, 0.08);
  --grid: rgba(255, 255, 255, 0.04);
  --heading: "Bebas Neue", "Space Grotesk", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  background: radial-gradient(circle at top, #202430 0%, #0b0c0f 45%, #07080a 100%);
  color: var(--text);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

.ambient-noise {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: 0.12;
  mix-blend-mode: soft-light;
  pointer-events: none;
  z-index: 0;
}

.hero {
  position: relative;
  padding: 32px 6vw 80px;
  z-index: 1;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 0 40px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--heading);
  font-size: 28px;
  letter-spacing: 2px;
}

.logo-mark {
  background: var(--accent);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
}

.logo-text {
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 24px;
  font-weight: 500;
  color: var(--muted);
}

.nav-links a:hover {
  color: var(--text);
}

.nav-cta {
  background: linear-gradient(135deg, var(--accent), #ff3b30);
  border: none;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(225, 6, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 28px rgba(225, 6, 0, 0.3);
}

.hero-content {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 48px;
  align-items: center;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--accent-2);
  font-size: 12px;
}

.hero-title {
  font-family: var(--heading);
  font-size: clamp(48px, 8vw, 96px);
  letter-spacing: 2px;
}

.hero-subtitle {
  color: var(--muted);
  font-size: 18px;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.4px;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 16px 30px rgba(225, 6, 0, 0.3);
}

.btn.ghost {
  border-color: var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}

.btn:hover {
  transform: translateY(-1px);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  padding-top: 12px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 14px;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  margin-top: 6px;
  display: block;
}

.hero-visual {
  position: relative;
  background: linear-gradient(145deg, #111420, #1a1f2b);
  border-radius: 24px;
  padding: 40px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.speed-lines {
  position: absolute;
  inset: -30% 0 0;
  background: repeating-linear-gradient(
    110deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.05) 12px,
    transparent 12px,
    transparent 24px
  );
  animation: drift 8s linear infinite;
}

.hero-track {
  position: relative;
  width: 100%;
  height: auto;
  z-index: 1;
}

.track-outline {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 16;
}

.track-inner {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-dasharray: 6 10;
}

.section {
  padding: 80px 6vw;
  position: relative;
  z-index: 1;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 32px;
}

.section-eyebrow {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 12px;
}

.section-title {
  font-family: var(--heading);
  font-size: clamp(32px, 5vw, 56px);
}

.section-meta {
  color: var(--muted);
  font-size: 14px;
  max-width: 260px;
  text-align: right;
}

.race-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 32px;
}

.race-list {
  display: grid;
  gap: 16px;
}

.race-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  display: grid;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  appearance: none;
  color: inherit;
  font: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.race-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 40%, rgba(225, 6, 0, 0.12), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.race-card:hover {
  transform: translateY(-2px);
  border-color: rgba(225, 6, 0, 0.5);
}

.race-card:hover::before,
.race-card.active::before {
  opacity: 1;
}

.race-card.active {
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(225, 6, 0, 0.2);
}

.race-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.race-title {
  font-size: 20px;
  font-weight: 600;
}

.race-subtitle {
  color: var(--muted);
  font-size: 14px;
}

.race-tag {
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.race-detail {
  position: sticky;
  top: 24px;
  align-self: start;
}

.detail-card {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
}

.detail-track {
  padding: 20px;
  background: radial-gradient(circle, rgba(225, 6, 0, 0.2), transparent 70%);
  border-bottom: 1px solid var(--border);
}

#trackSvg {
  width: 100%;
  height: 180px;
}

#trackPath {
  fill: none;
  stroke: var(--accent-2);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 12px rgba(255, 183, 3, 0.3));
}

#trackStart {
  fill: #ffffff;
  stroke: var(--accent-2);
  stroke-width: 2;
}

#trackFinish {
  fill: var(--accent);
  stroke: #0b0c0f;
  stroke-width: 1.5;
}

.detail-body {
  padding: 24px;
  display: grid;
  gap: 20px;
}

.detail-round {
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  font-size: 12px;
}

.detail-title {
  font-size: 28px;
  font-weight: 700;
}

.detail-subtitle {
  color: var(--muted);
  font-size: 15px;
}

.detail-data {
  display: grid;
  gap: 12px;
}

.detail-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.detail-value {
  font-size: 16px;
  font-weight: 600;
}

.detail-footer {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tag {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.map-shell {
  position: relative;
  aspect-ratio: 2 / 1;
  height: auto;
  min-height: 220px;
  max-height: 460px;
  border-radius: 24px;
  background: linear-gradient(160deg, #111722, #0b0c10 60%);
  border: 1px solid var(--border);
  overflow: hidden;
}

.map-canvas {
  position: absolute;
  inset: 0;
  transform-origin: top left;
  will-change: transform;
}

.map-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.world-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.45;
  object-fit: contain;
  filter: brightness(0.7) contrast(1.1);
  pointer-events: none;
}

.map-markers {
  position: absolute;
  inset: 0;
}

.map-tooltip {
  position: absolute;
  min-width: 180px;
  max-width: 220px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(14, 16, 22, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
  font-size: 12px;
  color: var(--text);
  z-index: 2;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.map-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.map-tooltip-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.map-tooltip-meta {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.marker {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: none;
  cursor: pointer;
  padding: 0;
  background: var(--accent-2);
  box-shadow: 0 0 16px currentColor;
  color: var(--accent-2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.marker::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0;
  animation: pulse 2.8s infinite;
}

.marker[data-region="Europe"] {
  color: #9b5de5;
  background: #9b5de5;
}

.marker[data-region="Americas"] {
  color: #00bbf9;
  background: #00bbf9;
}

.marker[data-region="Middle East"] {
  color: #f77f00;
  background: #f77f00;
}

.marker[data-region="Asia-Pacific"] {
  color: #2ec4b6;
  background: #2ec4b6;
}

.marker.active {
  transform: translate(-50%, -50%) scale(1.6);
  box-shadow: 0 0 30px currentColor;
}

.map-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.legend {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  position: relative;
  padding-left: 18px;
}

.legend::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: absolute;
  left: 0;
  top: 2px;
  background: var(--accent-2);
}

.legend[data-region="Europe"]::before {
  background: #9b5de5;
}

.legend[data-region="Americas"]::before {
  background: #00bbf9;
}

.legend[data-region="Middle East"]::before {
  background: #f77f00;
}

.legend[data-region="Asia-Pacific"]::before {
  background: #2ec4b6;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  display: grid;
  gap: 10px;
}

.team-name {
  font-family: var(--heading);
  font-size: 24px;
  letter-spacing: 1px;
}

.driver {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer {
  padding: 40px 6vw 60px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@keyframes drift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(120px);
  }
}

@keyframes pulse {
  0% {
    transform: scale(0.6);
    opacity: 0.8;
  }
  70% {
    transform: scale(1.6);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

@media (max-width: 960px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-content {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-meta {
    text-align: left;
  }

  .race-layout {
    grid-template-columns: 1fr;
  }

  .race-detail {
    position: static;
  }

  .map-shell {
    max-height: 320px;
  }
}

@media (max-width: 640px) {
  .nav-links {
    flex-wrap: wrap;
  }

  .hero {
    padding: 24px 5vw 64px;
  }

  .section {
    padding: 64px 5vw;
  }
}

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