/* ============================================================
   HoopScape marketing site — shared design system
   Brand: #E6611A (basketball orange). System-font stack (no
   third-party font requests → faster + no GDPR font-CDN concern).
   Light-first, with a dark theme via prefers-color-scheme to
   mirror the app's `userInterfaceStyle: "automatic"`.
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-warm: #faf7f2;
  --surface: #ffffff;
  --ink: #1a1410;
  --text: #38322b;
  --dim: #6b635a;
  --mute: #756f66; /* WCAG AA (>=4.5:1 on white) for small captions */
  --line: #ece4d9;
  --line-strong: #ddd3c5;
  --accent: #e6611a;              /* brand identity — non-text (dots, borders, focus, SVG) */
  --accent-ink: #b8480f;          /* text-safe orange: >=4.5:1 on white/warm/soft */
  --accent-soft: #fcebdd;
  --btn-bg: #b8480f;              /* filled-button surface — white label = 5.3:1 */
  --btn-bg-hover: #9f3f0c;
  --btn-fg: #ffffff;
  --deep: #1b1611;
  --deep-2: #241d16;
  --deep-text: #eee7db;
  --deep-dim: #b3a898;
  --deep-line: #372e24;
  --good: #1f9d55;
  --shadow-sm: 0 1px 2px rgba(40, 28, 16, .05), 0 4px 12px rgba(40, 28, 16, .05);
  --shadow-md: 0 2px 6px rgba(40, 28, 16, .06), 0 14px 36px rgba(40, 28, 16, .09);
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --wrap: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131009;
    --bg-warm: #1a150f;
    --surface: #1e1811;
    --ink: #f4eee3;
    --text: #d3cabd;
    --dim: #a39a8d;
    --mute: #8c8377; /* WCAG AA on the dark ground */
    --line: #2a2219;
    --line-strong: #382f24;
    --accent: #ff7c3c;
    --accent-ink: #ff955f;
    --accent-soft: #35210f;
    --btn-bg: #ff7c3c;            /* dark theme: bright fill + dark label = ~7:1 */
    --btn-bg-hover: #ff945e;
    --btn-fg: #17120c;
    --deep: #0e0b07;
    --deep-2: #171209;
    --deep-text: #f0e9dd;
    --deep-dim: #a99e8d;
    --deep-line: #2c241b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 12px rgba(0, 0, 0, .35);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, .45), 0 16px 40px rgba(0, 0, 0, .5);
  }
}

/* ---------- reset-ish ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--ink); line-height: 1.1; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- layout ---------- */
/* Clear the 64px sticky header when jumping to an in-page anchor (#features, #delete…). */
[id] { scroll-margin-top: 84px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(20px, 5vw, 40px); }
.section { padding: clamp(56px, 9vw, 104px) 0; }
.section--warm { background: var(--bg-warm); border-block: 1px solid var(--line); }
.eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-ink); margin-bottom: 14px;
}
.section-head { max-width: 60ch; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head h2 { font-size: clamp(28px, 4.4vw, 42px); font-weight: 800; }
.section-head p { margin-top: 16px; font-size: clamp(17px, 2vw, 19px); color: var(--dim); }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.top-inner { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--ink); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; opacity: .85; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-wordmark { height: 26px; width: auto; display: block; }
.brand-wordmark--footer { height: 26px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nav a.navlink { display: inline-flex; align-items: center; min-height: 44px; color: var(--dim); font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: var(--r-sm); }
.nav a.navlink:hover { color: var(--ink); background: var(--bg-warm); text-decoration: none; }
/* These hide rules must out-specify `.nav a.navlink` above (0,2,1). A media
   query adds no specificity, so the plainer `.nav .hide-sm` (0,2,0) lost the
   cascade and the links stayed visible at every width. */
@media (max-width: 640px) { .nav a.navlink.hide-sm { display: none; } }
/* Narrow phones: drop the text nav links so brand + CTA never overflow the row. */
@media (max-width: 460px) {
  .top-inner { gap: 8px; }
  .brand-wordmark { height: 22px; }
  .nav a.navlink { display: none; }
  .btn--nav { padding: 8px 14px; font-size: 14px; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 700; font-size: 16px; line-height: 1; cursor: pointer;
  padding: 13px 22px; min-height: 44px; border-radius: 999px; border: 1.5px solid transparent;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--btn-bg); color: var(--btn-fg); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 34%, transparent); }
.btn--primary:hover { background: var(--btn-bg-hover); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--dim); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-ink); }
/* Slimmer variant for the sticky header (still >=44px tall via .btn min-height). */
.btn--nav { padding: 9px 18px; font-size: 15px; }

/* store buttons */
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store {
  display: inline-flex; align-items: center; gap: 11px;
  background: var(--ink); color: var(--bg); border-radius: 13px;
  padding: 10px 18px 10px 16px; border: 1.5px solid var(--ink);
  transition: transform .12s ease, opacity .15s ease;
}
.store:hover { text-decoration: none; transform: translateY(-1px); opacity: .92; }
.store svg { width: 24px; height: 24px; flex: none; fill: var(--bg); }
.store .store-txt { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.store .store-top { font-size: 10.5px; letter-spacing: .02em; opacity: .82; }
.store .store-big { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.store[aria-disabled="true"] { pointer-events: none; opacity: .55; }

/* ---------- hero ---------- */
.hero { padding: clamp(48px, 8vw, 92px) 0 clamp(40px, 7vw, 80px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero h1 { font-size: clamp(38px, 6.4vw, 66px); font-weight: 800; letter-spacing: -.035em; }
.hero h1 .hl { color: var(--accent); }
.lede { margin-top: 22px; font-size: clamp(18px, 2.4vw, 21px); color: var(--dim); max-width: 44ch; }
.cta-row { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero-note { margin-top: 18px; font-size: 14px; color: var(--mute); }
.hero-visual { position: relative; }
.court { width: 100%; height: auto; filter: drop-shadow(0 30px 50px rgba(40,28,16,.14)); }
.hero-lockup { width: 100%; max-width: 340px; height: auto; display: block; margin: 0 auto; filter: drop-shadow(0 24px 44px rgba(40,28,16,.16)); }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 440px; margin: 0 auto; }
}

/* ---------- platform strip ---------- */
.platforms { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center; color: var(--dim); font-weight: 600; font-size: 15px; }
.platforms .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); display: inline-block; margin-right: 10px; vertical-align: middle; }

/* ---------- features ---------- */
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 720px) { .features { grid-template-columns: 1fr; } }
.feature {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 28px; box-shadow: var(--shadow-sm);
}
.feature .ic {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink); margin-bottom: 18px;
}
.feature .ic svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; }
.feature h3 { font-size: 20px; font-weight: 700; }
.feature p { margin-top: 9px; color: var(--dim); font-size: 15.5px; }

/* ---------- how it works ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: step; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding-top: 6px; }
.step .n {
  font-size: 13px; font-weight: 800; letter-spacing: .08em; color: var(--accent-ink);
  display: inline-flex; align-items: center; gap: 9px; margin-bottom: 12px;
}
.step .n::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  background: var(--accent-soft); color: var(--accent-ink); border-radius: 8px;
  padding: 3px 8px; font-variant-numeric: tabular-nums;
}
.step h3 { font-size: 19px; font-weight: 700; }
.step p { margin-top: 8px; color: var(--dim); font-size: 15.5px; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--deep); color: var(--deep-text); border-radius: var(--r-lg); padding: clamp(36px, 6vw, 64px); text-align: center; }
.cta-band h2 { color: #fff; font-size: clamp(26px, 4vw, 40px); font-weight: 800; }
.cta-band p { margin: 16px auto 0; max-width: 52ch; color: var(--deep-dim); font-size: 18px; }
.cta-band .stores, .cta-band .cta-row { justify-content: center; margin-top: 28px; }

/* ---------- footer ---------- */
.foot { background: var(--deep); color: var(--deep-dim); padding: 60px 0 40px; }
.foot-top { display: flex; flex-wrap: wrap; gap: 32px 64px; justify-content: space-between; padding-bottom: 36px; border-bottom: 1px solid var(--deep-line); }
.foot-brand { max-width: 34ch; }
.foot-brand .brand { color: var(--deep-text); }
.foot-brand p { margin-top: 14px; font-size: 14.5px; color: var(--deep-dim); }
.foot-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.foot-col h2 { color: var(--deep-text); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 14px; }
.foot-col a { display: block; color: var(--deep-dim); font-size: 15px; padding: 8px 0; }
.foot-col a:hover { color: var(--accent); text-decoration: none; }
.foot-bottom { padding-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; font-size: 13.5px; color: var(--deep-dim); }

/* ---------- page hero (support / legal) ---------- */
.page-hero { padding: clamp(48px, 7vw, 84px) 0 clamp(28px, 4vw, 44px); border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(34px, 5.2vw, 52px); font-weight: 800; }
.page-hero p { margin-top: 16px; font-size: 19px; color: var(--dim); max-width: 60ch; }
.breadcrumb { font-size: 14px; color: var(--mute); margin-bottom: 18px; }
.breadcrumb a { color: var(--dim); }

/* ---------- prose (legal + support copy) ---------- */
.prose { max-width: 74ch; overflow-wrap: break-word; }
.prose > * + * { margin-top: 20px; }
.prose h2 { font-size: 24px; font-weight: 700; margin-top: 44px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 19px; font-weight: 700; margin-top: 28px; }
.prose p, .prose li { color: var(--text); font-size: 16.5px; line-height: 1.7; }
.prose ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose strong { color: var(--ink); font-weight: 700; }
.prose .updated { font-size: 14.5px; color: var(--mute); }
.prose code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; background: var(--bg-warm); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

/* ---------- FAQ ---------- */
.faq { max-width: 78ch; display: flex; flex-direction: column; gap: 12px; }
.qa { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); overflow: hidden; }
.qa summary {
  cursor: pointer; list-style: none; padding: 20px 22px; font-weight: 700; font-size: 17px; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; font-size: 24px; font-weight: 400; color: var(--accent); line-height: 1; flex: none; transition: transform .2s ease; }
.qa[open] summary::after { transform: rotate(45deg); }
.qa .qa-body { padding: 0 22px 22px; color: var(--dim); font-size: 16px; line-height: 1.65; }
.qa .qa-body > * + * { margin-top: 12px; }
.qa .qa-body a { text-decoration: underline; }

/* ---------- contact card ---------- */
.contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-bottom: 44px; }
.contact-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 24px; box-shadow: var(--shadow-sm); }
.contact-card .ic { width: 42px; height: 42px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; margin-bottom: 14px; }
.contact-card .ic svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }
.contact-card h3 { font-size: 18px; font-weight: 700; }
.contact-card p { margin-top: 7px; color: var(--dim); font-size: 15px; }
.contact-card a.big { display: inline-block; margin-top: 12px; font-size: 16px; font-weight: 700; color: var(--accent-ink); }

/* ---------- misc ---------- */
.center { text-align: center; }
.mt-lg { margin-top: 44px; }
.notice {
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--r-md); padding: 18px 20px; font-size: 15.5px; color: var(--text);
}
.notice strong { color: var(--accent-ink); }
.skip {
  position: absolute; left: 12px; top: -60px; background: var(--btn-bg); color: var(--btn-fg);
  padding: 10px 16px; border-radius: 8px; font-weight: 700; z-index: 100; transition: top .15s ease;
}
.skip:focus { top: 12px; text-decoration: none; }
.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;
}
