@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800;900&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #f8f9fb;
  --card: #ffffff;
  --ink: #111827;
  --muted: #4a5466;
  --primary: #003366;
  --primary-10: rgba(0, 51, 102, 0.1);
  --accent: #2563eb;
  --secondary: #eef2f7;
  --border: #e5e7eb;
  --radius: 16px;
  --heading: 'Archivo', ui-sans-serif, system-ui, sans-serif;
  --body: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg.icon { width: 18px; height: 18px; flex-shrink: 0; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(248, 249, 251, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }
.brand.lg .logo { width: 64px; height: 64px; }
.site-header .brand-name { display: none; }
.brand:hover .logo { box-shadow: 0 0 0 3px var(--primary-10); }
.brand-name {
  font-family: var(--heading);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary);
}

.main-nav { display: flex; align-items: center; gap: 12px; }
.main-nav a {
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.main-nav a:hover { background: var(--secondary); color: var(--primary); }
.main-nav a.active {
  font-weight: 600;
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 12px;
}
.main-nav a.active:hover { background: none; }

.header-actions { display: flex; align-items: center; gap: 8px; }

.menu-toggle {
  display: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
  color: var(--primary);
}
.menu-toggle svg { width: 20px; height: 20px; }
.mobile-nav { display: none; border-top: 1px solid var(--border); background: var(--bg); }
.mobile-nav.open { display: block; }
.mobile-nav nav { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; }
.mobile-nav a.link { padding: 12px 14px; font-size: 18px; border-radius: 12px; font-weight: 500; }
.mobile-nav a.link.active { background: var(--secondary); color: var(--primary); font-weight: 600; }
.mobile-nav .btn { margin-top: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 20px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #0b3f75; }
.btn-outline { background: var(--card); border: 1px solid var(--border); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.btn-outline:hover { background: var(--secondary); }
.btn-pill { border-radius: 999px; padding: 0 24px; }
.btn-join { height: 48px; padding: 0 30px; font-size: 17px; }
.btn-lg { height: 52px; padding: 0 36px; font-size: 17px; }
.btn-white { background: #fff; color: var(--primary); }
.btn-white:hover { background: rgba(255, 255, 255, 0.9); }
.btn-ghost-light { border: 1px solid rgba(255, 255, 255, 0.6); color: #fff; }
.btn-ghost-light:hover { background: rgba(255, 255, 255, 0.1); }

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; background: var(--primary); color: #fff; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; transform: scale(1.06); }
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 51, 102, 0.66), rgba(0, 51, 102, 0.42), rgba(0, 51, 102, 0.8));
}
.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  padding-top: 128px;
  padding-bottom: 128px;
}
.hero.compact .hero-inner { padding-top: 128px; padding-bottom: 128px; }
.eyebrow-light {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
}
.hero h1 {
  margin: 12px 0 0;
  font-family: var(--heading);
  font-size: 76px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.025em;
  text-transform: uppercase;
}
.hero-sub {
  max-width: 760px;
  margin: 24px auto 0;
  font-size: 21px;
  line-height: 1.625;
  color: rgba(255, 255, 255, 0.85);
}
.tagline { margin-top: 28px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.tagline span:first-child { width: 48px; height: 1px; background: rgba(255, 255, 255, 0.6); }
.tagline span:last-child { font-size: 14px; font-weight: 700; letter-spacing: 0.3em; text-transform: uppercase; }
.hero-actions { margin-top: 36px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
}
.section-title {
  margin: 8px 0 0;
  font-family: var(--heading);
  font-size: 38px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-transform: uppercase;
}
.text-link { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 600; color: var(--primary); }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Event list ---------- */
.event-list { display: flex; flex-direction: column; gap: 16px; }
.event {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}
.event:hover { border-color: rgba(37, 99, 235, 0.4); }
.datebox {
  width: 76px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(238, 242, 247, 0.6);
}
.datebox .m { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.datebox .d { font-family: var(--heading); font-size: 28px; font-weight: 800; line-height: 1; margin: 2px 0; }
.datebox .w { font-size: 13px; font-weight: 500; color: var(--muted); }
.event-img { width: 180px; height: 120px; flex-shrink: 0; border-radius: 12px; overflow: hidden; background: var(--secondary); }
.event-img img { width: 100%; height: 100%; object-fit: cover; }
.event-body { flex: 1; min-width: 0; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--primary-10);
  color: var(--primary);
}
.badge.race { background: var(--primary); color: #fff; }
.event-title {
  margin: 8px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--heading);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
}
.event-title .icon { color: var(--accent); }
.event-meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 16px; color: var(--muted); }
.event-meta span { display: inline-flex; align-items: center; gap: 6px; }
.event-meta .icon { width: 16px; height: 16px; }
.event-desc { margin: 10px 0 0; max-width: 768px; font-size: 16px; line-height: 1.625; color: var(--muted); }
.event-action { flex-shrink: 0; }
.empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ---------- Calendar filters ---------- */
.cal-wrap { padding: 56px 0 80px; }
.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  margin-bottom: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.filters-left { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; }
.seg.fill { background: var(--secondary); }
.seg.outline { border: 1px solid var(--border); }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
}
.pill:hover { color: var(--primary); }
.pill.active { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.pill .icon { width: 16px; height: 16px; }
.month-nav { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 999px; }
.month-nav button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}
.month-nav button:hover { background: var(--secondary); }
.month-nav .label { min-width: 160px; text-align: center; font-size: 16px; font-weight: 600; }

/* ---------- Month grid ---------- */
.month-grid { padding: 20px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.grid7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wd { padding-bottom: 8px; text-align: center; font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.cell { min-height: 110px; padding: 6px; border: 1px solid rgba(229, 231, 235, 0.7); border-radius: 8px; min-width: 0; }
.cell.pad { border: 0; background: rgba(238, 242, 247, 0.4); }
.cell.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cell .num { margin-bottom: 4px; text-align: right; font-size: 13px; font-weight: 600; color: var(--muted); }
.cell.today .num { color: var(--accent); }
.chip {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 4px 6px;
  border-radius: 4px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--primary-10);
  color: var(--primary);
}
.chip:hover { background: rgba(0, 51, 102, 0.2); }
.chip.race { background: var(--primary); color: #fff; }

/* ---------- Dialog ---------- */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 20, 35, 0.6);
}
.dialog-backdrop.open { display: flex; }
.dialog {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.dialog-img { width: 100%; height: 200px; object-fit: cover; }
.dialog-body { padding: 24px; }
.dialog-body h3 { margin: 10px 0 0; font-family: var(--heading); font-size: 24px; font-weight: 800; }
.dialog-body .event-meta { margin-top: 10px; }
.dialog-body p { color: var(--muted); font-size: 15px; line-height: 1.6; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 70;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Content pages ---------- */
.band { background: var(--card); border-top: 1px solid var(--border); }
.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; }
.prose p { margin: 0 0 20px; color: var(--muted); line-height: 1.7; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-self: start; margin: 0; }
.stat { padding: 20px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.stat dt { font-family: var(--heading); font-size: 30px; font-weight: 800; color: var(--primary); }
.stat dd { margin: 4px 0 0; font-size: 13px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 40px; }
.value { padding-top: 20px; border-top: 2px solid var(--accent); }
.value h3 { margin: 0; font-family: var(--heading); font-size: 22px; font-weight: 700; }
.value p { margin: 10px 0 0; font-size: 16px; line-height: 1.65; color: var(--muted); }
.card { padding: 28px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.card h3 { margin: 0; font-family: var(--heading); font-size: 22px; font-weight: 700; }
.card p { color: var(--muted); font-size: 14px; line-height: 1.65; }
.card .price { font-family: var(--heading); font-size: 32px; font-weight: 800; color: var(--primary); margin: 12px 0 0; }
.card .price small { font-size: 14px; font-weight: 500; color: var(--muted); }
.card ul { margin: 16px 0 0; padding: 0; list-style: none; font-size: 16px; color: var(--muted); }
.card li { display: flex; gap: 8px; padding: 5px 0; }
.card li .icon { color: var(--accent); margin-top: 3px; }
.card.featured { border: 2px solid var(--primary); }
.res-card { display: flex; flex-direction: column; gap: 10px; transition: border-color 0.15s; }
.res-card:hover { border-color: rgba(37, 99, 235, 0.4); }
.res-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--primary-10); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; }
.res-icon .icon { width: 20px; height: 20px; }

.form { display: grid; gap: 16px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.form input, .form select, .form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 16px;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid rgba(37, 99, 235, 0.35); border-color: var(--accent); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; font-weight: 500; cursor: pointer; }
.checks input { width: auto; }

/* ---------- Footer ---------- */
.site-footer { margin-top: auto; background: var(--card); border-top: 1px solid var(--border); }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; padding-top: 56px; padding-bottom: 56px; }
.footer-grid p { max-width: 340px; margin: 16px 0 0; font-size: 16px; line-height: 1.65; color: var(--muted); }
.footer-grid h4 { margin: 0; font-family: var(--heading); font-size: 13px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; }
.footer-grid ul { margin: 16px 0 0; padding: 0; list-style: none; font-size: 16px; color: var(--muted); }
.footer-grid li { padding: 5px 0; display: flex; gap: 8px; align-items: flex-start; }
.footer-grid li .icon { color: var(--accent); margin-top: 2px; }
.footer-grid a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--border); }
.photo-credit a { text-decoration: underline; text-underline-offset: 2px; }
.footer-bottom .container { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 20px; padding-bottom: 20px; font-size: 14px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .main-nav { display: none; }
  .menu-toggle { display: inline-flex; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters > .seg { align-self: flex-start; }
  .split { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 767px) {
  .hero-inner, .hero.compact .hero-inner { padding-top: 80px; padding-bottom: 80px; }
  .hero h1 { font-size: 44px; }
  .hero-sub { font-size: 16px; }
  .section { padding: 56px 0; }
  .section-title { font-size: 28px; }
  .cal-wrap { padding: 32px 0 56px; }

  /* Event cards stack on phones */
  .event { flex-wrap: wrap; align-items: flex-start; gap: 14px; padding: 16px; }
  .event-img { order: -1; width: 100%; height: 160px; }
  .datebox { width: 64px; padding: 6px 0; }
  .datebox .d { font-size: 24px; }
  .event-body { flex: 1 1 0; min-width: 0; }
  .event-title { font-size: 17px; align-items: flex-start; }
  .event-title .icon { margin-top: 3px; }
  .event-action { width: 100%; }
  .event-action .btn { width: 100%; height: 40px; }

  .three { grid-template-columns: 1fr; gap: 28px; }
  .form .row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom .container { flex-direction: column; text-align: center; }
}

@media (max-width: 639px) {
  .brand-name { display: none; }
  .header-actions .btn-join { display: none; }
  .header-inner { height: 72px; }
  .logo { width: 52px; height: 52px; }
  .filters-left { flex-direction: column; align-items: stretch; }
  .seg { justify-content: space-between; }
  .seg .pill { flex: 1; justify-content: center; padding: 8px 10px; font-size: 13px; }
  .filters > .seg { align-self: stretch; }
  .month-nav { justify-content: space-between; }
  .month-grid { padding: 8px; }
  .grid7 { gap: 4px; }
  .wd { font-size: 10px; letter-spacing: 0.06em; }
  .cell { min-height: 64px; padding: 3px; }
  .chip { font-size: 9px; padding: 3px 4px; }
  .stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 400px) {
  .container { padding-left: 16px; padding-right: 16px; }
  .hero h1 { font-size: 34px; }
  .hero-actions .btn { width: 100%; }
}
