/* ===== Pitchside landing: Onyx theme, mirrors the app's design system ===== */

:root {
  /* warm "ink & newsprint" ramp, from the app's Theme.swift (dark) */
  --bg: #0C0B0A;
  --surface: #171614;
  --surface-2: #26231E;
  --elevated: #201E1A;
  --separator: #302C26;
  --hairline: #3B362E;
  --text: #F5F5F7;
  --text-2: #9A9AA2;
  --text-3: #5E5E66;

  /* accent (club colour): default is the app's Pitch Green; used as a FILL only */
  --accent: #2FBE7E;
  --accent-bright: #3FD48F;
  --accent-ink: #0B0B0A;

  --positive: #35C870;
  --negative: #FF5A4D;
  --gold: #E3B341;
  --info: #4C9BFF;

  --maxw: 1040px;
  --pad: 20px;
  --radius: 4px;      /* structural modules: cards, tiles, sheets */
  --radius-sm: 8px;   /* controls: buttons, inputs, chips */

  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Registered so a club change animates the accent fills at once (button, bar,
   selected chips) in one smooth "wash" into the club's colour. */
@property --accent {
  syntax: "<color>"; inherits: true; initial-value: #2FBE7E;
}
@property --accent-bright {
  syntax: "<color>"; inherits: true; initial-value: #3FD48F;
}
:root { transition: --accent .55s ease, --accent-bright .55s ease; }

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; }
em { font-style: italic; }
.accent-text { color: var(--accent); }   /* club name + tagline carry the club colour */

/* small uppercase label, the app's caption grammar */
.kicker {
  font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-2);
}

/* ---- Layout ---- */
.nav, main, .footer { position: relative; z-index: 1; }
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 60px var(--pad);
}

/* ---- Nav ---- */
.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--serif); font-weight: 700; font-size: 20px;
  text-decoration: none; color: var(--text);
}
.brand-mark { border-radius: var(--radius-sm); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 12px 18px; min-height: 46px;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: 38px; padding: 8px 14px; font-size: 15px; }
.btn-ghost {
  background: var(--surface-2);
  border-color: var(--hairline);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--text-3); }

/* ---- Hero ---- */
.hero {
  max-width: 720px;
  margin: 0 auto;
  padding: 30px var(--pad) 40px;
  text-align: center;
}
.eyebrow {
  margin: 4px 0 16px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-2);
}
.display {
  margin: 0 0 18px;
  font-size: clamp(34px, 8.5vw, 58px);
}
.lede {
  margin: 0 auto 26px;
  max-width: 34ch;
  color: var(--text-2);
  font-size: clamp(16px, 4.3vw, 19px);
}

/* ---- Signup form ---- */
.signup { max-width: 460px; margin: 0 auto; }
.signup--center { margin: 8px auto 0; }
.signup-form { margin: 0; }
.field-row { display: flex; flex-direction: column; gap: 10px; }
.field-row input[type="email"] {
  flex: 1; width: 100%;
  font: inherit; color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 14px 15px; min-height: 50px;
}
.field-row input[type="email"]::placeholder { color: var(--text-3); }
.field-row input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.field-row button {
  font: inherit; font-weight: 700; cursor: pointer;
  color: var(--accent-ink);
  background: var(--accent);
  border: none; border-radius: var(--radius-sm);
  padding: 14px 20px; min-height: 50px;
  transition: transform .12s ease, background .15s ease;
}
.field-row button:hover { background: var(--accent-bright); }
.field-row button:active { transform: translateY(1px); }
.field-row button:disabled { opacity: .6; cursor: default; }
.form-note { margin: 12px 2px 0; font-size: 13px; color: var(--text-3); }
.form-msg { margin: 10px 2px 0; font-size: 14px; min-height: 1em; }
.form-msg.err { color: var(--negative); }
.form-msg.ok { color: var(--positive); }
.hp { position: absolute; left: -9999px; }
.signup-success {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--accent);
  color: var(--text);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-align: left; font-size: 16px;
}
.signup-success strong { display: block; font-family: var(--serif); font-size: 19px; margin-bottom: 3px; }

/* ---- Chips (at a glance): squared tags, not pills ---- */
.chips {
  list-style: none; margin: 24px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.chips li {
  font-size: 12.5px; font-weight: 600; letter-spacing: .01em;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
}

/* ---- "Pick your club" modal (first-visit greeting) + controls ---- */
.club-modal {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; transition: opacity .26s ease;
}
.club-modal[hidden] { display: none; }
.club-modal.is-open { opacity: 1; }
.club-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, .72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.club-modal-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 26px 22px 20px;
  text-align: center;
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, .6);
  transform: translateY(8px) scale(.98);
  transition: transform .26s ease;
}
.club-modal-card:focus { outline: none; }
.club-modal.is-open .club-modal-card { transform: none; }
.club-modal-eyebrow {
  margin: 0 0 8px;
  font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-2);
}
#cm-title { margin: 0 0 8px; font-size: clamp(24px, 6vw, 30px); }
.club-modal-sub { margin: 0 auto 20px; max-width: 32ch; color: var(--text-2); font-size: 15px; }
.club-modal-skip {
  margin-top: 16px;
  font: inherit; font-size: 14px; font-weight: 600;
  color: var(--text-3); background: none; border: none; cursor: pointer;
}
.club-modal-skip:hover { color: var(--text-2); }

/* footer reopen control */
.footer-actions { margin: 0 0 14px; }
.club-reopen {
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--text-2); background: var(--surface-2);
  border: 1px solid var(--hairline); border-radius: var(--radius-sm);
  padding: 8px 14px; cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.club-reopen:hover { color: var(--text); border-color: var(--text-3); }

.club-chips {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.club-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: 13.5px; font-weight: 600; line-height: 1;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.club-chip:hover { border-color: var(--text-3); }
.club-chip:active { transform: translateY(1px); }
.club-chip.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-2));
}
.club-dot {
  width: 12px; height: 12px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
  flex: none;
}
.club-search {
  width: 100%; margin-top: 11px;
  font: inherit; font-size: 15px; color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 11px 13px; min-height: 44px;
  text-align: center;
}
.club-search::placeholder { color: var(--text-3); }
.club-search:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* ---- Device / phone frame (de-glossed, flat) ---- */
.device {
  position: relative;
  aspect-ratio: 9 / 19.5;
  background: #0B0A09;
  border: 1px solid var(--hairline);
  border-radius: 30px;
  padding: 7px;
  box-shadow: 0 10px 18px rgba(0,0,0,.18);
  overflow: hidden;
}
.device img { width: 100%; height: 100%; object-fit: cover; border-radius: 24px; position: relative; z-index: 1; }
.device-ph {
  position: absolute; inset: 7px; z-index: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 24px;
  background: var(--surface);
  color: var(--text-3);
  font-family: var(--serif); font-size: 15px; letter-spacing: .02em;
}
.device--hero {
  max-width: 258px;
  margin: 38px auto 0;
}

/* Hero carousel: stacked screenshots crossfading */
.device[data-carousel] img {
  position: absolute; inset: 7px;
  width: calc(100% - 14px); height: calc(100% - 14px);
  z-index: 1; opacity: 0;
  transition: opacity .8s ease;
}
.device[data-carousel] img.is-active { opacity: 1; }

/* ---- Sections ---- */
.section-title { margin: 0 0 8px; font-size: clamp(26px, 6vw, 36px); text-align: center; }
.section-sub { margin: 0 auto 34px; max-width: 40ch; text-align: center; color: var(--text-2); }
.features, .showcase { border-top: 1px solid var(--separator); }

/* ---- Feature cards ---- */
.features .grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 20px;
}
.card-ic {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--hairline);
  color: var(--text-2);
  margin-bottom: 14px;
}
.card-ic svg { width: 22px; height: 22px; display: block; }
.card h3 { margin: 0 0 6px; font-size: 19px; }
.card p { margin: 0; color: var(--text-2); font-size: 15.5px; }

/* ---- Showcase ---- */
.showcase .section-title { margin-bottom: 40px; }
.shots { display: grid; grid-template-columns: 1fr; gap: 22px; max-width: 290px; margin: 0 auto; }

/* ---- CTA ---- */
.cta {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  max-width: 760px;
  margin: 24px auto 60px;
  padding: 44px var(--pad);
  text-align: center;
}

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--hairline);
  max-width: var(--maxw); margin: 0 auto;
  padding: 34px var(--pad) 48px;
  text-align: center;
}
.footer-brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--serif); font-weight: 700; font-size: 18px;
}
.footer-tag { margin: 10px 0 18px; color: var(--text-2); }
.footer-legal { margin: 0 0 10px; color: var(--text-3); font-size: 14px; }
.footer-legal a { color: var(--text-2); text-decoration: none; }
.footer-legal a:hover { color: var(--text); }
.footer-fine { margin: 0 auto; color: var(--text-3); font-size: 12px; max-width: 46ch; opacity: .85; }

/* ===== Larger screens ===== */
@media (min-width: 620px) {
  .field-row { flex-direction: row; }
  .field-row button { white-space: nowrap; }
  .features .grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .shots { grid-template-columns: repeat(3, 1fr); max-width: 760px; gap: 20px; align-items: start; justify-content: center; }
  .shots .device:nth-child(2) { transform: translateY(-14px); }
}

@media (min-width: 900px) {
  .hero { padding-top: 44px; }
  .device--hero { max-width: 284px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
