/* ==========================================================================
   SAT RALLY - btc.tennis
   The page IS a top-down tennis court. Clay, white lines, optic yellow.
   ========================================================================== */

:root {
  --clay: #B04A25;
  --clay-deep: #8A3719;
  --clay-dark: #5E2410;
  --line: #FFFFFF;
  --optic: #DFF21E;
  --ink: #1A1410;
  --ink-2: #2A211B;
  --net: #CFC6BD;
  --green: #1F5A3D;
  --green-deep: #174631;
  --paper: #F4EEE8;

  --focus: var(--optic);

  --font-display: Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Narrow", Arial, sans-serif;
  --font-body: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --lw: clamp(3px, 0.45vw, 5px);
  --inset: clamp(8px, 3.2vw, 46px);
  --gut: clamp(14px, 3vw, 40px);
  --page-m: clamp(8px, 2vw, 32px);

  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2.25rem;
  --s-7: 3.5rem;
  --s-8: 5rem;

  --shadow-hard: 0 4px 0 var(--ink), 0 12px 18px rgba(26, 20, 16, 0.35);
  --shadow-soft: 0 2px 0 rgba(26, 20, 16, 0.5), 0 18px 30px -12px rgba(0, 0, 0, 0.55);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: #fff;
  background-color: var(--green);
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 64px, transparent 64px 128px);
  overflow-x: hidden;
}

img, svg { max-width: 100%; }
svg { display: block; }

h1, h2, h3, h4 {
  margin: 0 0 var(--s-3);
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.015em;
  line-height: 0.98;
  overflow-wrap: anywhere;
}
h1 { font-size: clamp(2.8rem, 9vw, 6.2rem); }
h2 { font-size: clamp(1.9rem, 4.6vw, 3.2rem); }
h3 { font-size: clamp(1.3rem, 2.6vw, 1.75rem); }
h4 { font-size: 1.15rem; }

p { margin: 0 0 var(--s-4); max-width: 68ch; }
ul, ol { margin: 0 0 var(--s-4); padding-left: 1.25rem; }
li { margin-bottom: var(--s-2); }

a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 4px; }

strong { font-weight: 800; }
code, kbd {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.9em;
}
kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 0.05em 0.45em;
  text-align: center;
  color: var(--ink);
  background: var(--net);
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 0 2px 0 var(--ink);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: fixed;
  top: -4rem; left: var(--s-3);
  z-index: 200;
  padding: 0.7rem 1.1rem;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
  background: var(--optic);
  border: 3px solid var(--ink);
  border-radius: 8px;
  text-decoration: none;
}
.skip:focus { top: var(--s-3); }

/* ---------- Scoreboard strip (header) ---------- */
.scorebar {
  background: var(--ink);
  border-bottom: 5px solid var(--optic);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 50;
}
.scorebar__in {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: space-between;
  gap: var(--s-2) var(--s-5);
  width: min(100% - 2 * var(--page-m), 1180px);
  margin: 0 auto;
  padding: var(--s-2) 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 44px;
  color: #fff;
  text-decoration: none;
}
.brand__ball { width: 34px; height: 34px; flex: none; }
.brand__name {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}
.brand__name b { color: var(--optic); font-weight: 400; }
.scorenav { flex: 1 1 100%; }
.scorenav ul {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
  margin: 0; padding: 0;
  list-style: none;
}
.scorenav li { margin: 0; }
.scorenav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0.3rem 0.2rem;
  font-family: var(--font-display);
  font-size: clamp(0.82rem, 3.4vw, 1.2rem);
  letter-spacing: 0.05em;
  line-height: 1.1;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  background: var(--ink-2);
  border-bottom: 4px solid transparent;
  transition: background-color 0.15s, transform 0.15s;
}
.scorenav__n {
  font-size: 0.66em;
  letter-spacing: 0.22em;
  color: var(--optic);
}
.scorenav a:hover { background: #46382E; text-decoration: underline; text-decoration-thickness: 2px; }
.scorenav a[aria-current="page"] {
  color: var(--ink);
  background: var(--optic);
  border-bottom-color: #fff;
}
.scorenav a[aria-current="page"] .scorenav__n { color: var(--ink); }

@media (min-width: 900px) {
  .scorebar { position: sticky; top: 0; }
  .scorebar__in { flex-wrap: nowrap; align-items: center; }
  .scorenav { flex: 0 1 540px; }
}

/* ---------- The court ---------- */
main { display: block; scroll-margin-top: 80px; }
main:focus { outline: none; }

.court {
  position: relative;
  width: min(100% - 2 * var(--page-m), 1180px);
  margin: var(--s-5) auto var(--s-7);
  padding-inline: var(--inset);
  color: #fff;
  background-color: var(--clay);
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1.6px),
    radial-gradient(rgba(26, 20, 16, 0.14) 1px, transparent 1.6px),
    repeating-linear-gradient(0deg, rgba(26, 20, 16, 0.05) 0 2px, transparent 2px 24px);
  background-size: 9px 9px, 13px 13px, auto;
  background-position: 0 0, 4px 6px, 0 0;
  border: var(--lw) solid var(--line);
  box-shadow: 0 0 0 clamp(4px, 0.8vw, 10px) rgba(0, 0, 0, 0.18), 0 28px 50px -12px rgba(0, 0, 0, 0.6);
  isolation: isolate;
}

.zone {
  position: relative;
  padding: var(--s-6) var(--gut);
  border-inline: var(--lw) solid var(--line);
}
.zone + .zone, .net + .zone, .zone + .net { margin-top: 0; }
.zone + .zone { border-top: var(--lw) solid var(--line); }
.zone--baseline::before {
  /* centre mark */
  content: "";
  position: absolute;
  top: 0; left: 50%;
  width: var(--lw); height: clamp(10px, 2vw, 18px);
  margin-left: calc(var(--lw) / -2);
  background: var(--line);
}
.zone--end::after {
  content: "";
  position: absolute;
  bottom: 0; left: 50%;
  width: var(--lw); height: clamp(10px, 2vw, 18px);
  margin-left: calc(var(--lw) / -2);
  background: var(--line);
}
.zone--boxes { padding: 0; }
.zone--game { padding-inline: clamp(8px, 2vw, 32px); }

/* service boxes: centre service line between */
.boxes { display: grid; grid-template-columns: minmax(0, 1fr); }
.box { padding: var(--s-6) var(--gut); position: relative; min-width: 0; }
.box + .box { border-top: var(--lw) solid var(--line); }
@media (min-width: 820px) {
  .boxes--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .boxes--2 > .box + .box { border-top: 0; border-left: var(--lw) solid var(--line); }
}
.box__tag, .kicker {
  display: inline-block;
  margin: 0 0 var(--s-3);
  padding: 0.2rem 0.7rem;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--net);
  border-radius: 999px;
}
.kicker { background: var(--optic); }

/* the net */
.net {
  position: relative;
  margin-inline: calc(var(--inset) * -1);
  padding: var(--s-6) calc(var(--inset) + var(--gut)) var(--s-7);
  color: #fff;
  background-color: var(--ink);
  background-image:
    repeating-linear-gradient(45deg, rgba(207, 198, 189, 0.16) 0 1px, transparent 1px 10px),
    repeating-linear-gradient(-45deg, rgba(207, 198, 189, 0.16) 0 1px, transparent 1px 10px);
  border-top: 12px solid var(--line);
  border-bottom: var(--lw) solid #000;
  box-shadow: 0 14px 22px -8px rgba(0, 0, 0, 0.6), inset 0 18px 22px -14px rgba(0, 0, 0, 0.7);
  --focus: var(--optic);
}
.net::before, .net::after {
  content: "";
  position: absolute;
  top: -12px; bottom: -4px;
  width: min(var(--inset), 28px);
  background: linear-gradient(90deg, #000, #43362C 60%, #000);
}
.net::before { left: 0; }
.net::after { right: 0; }
.net__title { color: var(--optic); max-width: 20ch; }
.net__sub { max-width: 60ch; color: var(--net); }

/* ---------- Typographic bits ---------- */
.mega {
  margin: 0 0 var(--s-4);
  font-size: clamp(4.8rem, 17vw, 12.5rem);
  line-height: 0.82;
  letter-spacing: 0;
  text-shadow: 0 6px 0 rgba(26, 20, 16, 0.55);
}
.mega em { font-style: normal; color: var(--optic); }
.lede {
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.38rem);
  line-height: 1.5;
}
.note {
  font-size: 0.95rem;
  max-width: 62ch;
}
.pull {
  margin: var(--s-5) 0;
  padding: var(--s-3) 0 var(--s-3) var(--s-4);
  border-left: 8px solid var(--optic);
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.4vw, 2.3rem);
  line-height: 1.05;
  text-transform: uppercase;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 46px;
  min-width: 46px;
  padding: 0.55em 1.25em;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.25rem);
  line-height: 1.1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: var(--optic);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow-hard);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}
.btn:hover {
  background: #EBFA62;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--ink), 0 16px 22px rgba(26, 20, 16, 0.38);
  text-decoration: none;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn--ghost {
  color: #fff;
  background: transparent;
  border-color: #fff;
  box-shadow: 0 4px 0 rgba(26, 20, 16, 0.7);
}
.btn--ghost:hover { color: var(--ink); background: #fff; }
.btn--ink { color: var(--optic); background: var(--ink); border-color: var(--ink); box-shadow: 0 4px 0 #000, 0 12px 18px rgba(0, 0, 0, 0.35); }
.btn--ink:hover { background: #3A2E26; }
.panel .btn--outline, .btn--outline { color: var(--ink); background: transparent; border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.btn--outline:hover { color: #fff; background: var(--ink); }
.btn--sm { min-height: 44px; padding: 0.4em 1em; font-size: 1.05rem; }
.btn[disabled], .btn[aria-disabled="true"] {
  color: var(--net);
  background: var(--ink-2);
  border: 2px dashed var(--net);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
  transition: none;
}
.btn[aria-pressed="true"] { background: #fff; color: var(--ink); border-color: var(--ink); }
.btn[aria-pressed="true"]::before { content: "\2713"; font-family: var(--font-body); font-weight: 800; }
.cta-row { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-4); margin: var(--s-5) 0 0; max-width: none; }
.link-arrow { font-weight: 800; }
.link-arrow::after { content: " \2192"; }

/* ---------- Panels ---------- */
.panel {
  --focus: var(--ink);
  padding: var(--s-5);
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}
.panel a { color: var(--green); }
.panel h2, .panel h3 { color: var(--ink); }
.panel--ink {
  --focus: var(--optic);
  color: #fff;
  background: var(--ink);
  border-color: #000;
}
.panel--ink a { color: var(--optic); }
.panel--ink h2, .panel--ink h3 { color: var(--optic); }
.panel--clay-deep {
  --focus: var(--optic);
  color: #fff;
  background: var(--clay-deep);
  border-color: var(--clay-dark);
}
.panel--clay-deep a { color: #fff; }

/* ---------- Scoreboard tiles ---------- */
.tile {
  --tile-size: clamp(3.2rem, 10vw, 7rem);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.15ch;
  padding: 0.05em 0.14em 0;
  font-family: var(--font-display);
  font-size: var(--tile-size);
  line-height: 1.02;
  text-transform: uppercase;
  color: var(--optic);
  background: linear-gradient(180deg, #2E241D 0 50%, #15100C 50% 100%);
  border-radius: 0.1em;
  box-shadow: inset 0 0 0 2px #43362C, 0 5px 0 #000, 0 14px 22px rgba(0, 0, 0, 0.45);
  perspective: 600px;
  overflow: hidden;
}
.tile::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 3px;
  background: #000;
  transform: translateY(-50%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12);
}
.tile__face { display: block; transform-origin: 50% 50%; backface-visibility: hidden; }
.tile[data-long="1"] .tile__face { font-size: 0.5em; letter-spacing: 0.03em; line-height: 2.05; }
.tile[data-long="1"] { min-width: 2.6ch; }
.tile--sm { --tile-size: clamp(2rem, 6.5vw, 3.4rem); }
.tile--xl { --tile-size: clamp(3.6rem, 12vw, 8.5rem); }
.tile.is-flipping .tile__face { animation: flip-in 0.5s cubic-bezier(0.2, 0.9, 0.25, 1) both; }
@keyframes flip-in {
  0% { transform: rotateX(-95deg); opacity: 0.2; }
  60% { transform: rotateX(12deg); opacity: 1; }
  100% { transform: rotateX(0); opacity: 1; }
}

.board { display: grid; gap: var(--s-3); }
.board__cols, .board__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: var(--s-3);
  align-items: center;
}
.board__cols {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--net);
}
.board__cols span:nth-child(n+2) { text-align: center; min-width: 3.5rem; }
.board__name {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.6vw, 2.1rem);
  line-height: 1;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.serve-badge {
  display: block;
  width: fit-content;
  margin: 0.35rem 0 0;
  padding: 0.12rem 0.5rem;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  vertical-align: middle;
  color: var(--ink);
  background: var(--optic);
  border-radius: 999px;
}
.serve-badge[hidden] { display: none; }
.board .tile { --tile-size: clamp(2.6rem, 5.2vw, 4.4rem); }
.board .tile--sm { --tile-size: clamp(1.9rem, 4vw, 2.9rem); }
.callout {
  margin: var(--s-3) 0 0;
  min-height: 3.2em;
  font-weight: 700;
  font-size: 1.05rem;
}

/* ---------- Home hero ---------- */
.hero { display: grid; gap: var(--s-6); grid-template-columns: minmax(0, 1fr); padding-top: var(--s-7); }
@media (min-width: 940px) {
  .hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; gap: var(--s-7); }
}
.hero__stage { display: grid; gap: var(--s-5); }

.bounce-lane {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-4);
  align-items: end;
  min-height: 190px;
  padding: var(--s-3) var(--s-4) var(--s-3);
  border-bottom: var(--lw) dashed rgba(255, 255, 255, 0.85);
}
.ball-btn {
  position: relative;
  display: grid;
  place-items: end center;
  width: 108px; height: 190px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  color: inherit;
}
.ball-btn .ball { position: relative; z-index: 2; width: 70px; height: 70px; margin-bottom: 12px; transform-origin: 50% 100%; }
.ball-btn__shadow {
  position: absolute;
  bottom: 6px; left: 50%;
  width: 72px; height: 16px;
  margin-left: -36px;
  background: radial-gradient(ellipse at center, rgba(26, 20, 16, 0.6), rgba(26, 20, 16, 0) 70%);
  z-index: 1;
}
.ball-btn.is-bouncing .ball { animation: ball-drop 3.8s linear 1 both; }
.ball-btn.is-bouncing .ball-btn__shadow { animation: shadow-drop 3.8s linear 1 both; }
.ball-btn[data-pose="1"] .ball { transform: scale(1.2, 0.8); }
.ball-btn[data-pose="2"] .ball { transform: translateY(-100px); }
.ball-btn[data-pose="1"] .ball-btn__shadow { transform: scale(1.2); }
.ball-btn[data-pose="2"] .ball-btn__shadow { transform: scale(0.55); opacity: 0.6; }
.bounce-cap { margin: 0; font-weight: 700; align-self: center; }

@keyframes ball-drop {
  0%   { transform: translateY(-150px); animation-timing-function: cubic-bezier(0.55, 0, 1, 0.5); }
  22%  { transform: translateY(0) scale(1, 1); }
  23%  { transform: translateY(0) scale(1.22, 0.78); animation-timing-function: ease-out; }
  25%  { transform: translateY(0) scale(1, 1); animation-timing-function: cubic-bezier(0, 0.5, 0.5, 1); }
  31%  { transform: translateY(-92px); animation-timing-function: cubic-bezier(0.5, 0, 1, 0.5); }
  38%  { transform: translateY(0) scale(1, 1); }
  39%  { transform: translateY(0) scale(1.18, 0.82); animation-timing-function: ease-out; }
  41%  { transform: translateY(0) scale(1, 1); animation-timing-function: cubic-bezier(0, 0.5, 0.5, 1); }
  47%  { transform: translateY(-56px); animation-timing-function: cubic-bezier(0.5, 0, 1, 0.5); }
  53%  { transform: translateY(0) scale(1, 1); }
  54%  { transform: translateY(0) scale(1.14, 0.86); animation-timing-function: ease-out; }
  56%  { transform: translateY(0) scale(1, 1); animation-timing-function: cubic-bezier(0, 0.5, 0.5, 1); }
  61%  { transform: translateY(-30px); animation-timing-function: cubic-bezier(0.5, 0, 1, 0.5); }
  66%  { transform: translateY(0); }
  72%  { transform: translateY(-14px); animation-timing-function: cubic-bezier(0.5, 0, 1, 0.5); }
  76%  { transform: translateY(0); }
  82%  { transform: translateY(-6px); }
  86%, 100% { transform: translateY(0); }
}
@keyframes shadow-drop {
  0%   { transform: scale(0.5); opacity: 0.4; }
  22%, 39%, 54%, 66%, 76%, 86%, 100% { transform: scale(1); opacity: 1; }
  31%  { transform: scale(0.62); opacity: 0.55; }
  47%  { transform: scale(0.78); opacity: 0.75; }
  61%  { transform: scale(0.9); opacity: 0.9; }
}

.demo__title { color: var(--optic); font-size: clamp(1.4rem, 3vw, 1.9rem); }
.demo__btns { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-4); }

/* mini court svgs */
.mini { width: min(100%, 150px); height: auto; margin: var(--s-3) 0; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.35)); }
.ladder-mini {
  display: flex; flex-wrap: wrap; gap: var(--s-2);
  margin: var(--s-3) 0 var(--s-4); padding: 0; list-style: none;
}
.ladder-mini li {
  margin: 0; padding: 0.35rem 0.75rem;
  font-family: var(--font-display);
  font-size: 1.3rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--optic); background: var(--ink);
  border-radius: 6px;
}

/* ---------- Facts at the net ---------- */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: var(--s-4);
  margin: var(--s-5) 0 0; padding: 0; list-style: none;
}
.fact {
  --focus: var(--ink);
  margin: 0;
  padding: var(--s-4) var(--s-4) var(--s-3);
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-top: 10px solid var(--optic);
  border-radius: 6px 6px 14px 14px;
  box-shadow: 0 5px 0 #000, 0 18px 26px -10px rgba(0, 0, 0, 0.6);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.fact:hover { transform: translateY(-4px); box-shadow: 0 9px 0 #000, 0 22px 30px -10px rgba(0, 0, 0, 0.6); }
.fact__num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.4vw, 2.9rem);
  line-height: 1;
  color: var(--green);
  overflow-wrap: anywhere;
}
.fact h3 { margin: var(--s-1) 0 var(--s-2); font-size: 1.25rem; color: var(--ink); }
.fact p { margin: 0 0 var(--s-2); font-size: 0.98rem; }

/* timeline ("match history") */
.history { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); margin: var(--s-4) 0; padding: 0; list-style: none; }
.history li { margin: 0; padding: var(--s-4); background: var(--clay-deep); border: var(--lw) solid var(--line); border-radius: 4px; }
.history__year { display: block; font-family: var(--font-display); font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1; color: var(--optic); }
.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: var(--s-3); }
.steps li { counter-increment: step; position: relative; margin: 0; padding: 0.2rem 0 0.2rem 3.4rem; min-height: 2.6rem; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  display: grid; place-items: center;
  width: 2.5rem; height: 2.5rem;
  font-family: var(--font-display); font-size: 1.5rem;
  color: var(--ink); background: var(--optic);
  border-radius: 50%;
  box-shadow: 0 3px 0 var(--ink);
}
.judge-note {
  margin-top: var(--s-5);
  padding: var(--s-4);
  border: var(--lw) dashed var(--line);
  border-radius: 6px;
  max-width: 72ch;
}
.judge-note p { margin: 0; }

/* ---------- Rally / game ---------- */
.game { display: grid; gap: var(--s-5); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1000px) {
  .game { grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: var(--s-6); }
}
.game__court {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin-inline: auto;
}
#rally-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 5;
  touch-action: none;
  background: var(--green);
  border: var(--lw) solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow-soft);
  cursor: crosshair;
}
.game__hint { margin: var(--s-3) 0 0; font-size: 0.92rem; text-align: center; }
.game__panel { display: grid; gap: var(--s-4); min-width: 0; }
.status {
  margin: 0;
  min-height: 3.4em;
  padding: var(--s-3) var(--s-4);
  font-weight: 700;
  color: var(--ink);
  background: var(--optic);
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: 0 4px 0 var(--ink);
  max-width: none;
}
.stats { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin: 0; font-size: 0.98rem; }
.stats span b { font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; color: var(--optic); letter-spacing: 0.03em; }
.ctl { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); align-items: end; }
.field { display: grid; gap: 0.3rem; min-width: 0; }
.field label, .field .label, legend.label, .label {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
input[type="text"], input[type="email"], input[type="number"], select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 0.55rem 0.8rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 8px;
  box-shadow: inset 0 2px 0 rgba(26, 20, 16, 0.12);
}
textarea { min-height: 150px; resize: vertical; line-height: 1.45; }
::placeholder { color: #5A4E45; opacity: 1; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: #B00020; box-shadow: 0 0 0 3px #fff, 0 0 0 6px #B00020; }
.err {
  margin: 0.2rem 0 0;
  padding: 0.3rem 0.6rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #7A0017;
  background: #FFE9EC;
  border-left: 6px solid #B00020;
  border-radius: 4px;
}
.err::before { content: "Fix this: "; font-weight: 800; }
.err[hidden] { display: none; }

fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 0; }
.seg legend { flex: 0 0 100%; width: 100%; padding: 0; margin-bottom: 0.3rem; }
.seg label { position: relative; display: inline-flex; margin: 0; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg span {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; min-width: 46px;
  padding: 0.4rem 1rem;
  font-family: var(--font-display);
  font-size: 1.1rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: #fff;
  background: var(--clay-deep);
  border: 3px solid #fff;
  margin-left: -3px;
}
.seg label:first-child span { margin-left: 0; border-radius: 999px 0 0 999px; }
.seg label:last-child span { border-radius: 0 999px 999px 0; }
.seg label:only-child span { border-radius: 999px; }
.seg input:checked + span { color: var(--ink); background: var(--optic); border-color: var(--ink); position: relative; z-index: 1; }
.seg input:checked + span::before { content: "\2713\00a0"; font-family: var(--font-body); font-weight: 800; }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 3px; z-index: 2; }
.seg input:disabled + span { color: var(--net); background: var(--ink-2); border-style: dashed; border-color: var(--net); cursor: not-allowed; }
.seg input:disabled { cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.turn-ctl { display: grid; gap: var(--s-3); padding: var(--s-4); }
.turn-ctl[hidden] { display: none; }
.turn-ctl .seg { gap: 0; }
.turn-ctl p { margin: 0; }

.rules-grid { display: grid; gap: var(--s-4) var(--s-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.rule { margin: 0; }
.rule h3 { color: var(--optic); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: var(--s-2) var(--s-4); margin: 0 0 var(--s-4); }
.keys dt { font-weight: 800; }
.keys dd { margin: 0; }

details {
  margin: 0 0 var(--s-3);
  background: rgba(26, 20, 16, 0.35);
  border: 2px solid #fff;
  border-radius: 8px;
}
details summary {
  position: relative;
  display: flex; align-items: center;
  min-height: 48px;
  padding: 0.6rem 3rem 0.6rem 1rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
  content: "+";
  position: absolute; right: 1rem; top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display); font-size: 1.8rem; line-height: 1;
  color: var(--optic);
}
details[open] summary::after { content: "\2212"; }
details > :not(summary) { padding-inline: 1rem; }
details > p:last-child { padding-bottom: 0.4rem; }

/* ---------- Scoring page ---------- */
.ladder {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: var(--s-5) 0; padding: 0; list-style: none;
  position: relative;
}
.ladder::before {
  content: "";
  position: absolute;
  left: 4%; right: 4%; top: 2.1rem;
  border-top: var(--lw) solid var(--line);
}
.ladder li { position: relative; margin: 0; text-align: center; padding: 0 0.15rem; }
.ladder__n {
  position: relative;
  display: grid; place-items: center;
  width: clamp(3.2rem, 9vw, 5rem); height: clamp(3.2rem, 9vw, 5rem);
  margin: 0 auto var(--s-2);
  font-family: var(--font-display); font-size: clamp(1.2rem, 4vw, 2.3rem);
  line-height: 1;
  color: var(--ink); background: var(--optic);
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 5px 0 var(--ink);
}
.ladder li:last-child .ladder__n { color: var(--optic); background: var(--ink); border-color: var(--line); }
.ladder__say { display: block; font-weight: 800; font-size: clamp(0.78rem, 2.4vw, 1rem); }
.ladder__sub { display: block; font-size: 0.85rem; }
.defs { display: grid; gap: var(--s-4); }
.defs dt { font-family: var(--font-display); font-size: 1.5rem; text-transform: uppercase; color: var(--optic); letter-spacing: 0.02em; }
.defs dd { margin: 0 0 var(--s-2); max-width: 66ch; }

.tracker { display: grid; gap: var(--s-5); }
.setup { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); align-items: end; }
.check { display: flex; align-items: center; gap: 0.7rem; min-height: 46px; font-weight: 700; }
.check input { width: 26px; height: 26px; flex: none; accent-color: var(--optic); }
.desk { display: grid; gap: var(--s-5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .desk { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; } }
.point-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
.point-btns .btn { min-height: 64px; font-size: clamp(1.1rem, 3.5vw, 1.5rem); overflow-wrap: anywhere; text-align: center; }
.point-btns .btn--wide { grid-column: span 1; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 1rem; }
caption { text-align: left; padding-bottom: var(--s-2); font-family: var(--font-display); font-size: 1.4rem; text-transform: uppercase; }
th, td { padding: 0.5rem 0.6rem; text-align: center; border-bottom: 2px solid rgba(26, 20, 16, 0.25); }
th[scope="row"], thead th:first-child { text-align: left; }
thead th { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; }
.log {
  max-height: 340px;
  margin: 0; padding: var(--s-3) var(--s-3) var(--s-3) 2.4rem;
  overflow: auto;
  font-size: 0.97rem;
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 10px;
}
.log li { padding: 0.3rem 0; border-bottom: 1px dashed rgba(26, 20, 16, 0.35); margin: 0; }
.log li.is-milestone { font-weight: 800; }
.empty {
  padding: var(--s-4);
  color: var(--ink);
  background: var(--net);
  border: 3px dashed var(--ink);
  border-radius: 10px;
  max-width: none;
}
.empty[hidden] { display: none; }
.empty strong { font-family: var(--font-display); font-weight: 400; font-size: 1.3rem; text-transform: uppercase; display: block; }
.summary-box { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.92rem; min-height: 190px; }

/* ---------- Drills ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; margin-bottom: var(--s-5); }
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0.4rem 1.1rem;
  font-family: var(--font-display); font-size: 1.1rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: #fff; background: var(--clay-deep);
  border: 3px solid #fff; border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s, background-color 0.12s;
}
.chip:hover { background: #fff; color: var(--ink); }
.chip[aria-pressed="true"] { color: var(--ink); background: var(--optic); border-color: var(--ink); }
.chip[aria-pressed="true"]::before { content: "\2713\00a0"; font-family: var(--font-body); font-weight: 800; }
.drills-layout { display: grid; gap: var(--s-6); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1060px) { .drills-layout { grid-template-columns: minmax(0, 1fr) 330px; } .session { position: sticky; top: 90px; } }
.drill-grid { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.drill {
  position: relative;
  display: flex; flex-direction: column;
  padding: var(--s-4);
  --focus: var(--ink);
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 6px 6px 18px 18px;
  box-shadow: 0 6px 0 #000, 0 22px 30px -12px rgba(0, 0, 0, 0.6);
  transition: transform 0.15s, box-shadow 0.15s;
}
.drill:hover { transform: translateY(-4px); box-shadow: 0 10px 0 #000, 0 26px 34px -12px rgba(0, 0, 0, 0.6); }
.drill[hidden] { display: none; }
.drill__top { display: flex; gap: var(--s-3); align-items: flex-start; justify-content: space-between; }
.drill__no { font-family: var(--font-display); font-size: clamp(3.4rem, 7vw, 4.8rem); line-height: 0.85; color: var(--green); }
.drill__svg {
  flex: none; width: 74px; height: auto;
  background: var(--clay); border-radius: 4px;
  box-shadow: 0 3px 0 var(--ink);
}
.drill h3 { margin: var(--s-2) 0; color: var(--ink); font-size: clamp(1.5rem, 2.6vw, 1.95rem); }
.drill__meta { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0 0 var(--s-3); padding: 0; list-style: none; }
.drill__meta li { margin: 0; padding: 0.15rem 0.6rem; font-size: 0.82rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); background: var(--net); border: 2px solid var(--ink); border-radius: 999px; }
.drill h4 { margin: var(--s-3) 0 var(--s-1); color: var(--green); font-size: 1.05rem; letter-spacing: 0.06em; }
.drill p, .drill li { font-size: 0.97rem; }
.drill ol { padding-left: 1.2rem; margin-bottom: var(--s-3); }
.drill__tie { margin-top: auto; padding: var(--s-3); background: var(--ink); color: #fff; border-radius: 8px; font-size: 0.93rem; }
.drill__tie strong { color: var(--optic); }
.drill .btn { margin-top: var(--s-4); align-self: flex-start; }
.drill .btn[aria-pressed="true"] { background: var(--green); color: #fff; border-color: var(--ink); }
.session ul { list-style: none; padding: 0; margin: 0 0 var(--s-4); display: grid; gap: var(--s-3); }
.session li { margin: 0; padding: var(--s-3); background: #fff; border: 2px solid var(--ink); border-radius: 8px; }
.session__row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.session__row strong { overflow-wrap: anywhere; }
.session .mins { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-2); }
.session .mins input { width: 5.5rem; min-height: 44px; }
.session .rm { min-height: 44px; min-width: 44px; padding: 0 0.7rem; font-weight: 800; color: var(--ink); background: var(--net); border: 2px solid var(--ink); border-radius: 8px; cursor: pointer; }
.session .rm:hover { background: var(--ink); color: var(--optic); }
.total { display: flex; align-items: baseline; gap: var(--s-2); margin-bottom: var(--s-3); }
.total__n { font-family: var(--font-display); font-size: 3.4rem; line-height: 1; color: var(--green); }
.session .btn-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.session .btn { box-shadow: 0 3px 0 var(--ink); }

/* ---------- Contact ---------- */
.mailbig {
  display: inline-block;
  margin: var(--s-3) 0 var(--s-4);
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 6.2vw, 4.2rem);
  line-height: 1;
  text-transform: none;
  color: var(--optic);
  overflow-wrap: anywhere;
  text-decoration-thickness: 4px;
}
.mailbig:hover { color: #fff; }
.form-grid { display: grid; gap: var(--s-4); }
.preview { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.92rem; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 7rem; }
.form-msg { margin: 0; min-height: 1.6em; font-weight: 700; max-width: none; }
.counter { font-size: 0.85rem; text-align: right; margin: 0; max-width: none; }
.tick-list { list-style: none; padding: 0; }
.tick-list li { position: relative; padding-left: 2rem; }
.tick-list li::before { content: "\2713"; position: absolute; left: 0; top: 0; font-weight: 800; color: var(--optic); }
.tick-list.no li::before { content: "\2715"; }

/* ---------- Baseline footer ---------- */
.baseline {
  margin-top: var(--s-7);
  padding: var(--s-6) 0 var(--s-7);
  color: #fff;
  background: var(--green-deep);
  border-top: 5px solid var(--line);
  --focus: var(--optic);
}
.baseline__in {
  display: grid;
  gap: var(--s-4) var(--s-6);
  grid-template-columns: minmax(0, 1fr);
  width: min(100% - 2 * var(--page-m), 1180px);
  margin: 0 auto;
}
@media (min-width: 860px) { .baseline__in { grid-template-columns: 1.1fr 1fr; } }
.baseline__brand { font-family: var(--font-display); font-size: 2.6rem; text-transform: uppercase; line-height: 1; }
.baseline__brand span { color: var(--optic); }
.baseline p { margin: 0 0 var(--s-2); font-size: 0.97rem; }
.baseline nav ul { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); list-style: none; margin: 0; padding: 0; }
.baseline nav li { margin: 0; }
.baseline nav a {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 0.9rem;
  font-family: var(--font-display); letter-spacing: 0.06em; text-transform: uppercase; font-size: 1.1rem;
  text-decoration: none; color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.85); border-radius: 999px;
}
.baseline nav a:hover { color: var(--ink); background: #fff; }
.baseline nav a[aria-current="page"] { color: var(--ink); background: var(--optic); border-color: var(--optic); }
.baseline a.mail { color: var(--optic); font-weight: 800; display: inline-block; padding: 0.55rem 0; }

noscript .panel { margin: var(--s-4); }

/* ---------- Print ---------- */
@media print {
  body { color: #000; background: #fff; font-size: 12pt; }
  .scorebar, .baseline nav, .skip, .btn, .toolbar, .net, .hero__stage, .point-btns, .setup, .actions, #rally-canvas, .no-print { display: none !important; }
  .court { width: 100%; margin: 0; color: #000; background: #fff; border: 0; box-shadow: none; padding: 0; }
  .zone { border: 0; padding: 0.5rem 0; }
  .zone + .zone { border: 0; }
  .zone::before, .zone::after { display: none; }
  .panel, .panel--ink, .panel--clay-deep, .drill, .fact, .log { color: #000; background: #fff; border: 1px solid #000; box-shadow: none; }
  .panel h2, .panel h3, .panel--ink h2, .panel--ink h3 { color: #000; }
  a { color: #000; }
  .baseline { color: #000; background: #fff; border-top: 1px solid #000; }
  .baseline a.mail { color: #000; }
  .tile { color: #000; background: #fff; box-shadow: none; border: 2px solid #000; }
  .tile::after { display: none; }
  .log { max-height: none; overflow: visible; }
  .session { position: static; }
  .drill[hidden] { display: none !important; }
}

/* ---------- Reduced motion: neutralize every animation and transition ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .btn:hover, .fact:hover, .drill:hover { transform: none; }
}
