/* Match&Match landing page (pricing test).
   Layout concept: a court seen from above — navy baseline (hero), chalk court,
   lime kitchen line around the plans. Same tokens as the app (src/theme/tokens.ts). */

@font-face { font-family: 'Barlow'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/Barlow_400Regular.ttf') format('truetype'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-style: normal; font-display: swap; src: url('fonts/Barlow_600SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'Barlow'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/Barlow_700Bold.ttf') format('truetype'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 800; font-style: normal; font-display: swap; src: url('fonts/BarlowCondensed_800ExtraBold.ttf') format('truetype'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 800; font-style: italic; font-display: swap; src: url('fonts/BarlowCondensed_800ExtraBold_Italic.ttf') format('truetype'); }

:root {
  color-scheme: light;
  --navy: #0b1a33;
  --navy-2: #13284a;
  --navy-3: #1b3260;
  --chalk: #f3f5f8;
  --surface: #ffffff;
  --line: #d8dee8;
  --ink: #0b1a33;
  --ink-2: #4a5873;
  --ink-inv-2: #c9d3e6;
  --lime: #c8fa3c;
  --lime-pressed: #b2e52a;
  --blue: #2b59ff;
  --blue-soft: #e5ebff;
  --coral: #ff5c4d;
  --danger: #c62f3d;
  --warning-soft: #fff3dc;
  --warning: #7a4700;

  --display: 'Barlow Condensed', 'Arial Narrow', 'Barlow', sans-serif;
  --body: 'Barlow', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* type scale */
  --t-xs: 0.875rem;  /* 14 */
  --t-s: 1rem;       /* 16 */
  --t-m: 1.125rem;   /* 18 */
  --t-l: 1.375rem;   /* 22 */
  --t-xl: 1.75rem;   /* 28 */
  --t-2xl: 2.5rem;   /* 40 */
  --t-3xl: clamp(2.75rem, 8.4vw, 5.25rem);

  --r-card: 28px;
  --r-ctl: 14px;
  --gutter: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--chalk);
  color: var(--ink);
  font: 400 var(--t-m)/1.55 var(--body);
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 50; background: var(--lime); color: var(--navy); padding: 8px 14px; border-radius: 10px; }

/* Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 26px; border-radius: 999px;
  font: 700 var(--t-m)/1 var(--body); text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: background-color .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn-lime { background: var(--lime); color: var(--navy); }
.btn-lime:hover { background: var(--lime-pressed); }
.btn-navy { background: var(--navy); color: var(--lime); }
.btn-navy:hover { background: var(--navy-3); }
.btn-ghost { color: #fff; border-color: rgba(255,255,255,.35); background: transparent; }
.btn-ghost:hover { border-color: #fff; }
.btn-outline { background: var(--surface); color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--chalk); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* Top bar --------------------------------------------------------------- */
.bar { background: var(--navy); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--navy); z-index: 21; }
.bar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: italic 800 1.625rem/1 var(--display); }
.ball {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  background:
    radial-gradient(circle at 50% 50%, var(--navy) 0 9%, transparent 10%),
    radial-gradient(circle at 50% 29%, var(--navy) 0 8%, transparent 9%),
    radial-gradient(circle at 68% 39%, var(--navy) 0 8%, transparent 9%),
    radial-gradient(circle at 68% 61%, var(--navy) 0 8%, transparent 9%),
    radial-gradient(circle at 50% 71%, var(--navy) 0 8%, transparent 9%),
    radial-gradient(circle at 32% 61%, var(--navy) 0 8%, transparent 9%),
    radial-gradient(circle at 32% 39%, var(--navy) 0 8%, transparent 9%),
    var(--lime);
}
.brand .amp { color: var(--lime); padding: 0 1px; }
.bar-link { color: var(--lime); font-weight: 700; text-decoration: none; font-size: var(--t-s); padding: 10px 0; }
.bar-link:hover { text-decoration: underline; }

/* Hero ------------------------------------------------------------------ */
.hero {
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(255,255,255,.06) calc(50% - 1px), rgba(255,255,255,.06) calc(50% + 1px), transparent calc(50% + 1px)),
    radial-gradient(ellipse 70% 60% at 70% 40%, #1a3466 0%, rgba(11,26,51,0) 70%),
    var(--navy);
  color: #fff;
  padding-block: 40px 56px;
  overflow: hidden;
}
.hero-grid { display: grid; gap: 40px; align-items: center; }
.hero h1 { font: italic 800 var(--t-3xl)/0.95 var(--display); letter-spacing: -0.5px; max-width: 13ch; }
.lede { margin-top: 18px; font-size: var(--t-l); line-height: 1.45; color: var(--ink-inv-2); max-width: 34ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.fine { margin-top: 14px; font-size: var(--t-xs); color: var(--ink-2); }
.hero .fine { color: var(--ink-inv-2); }

/* Player card deck */
.deck { position: relative; margin: 0 auto 30px; width: min(320px, 82vw); aspect-ratio: 320 / 418; max-width: 100%; }
.pcard { position: absolute; inset: 0; border-radius: var(--r-card); background: var(--surface); color: var(--ink); overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.45); }
.pcard img { width: 100%; height: 66%; object-fit: cover; }
.pcard-back2 { transform: translate(-10%, -4%) rotate(-9deg) scale(.9); opacity: .55; }
.pcard-back1 { transform: translate(8%, -2%) rotate(6deg) scale(.95); opacity: .8; }
.pcard-top { transform: rotate(-2deg); }
.pcard-photo { position: relative; height: 66%; }
.pcard-photo img { height: 100%; }
.pcard-photo::after { content: ""; position: absolute; inset: 40% 0 0; background: linear-gradient(rgba(11,26,51,0), rgba(11,26,51,.88)); }
.level { position: absolute; left: 14px; top: 14px; z-index: 1; width: 64px; height: 64px; border-radius: 16px; background: var(--lime); color: var(--navy); display: flex; flex-direction: column; align-items: center; justify-content: center; font: 700 .75rem/1 var(--body); }
.level b { font: 800 2rem/0.9 var(--display); }
.pcard-id { position: absolute; left: 18px; bottom: 14px; z-index: 1; display: grid; gap: 2px; }
.pname { font: 800 2.6rem/1 var(--display); color: #fff; }
.ploc { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-weight: 600; font-size: var(--t-s); }
.pin { width: 12px; height: 12px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--lime); }
.mi { background: var(--lime); color: var(--navy); border-radius: 999px; padding: 1px 9px; font-weight: 700; font-size: var(--t-xs); }
.pcard-body { padding: 14px 16px; display: grid; gap: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { background: #eaeef4; border-radius: 10px; padding: 5px 10px; font-size: var(--t-xs); font-weight: 600; }
.fitrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fit { background: var(--blue-soft); color: var(--blue); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: var(--t-s); }
.stamp { font: italic 800 1.25rem/1 var(--display); color: var(--navy); background: var(--lime); padding: 6px 12px; border-radius: 10px; transform: rotate(-4deg); }
.deck figcaption { position: absolute; left: 0; right: 0; bottom: -30px; text-align: center; font-size: var(--t-xs); color: var(--ink-inv-2); }

@media (prefers-reduced-motion: no-preference) {
  .pcard-top { animation: deal .7s cubic-bezier(.2,.9,.3,1.2) both .15s; }
  .stamp { animation: stamp .35s cubic-bezier(.2,.9,.3,1.4) both 1s; }
  @keyframes deal { from { transform: translate(40%, 14%) rotate(14deg); opacity: 0; } to { transform: rotate(-2deg); opacity: 1; } }
  @keyframes stamp { from { transform: rotate(-4deg) scale(1.8); opacity: 0; } to { transform: rotate(-4deg) scale(1); opacity: 1; } }
}

/* Sections -------------------------------------------------------------- */
.section { padding-block: 64px; }
.section-alt { background: var(--surface); }
.section h2 { font: italic 800 var(--t-2xl)/1 var(--display); }
.sub { margin-top: 12px; font-size: var(--t-m); color: var(--ink-2); max-width: 52ch; }

/* Scoreboard (pain) */
.scoreboard { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 16px; }
.score { display: grid; gap: 14px; align-content: start; }
.score-face {
  display: grid; grid-template-columns: 1fr 10px 1fr; align-items: center;
  background: var(--navy); border-radius: 22px; padding: 18px 14px;
  border: 3px solid var(--navy-3);
}
.digits {
  display: grid; justify-items: center; color: #fff;
  font: 800 clamp(3rem, 12vw, 4.25rem)/0.9 var(--display); letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.digits small { font: 700 var(--t-xs)/1.2 var(--body); letter-spacing: .6px; color: var(--ink-inv-2); margin-top: 6px; }
.digits.coral { color: var(--coral); }
.sep { width: 10px; height: 6px; border-radius: 3px; background: var(--ink-inv-2); justify-self: center; }
.score p { color: var(--ink-2); }
.score strong { color: var(--ink); display: block; font-size: var(--t-l); line-height: 1.25; margin-bottom: 4px; }

/* Steps */
.steps { list-style: none; counter-reset: step; margin: 28px 0 0; padding: 0; display: grid; gap: 16px; }
.steps li { counter-increment: step; position: relative; padding: 22px 22px 22px 76px; border-radius: 22px; background: var(--chalk); }
.steps li::before {
  content: counter(step); position: absolute; left: 18px; top: 18px;
  width: 42px; height: 42px; border-radius: 50%; background: var(--navy); color: var(--lime);
  display: grid; place-items: center; font: italic 800 1.5rem/1 var(--display);
}
.steps h3 { font-size: var(--t-l); line-height: 1.25; }
.steps p { margin-top: 6px; color: var(--ink-2); }

.fitbox { margin-top: 32px; padding: 24px; border-radius: 22px; border: 2px solid var(--line); }
.fitbox h3 { font: italic 800 var(--t-xl)/1.05 var(--display); }
.fitbox > p { margin-top: 6px; color: var(--ink-2); }
.fitbar { margin-top: 18px; display: flex; gap: 4px; min-height: 64px; border-radius: 14px; overflow: hidden; }
.seg { display: flex; flex-direction: column; justify-content: center; padding: 8px 10px; font-size: var(--t-xs); font-weight: 600; min-width: 0; line-height: 1.2; }
.seg b { font: 800 1.5rem/1 var(--display); }
.seg-dist { flex: 35; background: var(--navy); color: #fff; }
.seg-skill { flex: 30; background: var(--blue); color: #fff; }
.seg-time { flex: 20; background: var(--lime); color: var(--navy); }
.seg-style { flex: 15; background: #dfe5ee; color: var(--navy); }

/* Plans ----------------------------------------------------------------- */
.plans-band { background: var(--navy); color: #fff; position: relative; }
.plans-band::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--lime); }
.plans-band .sub { color: var(--ink-inv-2); }
.plans { margin-top: 32px; display: grid; gap: 18px; align-items: stretch; }
.plan {
  position: relative; display: flex; flex-direction: column; gap: 18px;
  background: var(--navy-2); border: 2px solid var(--navy-3); border-radius: var(--r-card); padding: 26px 24px 24px;
}
.plan h3 { font: italic 800 2.4rem/0.95 var(--display); }
.plan-for { margin-top: 4px; color: var(--ink-inv-2); font-weight: 600; }
.price { margin-top: 14px; display: flex; align-items: baseline; gap: 4px; }
.amount { font: italic 800 4rem/0.9 var(--display); letter-spacing: -1px; }
.per { font-weight: 700; color: var(--ink-inv-2); }
.feat { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; flex: 1; }
.feat li { position: relative; padding-left: 28px; line-height: 1.4; }
.feat li::before { content: ""; position: absolute; left: 2px; top: .3em; width: 14px; height: 8px; border-left: 3px solid var(--lime); border-bottom: 3px solid var(--lime); transform: rotate(-45deg); }
.plan .btn { width: 100%; }
.plan-plus { background: var(--lime); color: var(--navy); border-color: var(--lime); }
.plan-plus .plan-for, .plan-plus .per { color: #33521a; }
.plan-plus .feat li::before { border-color: var(--navy); }
.plan-pro { border-color: var(--blue); }
.badge { position: absolute; top: -14px; left: 24px; background: var(--navy); color: var(--lime); border: 2px solid var(--lime); border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: var(--t-xs); }
.plans-note { margin-top: 22px; font-size: var(--t-xs); color: var(--ink-inv-2); max-width: 70ch; }

/* Safety ---------------------------------------------------------------- */
.facts { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 22px; }
.facts li { border-top: 3px solid var(--navy); padding-top: 14px; }
.facts h3 { font-size: var(--t-l); line-height: 1.25; }
.facts p { margin-top: 4px; color: var(--ink-2); }

/* FAQ ------------------------------------------------------------------- */
.faq > * { max-width: 820px; }
.faq h2 { margin-bottom: 18px; }
.faq details { border-bottom: 2px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 40px 18px 0; position: relative; font-weight: 700; font-size: var(--t-l); line-height: 1.3; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 12px; font: 800 2rem/1 var(--display); color: var(--blue); }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding-bottom: 18px; color: var(--ink-2); max-width: 65ch; }

/* Closer ---------------------------------------------------------------- */
.closer { background: var(--lime); padding-block: 56px; }
.closer-inner { display: grid; gap: 22px; justify-items: start; }
.closer h2 { font: italic 800 clamp(2.4rem, 7vw, 4rem)/0.95 var(--display); max-width: 16ch; }

/* Footer ---------------------------------------------------------------- */
.foot { background: var(--navy); color: var(--ink-inv-2); padding-block: 32px 40px; font-size: var(--t-xs); }
.foot nav { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-bottom: 14px; }
.foot a { color: #fff; }

/* Dialog ---------------------------------------------------------------- */
dialog {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92vh;
  background: transparent; color: var(--ink); overflow: visible;
}
dialog::backdrop { background: rgba(11, 26, 51, .72); }
.sheet {
  position: relative; background: var(--surface); border-radius: 26px 26px 0 0; padding: 26px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  max-height: 92vh; overflow-y: auto;
}
@media (min-width: 640px) {
  dialog { margin: auto; }
  .sheet { border-radius: 26px; padding: 32px 30px 28px; }
}
@media (prefers-reduced-motion: no-preference) {
  dialog[open] .sheet { animation: rise .28s cubic-bezier(.2,.9,.3,1) both; }
  @keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
}
.close { position: absolute; right: 12px; top: 10px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--chalk); font: 700 1.6rem/1 var(--body); color: var(--navy); cursor: pointer; }
.sheet h2 { font: italic 800 2.2rem/1 var(--display); padding-right: 48px; }
.seg-plans { border: 0; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg-plans legend { font-weight: 700; font-size: var(--t-s); margin-bottom: 8px; padding: 0; }
.seg-plans label { position: relative; }
.seg-plans input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-plans span { display: grid; justify-items: center; gap: 2px; padding: 10px 6px; border-radius: var(--r-ctl); border: 2px solid var(--line); font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); text-align: center; }
.seg-plans b { font: italic 800 1.35rem/1 var(--display); color: var(--ink); }
.seg-plans input:checked + span { border-color: var(--navy); background: var(--navy); color: var(--ink-inv-2); }
.seg-plans input:checked + span b { color: var(--lime); }
.seg-plans input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }

#join-form { margin-top: 20px; display: grid; gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field label { font-weight: 700; font-size: var(--t-s); }
.opt { font-weight: 400; color: var(--ink-2); }
.field input, .field select {
  width: 100%; min-height: 52px; border-radius: var(--r-ctl); border: 2px solid var(--line); background: var(--surface);
  padding: 0 14px; font: 400 var(--t-m) var(--body); color: var(--ink);
}
.field input:focus, .field select:focus { border-color: var(--blue); outline: none; }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.err { color: var(--danger); font-size: var(--t-xs); font-weight: 600; }
.check { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; font-size: var(--t-s); line-height: 1.4; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--navy); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
#join-done-view { display: grid; gap: 14px; }
#join-done-view[hidden] { display: none; }
#done-text { color: var(--ink-2); }
.notice { background: var(--warning-soft); color: var(--warning); border-radius: 14px; padding: 12px 14px; font-size: var(--t-s); font-weight: 600; }
.wtp { border: 2px solid var(--line); border-radius: 18px; margin: 4px 0 0; padding: 16px; }
.wtp legend { font-weight: 700; padding: 0 6px; font-size: var(--t-s); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chips span { display: inline-block; min-width: 64px; text-align: center; padding: 10px 14px; border-radius: 999px; border: 2px solid var(--line); font-weight: 700; }
.chips input:checked + span { background: var(--navy); color: var(--lime); border-color: var(--navy); }
.chips input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.thanks { margin-top: 10px; color: #16804b; font-weight: 600; font-size: var(--t-s); }
.done-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.done-actions .btn { flex: 1 1 200px; }

/* Wider screens --------------------------------------------------------- */
@media (min-width: 720px) {
  .scoreboard { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .steps li { padding: 70px 22px 24px; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .plans { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plan-plus { transform: translateY(-10px); }
  /* Equal columns on tablets: the price shrinks instead of squeezing the Free card. */
  .amount { font-size: clamp(2.875rem, calc(7.08vw - 4px), 4rem); }
}
@media (min-width: 960px) {
  .hero { padding-block: 72px 88px; }
  .hero-grid { grid-template-columns: 1.15fr .85fr; gap: 56px; }
  .deck { width: 340px; }
  .facts { grid-template-columns: repeat(4, 1fr); }
  .closer-inner { grid-template-columns: 1fr auto; align-items: center; }
}
