/* ---------------------------------------------------------------------------
   Sporloop landing — Court & Course
   Design tokens mirror /design/sporloop-court-course-palette.md
---------------------------------------------------------------------------- */

/* ---------- Fonts (self-hosted) ----------
   Put the .woff2 files in /fonts (see fonts/README.md for download links).
   Until then, the @font-face src will 404 silently and the page uses the
   system-font fallback stack below.
---------------------------------------------------------------------------- */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("./fonts/BricolageGrotesque-Variable.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("./fonts/Satoshi-Variable.woff2") format("woff2-variations");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Brand */
  --court-green: #4a7c59;
  --court-green-dark: #3a6347;
  --court-green-tint: rgba(74, 124, 89, 0.10);
  --gold: #c1a348;
  --gold-tint: rgba(193, 163, 72, 0.12);

  /* Accents */
  --tennis-ball: #d4e84a;
  --wimbledon: #7cb87a;
  --clay: #c15a3a;

  /* Surfaces */
  --bg: #f7f5f0;
  --surface: #ffffff;
  --muted: #eff0eb;
  --forest-ink: #1a2614;
  --text: #1a2614;
  --text-muted: rgba(26, 38, 20, 0.62);
  --text-soft: rgba(26, 38, 20, 0.42);
  --border: rgba(26, 38, 20, 0.09);
  --border-strong: rgba(26, 38, 20, 0.16);

  /* Gradients */
  --g-cta: linear-gradient(135deg, #1a2614 0%, #2c4220 50%, #3a5c2e 100%);
  --g-hero: linear-gradient(145deg, #f7f5f0 0%, #ebf0e4 100%);
  --g-sport: linear-gradient(135deg, #4a7c59, #c1a348);
  --g-mesh:
    radial-gradient(ellipse 80% 60% at 10% 5%, rgba(74, 124, 89, 0.10) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 90% 90%, rgba(193, 163, 72, 0.07) 0%, transparent 55%);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(26, 38, 20, 0.06);
  --shadow-md: 0 4px 16px rgba(26, 38, 20, 0.08);
  --shadow-cta: 0 8px 32px rgba(26, 38, 20, 0.18);
  --shadow-accent: 0 4px 20px rgba(74, 124, 89, 0.28);

  /* Radii */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-btn: 12px;
  --r-card: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* Type */
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Satoshi", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Layout */
  --container: 1120px;
  --container-narrow: 720px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv01", "cv02";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible {
  outline: 2px solid var(--court-green);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 8px 14px;
  background: var(--forest-ink); color: var(--bg);
  border-radius: var(--r-btn);
  z-index: 100;
  /* Visually hidden until focused — bullet-proof clip pattern */
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  width: 1px; height: 1px;
  overflow: hidden;
  white-space: nowrap;
}
.skip-link:focus,
.skip-link:focus-visible {
  clip: auto;
  clip-path: none;
  width: auto;
  height: auto;
  overflow: visible;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0;
  color: var(--forest-ink);
}
h1 { font-size: clamp(2.5rem, 6vw, 4.25rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.125rem; letter-spacing: -0.01em; }

p { margin: 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--court-green-dark);
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: var(--r-pill);
  background: var(--court-green);
  box-shadow: 0 0 0 4px var(--court-green-tint);
}

.lede {
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 34em;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}
.container.narrow { max-width: var(--container-narrow); }

section { padding: 80px 0; }
section.compact { padding: 56px 0; }

@media (max-width: 720px) {
  section { padding: 56px 0; }
  section.compact { padding: 40px 0; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between;
  height: 88px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
}
.brand-mark {
  height: 36px;
  width: auto;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.brand-mark img {
  display: block;
  height: 100%;
  width: auto;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--forest-ink);
}
.nav-links {
  display: flex; gap: 28px; align-items: center;
  font-size: 0.925rem;
  color: var(--text-muted);
}
.nav-links a:hover { color: var(--forest-ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: var(--r-pill);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--g-cta);
  color: var(--bg);
  box-shadow: var(--shadow-cta);
}
.btn-primary:hover { box-shadow: 0 10px 36px rgba(26, 38, 20, 0.24); }

.btn-accent {
  background: var(--court-green);
  color: #fff;
  box-shadow: var(--shadow-accent);
}
.btn-accent:hover { background: var(--court-green-dark); }

.btn-ghost {
  background: var(--surface);
  color: var(--forest-ink);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: var(--muted); }

.btn-lg { padding: 16px 28px; font-size: 1rem; }
.btn-full { width: 100%; }

.btn .arrow { transition: transform 0.18s var(--ease); }
.btn:hover .arrow { transform: translateX(2px); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(48px, 6vw, 96px) 0 clamp(56px, 6vw, 96px);
  background: var(--g-hero);
  overflow: hidden;
}
@media (min-width: 960px) {
  .hero {
    /* Desktop only — ensures the map has enough vertical room to read
       without forcing excess empty space on mobile. */
    min-height: clamp(560px, 72vh, 720px);
  }
}
/* Ivory fade overlay — keeps the hero copy legible over the map bg.
   Strong on the left (text), soft transition at the map boundary,
   mostly transparent over the map itself. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(247, 245, 240, 0.97) 0%,
    rgba(247, 245, 240, 0.92) 30%,
    rgba(247, 245, 240, 0.55) 50%,
    rgba(247, 245, 240, 0.18) 70%,
    rgba(247, 245, 240, 0.10) 100%
  );
  pointer-events: none;
  z-index: 1;
}
/* Optional mesh atmosphere kept as a subtle top-layer warmth */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--g-mesh);
  pointer-events: none;
  z-index: 2;
  opacity: 0.6;
}
.hero-grid {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: minmax(0, 620px) 1fr;
    gap: 48px;
  }
}

.hero-copy .badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--court-green-tint);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.hero-copy h1 { margin-bottom: 16px; }
.hero-copy h1 .accent {
  background: var(--g-sport);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-copy .lede { margin-bottom: 28px; }

.hero-cta {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  margin-bottom: 20px;
}
.hero-cta .note {
  font-size: 0.82rem;
  color: var(--text-soft);
  font-style: italic;
  font-weight: 500;
}
.hero-trust {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 8px;
}
.trust-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--forest-ink);
  box-shadow: var(--shadow-sm);
}
.trust-chip svg { width: 14px; height: 14px; color: var(--court-green); }

/* Hero illustration — full-section background, map right-aligned at its
   natural aspect so pins stay crisp and nothing is cropped. */
.hero-illus {
  position: absolute;
  inset: 0;
  margin: 0;
  width: 100%;
  z-index: 0;
  pointer-events: none;
  border-radius: 0;
  box-shadow: none;
  aspect-ratio: auto;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.hero-illus-img {
  display: block;
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: cover;
  object-position: center;
}
@media (max-width: 959px) {
  /* On mobile the map becomes a full-section wallpaper. cover + center
     crop keeps pins visible but the heavy ivory overlay (below) mutes it
     so the stacked text reads cleanly on top, no crowding. */
  .hero-illus {
    justify-content: center;
    align-items: center;
  }
  .hero-illus-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }
  /* Strong flat ivory veil so the map is a texture, not content */
  .hero::before {
    background: rgba(247, 245, 240, 0.86);
  }
}

/* ---------- Placeholder blocks (for illustrations to be generated) ---------- */
.illus-slot {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1.5px dashed var(--border-strong);
  display: grid;
  place-items: center;
  color: var(--text-soft);
  overflow: hidden;
}
.illus-slot::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--g-mesh);
  opacity: 0.6;
  pointer-events: none;
}
.illus-slot .slot-inner {
  position: relative;
  text-align: center;
  padding: 24px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  line-height: 1.6;
}
.illus-slot .slot-inner strong {
  display: block;
  font-size: 0.9rem;
  color: var(--court-green-dark);
  margin-bottom: 4px;
}
.illus-slot .slot-inner span {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

/* ---------- Value props ---------- */
.section-head {
  text-align: center;
  margin-bottom: clamp(32px, 4vw, 56px);
}
.section-head .eyebrow { margin-bottom: 14px; }
.section-head h2 { max-width: 22ch; margin: 0 auto; }
.section-head p { margin-top: 14px; color: var(--text-muted); max-width: 46ch; margin-left: auto; margin-right: auto; }

.value-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(1, 1fr);
}
@media (min-width: 640px)  { .value-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px)  { .value-grid { grid-template-columns: repeat(3, 1fr); } }

.value-card {
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.value-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(74, 124, 89, 0.28);
}
.value-card .icon {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  background: var(--court-green-tint);
  color: var(--court-green-dark);
  display: grid; place-items: center;
  margin-bottom: 18px;
}
.value-card .icon.gold {
  background: var(--gold-tint);
  color: #8b7632;
}
.value-card h3 { margin-bottom: 6px; }
.value-card p { color: var(--text-muted); font-size: 0.94rem; line-height: 1.55; }

/* Illustration variant — pure visual tile, no padding, image fills the card
   at its natural aspect. Target source aspect ratio: 3:2 landscape so the
   card's height matches the text cards in its row without dictating
   extra vertical space. */
.value-card--illus {
  padding: 0;
  overflow: hidden;
  background: var(--bg);
  display: grid;
  place-items: center;
}
.value-card--illus:hover { transform: translateY(-2px); }
.value-illus-img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- How it works ---------- */
.how {
  background: var(--muted);
  position: relative;
}
.how-illus {
  max-width: 880px;
  margin: 0 auto clamp(32px, 5vw, 56px);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--bg);
}
.how-illus-img {
  display: block;
  width: 100%;
  height: auto;
}
.how .steps {
  max-width: 680px;
  margin: 0 auto;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
  counter-reset: step;
}
.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: start;
  padding: 22px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.step:hover { border-color: rgba(74, 124, 89, 0.28); box-shadow: var(--shadow-sm); }
.step-num {
  counter-increment: step;
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  background: var(--g-cta);
  color: var(--bg);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
}
.step h3 { margin-bottom: 4px; }
.step p { color: var(--text-muted); font-size: 0.94rem; }

/* ---------- Form ---------- */
.form-section { background: var(--bg); }
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(28px, 4vw, 48px);
  box-shadow: var(--shadow-md);
}

.form-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .form-grid.two { grid-template-columns: 1fr 1fr; }
}

.field { display: block; }
.field > label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 8px;
  color: var(--forest-ink);
}
.field > input,
.field > select,
.field > textarea {
  width: 100%;
  background: var(--muted);
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  padding: 14px 16px;
  font-size: 0.95rem;
  color: var(--forest-ink);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.field > input::placeholder,
.field > textarea::placeholder { color: var(--text-soft); }
.field > input:focus,
.field > select:focus,
.field > textarea:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--court-green);
  box-shadow: 0 0 0 4px var(--court-green-tint);
}
.field > textarea { resize: vertical; min-height: 96px; }

.field .error {
  display: none;
  color: var(--clay);
  font-size: 0.82rem;
  margin-top: 6px;
}
.field.has-error > input,
.field.has-error > select,
.field.has-error > textarea { border-color: var(--clay); }
.field.has-error .error { display: block; }

.form-submit { margin-top: 8px; }

.chip-group {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.chip {
  padding: 9px 14px;
  border-radius: var(--r-pill);
  background: var(--muted);
  border: 1.5px solid transparent;
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--forest-ink);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.chip:hover { border-color: var(--court-green-tint); }
.chip[aria-pressed="true"] {
  background: var(--court-green);
  color: #fff;
  border-color: var(--court-green);
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
  opacity: 0;
}

.form-success {
  text-align: center;
  padding: clamp(32px, 5vw, 56px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
}
.form-success .check {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  border-radius: var(--r-pill);
  background: var(--court-green);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: var(--shadow-accent);
}
.form-success h2 { margin-bottom: 10px; }
.form-success p { color: var(--text-muted); max-width: 36ch; margin: 0 auto 20px; }

.hidden { display: none !important; }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--g-cta);
  color: var(--bg);
  border-radius: var(--r-xl);
  padding: clamp(32px, 4vw, 56px);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-band::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(193, 163, 72, 0.18) 0%, transparent 70%);
  pointer-events: none;
}
.cta-band h2 { color: var(--bg); position: relative; margin-bottom: 10px; }
.cta-band p { color: rgba(247, 245, 240, 0.78); position: relative; margin: 0 auto 24px; max-width: 44ch; }
.cta-band .btn {
  background: var(--gold);
  color: var(--forest-ink);
  position: relative;
}
.cta-band .btn:hover { background: #d4b655; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 40px 0 48px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.85rem;
}
.site-footer .bar {
  display: flex; flex-wrap: wrap;
  gap: 16px 28px;
  align-items: center; justify-content: space-between;
}
.site-footer a:hover { color: var(--forest-ink); }

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
.reveal.in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .btn:hover { transform: none; }
}

/* ---------- Small helpers ---------- */
.center { text-align: center; }
.stack-sm > * + * { margin-top: 8px; }
.stack-md > * + * { margin-top: 16px; }
