/* ── Design tokens ─────────────────────────────────────── */
:root {
  --bg:          #000000;
  --bg-2:        #0a0a0a;
  --bg-3:        #101012;
  --bg-4:        #16161a;
  --border:      #1f1f22;
  --border-soft: #1a1a1d;
  --text:        #ffffff;
  --text-muted:  #9a9aa0;
  --text-dim:    #5a5a60;
  --accent:      #FF2D4F;
  --accent-soft: rgba(255, 45, 79, 0.15);
  --accent-glow: rgba(255, 45, 79, 0.3);
  --font:        'Inter Tight', system-ui, sans-serif;
  --mono:        'JetBrains Mono', monospace;
}

/* ── Reset & base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }

/* ── Page header ───────────────────────────────────────── */
.site-header {
  background: var(--bg);
  padding: 22px 40px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.site-logo {
  font-family: var(--font);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.015em;
  color: #ffffff;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav { display: flex; gap: 36px; }
.site-nav a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #cfcfd4;
  transition: color 0.15s;
}
.site-nav a:hover { color: #fff; }

/* ── HERO ──────────────────────────────────────────────── */
.hero {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

/* Headline block */
.hero__intro {
  padding: 44px 40px 28px;
  border-bottom: 1px solid var(--border);
  max-width: none;
}
.hero__headline {
  font-family: var(--font);
  font-weight: 700;
  font-size: 48px;
  letter-spacing: -0.03em;
  line-height: 1.02;
  color: #ffffff;
  margin: 0;
  max-width: 880px;
}
.hero__subline {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #7a7a80;
  margin: 14px 0 0;
}

/* Globe ↔ panel split */
.hero__split {
  display: flex;
  min-height: 520px;
}

/* ── Globe ─────────────────────────────────────────────── */
.globe-wrap {
  flex: 1;
  position: relative;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  overflow: hidden;
  min-height: 520px;
}
#globe-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}
#globe-canvas:active { cursor: grabbing; }
.globe-hint {
  position: absolute;
  bottom: 16px;
  left: 16px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #5a5a60;
  pointer-events: none;
}
.globe-legend {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
}
.globe-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #8a8a90;
}
.legend-dot {
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-dot--done     { width: 5px; height: 5px; background: #6c7a8e; }
.legend-dot--upcoming { width: 5px; height: 5px; background: #ffffff; }
.legend-dot--next     {
  width: 8px;
  height: 8px;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 45, 79, 0.25);
}

/* Globe pins */
.globe-pin {
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s;
  background: transparent;
}
.globe-pin:hover { transform: translate(-50%, -50%) scale(2) !important; }
.globe-pin--done {
  width: 5px;
  height: 5px;
  background: #6c7a8e;
}
.globe-pin--upcoming {
  width: 5px;
  height: 5px;
  background: #ffffff;
}
.globe-pin--next {
  width: 8px;
  height: 8px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 45, 79, 0.25), 0 0 14px rgba(255, 45, 79, 0.6);
}
.globe-pin--live {
  width: 8px;
  height: 8px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 45, 79, 0.25), 0 0 14px rgba(255, 45, 79, 0.6);
}

/* Globe tooltip */
#globe-tooltip {
  position: absolute;
  background: #101012;
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  padding: 7px 12px;
  font-size: 0.75rem;
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
  display: none;
  border-radius: 6px;
}
#globe-tooltip .tt-name  {
  font-family: var(--font);
  font-weight: 600;
  color: #fff;
  font-size: 13px;
}
#globe-tooltip .tt-round {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: #8a8a90;
  margin-top: 2px;
}

/* ── Next-race panel ───────────────────────────────────── */
.next-race {
  width: 580px;
  flex-shrink: 0;
  background: #0a0a0b;
  padding: 44px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* a. Status row */
.nr__status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
}
.nr__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 45, 79, 0.25);
  flex-shrink: 0;
}
.nr__next-label { color: var(--accent); }
.nr__sep        { color: #3a3a3f; }
.nr__round      { color: #cfcfd4; }

/* b. Country block */
.nr__country-block { display: flex; flex-direction: column; }
.nr__country {
  font-family: var(--font);
  font-weight: 700;
  font-size: 72px;
  letter-spacing: -0.03em;
  line-height: 0.95;
  color: #ffffff;
}
.nr__city {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font);
  font-size: 15px;
  color: #9a9aa0;
  margin-top: 12px;
}

/* c. Countdown grid */
.countdown {
  display: flex;
  gap: 10px;
}
.countdown__unit {
  flex: 1;
  background: #16161a;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 8px 12px;
  text-align: center;
}
.countdown__n {
  display: block;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 38px;
  line-height: 1;
  color: #ffffff;
  letter-spacing: -0.02em;
}
.countdown__l {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #7a7a80;
  margin-top: 8px;
}

/* d. Track layout box */
.nr__track-box {
  background: #101012;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  height: 168px;
  position: relative;
  overflow: hidden;
  color: #ffffff;
}
.nr__track-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #7a7a80;
  position: relative;
  z-index: 1;
}
.nr__track-box svg {
  position: absolute;
  right: 16px;
  top: 16px;
  bottom: 16px;
  width: 260px;
  height: calc(100% - 32px);
  pointer-events: none;
}

/* e. CTA */
.nr__cta {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ffffff;
  text-decoration: none;
  white-space: nowrap;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--accent);
  margin-top: 4px;
}
.nr__cta:hover { color: #cfcfd4; }

/* ── Timeline section ──────────────────────────────────── */
.timeline {
  max-width: 1400px;
  margin: 48px auto 0;
  padding: 0 40px;
}
.timeline__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 20px;
}
.timeline__head h2 {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.timeline__sub {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7a7a80;
  text-align: right;
  max-width: 320px;
}

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 20px;
}
.filter-group {
  display: flex;
  gap: 6px;
  align-items: center;
  padding-right: 16px;
  border-right: 1px solid var(--border);
}
.filter-group:last-of-type { border-right: none; padding-right: 0; }
.filter-label {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  margin-right: 4px;
}
.chip {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: #8a8a90;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  text-transform: uppercase;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}
.filter-tally {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  white-space: nowrap;
  text-transform: uppercase;
}

/* Timeline grid */
.timeline__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}
.timeline-month {
  padding: 12px 10px 14px;
  border-right: 1px solid var(--border-soft);
  min-height: 180px;
  position: relative;
}
.timeline-month:last-child { border-right: none; }
.timeline-month__label {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  margin-bottom: 10px;
}

/* Race chips in timeline */
.tl-race {
  display: block;
  padding: 7px 8px;
  margin-bottom: 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  cursor: pointer;
  transition: border-color 0.15s;
  text-decoration: none;
  color: var(--text);
  position: relative;
}
.tl-race:hover { border-color: var(--accent); }
.tl-race.done  { background: var(--bg-3); }
.tl-race.coming-soon { pointer-events: none; }
.tl-race.next  { border-color: var(--accent); }
.tl-race.next::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 45, 79, 0.25);
}
.tl-race__name { font-size: 0.78rem; font-weight: 600; line-height: 1.2; }
.tl-race__date {
  font-family: var(--mono);
  font-size: 0.6rem;
  opacity: 0.7;
  margin-top: 2px;
  letter-spacing: 0.05em;
}

/* ── Grid section ──────────────────────────────────────── */
.grid-section {
  max-width: 1400px;
  margin: 48px auto 60px;
  padding: 0 40px;
}
.grid-section h2 {
  font-family: var(--font);
  font-weight: 800;
  font-size: 36px;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
  color: #fff;
}
.races-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

/* ── Race card ─────────────────────────────────────────── */
.race-card {
  background: #101012;
  border-radius: 16px;
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 210px;
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
}
.race-card.rc--active   { border: 1px solid var(--accent); }
.race-card.rc--inactive { border: 1px solid var(--border); }
.race-card.coming-soon  { border: 1px solid var(--border); opacity: 0.35; pointer-events: none; }

.rc__track {
  position: absolute;
  right: 14px;
  top: 16px;
  width: 150px;
  height: 100px;
  pointer-events: none;
  filter: brightness(0) invert(1);
  object-fit: contain;
  opacity: 0.95;
}

.rc__round {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #5a5a60;
}
.rc--active .rc__round { color: #fff; }

.rc__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5a5a60;
  flex-shrink: 0;
}
.rc__dot--active {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 45, 79, 0.25);
}

.rc__country {
  font-family: var(--font);
  font-weight: 700;
  font-size: 32px;
  letter-spacing: -0.025em;
  line-height: 1;
  margin-top: 16px;
  max-width: 55%;
  color: #fff;
}
.rc__city {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
  color: #8a8a90;
}
.rc__spacer { flex: 1; }
.rc__date {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a8a90;
  margin-bottom: 10px;
}
.rc__cta {
  display: inline-block;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding-bottom: 4px;
  border-bottom: 1px solid #2a2a2e;
  white-space: nowrap;
  align-self: flex-start;
  color: #cfcfd4;
}
.rc--active .rc__cta {
  border-bottom-color: var(--accent);
  color: #fff;
}

/* ── Footer ────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 28px 40px;
  border-top: 1px solid var(--border);
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1279px) {
  .races-grid { grid-template-columns: repeat(3, 1fr); }
  .next-race  { width: 440px; padding: 32px; }
}
@media (max-width: 1024px) {
  .next-race  { width: 380px; padding: 28px; }
  .nr__country { font-size: 52px; }
  .countdown__n { font-size: 28px; }
}
@media (max-width: 900px) {
  .hero__split   { flex-direction: column; }
  .globe-wrap    { min-height: 360px; border-right: none; border-bottom: 1px solid var(--border); }
  .next-race     { width: 100%; padding: 28px 24px; }
  .site-nav      { display: none; }
  .timeline__head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .timeline__sub  { text-align: left; }
  .races-grid    { grid-template-columns: repeat(2, 1fr); }
  .hero__intro   { padding: 32px 24px 20px; }
  .hero__headline { font-size: 36px; }
}
@media (max-width: 600px) {
  .site-header   { padding: 18px 20px; }
  .hero__intro   { padding: 28px 20px 18px; }
  .hero__headline { font-size: 28px; }
  .timeline, .grid-section { padding: 0 20px; }
  .timeline, .grid-section { margin-top: 32px; }
  .filter-bar    { gap: 10px; }
  .races-grid    { grid-template-columns: 1fr; }
  .rc__track     { width: 110px; height: 72px; }
  .nr__country   { font-size: 40px; }
  .countdown__n  { font-size: 24px; }
}
