/* ============================================================
   IMSA 12 Hours of Sebring 2026 — Design System
   ============================================================ */

:root {
  --bg: #050a14;
  --bg-card: #0d1726;
  --bg-card-hover: #152033;
  --border: #1e3050;
  --border-light: #2a4070;
  --text: #d8e8f4;
  --text-muted: #5a7a9a;
  --text-bright: #ffffff;

  /* Class colors */
  --gtp: #f5a623;
  --lmp2: #3b9eff;
  --gtdpro: #ff4757;
  --gtd: #b06af0;

  /* Brand */
  --green: #00c853;
  --green-dark: #009940;
  --gold: #f5a623;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  --font-mono: 'Courier New', Courier, monospace;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  min-height: 100vh;
}

a { color: inherit; }
img { max-width: 100%; }

/* ============================================================
   NAVIGATION
   ============================================================ */

nav {
  background: rgba(5, 10, 20, 0.97);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.nav-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  height: 62px;
}

.nav-brand {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-bright);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  letter-spacing: -0.01em;
}

.nav-brand .flag { font-size: 1.2rem; }
.nav-brand .accent { color: var(--green); }

.nav-links {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 0;
}

.nav-links a {
  display: block;
  padding: 0 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 62px;
  transition: color 0.15s;
  white-space: nowrap;
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 10px;
  background: none;
  border: none;
  margin-left: 1rem;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

/* ============================================================
   CONTAINER / LAYOUT
   ============================================================ */

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

.section { padding: 3.5rem 0; }
.section + .section { border-top: 1px solid var(--border); }

.section-header { margin-bottom: 2rem; }

.section-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-bright);
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

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

/* ============================================================
   HERO
   ============================================================ */

.hero {
  background: linear-gradient(160deg, #050a14 0%, #0a1428 40%, #150a28 100%);
  border-bottom: 1px solid var(--border);
  padding: 5rem 1.25rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg, transparent, transparent 24px, rgba(255,255,255,0.012) 24px, rgba(255,255,255,0.012) 48px);
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  background: var(--green);
  color: #000;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 20px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  font-weight: 900;
  color: var(--text-bright);
  line-height: 1.05;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

.hero h1 .hl { color: var(--gold); }

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

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.hero-meta-item .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.hero-meta-item .value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-bright);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.625rem 1.375rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.18s;
}

.btn-primary { background: var(--green); color: #000; }
.btn-primary:hover { background: var(--green-dark); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border-light); }
.btn-outline:hover { background: var(--bg-card); border-color: var(--text-muted); }

/* ============================================================
   BADGES
   ============================================================ */

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-gtp    { background: var(--gtp);    color: #000; }
.badge-lmp2   { background: var(--lmp2);   color: #000; }
.badge-gtdpro { background: var(--gtdpro); color: #fff; }
.badge-gtd    { background: var(--gtd);    color: #fff; }
.badge-green  { background: var(--green);  color: #000; }
.badge-gray   { background: var(--bg-card); color: var(--text-muted); border: 1px solid var(--border); }

/* ============================================================
   CARDS
   ============================================================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color 0.18s, background 0.18s;
}

.card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* Class cards */
.class-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.class-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
}

.class-card.gtp::before    { background: linear-gradient(90deg, var(--gtp), #ffcc66); }
.class-card.lmp2::before   { background: linear-gradient(90deg, var(--lmp2), #66b3ff); }
.class-card.gtdpro::before { background: linear-gradient(90deg, var(--gtdpro), #ff8090); }
.class-card.gtd::before    { background: linear-gradient(90deg, var(--gtd), #cc99ff); }

.class-card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.class-card .class-name {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-bright);
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.class-card .class-full {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.class-card .class-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.55;
}

.class-card .class-stats {
  display: flex;
  gap: 1.5rem;
}

.class-card .cs-item .cs-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-bright);
}

.class-card .cs-item .cs-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Team cards */
.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.team-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.team-card.gtp::before    { background: var(--gtp); }
.team-card.lmp2::before   { background: var(--lmp2); }
.team-card.gtdpro::before { background: var(--gtdpro); }
.team-card.gtd::before    { background: var(--gtd); }

.team-card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.team-card .team-name {
  font-weight: 700;
  color: var(--text-bright);
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.team-card .team-car {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.team-card .team-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 0.5rem; }

.team-card .team-drivers {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Car number badge */
.car-no {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-light);
  color: var(--text-bright);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}

/* Driver cards */
.driver-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.18s;
}

.driver-card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

.driver-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a2640, #0d1726);
  border: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-bright);
  flex-shrink: 0;
}

.driver-info .driver-name {
  font-weight: 700;
  color: var(--text-bright);
  font-size: 0.92rem;
}

.driver-info .driver-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */

.page-header {
  padding: 3rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
  position: relative;
}

.breadcrumb {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { margin: 0 6px; }

.page-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 900;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
}

.page-header .lead {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 640px;
}

/* Class-specific page header accents */
.page-header.gtp    { border-left: 4px solid var(--gtp);    padding-left: 1.25rem; }
.page-header.lmp2   { border-left: 4px solid var(--lmp2);   padding-left: 1.25rem; }
.page-header.gtdpro { border-left: 4px solid var(--gtdpro); padding-left: 1.25rem; }
.page-header.gtd    { border-left: 4px solid var(--gtd);    padding-left: 1.25rem; }

/* ============================================================
   TABLES
   ============================================================ */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.025); }

.data-table .num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-bright);
}

.data-table a { color: var(--text); text-decoration: none; }
.data-table a:hover { color: var(--green); }

/* Schedule table */
.sched-section { margin-bottom: 2.5rem; }

.sched-day {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
  padding: 0.5rem 1rem;
  background: rgba(0,200,83,0.08);
  border-left: 3px solid var(--green);
  border-radius: 0 4px 4px 0;
}

.sched-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  transition: background 0.15s;
}

.sched-row:hover { background: var(--bg-card-hover); }

.sched-row.race {
  border-color: rgba(0,200,83,0.3);
  background: rgba(0,200,83,0.06);
}

.sched-time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text-bright);
  min-width: 150px;
  font-size: 0.9rem;
}

.sched-name {
  font-weight: 700;
  color: var(--text-bright);
  font-size: 0.95rem;
}

.sched-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   STAT BOXES
   ============================================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-bright);
  line-height: 1;
  margin-bottom: 0.3rem;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ============================================================
   INFO / CALLOUT BOXES
   ============================================================ */

.callout {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.callout.gtp    { border-left-color: var(--gtp); }
.callout.lmp2   { border-left-color: var(--lmp2); }
.callout.gtdpro { border-left-color: var(--gtdpro); }
.callout.gtd    { border-left-color: var(--gtd); }
.callout.warn   { border-left-color: var(--gold); background: rgba(245,166,35,0.06); }

.callout-title {
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.callout p { font-size: 0.9rem; color: var(--text-muted); }

/* ============================================================
   TEAM / DRIVER PROFILE PAGES
   ============================================================ */

.team-hero {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.team-number-bg {
  font-family: var(--font-mono);
  font-size: 8rem;
  font-weight: 900;
  line-height: 1;
  opacity: 0.06;
  position: absolute;
  right: 2rem;
  top: 0;
  color: var(--text-bright);
  pointer-events: none;
  user-select: none;
}

.entry-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.entry-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.entry-num {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 900;
  color: var(--text-bright);
  line-height: 1;
}

.entry-info .entry-car {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.25rem;
}

.entry-info .entry-team { font-size: 0.85rem; color: var(--text-muted); }

.drivers-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.driver-chip {
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all 0.15s;
}

.driver-chip:hover {
  border-color: var(--green);
  color: var(--green);
}

.driver-chip .chip-name {
  font-weight: 700;
  color: var(--text-bright);
  font-size: 0.9rem;
}

.driver-chip:hover .chip-name { color: var(--green); }

.driver-chip .chip-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   HISTORY / LONG-FORM TEXT
   ============================================================ */

.prose h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-bright);
  margin: 2.5rem 0 0.75rem;
  letter-spacing: -0.02em;
}

.prose h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-bright);
  margin: 1.75rem 0 0.5rem;
}

.prose p {
  color: var(--text);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.75;
}

.prose ul, .prose ol {
  color: var(--text);
  margin: 0.75rem 0 1rem 1.5rem;
  font-size: 0.95rem;
}

.prose li { margin-bottom: 0.35rem; line-height: 1.65; }

.prose strong { color: var(--text-bright); font-weight: 700; }

/* ============================================================
   GRIDS
   ============================================================ */

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.grid-teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.grid-drivers { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.75rem; }

/* ============================================================
   UTILITY
   ============================================================ */

.text-muted  { color: var(--text-muted); }
.text-bright { color: var(--text-bright); }
.text-green  { color: var(--green); }
.text-gtp    { color: var(--gtp); }
.text-lmp2   { color: var(--lmp2); }
.text-gtdpro { color: var(--gtdpro); }
.text-gtd    { color: var(--gtd); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.divider { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

.tag {
  display: inline-block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 2px 9px;
  border-radius: 4px;
}

/* ============================================================
   FOOTER
   ============================================================ */

footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.25rem;
  margin-top: 5rem;
  text-align: center;
}

footer p { color: var(--text-muted); font-size: 0.85rem; line-height: 1.8; }
footer a { color: var(--green); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    background: rgba(5,10,20,0.98);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 0.5rem 0;
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    line-height: 1;
    padding: 0.8rem 1.25rem;
    border-bottom: 1px solid var(--border);
  }

  .nav-toggle { display: flex; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-auto { grid-template-columns: 1fr; }
  .grid-teams { grid-template-columns: 1fr; }
  .grid-drivers { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

  .hero { padding: 3rem 1.25rem; }
  .hero-meta { gap: 1.5rem; }
  .entry-header { flex-direction: column; gap: 0.75rem; }
  .team-number-bg { display: none; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 2rem; }
}
