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

:root {
  --navy:     #1a1a2e;
  --accent:   #6366f1;
  --accent-h: #4f52e0;
  --green:    #16a34a;
  --gray-50:  #f8f9fc;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-900: #111827;
  --text:     #1f2937;
  --radius:   12px;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

/* ── Loading / Spinner ──────────────────────────────────────────────────────── */
.hp-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 80px 0;
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Header ─────────────────────────────────────────────────────────────────── */
.hp-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 0 24px;
  background: transparent;
  transition: background .25s, box-shadow .25s;
}
.hp-header-scrolled {
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--gray-200);
}
.hp-header-inner {
  max-width: 1200px; margin: 0 auto;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
}
.hp-logo img { height: 28px; display: block; }
.hp-header-link {
  font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,.8);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.2);
  transition: color .15s, background .15s, border-color .15s;
}
.hp-header-link:hover {
  color: #fff;
  background: rgba(255,255,255,.1);
}
.hp-header-scrolled .hp-header-link {
  color: var(--gray-600);
  border-color: var(--gray-200);
}
.hp-header-scrolled .hp-header-link:hover {
  color: var(--accent);
  background: rgba(99,102,241,.06);
  border-color: rgba(99,102,241,.3);
}

/* ── Nav ────────────────────────────────────────────────────────────────────── */
.hp-nav { display: flex; align-items: center; gap: 2px; }

.hp-nav-link {
  font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,.72);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.hp-nav-link:hover,
.hp-nav-link.active {
  color: #fff;
  background: rgba(255,255,255,.12);
}
.hp-nav-link-cta {
  border: 1px solid rgba(255,255,255,.22);
  margin-left: 4px;
  color: rgba(255,255,255,.88);
}
.hp-header-scrolled .hp-nav-link      { color: var(--gray-600); }
.hp-header-scrolled .hp-nav-link:hover,
.hp-header-scrolled .hp-nav-link.active {
  color: var(--accent);
  background: rgba(99,102,241,.06);
}
.hp-header-scrolled .hp-nav-link-cta  { border-color: var(--gray-200); }
.hp-header-scrolled .hp-nav-link-cta:hover { border-color: rgba(99,102,241,.3); }

@media (max-width: 520px) {
  .hp-nav-link:not(.hp-nav-link-cta) { display: none; }
}

/* ── Hero ───────────────────────────────────────────────────────────────────── */
.hp-hero {
  position: relative;
  min-height: 420px;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 100px 24px 60px;
}
@media (min-width: 768px) { .hp-hero { min-height: 480px; } }

.hp-hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 75% 90% at 12% 115%, rgba(99,102,241,.22) 0%, transparent 55%),
    radial-gradient(ellipse 55% 65% at 88% -5%,  rgba(139,92,246,.18) 0%, transparent 50%),
    #0c0c1b;
}
.hp-hero-bg::after {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 28px 28px;
}

.hp-hero-content {
  position: relative; z-index: 1;
  max-width: 680px; width: 100%;
}

.hp-hero-eyebrow {
  margin: 0 0 12px;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 2px;
  color: var(--accent);
}

.hp-hero-title {
  margin: 0 0 32px;
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 800; line-height: 1.1; letter-spacing: -.5px;
  color: #fff;
}

/* ── Search bar ─────────────────────────────────────────────────────────────── */
.hp-search-wrap {
  position: relative;
  max-width: 520px; margin: 0 auto 16px;
}
.hp-search-icon {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  color: var(--gray-400); pointer-events: none;
}
.hp-search {
  width: 100%;
  padding: 15px 22px 15px 50px;
  font-size: 15px; font-family: inherit;
  border: none; outline: none;
  border-radius: 50px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 8px 40px rgba(0,0,0,.32), 0 2px 8px rgba(0,0,0,.15);
  color: var(--gray-900);
  transition: box-shadow .15s;
  -webkit-appearance: none;
}
.hp-search:focus {
  box-shadow: 0 8px 40px rgba(0,0,0,.32), 0 0 0 3px rgba(99,102,241,.45);
}
.hp-search::-webkit-search-cancel-button { -webkit-appearance: none; }

.hp-hero-stats {
  margin: 0;
  font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,.5);
  min-height: 20px;
}

/* ── Main / Grid ────────────────────────────────────────────────────────────── */
.hp-main {
  padding: 40px 0 80px;
}
.hp-container {
  max-width: 1200px; margin: 0 auto;
  padding: 0 24px;
}
.hp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
@media (max-width: 640px) {
  .hp-grid { grid-template-columns: 1fr; }
}

/* ── Card ───────────────────────────────────────────────────────────────────── */
.hp-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.07);
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  transition: transform .22s ease, box-shadow .22s ease;
  cursor: pointer;
}
.hp-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 48px rgba(0,0,0,.14);
}

/* Thumbnail */
.hp-card-thumb {
  position: relative;
  aspect-ratio: 3/2;
  overflow: hidden;
  flex-shrink: 0;
}
.hp-card-thumb-img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transition: transform .45s ease;
}
.hp-card:hover .hp-card-thumb-img {
  transform: scale(1.07);
}

/* Date badge */
.hp-card-date-badge {
  position: absolute; top: 12px; right: 12px;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(6px);
  border-radius: 10px;
  padding: 8px 12px;
  text-align: center;
  min-width: 54px;
  box-shadow: 0 2px 14px rgba(0,0,0,.18);
  line-height: 1;
}
.hp-card-date-day {
  display: block;
  font-size: 24px; font-weight: 800;
  color: var(--gray-900);
}
.hp-card-date-month {
  display: block;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--accent);
  margin-top: 3px;
}
.hp-card-date-year {
  display: block;
  font-size: 10px; font-weight: 500;
  color: var(--gray-400);
  margin-top: 2px;
}

/* Circuit badge */
.hp-card-circuit-badge {
  position: absolute; bottom: 10px; left: 10px;
  display: flex; align-items: center; gap: 5px;
  background: rgba(139,92,246,.88);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 11px; font-weight: 600;
  padding: 4px 9px;
  border-radius: 20px;
  letter-spacing: .2px;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  max-width: calc(100% - 20px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Card body */
.hp-card-body {
  padding: 18px 20px 20px;
  flex: 1; display: flex; flex-direction: column;
}
.hp-card-event-name {
  margin: 0 0 3px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .7px;
  color: var(--gray-400);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hp-card-title {
  margin: 0 0 10px;
  font-size: 17px; font-weight: 700;
  color: var(--gray-900); line-height: 1.3;
}
.hp-card-location {
  margin: 0 0 16px;
  display: flex; align-items: center; gap: 5px;
  font-size: 13px; color: var(--gray-600);
}
.hp-card-footer {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}
.hp-card-races-badge {
  font-size: 12px; font-weight: 500;
  color: var(--gray-600);
  background: var(--gray-100);
  padding: 3px 10px; border-radius: 20px;
  white-space: nowrap;
}
.hp-card-price {
  font-size: 13px; font-weight: 700;
  color: var(--green);
  white-space: nowrap;
}
.hp-card-cta {
  margin-left: auto;
  padding: 7px 16px;
  background: var(--accent); color: #fff;
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
  white-space: nowrap;
  transition: background .15s;
}
.hp-card:hover .hp-card-cta {
  background: var(--accent-h);
}

/* ── Empty state ────────────────────────────────────────────────────────────── */
.hp-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 80px 24px;
  text-align: center;
}
.hp-empty-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-400);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.hp-empty p {
  margin: 0;
  font-size: 15px; color: var(--gray-600);
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.cr-footer {
  background: #0d0d1e;
  color: rgba(255,255,255,.7);
  padding: 48px 24px 0;
  font-size: 13px; line-height: 1.7;
}
.cr-footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.cr-footer-heading {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: #fff; margin: 0 0 14px;
}
.cr-footer-heading span { color: var(--accent); }
.cr-footer-col p { margin: 0; }
.cr-footer-nav { display: flex; flex-direction: column; gap: 6px; }
.cr-footer-nav a { color: rgba(255,255,255,.6); text-decoration: none; transition: color .15s; }
.cr-footer-nav a:hover { color: #fff; }
.cr-footer-social { display: flex; gap: 10px; }
.cr-footer-social-link {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.6);
  transition: background .15s, color .15s;
}
.cr-footer-social-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.cr-footer-bottom {
  max-width: 1200px; margin: 0 auto;
  padding: 18px 0;
  font-size: 12px; color: rgba(255,255,255,.35);
}
