/* Golf Swing Score: shared styles.
   Dark is the default theme. [data-theme="light"] swaps the tokens below;
   the attribute is set before first paint by /theme.js. Style with the
   variables, never raw colors, so both themes stay in sync. */

:root {
  --bg: #07110c;
  --bg-alt: #0b1812;
  --card: #0f2119;
  --card-hover: #13291f;
  --border: #1c3528;
  --fg: #ecf5ef;
  --muted: #9bb3a5;
  --dim: #6f8a7b;
  --accent: #22c55e;
  --accent-strong: #16a34a;
  --accent-soft: rgba(34, 197, 94, 0.12);
  --accent-glow: rgba(34, 197, 94, 0.28);
  --on-accent: #04210f;
  --gold: #facc15;
  --gold-soft: rgba(250, 204, 21, 0.14);
  --warn: #fbbf24;
  --danger: #f87171;
  --nav-bg: rgba(7, 17, 12, 0.82);
  --hero-glow:
    radial-gradient(1100px 560px at 85% -15%, rgba(34, 197, 94, 0.20), transparent 60%),
    radial-gradient(700px 480px at -10% 30%, rgba(250, 204, 21, 0.07), transparent 60%);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f6faf7;
  --bg-alt: #ecf4ee;
  --card: #ffffff;
  --card-hover: #f3f8f4;
  --border: #d5e5da;
  --fg: #0b1f14;
  --muted: #465f50;
  --dim: #6b8375;
  --accent: #15803d;
  --accent-strong: #166534;
  --accent-soft: rgba(21, 128, 61, 0.10);
  --accent-glow: rgba(21, 128, 61, 0.22);
  --on-accent: #ffffff;
  --gold: #b45309;
  --gold-soft: rgba(202, 138, 4, 0.12);
  --warn: #b45309;
  --danger: #dc2626;
  --nav-bg: rgba(246, 250, 247, 0.88);
  --hero-glow:
    radial-gradient(1100px 560px at 85% -15%, rgba(21, 128, 61, 0.13), transparent 60%),
    radial-gradient(700px 480px at -10% 30%, rgba(202, 138, 4, 0.07), transparent 60%);
  --shadow: 0 24px 60px rgba(15, 40, 25, 0.12);
  color-scheme: light;
}

/* -------------------- Base -------------------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a { color: var(--accent); }
img, svg { display: block; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 1.5rem; }

/* -------------------- Buttons -------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 24px var(--accent-glow); }
.btn-primary:hover:not(:disabled) { background: var(--accent-strong); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--border); }
.btn-ghost:hover { background: var(--card-hover); }
.btn-lg { padding: 0.9rem 1.6rem; font-size: 1.05rem; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  font-size: 1.05rem;
  cursor: pointer;
}
.icon-btn:hover { background: var(--card-hover); }

/* -------------------- Nav -------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 68px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--fg);
  text-decoration: none;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: 1.1rem;
}
.brand-accent { color: var(--accent); }

.nav-links { display: flex; gap: 1.75rem; }
.nav-links a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover { color: var(--fg); }

.nav-actions { display: flex; align-items: center; gap: 0.6rem; }

/* -------------------- Hero -------------------- */
.hero { background: var(--hero-glow); padding: 5rem 0 4.5rem; overflow: hidden; }

.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 3.5rem; align-items: center; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 1.25rem;
}
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }

.hero h1 {
  font-size: clamp(2.4rem, 5.2vw, 3.9rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 900;
  margin-bottom: 1.25rem;
}
.hero h1 .highlight {
  background: linear-gradient(90deg, var(--accent), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede { color: var(--muted); font-size: 1.15rem; max-width: 560px; margin-bottom: 2rem; }

.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.75rem; }

.hero-points { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; color: var(--muted); font-size: 0.9rem; }
.hero-points li::before { content: "✓"; color: var(--accent); font-weight: 700; margin-right: 0.4rem; }

/* Sample score card */
.score-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.score-card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; font-size: 0.8rem; }
.sample-tag { padding: 0.2rem 0.6rem; border-radius: 999px; background: var(--gold-soft); color: var(--gold); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.7rem; }
.score-card-meta { color: var(--dim); }

.score-body { display: grid; grid-template-columns: 132px 1fr; gap: 1.5rem; align-items: center; }

.score-ring-wrap { position: relative; width: 132px; height: 132px; }
.score-ring { width: 132px; height: 132px; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--border); stroke-width: 10; }
.ring-fill { fill: none; stroke: url(#ringGradient); stroke-width: 10; stroke-linecap: round; }
.score-value { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.score-number { font-size: 2.6rem; font-weight: 900; letter-spacing: -0.04em; line-height: 1; }
.score-of { color: var(--dim); font-size: 0.8rem; font-weight: 600; }

.metric-list { list-style: none; display: grid; gap: 0.7rem; }
.metric-row { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 0.75rem; font-size: 0.85rem; }
.metric-name { color: var(--muted); }
.metric-val { font-weight: 700; }
.metric-bar { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.metric-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.metric-bar.warn span { background: var(--gold); }

.score-fix { margin-top: 1.25rem; padding: 0.9rem 1rem; border-radius: 12px; background: var(--bg-alt); border: 1px solid var(--border); display: grid; gap: 0.35rem; font-size: 0.85rem; }
.score-fix strong { color: var(--fg); }
.score-fix .label { color: var(--dim); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }

/* -------------------- Sections -------------------- */
.section { padding: 5.5rem 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-head { text-align: center; max-width: 680px; margin: 0 auto 3rem; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 0.75rem; }
.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); line-height: 1.15; letter-spacing: -0.03em; font-weight: 800; margin-bottom: 0.9rem; }
.section-head p { color: var(--muted); font-size: 1.05rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.6rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--accent-glow); transform: translateY(-2px); }
.card h3 { font-size: 1.1rem; margin-bottom: 0.4rem; letter-spacing: -0.01em; }
.card p { color: var(--muted); font-size: 0.95rem; }

.icon-tile {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

/* How it works */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; counter-reset: step; }
.step { position: relative; }
.step-num {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
  margin-bottom: 1rem;
}

/* What we measure */
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.metric-grid .card { padding: 1.35rem; }
.metric-grid h3 { font-size: 1rem; }
.metric-grid p { font-size: 0.88rem; }

.fault-strip { margin-top: 2.5rem; text-align: center; }
.fault-strip p { color: var(--muted); margin-bottom: 1rem; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; list-style: none; }
.chip { padding: 0.45rem 0.9rem; border-radius: 999px; border: 1px solid var(--border); background: var(--card); font-size: 0.88rem; font-weight: 500; }

/* Split feature (simulator, privacy) */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem; align-items: center; }
.split h2 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); line-height: 1.15; letter-spacing: -0.03em; font-weight: 800; margin-bottom: 1rem; }
.split p { color: var(--muted); font-size: 1.05rem; margin-bottom: 1.25rem; }

.check-list { list-style: none; display: grid; gap: 0.7rem; }
.check-list li { display: grid; grid-template-columns: 22px 1fr; gap: 0.6rem; color: var(--fg); }
.check-list li::before { content: "✓"; color: var(--accent); font-weight: 800; }
.check-list + .btn { margin-top: 1.75rem; }

.data-panel { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 1.5rem; box-shadow: var(--shadow); }
.data-panel-title { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: var(--dim); margin-bottom: 1rem; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.data-table td { padding: 0.65rem 0; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }
.data-table td:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.insight { margin-top: 1rem; padding: 0.85rem 1rem; border-radius: 12px; background: var(--accent-soft); color: var(--fg); font-size: 0.88rem; }
.insight strong { color: var(--accent); }

.privacy-panel { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.privacy-panel .card { padding: 1.25rem; }
.privacy-panel h3 { font-size: 0.98rem; }
.privacy-panel p { font-size: 0.86rem; }

/* Pricing */
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; align-items: stretch; }
.tier { display: flex; flex-direction: column; position: relative; }
.tier.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.tier-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tier-name { color: var(--muted); font-weight: 600; margin-bottom: 0.4rem; }
.price { font-size: 2.6rem; font-weight: 900; letter-spacing: -0.04em; line-height: 1.1; margin-bottom: 0.3rem; }
.price small { font-size: 0.95rem; font-weight: 500; color: var(--dim); letter-spacing: 0; }
.tier-desc { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.25rem; }
.tier ul { list-style: none; display: grid; gap: 0.55rem; margin-bottom: 1.75rem; flex: 1; }
.tier li { display: grid; grid-template-columns: 20px 1fr; gap: 0.5rem; font-size: 0.93rem; }
.tier li::before { content: "✓"; color: var(--accent); font-weight: 800; }
.tier .btn { width: 100%; }
.pricing-note { text-align: center; color: var(--dim); font-size: 0.85rem; margin-top: 1.5rem; }

/* FAQ */
.faq { max-width: 780px; margin: 0 auto; display: grid; gap: 0.75rem; }
.faq details { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 1.1rem 1.3rem; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); margin-top: 0.75rem; font-size: 0.95rem; }

/* Final CTA */
.cta-band {
  text-align: center;
  padding: 4rem 2rem;
  border-radius: 24px;
  background: var(--hero-glow), var(--card);
  border: 1px solid var(--border);
}
.cta-band h2 { font-size: clamp(1.9rem, 3.8vw, 2.8rem); letter-spacing: -0.03em; font-weight: 900; margin-bottom: 0.8rem; }
.cta-band p { color: var(--muted); font-size: 1.1rem; margin-bottom: 1.75rem; }

/* -------------------- Footer -------------------- */
footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}
footer p + p { margin-top: 0.375rem; }
footer a { color: var(--accent); }

.site-footer { text-align: left; padding: 2.5rem 0; margin-top: 3rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.footer-tagline { color: var(--dim); margin-top: 0.5rem; }
.footer-legal { text-align: right; }

/* -------------------- Upload page -------------------- */
.page-head { padding: 3.5rem 0 1.5rem; background: var(--hero-glow); }
.page-head h1 { font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -0.03em; font-weight: 900; margin-bottom: 0.5rem; }
.page-head p { color: var(--muted); font-size: 1.05rem; max-width: 620px; }

.tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.5rem 0 2rem; }
.tip { display: grid; grid-template-columns: 36px 1fr; gap: 0.75rem; align-items: start; font-size: 0.9rem; color: var(--muted); }
.tip strong { color: var(--fg); display: block; }
.tip-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); }

.upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-bottom: 2rem; }
.upload-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 1.5rem; }
.upload-card h3 { margin-bottom: 0.4rem; font-size: 1.05rem; }
.upload-card .hint { color: var(--muted); font-size: 0.88rem; margin-bottom: 1rem; }
.upload-card .optional { font-weight: 500; color: var(--dim); font-size: 0.85rem; }
.upload-card input[type="file"] {
  width: 100%;
  padding: 0.6rem;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--fg);
  font: inherit;
  font-size: 0.85rem;
}
.upload-card input[type="file"]::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.upload-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
#status { color: var(--muted); }
.upload-consent { margin-top: 1.5rem; color: var(--dim); font-size: 0.85rem; max-width: 720px; }

/* -------------------- Legal pages -------------------- */
.legal-page { max-width: 800px; margin: 0 auto; padding: 3rem 1.5rem; }
.legal-page h1 { font-size: 2.2rem; letter-spacing: -0.03em; margin-bottom: 0.5rem; }
.legal-page h2 { margin: 2rem 0 0.75rem; font-size: 1.25rem; }
.legal-page h3 { margin: 1.25rem 0 0.5rem; font-size: 1rem; }
.legal-page p { margin-bottom: 0.75rem; color: var(--muted); }
.legal-page strong { color: var(--fg); }
.legal-page ul { margin: 0.75rem 0 0.75rem 1.5rem; color: var(--muted); }
.legal-page li { margin-bottom: 0.375rem; }
.legal-page .legal-updated { color: var(--dim); font-size: 0.875rem; }

/* -------------------- Sign-in modal (built by app.js) -------------------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}
.modal[hidden] { display: none; }

.modal-content {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow);
}
.modal-content h2 { margin-bottom: 0.5rem; font-size: 1.375rem; letter-spacing: -0.02em; }

.modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}
.modal-close:hover { color: var(--fg); }

.auth-subtitle { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.25rem; }

.age-confirm {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.age-confirm input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin-top: 0.1rem;
  cursor: pointer;
}

.modal-content .btn-full {
  width: 100%;
  padding: 0.75rem 1.2rem;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.modal-content .btn-full:hover { background: var(--accent-strong); }

.auth-hint, .auth-error { margin-top: 0.75rem; font-size: 0.82rem; }
.auth-hint { color: var(--warn); }
.auth-error { color: var(--danger); }

/* -------------------- Responsive -------------------- */
@media (max-width: 960px) {
  .hero-grid, .split { grid-template-columns: 1fr; gap: 2.5rem; }
  .score-card { max-width: 520px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .tiers, .steps, .upload-grid, .tips { grid-template-columns: 1fr; }
  .tiers { max-width: 440px; margin: 0 auto; }
}

@media (max-width: 860px) {
  .nav-links { display: none; }
}

@media (max-width: 560px) {
  .nav-cta { display: none; }
  .hero { padding: 3.5rem 0 3rem; }
  .section { padding: 4rem 0; }
  .metric-grid, .privacy-panel { grid-template-columns: 1fr; }
  .score-body { grid-template-columns: 1fr; justify-items: center; }
  .metric-list { width: 100%; }
  .footer-legal { text-align: left; }
}
