/* ============================================================
   Pickleball Tracker: AI Coach — marketing site
   Dark, court-teal identity matching the app (Theme.swift palette).
   ============================================================ */

:root {
  /* Brand palette — from the app's Theme.swift */
  --court:        #36c5da;   /* bright court teal (dark-mode variant) */
  --court-strong: #0a8ba3;
  --court-deep:   #092e42;
  --court-deepest:#06202f;
  --optic:        #d6f046;   /* optic ball yellow */
  --optic-2:      #c7e033;
  --win:          #2ed18c;
  --loss:         #ff6e60;

  /* Surface + ink */
  --bg:        #05121a;
  --bg-2:      #081a26;
  --ink:       #eaf3f5;
  --muted:     #9db2bb;
  --muted-2:   #7c949e;
  --card:      rgba(255, 255, 255, 0.035);
  --card-2:    rgba(255, 255, 255, 0.05);
  --line:      rgba(255, 255, 255, 0.09);
  --line-2:    rgba(255, 255, 255, 0.14);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", "Segoe UI", var(--font);

  --wrap: 1140px;
  --radius: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

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

/* Ambient background wash */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 620px at 82% -6%, rgba(54, 197, 218, 0.16), transparent 60%),
    radial-gradient(900px 560px at 6% 8%, rgba(10, 139, 163, 0.14), transparent 62%),
    linear-gradient(180deg, var(--court-deepest) 0%, var(--bg) 42%, var(--bg) 100%);
}

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

h1, h2, h3, h4 {
  font-family: var(--font-round);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(20px, 5vw, 40px); }

.hl { color: var(--optic); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--court); margin: 0 0 18px;
}
.eyebrow--center { justify-content: center; }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--optic); box-shadow: 0 0 12px var(--optic); }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 999;
  background: var(--optic); color: #04121a; padding: 10px 16px; border-radius: 10px; font-weight: 700;
}
.skip-link:focus { left: 16px; }

:focus-visible { outline: 2px solid var(--court); outline-offset: 3px; border-radius: 6px; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 700; font-size: 1rem; line-height: 1;
  padding: 15px 24px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn--ghost:hover { border-color: var(--court); color: #fff; }
.btn--outline { background: transparent; border-color: var(--court); color: var(--court); }
.btn--outline:hover { background: rgba(54, 197, 218, 0.12); color: #fff; }
.btn--sm { padding: 11px 16px; font-size: 0.9rem; }

/* App Store badge (self-contained) */
.appstore {
  background: #000; color: #fff; border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 11px 20px 11px 18px; gap: 12px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
}
.appstore:hover { border-color: rgba(255, 255, 255, 0.5); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5); }
.appstore__logo { width: 21px; height: 25px; fill: #fff; flex: none; }
.appstore__text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; text-align: left; }
.appstore__text small { font-size: 0.64rem; font-weight: 500; letter-spacing: 0.02em; opacity: 0.92; }
.appstore__text strong { font-family: var(--font-round); font-size: 1.16rem; font-weight: 700; letter-spacing: -0.01em; }
.appstore--nav { padding: 8px 16px 8px 14px; }
.appstore--nav .appstore__text strong { font-size: 1rem; }
.appstore--nav .appstore__logo { width: 17px; height: 20px; }
.appstore--lg { padding: 15px 30px 15px 26px; }
.appstore--lg .appstore__text strong { font-size: 1.32rem; }
.appstore--lg .appstore__logo { width: 25px; height: 30px; }

.textlink { color: var(--court); font-weight: 700; border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.textlink:hover { border-color: var(--court); }

/* ============================================================
   Nav
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 100;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.nav--scrolled {
  background: rgba(5, 16, 23, 0.72);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom-color: var(--line);
}
.nav__inner { display: flex; align-items: center; gap: 20px; height: 68px; }

.brand { display: inline-flex; align-items: center; gap: 11px; font-family: var(--font-round); font-weight: 800; letter-spacing: -0.01em; }
.brand__icon { border-radius: 9px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4); }
.brand__name { font-size: 1.02rem; }
.brand__sub { color: var(--court); }

.nav__links { display: flex; gap: 26px; margin-left: auto; }
.nav__links a { color: var(--muted); font-weight: 600; font-size: 0.94rem; transition: color 0.2s; }
.nav__links a:hover { color: var(--ink); }
.nav .appstore--nav { margin-left: 8px; }
.nav__links + .appstore--nav { margin-left: 8px; }
.nav__links ~ .appstore--nav { margin-left: 8px; }

/* ============================================================
   Hero
   ============================================================ */
.hero { position: relative; padding: clamp(48px, 8vw, 96px) 0 clamp(60px, 8vw, 110px); overflow: hidden; }
.hero__glow {
  position: absolute; top: -10%; right: -6%; width: 720px; max-width: 90vw; height: 720px;
  background: radial-gradient(circle at 60% 40%, rgba(54, 197, 218, 0.22), transparent 62%);
  filter: blur(10px); pointer-events: none;
}
.hero__inner { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(28px, 5vw, 64px); align-items: center; position: relative; }

.hero h1 { font-size: clamp(2.7rem, 6.2vw, 4.6rem); margin-bottom: 22px; }
.lede { font-size: clamp(1.06rem, 1.6vw, 1.28rem); color: var(--muted); max-width: 34ch; margin: 0 0 30px; }
.lede em { color: var(--ink); font-style: normal; font-weight: 700; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero__trust { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 0; margin: 26px 0 0; color: var(--muted-2); font-size: 0.9rem; font-weight: 600; }
.hero__trust li { position: relative; padding-left: 20px; }
.hero__trust li::before { content: "✓"; position: absolute; left: 0; color: var(--win); font-weight: 800; }

/* Hero: phone + Apple Watch */
.hero__art { position: relative; display: flex; justify-content: center; align-items: center; min-height: 500px; }
.phone-stack { position: relative; }
.hero__art .phone--hero { --pw: clamp(224px, 25vw, 286px); position: relative; z-index: 2; }

/* Apple Watch tucked into the phone's bottom-right — "score on your wrist".
   Photorealistic device (titanium case + crown + bezel) is baked into the PNG. */
.watch {
  --ww: clamp(116px, 13.5vw, 150px);
  position: absolute; z-index: 4; right: -9%; bottom: 4%;
  width: var(--ww); height: auto; display: block;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.55));
}

/* ============================================================
   Phone frame
   ============================================================ */
.phone {
  --pw: 280px;
  width: var(--pw); flex: none;
  padding: 9px; border-radius: 42px; position: relative;
  background: linear-gradient(155deg, #26343c, #0d181e 60%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.75), inset 0 1px 1px rgba(255, 255, 255, 0.16);
}
.phone img { display: block; width: 100%; height: auto; border-radius: 34px; background: #000; }
.phone__island {
  position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  width: 30%; height: 15px; background: #000; border-radius: 12px; z-index: 3;
}
.phone--sm { --pw: clamp(210px, 46vw, 240px); }

/* ============================================================
   Value strip
   ============================================================ */
.strip { border-block: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); }
.strip__inner {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 18px;
  padding: 20px 0; color: var(--muted); font-weight: 600; font-size: 0.94rem; text-align: center;
}
.strip__dot { color: var(--court); }

/* ============================================================
   Section scaffold
   ============================================================ */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section__head { max-width: 720px; margin: 0 auto clamp(40px, 5vw, 64px); text-align: center; }
.section__head h2 { font-size: clamp(2rem, 4.4vw, 3.1rem); }
.section__sub { color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.15rem); margin: 16px 0 0; }

/* ---------- How it works ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 26px; position: relative; overflow: hidden;
  transition: transform 0.25s var(--ease), border-color 0.25s, background 0.25s;
}
.step:hover { transform: translateY(-4px); border-color: var(--line-2); background: var(--card-2); }
.step__num {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  font-family: var(--font-round); font-weight: 800; font-size: 1.3rem; color: var(--court-deepest);
  background: linear-gradient(150deg, var(--optic), var(--optic-2)); margin-bottom: 18px;
  box-shadow: 0 8px 20px -6px rgba(214, 240, 70, 0.5);
}
.step h3 { font-size: 1.28rem; margin-bottom: 10px; }
.step p { color: var(--muted); margin: 0; }
.step em { color: var(--ink); font-style: normal; font-weight: 700; }

/* ---------- Spotlight ---------- */
.spotlight { position: relative; }
.spotlight__inner { display: grid; grid-template-columns: 1fr 0.82fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
.spotlight__copy h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); margin-bottom: 20px; }
.spotlight__copy > p { color: var(--muted); font-size: 1.1rem; margin: 0 0 26px; }
.spotlight__art { display: flex; justify-content: center; }
.spotlight__art .phone { --pw: clamp(250px, 32vw, 316px); }

.ticks { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 16px; }
.ticks li { position: relative; padding-left: 34px; color: var(--muted); }
.ticks li strong { color: var(--ink); }
.ticks li::before {
  content: "✦"; position: absolute; left: 0; top: -1px;
  color: var(--optic); font-size: 1.05rem;
}

/* ============================================================
   Features — uniform tiles (identical size + identical screenshots)
   ============================================================ */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; grid-auto-rows: 1fr; }
.tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 28px 0; overflow: hidden; position: relative;
  display: flex; flex-direction: column;
  transition: transform 0.25s var(--ease), border-color 0.25s, background 0.25s;
}
.tile:hover { transform: translateY(-4px); border-color: var(--line-2); background: var(--card-2); }
.tile .ic { font-size: 1.6rem; display: block; margin-bottom: 14px; }
.tile h3 { font-size: 1.28rem; margin-bottom: 10px; }
.tile p { color: var(--muted); margin: 0; }
/* Screenshot pinned to the bottom of every tile → all shots the same size, same baseline */
.tile__shot { margin-top: auto; padding-top: 26px; display: flex; justify-content: center; }
.phone--tile {
  --pw: 158px; padding: 7px; border-radius: 34px;
  box-shadow: 0 22px 46px -26px rgba(0, 0, 0, 0.85);
}
.phone--tile img { border-radius: 28px; }
.phone--tile .phone__island { top: 15px; height: 12px; }

/* ============================================================
   Privacy
   ============================================================ */
.privacy__inner { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(32px, 6vw, 68px); align-items: center; }
.privacy__copy h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); margin-bottom: 18px; }
.privacy__copy > p { color: var(--muted); font-size: 1.1rem; margin: 0 0 22px; }
.privacy__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.privacy__list li {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px;
}
.privacy__list strong { color: var(--ink); }
.privacy__list div { color: var(--muted); }
.ic--sm { font-size: 1.4rem; flex: none; line-height: 1.3; }

/* ============================================================
   Pricing
   ============================================================ */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; max-width: 880px; margin: 0 auto; align-items: stretch; }
.plan {
  background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 34px 30px;
  display: flex; flex-direction: column; position: relative;
}
.plan--featured {
  background: linear-gradient(160deg, rgba(54, 197, 218, 0.12), rgba(255, 255, 255, 0.03));
  border-color: rgba(54, 197, 218, 0.4);
  box-shadow: 0 30px 70px -34px rgba(54, 197, 218, 0.5);
}
.plan__badge {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(150deg, var(--optic), var(--optic-2)); color: var(--court-deepest);
  font-weight: 800; font-size: 0.74rem; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 6px 16px; border-radius: 999px; white-space: nowrap;
}
.plan__name { font-size: 1.4rem; margin-bottom: 8px; }
.plan__price { display: flex; align-items: baseline; gap: 8px; margin: 0 0 6px; }
.plan__amount { font-family: var(--font-round); font-size: 3rem; font-weight: 800; letter-spacing: -0.03em; }
.plan__per { color: var(--muted); font-weight: 600; }
.plan__tag { color: var(--muted); margin: 0 0 22px; }
.plan__tag strong { color: var(--optic); }
.plan__list { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 12px; }
.plan__list li { position: relative; padding-left: 30px; color: var(--muted); }
.plan__list li strong { color: var(--ink); }
.plan__list li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 0.72rem; font-weight: 800; color: var(--court-deepest); background: var(--court);
}
.plan--featured .plan__list li::before { background: var(--optic); }
.plan__cta { margin-top: auto; width: 100%; }
.pricing__note { text-align: center; color: var(--muted-2); font-size: 0.86rem; margin: 26px auto 0; max-width: 52ch; }

/* ============================================================
   Final CTA
   ============================================================ */
.cta { position: relative; padding: clamp(64px, 9vw, 120px) 0; overflow: hidden; text-align: center; }
.cta__glow {
  position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(680px 340px at 50% 0%, rgba(54, 197, 218, 0.22), transparent 66%);
}
.cta__inner { position: relative; z-index: 1; max-width: 640px; margin-inline: auto; }
.cta__icon { border-radius: 20px; margin: 0 auto 24px; box-shadow: 0 20px 50px -18px rgba(0, 0, 0, 0.7); }
.cta h2 { font-size: clamp(2rem, 4.6vw, 3.2rem); margin-bottom: 14px; }
.cta p { color: var(--muted); font-size: 1.15rem; margin: 0 0 30px; }
.cta .appstore { margin-inline: auto; }

/* ============================================================
   Footer
   ============================================================ */
.footer { border-top: 1px solid var(--line); background: rgba(0, 0, 0, 0.25); padding: 56px 0 34px; margin-top: 20px; }
.footer__inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer__tag { color: var(--muted); margin: 14px 0 0; max-width: 32ch; }
.footer__col { display: flex; flex-direction: column; gap: 11px; }
.footer__col h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-2); margin-bottom: 4px; font-family: var(--font); font-weight: 700; }
.footer__col a { color: var(--muted); font-size: 0.95rem; transition: color 0.2s; width: fit-content; }
.footer__col a:hover { color: var(--court); }
.footer__legal { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 0.84rem; }
.footer__legal p { margin: 4px 0; }
.footer__fine { color: var(--muted-2); opacity: 0.8; }

/* ============================================================
   Reveal animation
   ============================================================ */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .reveal.in-view { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
  .hero__inner { grid-template-columns: 1fr; text-align: center; }
  .hero__copy { display: flex; flex-direction: column; align-items: center; }
  .lede { max-width: 46ch; }
  .hero__cta, .hero__trust { justify-content: center; }
  .hero__art { min-height: 0; margin-top: 12px; }
  .spotlight__inner { grid-template-columns: 1fr; }
  .spotlight__copy { text-align: center; }
  .spotlight__copy .eyebrow { justify-content: center; }
  .ticks { text-align: left; max-width: 560px; margin-inline: auto 28px; margin-inline: auto; }
  .spotlight__art { order: -1; }
  .privacy__inner { grid-template-columns: 1fr; }
  .privacy__copy { text-align: center; }
  .privacy__copy .eyebrow { justify-content: center; }
}

@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav .appstore--nav { margin-left: auto; }
  .steps { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .footer__inner { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  /* Nav: compact so brand + badge never collide */
  .nav__inner { height: 58px; gap: 10px; }
  .brand__name { font-size: 0.9rem; white-space: nowrap; }
  .brand__sub { display: none; }
  .brand__icon { width: 30px; height: 30px; }
  .appstore--nav { padding: 7px 13px; gap: 8px; }
  .appstore--nav .appstore__text small { display: none; }
  .appstore--nav .appstore__text strong { font-size: 0.92rem; }

  .hero { padding-top: 26px; }
  /* Trim big phones so the stacked page isn't endless */
  .hero__art .phone--hero { --pw: 208px; }
  .spotlight__art .phone { --pw: 206px; }
  .tiles { grid-template-columns: 1fr; max-width: 400px; margin-inline: auto; }
  .phone--tile { --pw: 168px; }
  .plans { grid-template-columns: 1fr; }
  .plan--featured { order: -1; }
  .footer__inner { grid-template-columns: 1fr; }
  .footer__legal { text-align: center; }

  /* Full-width CTAs — scoped so the nav badge stays compact */
  .hero__cta { width: 100%; flex-direction: column; align-items: stretch; }
  .hero__cta .btn { width: 100%; }
  .cta .appstore, .plan__cta { width: 100%; }
}

