/* ── Design Tokens ──────────────────────────────────────────────── */
:root {
  --bg:           #080e1a;
  --surface:      #0f172a;
  --border:       rgba(229, 231, 235, 0.10);
  --text:         #e5e7eb;
  --text-muted:   #9ca3af;
  --green:        #22c55e;
  --green-mid:    #16a34a;
  --green-glow:   rgba(34, 197, 94, 0.15);
  --grid-line:    rgba(229, 231, 235, 0.045);
}

/* ── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Grid background (sits under all dark sections) ─────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, var(--grid-line) 1.5px, transparent 1.5px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ── Navbar ──────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 14, 26, 0.90);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: visible; /* allow mobile dropdown to overflow below */
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-name span { color: var(--green); }

/* ── Desktop nav links ───────────────────────────────────────────── */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin-left: 1.25rem;    /* gap from brand */
  margin-right: auto;      /* push badge to far right */
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(229, 231, 235, 0.06);
}

.nav-link svg { flex-shrink: 0; }

/* Back link used on inner Worker-rendered pages (e.g. /cities) */
.nav-back {
  font-family: 'Space Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.05em;
  margin-left: auto;
  transition: color 0.2s;
}
.nav-back:hover { color: var(--text); }

/* ── Mobile nav toggle ───────────────────────────────────────────── */
.nav-toggle {
  display: none;           /* hidden on desktop */
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  line-height: 0;
  margin-right: 0.5rem;
  margin-left: auto;
  transition: color 0.2s, border-color 0.2s;
}

.nav-toggle:hover { color: var(--text); border-color: var(--text-muted); }

/* ── Mobile dropdown ─────────────────────────────────────────────── */
.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(8, 14, 26, 0.97);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 0.5rem 1rem 0.75rem;
}

.mobile-menu.is-open { display: block; }

.mobile-menu ul { list-style: none; }

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s;
}

.mobile-nav-link:hover { color: var(--text); }
.mobile-menu ul li:last-child .mobile-nav-link { border-bottom: none; }

.navbar-badge {
  margin-left: auto;
  font-family: 'Space Mono', monospace;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.40);
  background: rgba(34, 197, 94, 0.07);
  padding: 0.22rem 0.65rem;
  border-radius: 100px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── Banner ──────────────────────────────────────────────────────── */
/*
  Full-width white section — the image's own white background merges
  seamlessly with the container. The ::after gradient dissolves the
  white into the dark page with no hard edge.
*/
.banner {
  position: relative;
  z-index: 1;
  width: 100%;
  background: #ffffff;
  overflow: hidden;
  line-height: 0; /* collapse the inline-image gap */
}

.banner-image {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: auto;
}

/* White → dark fade at the bottom of the banner */
.banner::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 40%;
  background: linear-gradient(to bottom, transparent 0%, var(--bg) 100%);
  pointer-events: none;
}

/* Desktop: fixed height, width auto → natural proportions, centered in white banner */
@media (min-width: 768px) {
  .banner {
    display: flex;
    justify-content: center;
    overflow: visible;
  }
  .banner-image {
    width: auto;
    height: 280px;
  }
}

/* ── Content section ─────────────────────────────────────────────── */
.content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 1.5rem 3.5rem;
  gap: 1.5rem;
}

.hero-eyebrow {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green);
}

.hero-headline {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
  max-width: 680px;
}

.hero-headline em {
  font-style: normal;
  color: var(--green);
}

.hero-sub {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.75;
  font-weight: 400;
}

/* ── Waitlist form ───────────────────────────────────────────────── */
#waitlist-container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.waitlist-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

/* Turnstile widget — full width so it wraps to its own row */
.cf-turnstile {
  width: 100%;
}

.waitlist-form input[type="email"] {
  flex: 1;
  min-width: 200px;
  padding: 0.8rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.waitlist-form input[type="email"]:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.waitlist-form input[type="email"]::placeholder {
  color: var(--text-muted);
}

.btn-notify {
  padding: 0.8rem 1.5rem;
  background: var(--green);
  color: #000;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, opacity 0.2s;
  white-space: nowrap;
}

.btn-notify:hover  { background: var(--green-mid); }
.btn-notify:active { transform: scale(0.97); }
.btn-notify.htmx-request { opacity: 0.65; cursor: wait; }

/* ── Success / error states (returned by htmx) ───────────────────── */
.success-msg {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.30);
  border-radius: 10px;
  color: var(--green);
  font-size: 0.9rem;
  line-height: 1.5;
  animation: fadeUp 0.3s ease;
}

.error-msg {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.30);
  border-radius: 10px;
  color: #ef4444;
  font-size: 0.9rem;
  animation: fadeUp 0.3s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.form-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: -0.5rem;
  font-family: 'Space Mono', monospace;
}

/* ── Feature strip ───────────────────────────────────────────────── */
.features {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  background: var(--border);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  gap: 1px;
}

.feature-cell {
  background: var(--bg);
  padding: 2rem 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  transition: background 0.25s;
}

.feature-cell:hover { background: rgba(34, 197, 94, 0.04); }
.feature-cell svg   { opacity: 0.85; }

.feature-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.feature-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 180px;
}

/* ── Footer ──────────────────────────────────────────────────────── */
footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2.5rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-family: 'Space Mono', monospace;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 0.4rem;
  transition: color 0.2s;
}

.footer-logo:hover { color: var(--text); }

.build-ref {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  color: rgba(156, 163, 175, 0.45);
  letter-spacing: 0.06em;
}


/* ── Privacy modal ───────────────────────────────────────────────── */
.privacy-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-muted);
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}
.privacy-link:hover { color: var(--text); }

dialog.privacy-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(92vw, 560px);
  max-height: 80vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  color: var(--text);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  z-index: 100;
}

dialog.privacy-dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.privacy-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
}

.privacy-dialog-header h2 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.privacy-version {
  display: block;
  font-family: 'Space Mono', monospace;
  font-size: 0.62rem;
  color: var(--green);
  margin-top: 0.25rem;
  letter-spacing: 0.05em;
}

.privacy-dialog-close {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 1rem;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s;
  line-height: 1;
}
.privacy-dialog-close:hover { color: var(--text); border-color: var(--text-muted); }

.privacy-dialog-body {
  padding: 1.25rem 1.5rem 1.5rem;
  overflow-y: auto;
  max-height: calc(80vh - 90px);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--text-muted);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.privacy-dialog-body h3 {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.privacy-dialog-body section { display: flex; flex-direction: column; gap: 0.25rem; }

.privacy-dialog-body a {
  color: var(--green);
  text-underline-offset: 3px;
}

/* ── Coverage Areas ──────────────────────────────────────────────── */
.coverage {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.coverage-hd {
  margin-bottom: 2rem;
  text-align: center;
}

.coverage-eyebrow {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.5rem;
}

.coverage-hd h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.coverage-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.coverage-loading,
.coverage-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: 'Space Mono', monospace;
  padding: 2rem;
  border: 1px dashed var(--border);
  border-radius: 12px;
}

/* Region accordion */
.cov-region {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: border-color 0.2s;
}

.cov-region[open] {
  border-color: rgba(34, 197, 94, 0.25);
}

.cov-region-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  list-style: none;          /* hide native triangle in Firefox */
  user-select: none;
  transition: background 0.2s;
}

.cov-region-summary::-webkit-details-marker { display: none; } /* hide in Safari/Chrome */

.cov-region-summary:hover {
  background: rgba(34, 197, 94, 0.04);
}

.cov-region-name {
  font-weight: 700;
  font-size: 0.92rem;
  flex: 1;
}

.cov-region-badge {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  background: var(--green-glow);
  border: 1px solid rgba(34, 197, 94, 0.25);
  padding: 0.2rem 0.55rem;
  border-radius: 100px;
}

.cov-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.cov-region[open] .cov-chevron {
  transform: rotate(180deg);
}

/* City grid inside an open region */
.cov-city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.6rem;
  padding: 0 1rem 1rem;
  animation: fadeUp 0.2s ease;
}

.cov-city {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: border-color 0.2s;
}

.cov-city:hover {
  border-color: rgba(34, 197, 94, 0.3);
}

.cov-city-name {
  font-weight: 600;
  font-size: 0.88rem;
}

.cov-city-county {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: 'Space Mono', monospace;
}

.cov-city-leagues {
  font-size: 0.68rem;
  font-family: 'Space Mono', monospace;
  margin-top: 0.15rem;
}

.cov-city-leagues.active  { color: var(--green); }
.cov-city-leagues.pending { color: var(--text-muted); }

/* ── Mobile tweaks ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Swap inline nav for hamburger, move it to far left */
  .nav-links  { display: none; }
  .nav-toggle {
    display: flex;
    align-items: center;
    order: -1;          /* before brand in flex order */
    margin-left: 0;     /* remove the auto that was centering it */
    margin-right: 0.75rem;
  }
}

@media (max-width: 480px) {
  .navbar  { padding: 0.9rem 1rem; }
  .content { padding: 2rem 1rem 2.5rem; gap: 1.25rem; }
  /* Stack form controls full-width on small screens */
  .waitlist-form input[type="email"],
  .btn-notify { width: 100%; }

  .coverage { padding: 2rem 1rem 3rem; }
  .cov-city-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
