/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:       #e10600;
  --red-dark:  #a00400;
  --gold:      #ffd700;
  --dark:      #0a0a0f;
  --dark2:     #12121a;
  --dark3:     #1a1a28;
  --card-bg:   #16161f;
  --border:    #2a2a3e;
  --text:      #e8e8f0;
  --text-muted:#888899;
  --font-display: 'Orbitron', monospace;
  --font-body:    'Rajdhani', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--dark);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Checkered Bar ── */
.checkered-bar {
  height: 12px;
  background-image: repeating-linear-gradient(
    90deg,
    #fff 0px, #fff 12px,
    #000 12px, #000 24px
  );
  position: absolute;
  left: 0; right: 0;
  z-index: 10;
}
.checkered-bar.top    { top: 0; }
.checkered-bar.bottom { bottom: 0; }

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, #0a0a0f 0%, #1a0008 40%, #0a0a0f 100%);
  z-index: 0;
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg,   transparent, transparent 39px, rgba(255,255,255,.03) 40px),
    repeating-linear-gradient(90deg,  transparent, transparent 39px, rgba(255,255,255,.03) 40px);
  z-index: 1;
}

.navbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 2.5rem;
  padding-top: calc(12px + 1rem);
}

.logo {
  display: flex;
  align-items: baseline;
  gap: .25rem;
  font-family: var(--font-display);
  font-weight: 900;
}
.logo-f1 {
  font-size: 2rem;
  color: var(--red);
  text-shadow: 0 0 20px rgba(225,6,0,.6);
  letter-spacing: -2px;
}
.logo-year {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.nav-title {
  font-family: var(--font-display);
  font-size: .65rem;
  letter-spacing: .2em;
  color: var(--text-muted);
  border-left: 2px solid var(--red);
  padding-left: 1rem;
}

.hero-content {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  padding: 2rem 1rem 3rem;
}

.hero-sub {
  font-family: var(--font-display);
  font-size: .75rem;
  letter-spacing: .35em;
  color: var(--red);
  margin-bottom: .5rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 900;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 60px rgba(225,6,0,.4);
  margin-bottom: 1rem;
}
.hero-title .accent {
  color: var(--red);
  -webkit-text-stroke: 1px var(--red-dark);
}

.hero-desc {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .1em;
}

/* ── Calendar Section ── */
.calendar-section {
  max-width: 1300px;
  margin: 0 auto;
  padding: 4rem 1.5rem 5rem;
}

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: .15em;
  color: #fff;
}
.underline-bar {
  width: 80px;
  height: 4px;
  background: var(--red);
  margin: .75rem auto 0;
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(225,6,0,.7);
}

/* ── Filter Bar ── */
.filter-bar {
  display: flex;
  justify-content: center;
  gap: .75rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: var(--font-display);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  padding: .5rem 1.4rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 2px;
  transition: all .2s;
  text-transform: uppercase;
}
.filter-btn:hover,
.filter-btn.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 0 14px rgba(225,6,0,.4);
}

/* ── Races Grid ── */
.races-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

/* ── Race Card ── */
.race-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  position: relative;
}

.race-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,.5), 0 0 0 1px var(--red);
  border-color: var(--red);
}

.race-card.past {
  opacity: .55;
  filter: grayscale(.5);
}

.race-card.next-race {
  border-color: var(--gold);
  box-shadow: 0 0 30px rgba(255,215,0,.25);
}
.race-card.next-race::before {
  content: 'NÄCHSTES RENNEN';
  position: absolute;
  top: 0; right: 0;
  background: var(--gold);
  color: #000;
  font-family: var(--font-display);
  font-size: .55rem;
  font-weight: 700;
  letter-spacing: .1em;
  padding: .3rem .7rem;
  border-bottom-left-radius: 3px;
  z-index: 5;
}

.card-stripe {
  height: 4px;
  background: var(--red);
  flex-shrink: 0;
}
.race-card.past .card-stripe { background: #444; }
.race-card.next-race .card-stripe { background: var(--gold); }

.card-body {
  padding: 1.25rem 1.5rem;
  flex: 1;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.round-badge {
  font-family: var(--font-display);
  font-size: .6rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--dark3);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: .3rem .5rem;
  white-space: nowrap;
  flex-shrink: 0;
  text-align: center;
  line-height: 1.2;
}
.round-badge .num {
  display: block;
  font-size: 1.1rem;
  color: var(--text);
}

.card-info { flex: 1; min-width: 0; }

.race-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: .3rem;
}

.circuit-name {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .6rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
}
.meta-icon {
  width: 14px;
  height: 14px;
  opacity: .7;
  flex-shrink: 0;
}

.card-footer {
  padding: .75rem 1.5rem;
  background: var(--dark3);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.date-display {
  font-family: var(--font-display);
  font-size: .75rem;
  color: var(--red);
  font-weight: 700;
  letter-spacing: .05em;
}
.race-card.past .date-display { color: var(--text-muted); }
.race-card.next-race .date-display { color: var(--gold); }

.status-pill {
  font-family: var(--font-display);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .08em;
  padding: .25rem .65rem;
  border-radius: 20px;
  text-transform: uppercase;
}
.status-pill.upcoming { background: rgba(225,6,0,.15); color: var(--red); border: 1px solid rgba(225,6,0,.3); }
.status-pill.past     { background: rgba(255,255,255,.06); color: var(--text-muted); border: 1px solid var(--border); }
.status-pill.next     { background: rgba(255,215,0,.15); color: var(--gold); border: 1px solid rgba(255,215,0,.4); }

/* ── Hidden ── */
.hidden { display: none !important; }

/* ── Footer ── */
.footer {
  position: relative;
  background: var(--dark2);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1.5rem 1rem;
  padding-top: calc(12px + 1rem);
  font-size: .85rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: .05em;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .races-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 3.5rem; }
  .navbar { padding: 1rem 1.25rem; padding-top: calc(12px + .75rem); }
  .nav-title { display: none; }
}
