:root {
  --bg-color: #0b0e14;
  --bg-card: #141923;
  --bg-card-hover: #1b2230;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --border-color: #232c3d;
  --f1-red: #e10600;
  --arg-blue: #75aadb;
  --arg-sun: #f6b40e;
  --accent-green: #10b981;
  --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-color: #f3f4f6;
    --bg-card: #ffffff;
    --bg-card-hover: #f9fafb;
    --text-main: #111827;
    --text-muted: #4b5563;
    --border-color: #e5e7eb;
    --card-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.1);
  }
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
  padding: 0.85rem 1.25rem;
}

.header-content {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-link {
  text-decoration: none;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s;
}

.brand-badge:hover {
  color: var(--arg-blue);
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.live-dot {
  width: 9px;
  height: 9px;
  background-color: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.driver-tag {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--arg-blue);
  background: rgba(117, 170, 219, 0.12);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(117, 170, 219, 0.3);
}

/* Hero */
.hero-section {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
}

.hero-flag-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.badge-f1 {
  background: var(--f1-red);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.hero-section h1 {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto;
}

/* Next Race Hero Card */
.next-race-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2.25rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

.next-race-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--arg-blue), var(--f1-red));
}

.next-race-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.75rem;
}

.next-race-flag-title {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.hero-flag {
  font-size: 3.5rem;
  line-height: 1;
}

.next-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--f1-red);
  background: rgba(225, 6, 0, 0.12);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  margin-bottom: 0.35rem;
}

.next-race-name {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}

.next-circuit-text {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Countdown Ticker */
.countdown-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 2rem;
  text-align: center;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
}

.countdown-num {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--arg-blue);
  line-height: 1;
  font-feature-settings: "tnum";
}

.countdown-lbl {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 0.35rem;
  letter-spacing: 0.05em;
}

/* Sessions Grid */
.sessions-card {
  margin-bottom: 1.75rem;
}

.sessions-header {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.sessions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
}

.session-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.session-highlight {
  background: rgba(225, 6, 0, 0.08);
  border-color: rgba(225, 6, 0, 0.4);
}

.session-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  margin-right: 0.4rem;
}

.session-time {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.95rem;
}

/* Broadcast Banner */
.broadcast-banner {
  background: linear-gradient(135deg, rgba(117, 170, 219, 0.08), rgba(0, 0, 0, 0.2));
  border: 1px solid rgba(117, 170, 219, 0.2);
  border-radius: 14px;
  padding: 1.25rem;
}

.broadcast-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.broadcast-channels {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.channel-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-main);
}

/* Driver Card */
.driver-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.driver-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--arg-blue), #1e3a8a);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(117, 170, 219, 0.4);
}

.driver-number {
  font-size: 1.8rem;
  font-weight: 900;
  color: #fff;
  font-style: italic;
}

.driver-info h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.driver-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Calendar Section */
.calendar-section {
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem;
}

.race-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.35rem;
  transition: transform 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.race-card:hover {
  transform: translateY(-2px);
  border-color: var(--arg-blue);
}

.race-card-active {
  border-color: var(--f1-red);
  box-shadow: 0 0 20px rgba(225, 6, 0, 0.2);
}

.race-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.round-number {
  font-size: 0.75rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.race-flag {
  font-size: 1.3rem;
}

.race-country {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.status-badge-next {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 800;
  background: var(--f1-red);
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.race-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.race-circuit {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  flex-grow: 1;
}

.race-dates {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.race-main-time {
  font-size: 0.95rem;
  border-top: 1px dashed var(--border-color);
  padding-top: 0.6rem;
  color: var(--text-main);
}

/* FAQ */
.faq-section {
  margin-bottom: 2.5rem;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.faq-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
}

.faq-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.faq-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Cross Promo */
.cross-promo-card {
  background: linear-gradient(135deg, rgba(225, 6, 0, 0.08), rgba(117, 170, 219, 0.08));
  border: 1px solid rgba(117, 170, 219, 0.3);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 3rem;
  text-align: center;
}

.cross-promo-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--arg-blue);
  margin-bottom: 0.5rem;
}

.cross-promo-card h3 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.cross-promo-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.promo-links {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.promo-pill {
  display: inline-flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.2s;
}

.promo-pill:hover {
  background: var(--arg-blue);
  color: #000;
  border-color: var(--arg-blue);
  transform: translateY(-2px);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
  padding: 2rem 0;
  margin-top: auto;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.site-footer a {
  color: var(--arg-blue);
  text-decoration: none;
}

.footer-note {
  font-size: 0.8rem;
  margin-top: 0.4rem;
  opacity: 0.75;
}

@media (max-width: 640px) {
  .hero-section h1 {
    font-size: 1.8rem;
  }
  .next-race-card {
    padding: 1.25rem;
  }
  .countdown-num {
    font-size: 1.8rem;
  }
  .driver-card {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem;
  }
}
