/* The Bay Lawn Club. Each page is a Grand Slam surface:
   home + membership = Wimbledon grass · manifesto = Roland-Garros clay
   weekly meet = US Open hard court · founder = Australian Open blue */

body.slam-wimbledon {
  --bg: #F6F1E7; --surface: #EDE5D3; --ink: #16241B; --muted: #5C665E;
  --primary: #1F4D2B; --on-primary: #F6F1E7; --accent: #4B2A63;
  --court: #3F7D3B; --court-alt: #36703A; --court-out: #3F7D3B;
  --board: #0F3B23; --board-ink: #F6F1E7;
  --line: rgba(22, 36, 27, 0.16);
}
body.slam-rg {
  --bg: #F5EBDF; --surface: #EBDCCB; --ink: #2A160E; --muted: #6E5444;
  --primary: #B4532A; --on-primary: #FFF8F0; --accent: #1F4D3A;
  --court: #C2602F; --court-alt: #B85A2B; --court-out: #B85A2B;
  --board: #1F4D3A; --board-ink: #F5EBDF;
  --line: rgba(42, 22, 14, 0.16);
}
body.slam-uso {
  --bg: #0F1B33; --surface: #16264A; --ink: #EAF0F7; --muted: #9AA9C2;
  --primary: #D7F24A; --on-primary: #0F1B33; --accent: #D7F24A;
  --court: #2F5DA8; --court-alt: #2F5DA8; --court-out: #0E1E3F;
  --board: #091224; --board-ink: #EAF0F7;
  --line: rgba(234, 240, 247, 0.16);
}
body.slam-royal {
  --bg: #F5F0F7; --surface: #E9E0EF; --ink: #22132F; --muted: #64547A;
  --primary: #4B2A63; --on-primary: #F5F0F7; --accent: #1F4D2B;
  --court: #4B2A63; --court-alt: #4B2A63; --court-out: #2E1A3F;
  --board: #22132F; --board-ink: #F5F0F7;
  --line: rgba(34, 19, 47, 0.16);
}
body.slam-ao {
  --bg: #EEF5FB; --surface: #DDEBF7; --ink: #0B2340; --muted: #4E6680;
  --primary: #1466C8; --on-primary: #FFFFFF; --accent: #0A7CC2;
  --court: #1F6FC9; --court-alt: #1F6FC9; --court-out: #4A93DC;
  --board: #0B2340; --board-ink: #EEF5FB;
  --line: rgba(11, 35, 64, 0.16);
}
:root {
  --ball: #D7F24A;
  --chalk: #FFFFFF;
  --serif: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-weight: 300; font-size: 18px; line-height: 1.7;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
img, svg { display: block; max-width: 100%; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.1; margin: 0 0 .5em; }
h1 { font-size: clamp(2.8rem, 8vw, 6rem); }
h2 { font-size: clamp(2rem, 4.4vw, 3.2rem); }
h3 { font-size: 1.4rem; }
p { margin: 0 0 1.1em; }

.eyebrow {
  display: block; margin-bottom: 1.1rem;
  font-size: .72rem; font-weight: 500; letter-spacing: .32em; text-transform: uppercase;
  color: var(--accent);
}
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(700px, 100% - 32px); margin-inline: auto; }
.center { text-align: center; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font-family: var(--serif); font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand .crest-mark { width: 40px; height: 40px; color: var(--primary); }
body.slam-uso .brand .crest-mark { color: var(--ink); }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a { color: var(--ink); font-size: .74rem; letter-spacing: .22em; text-transform: uppercase; }
.nav a[aria-current="page"] { color: var(--accent); }
.nav a[aria-current="page"]::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ball); margin-right: 8px; vertical-align: 2px;
  box-shadow: inset -1px -1px 0 rgba(0,0,0,.18);
}
.menu-toggle {
  display: none; background: none; border: 1px solid var(--line); color: var(--ink);
  border-radius: 999px; height: 36px; padding: 0 14px; cursor: pointer;
  font: 400 .7rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase;
}
@media (max-width: 1080px) {
  .menu-toggle { display: inline-block; }
  .nav {
    position: absolute; top: 72px; left: 0; right: 0; display: none;
    flex-direction: column; align-items: flex-start; gap: 18px;
    padding: 24px 16px 28px; background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .nav.open { display: flex; }
}

/* Buttons: a ball leads every one */
.btn {
  display: inline-flex; align-items: center; gap: 12px; padding: 16px 28px;
  background: var(--primary); color: var(--on-primary); border: 1px solid var(--primary);
  font: 400 .74rem/1 var(--sans); letter-spacing: .24em; text-transform: uppercase;
  cursor: pointer; transition: transform .2s, box-shadow .2s;
}
.btn::before {
  content: ""; width: 12px; height: 12px; border-radius: 50%; flex: none;
  background: var(--ball); box-shadow: inset -2px -2px 0 rgba(0,0,0,.15);
}
.btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.btn.light { background: var(--chalk); color: #14231A; border-color: var(--chalk); }
.btn.ghost { background: transparent; color: var(--chalk); border-color: rgba(255,255,255,.7); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 2rem; }
.center .btn-row { justify-content: center; }

/* Court hero */
.court-hero {
  position: relative; overflow: hidden; color: var(--chalk);
  background: var(--court-out);
  padding: clamp(96px, 15vw, 190px) 0 clamp(88px, 13vw, 160px);
  text-align: center; isolation: isolate;
}
body.slam-wimbledon .court-hero {
  background: repeating-linear-gradient(90deg, var(--court) 0 9%, var(--court-alt) 9% 18%);
}
body.slam-rg .court-hero {
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.06), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,.08), transparent 45%),
    var(--court);
}
.court-lines {
  position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%;
  /* fade the lines where the headline sits so the net doesn't cut through text */
  -webkit-mask-image: radial-gradient(ellipse 40% 42% at 50% 52%, rgba(0,0,0,.12) 55%, #000 100%);
          mask-image: radial-gradient(ellipse 40% 42% at 50% 52%, rgba(0,0,0,.12) 55%, #000 100%);
}
.court-lines .surface { fill: var(--court); }
body.slam-wimbledon .court-lines .surface, body.slam-rg .court-lines .surface { fill: none; }
.court-lines .l { stroke: var(--chalk); stroke-width: 2; fill: none; vector-effect: non-scaling-stroke; opacity: .85; }
.court-lines .net { stroke: var(--chalk); stroke-width: 4; vector-effect: non-scaling-stroke; opacity: .9; }
.court-hero h1, .court-hero h2 { text-shadow: 0 2px 18px rgba(0,0,0,.25); }
.court-hero .eyebrow { color: var(--chalk); opacity: .9; }
.court-hero .lede { font-size: 1.2rem; max-width: 560px; margin: 0 auto; text-shadow: 0 1px 10px rgba(0,0,0,.3); }
.court-hero .crest-mark { width: 96px; height: 96px; margin: 0 auto 1.6rem; color: var(--chalk); }

/* Bouncing ball across the hero */
.bounce {
  position: absolute; left: -40px; bottom: 18%; width: 22px; height: 22px; z-index: 0;
  animation: travel 3.2s cubic-bezier(.4,.1,.6,1) .4s 1 forwards;
}
.bounce svg { width: 22px; height: 22px; animation: hop .8s ease-in 4 alternate .4s; }
@keyframes travel { to { left: calc(100% + 40px); } }
@keyframes hop { 0% { transform: translateY(0); } 100% { transform: translateY(-120px); animation-timing-function: ease-out; } }
@media (prefers-reduced-motion: reduce) { .bounce { display: none; } }

/* Net-tape divider */
.net-divider {
  height: 34px; position: relative;
  background:
    repeating-linear-gradient(45deg, transparent 0 6px, color-mix(in srgb, var(--ink) 22%, transparent) 6px 7px),
    repeating-linear-gradient(-45deg, transparent 0 6px, color-mix(in srgb, var(--ink) 22%, transparent) 6px 7px);
}
.net-divider::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 7px;
  background: var(--chalk); box-shadow: 0 1px 0 var(--line);
}
body.slam-uso .net-divider::before { background: var(--ink); }

/* Sections */
section { padding: clamp(72px, 10vw, 128px) 0; }
.lined { border-top: 1px solid var(--line); }
.split { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(32px, 6vw, 96px); }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }
.letter p { font-size: 1.15rem; }
.letter p:first-child { font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.3; }
.sign { font-family: var(--serif); font-style: italic; font-size: 1.8rem; }

/* Service-box grid: a court drawn around cards */
.service-boxes {
  display: grid; grid-template-columns: repeat(2, 1fr);
  border: 2px solid var(--ink); position: relative;
}
.service-boxes > * { padding: clamp(26px, 4vw, 44px); border: 1px solid color-mix(in srgb, var(--ink) 55%, transparent); }
.service-boxes.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 880px) { .service-boxes.four { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .service-boxes, .service-boxes.four { grid-template-columns: 1fr; } }
.service-boxes h3 { margin-bottom: .4em; }
.service-boxes p:last-child { margin-bottom: 0; }

/* Ball bullets */
ul.balls { list-style: none; padding: 0; margin: 0; }
ul.balls li { position: relative; padding: 14px 0 14px 32px; border-bottom: 1px solid var(--line); }
ul.balls li::before {
  content: ""; position: absolute; left: 0; top: 23px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--ball); box-shadow: inset -2px -2px 0 rgba(0,0,0,.15);
}

/* Scoreboard */
.scoreboard {
  background: var(--board); color: var(--board-ink);
  border: 6px solid color-mix(in srgb, var(--board) 70%, #000);
  padding: clamp(18px, 3vw, 28px); font-variant-numeric: tabular-nums;
}
.scoreboard .title {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  font-size: .7rem; letter-spacing: .3em; text-transform: uppercase; opacity: .75;
  padding-bottom: 12px; margin-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.15);
}
.scoreboard .row {
  display: grid; grid-template-columns: 130px 1fr; gap: 18px; align-items: baseline;
  padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.08);
}
.scoreboard .row:last-child { border-bottom: 0; }
.scoreboard .k { font-size: .7rem; letter-spacing: .26em; text-transform: uppercase; color: var(--ball); }
.scoreboard .v { font-size: 1.05rem; font-weight: 400; letter-spacing: .04em; }
.scoreboard .big { font-family: var(--sans); font-weight: 400; font-size: clamp(2rem, 5vw, 3rem); color: var(--ball); line-height: 1; }
@media (max-width: 520px) { .scoreboard .row { grid-template-columns: 1fr; gap: 2px; } }
.board-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.board-grid > div { padding: 18px 16px; border-right: 1px solid rgba(255,255,255,.1); }
.board-grid > div:last-child { border-right: 0; }
.board-grid p { margin: 8px 0 0; font-size: .9rem; opacity: .85; }
@media (max-width: 760px) { .board-grid { grid-template-columns: 1fr 1fr; } .board-grid > div { border-bottom: 1px solid rgba(255,255,255,.1); } }

.tbd { border: 1px dashed currentColor; padding: 0 8px; font-size: .85em; opacity: .85; white-space: nowrap; }

/* Founder portrait, framed like a doubles alley */
.portrait { margin: 0; position: relative; max-width: 420px; border: 2px solid var(--primary); padding: 10px; }
.portrait img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; }

/* Form */
form { display: grid; gap: 22px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }
label { display: block; font-size: .7rem; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
input, select, textarea {
  width: 100%; padding: 14px 0; font: 300 1.05rem var(--sans); color: var(--ink);
  background: transparent; border: 0; border-bottom: 2px solid var(--line);
  border-radius: 0; outline: none; -webkit-appearance: none; appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 8px) 50%; background-size: 6px 6px; background-repeat: no-repeat;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-bottom-color: var(--primary); }
.checks { display: flex; flex-wrap: wrap; gap: 10px; }
.checks label {
  display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px;
  font-size: .72rem; letter-spacing: .12em; color: var(--ink);
}
.checks input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.checks label::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--muted); }
.checks label:has(input:checked) { border-color: var(--primary); }
.checks label:has(input:checked)::before { background: var(--ball); border-color: transparent; box-shadow: inset -1px -1px 0 rgba(0,0,0,.2); }
.checks label:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.form-note { font-size: .88rem; color: var(--muted); }
.form-status { min-height: 1.5em; color: var(--primary); }
.hp { position: absolute; left: -9999px; }

/* Footer: a baseline */
.site-footer { border-top: 3px solid var(--ink); padding: 56px 0 44px; font-size: .88rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.site-footer nav a { color: var(--muted); letter-spacing: .16em; text-transform: uppercase; font-size: .7rem; }
.site-footer .slams { font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ================= Royal dark theme =================
   Aubergine + antique gold base; each page keeps a deep version of its Slam surface. */
html[data-theme="dark"] body {
  --bg: #120B1A; --surface: #1E1230; --ink: #F3ECDD; --muted: #B3A6BC;
  --primary: #C9A24A; --on-primary: #120B1A; --accent: #C9A24A;
  --board: #1E1230; --board-ink: #F3ECDD;
  --line: rgba(201, 162, 74, 0.22);
  --court-line: #C9A24A; --tape: #C9A24A; --box-line: #C9A24A; --wall: #1E1230;
}
html[data-theme="dark"] body.slam-wimbledon { --court: #13321D; --court-alt: #0F2A18; --court-out: #13321D; }
html[data-theme="dark"] body.slam-rg { --court: #4A1E10; --court-alt: #42190D; --court-out: #3A160B; }
html[data-theme="dark"] body.slam-uso { --court: #1F3F7A; --court-alt: #1F3F7A; --court-out: #0A1630; }
html[data-theme="dark"] body.slam-royal { --court: #3A1F52; --court-alt: #3A1F52; --court-out: #1E1230; }
html[data-theme="dark"] body.slam-ao { --court: #0F2F5C; --court-alt: #0F2F5C; --court-out: #0A2246; }
html[data-theme="dark"] .court-lines .l, html[data-theme="dark"] .court-lines .net { stroke: var(--court-line); }
html[data-theme="dark"] .net-divider::before { background: var(--tape); }
html[data-theme="dark"] .service-boxes { border-color: var(--box-line); }
html[data-theme="dark"] .service-boxes > * { border-color: rgba(201, 162, 74, 0.35); }
html[data-theme="dark"] .site-footer { border-top-color: var(--box-line); }
html[data-theme="dark"] .btn.light { background: #C9A24A; border-color: #C9A24A; color: #120B1A; }
html[data-theme="dark"] .btn.ghost { border-color: rgba(243, 236, 221, .6); color: #F3ECDD; }
html[data-theme="dark"] .scoreboard { border-color: #C9A24A; }
html[data-theme="dark"] .court-hero .eyebrow { color: #C9A24A; opacity: 1; }
html[data-theme="dark"] .checks label:has(input:checked) { border-color: #C9A24A; }
select option { color: #16241B; background: #fff; }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  background: none; border: 1px solid var(--line); color: var(--ink);
  font: 400 .68rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase;
}
.theme-toggle svg { width: 16px; height: 16px; color: var(--accent); }
.theme-toggle:hover { border-color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 12px; }
@media (max-width: 1080px) { .theme-toggle span { display: none; } }

/* ================= Royal Box hero (membership) ================= */
body { --wall: #1F4D2B; --box-inside: #102A19; --awning: #3C7A45; }
html[data-theme="dark"] body { --wall: #1E1230; --box-inside: #120B1A; --awning: #1F4D2B; }
.box-hero { background: var(--wall); color: #F6F1E7; text-align: center; padding: clamp(80px, 11vw, 130px) 0 0; overflow: hidden; }
html[data-theme="dark"] .box-hero { color: #F3ECDD; }
.box-hero .eyebrow { color: #F6F1E7; opacity: .85; }
html[data-theme="dark"] .box-hero .eyebrow { color: #C9A24A; opacity: 1; }
.box-hero .lede { font-size: 1.2rem; max-width: 560px; margin: 0 auto; }
.royal-box { width: min(1100px, 100%); margin: clamp(36px, 6vw, 64px) auto 0; }
.royal-box svg { width: 100%; height: auto; }
.royal-box .fan {
  transform: translateY(26px);
  transition: transform .55s cubic-bezier(.3, 1.5, .5, 1);
  transition-delay: var(--d);
}
.royal-box.standing .fan { transform: translateY(0); }
.royal-box .hand { opacity: 0; transition: opacity .2s; }
.royal-box.clapping .hand { opacity: 1; }
.royal-box.clapping .hand.l { animation: clapL .22s ease-in-out infinite alternate; animation-delay: var(--cd); }
.royal-box.clapping .hand.r { animation: clapR .22s ease-in-out infinite alternate; animation-delay: var(--cd); }
@keyframes clapL { to { transform: translateX(4px); } }
@keyframes clapR { to { transform: translateX(-4px); } }
.royal-box .hat { transform-box: fill-box; transform-origin: center bottom; }
.royal-box.clapping .hat { animation: tip .5s ease-in-out 2 alternate; animation-delay: var(--cd); }
@keyframes tip { to { transform: translateY(-5px) rotate(-8deg); } }
@media (prefers-reduced-motion: reduce) {
  .royal-box .fan { transform: none; transition: none; }
  .royal-box .hand, .royal-box .hat { animation: none !important; }
}

/* Form sets, numbered like a match */
fieldset { border: 0; border-top: 2px solid var(--box-line, var(--ink)); margin: 0; padding: 30px 0 14px; display: grid; gap: 22px; min-width: 0; }
legend { float: left; width: 100%; padding: 0; margin-bottom: 4px; font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.2; }
legend + * { clear: both; }
.set-num {
  display: inline-block; vertical-align: middle; margin-right: 14px;
  background: var(--board); color: var(--ball); padding: 6px 10px;
  font: 500 .66rem/1 var(--sans); letter-spacing: .26em; text-transform: uppercase;
}
html[data-theme="dark"] .set-num { color: #C9A24A; border: 1px solid #C9A24A; }
form { gap: 44px; }

/* Full-screen heroes: the first view is just the court (or the Royal Box) */
.court-hero, .box-hero {
  min-height: calc(100vh - 72px); min-height: calc(100svh - 72px);
  display: flex; flex-direction: column; justify-content: center; position: relative;
}
.court-hero { padding: 80px 0 110px; }
.box-hero { padding: 64px 0 0; justify-content: space-between; }
.box-hero .royal-box { width: min(1100px, 100%, (100svh - 400px) * 2.75); margin-top: 32px; }
.scroll-cue {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: #F6F1E7; font-size: .62rem; letter-spacing: .3em; text-transform: uppercase; opacity: .85;
}
.scroll-cue:hover { text-decoration: none; opacity: 1; }
.scroll-cue svg { width: 16px; height: 16px; animation: cue 1.4s ease-in-out infinite; }
@keyframes cue { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
.box-hero .scroll-cue { bottom: auto; top: calc(100% - 26px); display: none; }
@media (prefers-reduced-motion: reduce) { .scroll-cue svg { animation: none; } }
html { scroll-behavior: smooth; }
#details { scroll-margin-top: 72px; }

.service-boxes.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 880px) { .service-boxes.three { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .service-boxes.three { grid-template-columns: 1fr; } }

/* Courtside crew (Get Involved hero) */
.crew-layer { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.crew-layer .flash { opacity: 0; transition: opacity .25s ease-out; }
.crew-layer .photog.pop .flash { opacity: 1; transition: none; }
.crew-layer .arm { transform-box: fill-box; transform-origin: 50% 0; transition: transform .25s ease; }
.crew-layer .call .arm { transform: rotate(-135deg); }
.crew-layer .runner { transition: transform 1.6s cubic-bezier(.55,0,.35,1); }
.crew-layer .r1.at-net { transform: translateY(1240px); }
.crew-layer .r2.at-net { transform: translateY(-1240px); }
