@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400..700;1,9..144,400..700&family=DM+Sans:wght@400..700&display=swap");

/* Longer Stride, Clubhouse Copper palette: Court Green lead, cream ground, copper accent, oxblood labels, Rally Yellow for the ball only. */
:root {
  --bg: #F5F3EC;          /* Clubhouse Cream */
  --surface: #FFFDF8;
  --ink: #1F3A2E;         /* Court Green */
  --muted: #3F4F45;       /* Fairway Ink */
  --line: #E2DDD0;
  --edge: #8E8570;        /* answer borders, 3:1 on surface */
  --court: #1F3A2E;       /* primary buttons */
  --on-court: #F5F3EC;
  --court-soft: #DCE5D9;  /* Sage */
  --accent: #9A5B2A;      /* Deep Copper: progress, drill labels */
  --label: #6E2A2A;       /* Oxblood: eyebrows */
  --ball: #D7E04F;        /* Rally Yellow */
  --ball-ink: #1F3A2E;
  --notice: #F3E7D6;
  --err: #A8322A;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "DM Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --r: 14px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #13261E; --surface: #1F3A2E; --ink: #F5F3EC; --muted: #CFDCD3; --line: #3E6B55; --edge: #6F9A84;
  --court: #D9A273; --on-court: #1F3A2E; --court-soft: #2F5443; --accent: #D9A273; --label: #D9A273;
  --notice: #2F3B2A; --err: #F2A69B; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #13261E; --surface: #1F3A2E; --ink: #F5F3EC; --muted: #CFDCD3; --line: #3E6B55; --edge: #6F9A84;
  --court: #D9A273; --on-court: #1F3A2E; --court-soft: #2F5443; --accent: #D9A273; --label: #D9A273;
  --notice: #2F3B2A; --err: #F2A69B; color-scheme: dark }

*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font-body);
  font-size: 1.125rem; line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
a { color: var(--label); }
.wrap { max-width: 40rem; margin: 0 auto; padding-block: 20px 32px; display: flex; flex-direction: column; gap: 24px; min-height: 100vh; }
main { flex: 1; }

.brand { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.wordmark { display: inline-flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink); }
.wordmark .name { font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; line-height: 1; }
.wordmark .line { width: 9.5rem; height: auto; color: #D9A273; }
.brand .tag { font-family: var(--font-display); font-style: italic; color: var(--accent); font-size: 1.1rem; }

h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; line-height: 1.15; font-weight: 600; }
h1 { font-size: clamp(2rem, 7vw, 2.75rem); }
h1.result-h { font-size: clamp(1.6rem, 6vw, 2.2rem); }
h2 { font-size: clamp(1.45rem, 5vw, 1.8rem); }
h3 { font-size: 1.25rem; }
p { margin: 0; max-width: 62ch; }
.muted { color: var(--muted); }
.eyebrow { font-size: 0.875rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--label); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.screen { display: flex; flex-direction: column; gap: 20px; }

/* progress */
.progress { display: flex; flex-direction: column; gap: 8px; }
.progress .meta { display: flex; justify-content: space-between; font-size: 0.95rem; color: var(--muted); }
.progress .part { text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; color: var(--label); }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .25s ease; }

/* answers */
.answers { display: flex; flex-direction: column; gap: 10px; }
.opt {
  width: 100%; text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--surface); border: 2px solid var(--edge); border-radius: var(--r);
  padding: 16px 18px; min-height: 60px; line-height: 1.35;
  transition: border-color .15s, background .15s;
}
.opt:hover { border-color: var(--court); }
.opt[aria-pressed="true"] { border-color: var(--court); background: var(--court-soft); }
.opt:focus-visible, .btn:focus-visible, .link:focus-visible, input:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.btn {
  font: inherit; font-weight: 700; cursor: pointer; border-radius: 99px; padding: 14px 26px; min-height: 54px;
  background: var(--court); color: var(--on-court); border: 2px solid var(--court);
}
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.link { background: none; border: 0; padding: 12px 0; min-height: 48px; font: inherit; color: var(--ink); text-decoration: underline; cursor: pointer; }
.nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
label.field span.hint { font-weight: 400; color: var(--muted); font-size: 1rem; }
input[type="email"], input[type="text"], input[type="number"] {
  font: inherit; color: var(--ink); background: var(--surface); border: 2px solid var(--edge);
  border-radius: 12px; padding: 12px 14px; min-height: 54px; width: 100%;
}
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 1.05rem; }
.check input { width: 28px; height: 28px; margin-top: 0; flex: none; accent-color: var(--court); }
.err { color: var(--err); font-weight: 700; font-size: 1rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice { background: var(--notice); border-radius: 12px; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }

/* intro facts */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.facts b { display: block; font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; }
.facts span { color: var(--muted); font-size: 1rem; }
@media (max-width: 380px) { .facts { grid-template-columns: 1fr; } }

/* result */
.hero { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px 20px; display: flex; flex-direction: column; gap: 14px; }
.levelnum { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ball {
  width: 112px; height: 112px; border-radius: 50%; background: var(--ball); color: var(--ball-ink);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 2.4rem;
  font-variant-numeric: tabular-nums; flex: none;
  background-image: radial-gradient(circle at 30% 30%, rgba(0,0,0,.09) 0 4px, transparent 5px), radial-gradient(circle at 70% 35%, rgba(0,0,0,.09) 0 4px, transparent 5px), radial-gradient(circle at 45% 72%, rgba(0,0,0,.09) 0 4px, transparent 5px), radial-gradient(circle at 76% 70%, rgba(0,0,0,.09) 0 4px, transparent 5px);
}
.levelnum .lbl { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.scale { position: relative; height: 54px; margin-top: 4px; }
.scale .track { position: absolute; left: 0; right: 0; top: 14px; height: 12px; border-radius: 99px; background: var(--court-soft); border: 1px solid var(--line); }
.scale .band { position: absolute; top: 14px; height: 12px; border-radius: 99px; background: var(--accent); opacity: .6; }
.scale .dot { position: absolute; top: 8px; width: 24px; height: 24px; margin-left: -12px; border-radius: 50%; background: var(--ball); border: 3px solid var(--ink); }
.scale .ticks { position: absolute; left: 0; right: 0; top: 32px; display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.leak { display: grid; grid-template-columns: 2.25rem 1fr; gap: 12px; align-items: start; }
.leak > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.leak .n { width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--court-soft); color: var(--ink); display: grid; place-items: center; font-weight: 700; }
.pill { display: inline-block; font-size: 0.85rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.weeks { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.weeks li { display: grid; grid-template-columns: 4.5rem 1fr; gap: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.weeks li b { color: var(--muted); font-weight: 700; }
dl.math { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 12px 0 0; font-size: 1rem; }
dl.math dt { color: var(--muted); }
dl.math dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px; }
details summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.share { border: 2px dashed var(--edge); border-radius: var(--r); padding: 16px; font-family: var(--font-display); font-size: 1.15rem; overflow-wrap: anywhere; }

/* footer and text pages */
.foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 16px; color: var(--muted); font-size: 1rem; }
.foot a { color: var(--muted); min-height: 48px; display: inline-flex; align-items: center; }
.prose { display: flex; flex-direction: column; gap: 16px; }
.prose h2 { margin-top: 12px; }
.prose ul { margin: 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: 6px; }

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

/* drill and warm-up pages */
.prose ol { margin: 0; padding-left: 1.5rem; display: flex; flex-direction: column; gap: 8px; }
.drill-facts { grid-template-columns: 1fr 2fr; }
.facts b.small { font-family: var(--font-body); font-size: 1.05rem; font-weight: 700; line-height: 1.35; }
.card.pass { background: var(--court-soft); border-color: transparent; }
.pass-line { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; }
.drill-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.drill-links a { display: flex; gap: 10px; align-items: baseline; min-height: 48px; padding: 10px 0; color: var(--ink); font-weight: 700; }
.drill-links .pill { min-width: 6.5rem; }
ol.moves { list-style: none; padding: 0; }
.moves h2 { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.moves .time { font-family: var(--font-body); font-size: 1rem; font-weight: 400; }
.prose .btn { text-decoration: none; display: inline-flex; align-items: center; }
.drill-more { font-weight: 700; color: var(--ink); min-height: 48px; display: inline-flex; align-items: center; }
@media (max-width: 380px) { .drill-facts { grid-template-columns: 1fr; } }
