/* Rally · landing page. Direction: "The well-kept board" (dense tiles), General Sans, bottle ink and ball yellow.
   One board of filled tiles: 12 columns, 8px gaps, 12px page margins, one 6px radius. Text starts 24px inside
   its tile, and text on the page ground keeps the same 24px indent, so every text block shares the 36px edge. */
:root {
  --bg: #f7f7f7;
  --surface: #ebebeb;
  --ink: #0d2a1c;
  --ink-2: #163a28;
  --muted: #4d5a53;
  --accent: #f6e016;
  --accent-ink: #0d2a1c;
  --field-1: #d3ddd6;
  --field-2: #9db2a4;
  --on-ink: #eef3ef;
  --on-ink-soft: #c3d1c8;

  --font: "General Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.75rem);
  --step-head: clamp(2.25rem, 1.3rem + 3.6vw, 4.5rem);
  --step-display: clamp(7rem, 13vw, 12.5rem);

  --m: 12px;            /* page margin */
  --gap: 8px;           /* between tiles */
  --pad: 24px;          /* inside tiles, and the indent of text on the ground */
  --r: 6px;             /* the one radius */
  --section: clamp(96px, 11vw, 168px);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --t-press: 140ms; --t-hover: 180ms; --t-ui: 240ms; --t-reveal: 800ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--step-body)/1.45 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, figure, ul, ol, dl, dd, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
h2 { font-size: var(--step-head); line-height: 0.98; letter-spacing: -0.03em; font-weight: 600; text-wrap: balance; }
p { text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--ink); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tile { border-radius: var(--r); overflow: hidden; }
.photo { position: relative; background: var(--surface); }
.photo img, .photo video { width: 100%; height: 100%; object-fit: cover; }

.button { display: inline-flex; align-items: center; height: 52px; padding: 0 22px; border-radius: var(--r); font-weight: 500; transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease; }
.button:active { transform: scale(0.97); }
.button.ink { background: var(--ink); color: var(--on-ink); }
.button.small { height: 40px; padding: 0 16px; background: var(--accent); color: var(--accent-ink); font-size: var(--step-small); }
@media (hover: hover) and (pointer: fine) {
  .button.ink:hover { background: var(--ink-2); color: var(--accent); }
  .button.small:hover { background: var(--ink); color: var(--accent); }
}

/* ---------- hero: the name band, the link tiles, the stage ---------- */
.hero { display: grid; grid-template-rows: 170px 64px minmax(0, 1fr); gap: var(--gap); height: 100svh; min-height: 720px; max-height: 1080px; padding: var(--m); }
.band { display: flex; justify-content: center; align-items: flex-start; background: var(--ink); border-radius: var(--r); overflow: hidden; }
.band h1 { margin-top: 12px; font-size: var(--step-display); line-height: 0.8; letter-spacing: -0.05em; font-weight: 700; color: var(--accent); white-space: nowrap; }
.links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.links a { padding: 20px var(--pad); border-radius: var(--r); background: var(--surface); font-weight: 500; line-height: 1.2; transition: background-color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) { .links a:hover { background: var(--field-1); } }
.stage { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); min-height: 0; }
.rail-left { grid-column: 1 / 3; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: var(--gap); min-height: 0; }
.facts { display: grid; gap: 8px; padding: 20px var(--pad) 22px; background: var(--surface); font-size: var(--step-small); line-height: 1.3; font-weight: 500; }
.main { grid-column: 3 / 11; min-height: 0; }
.statement { position: absolute; left: 0; bottom: 0; width: min(100%, 52rem); padding: 22px var(--pad) 24px; border-top-right-radius: var(--r); background: var(--bg); font-size: clamp(1.25rem, 0.9rem + 1.1vw, 2rem); line-height: 1.22; letter-spacing: -0.01em; font-weight: 500; }
.rail-right { grid-column: 11 / 13; display: grid; grid-template-rows: repeat(4, minmax(0, 1fr)) minmax(0, 1.5fr); gap: var(--gap); min-height: 0; }
.rail-right li { border-radius: var(--r); overflow: hidden; font-size: var(--step-small); line-height: 1.3; }
.rail-right li > a, .rail-right li > span { display: block; height: 100%; padding: 16px 18px; transition: background-color var(--t-hover) ease; }
.rail-right b { display: block; font-weight: 600; }
.rail-right .t1 { background: var(--surface); }
.rail-right .t2 { background: var(--field-1); }
.rail-right .t3 { background: var(--field-2); }
.rail-right .t4 { background: var(--ink-2); color: var(--on-ink); }
.rail-right .t5 { background: var(--accent); }
.rail-right .action { display: flex; flex-direction: column; justify-content: space-between; font-size: var(--step-lead); line-height: 1.05; font-weight: 600; letter-spacing: -0.01em; transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
.rail-right .action::after { content: "→"; font-size: var(--step-lead); transition: transform var(--t-ui) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .rail-right .t1 a:hover { background: var(--field-1); }
  .rail-right .t2 a:hover, .rail-right .t3 a:hover { background: var(--surface); }
  .rail-right .action:hover { background: var(--ink); color: var(--accent); }
  .rail-right .action:hover::after { transform: translateX(6px); }
}
.rail-right .action:active { transform: scale(0.98); }

/* ---------- the board: tonight's courts ---------- */
.board-section { margin: 0 var(--m); padding: clamp(56px, 7vw, 104px) var(--pad) 0; border-radius: var(--r); background: var(--ink); color: var(--on-ink); overflow: hidden; }
.board-intro { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: end; }
.board-intro h2 { grid-column: 1 / 8; color: var(--on-ink); }
.board-intro p { grid-column: 8 / 13; max-width: 40ch; color: var(--on-ink-soft); }
.board-window { margin: 80px calc(var(--pad) * -1 + 12px) 0; overflow: hidden; }
.board { display: grid; gap: 4px; margin: -36px 0; }
.board .row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: center; width: 100%; min-height: 72px; padding: 0 16px; border: 0; border-radius: 4px; background: var(--ink-2); color: var(--on-ink); text-align: left; font-size: var(--step-lead); line-height: 1.1; letter-spacing: -0.01em; cursor: pointer; font-variant-numeric: tabular-nums; transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) { .board .row:not(.open):hover { background: #1d4733; } }
.board .row:active { transform: scale(0.995); }
.board .name { grid-column: 1 / 6; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board .court { grid-column: 6 / 8; color: var(--on-ink-soft); white-space: nowrap; }
.board .time { grid-column: 8 / 10; white-space: nowrap; }
.board .players { grid-column: 10 / 12; color: var(--on-ink-soft); white-space: nowrap; }
.board .status { grid-column: 12 / 13; justify-self: end; padding: 7px 10px 8px; border-radius: 4px; font-size: var(--step-small); font-weight: 600; line-height: 1; white-space: nowrap; }
.status.ok { background: #2f7a52; color: #fff; }
.status.paid, .status.booked { background: var(--field-1); color: var(--ink); }
.status.league { background: var(--field-2); color: var(--ink); }
.status.bad { background: #d8352f; color: #fff; }
.status.free, .status.wait { background: var(--accent); color: var(--ink); }
.board .detail { grid-column: 1 / 10; display: none; margin-top: 18px; font-size: var(--step-body); line-height: 1.45; letter-spacing: 0; max-width: 62ch; color: var(--ink); }
.board .row.open { min-height: 216px; align-content: center; background: var(--accent); color: var(--ink); }
.board .row.open .court, .board .row.open .players { color: var(--ink); }
.board .row.open .detail { display: block; }
.board .row.open .status { background: var(--ink); color: var(--accent); }
.board .row.open .name { font-weight: 600; }

/* ---------- a freed court fills itself ---------- */
.refill { margin-top: var(--section); padding: 0 var(--m); }
.refill h2 { padding: 0 var(--pad); margin-bottom: 64px; max-width: 14ch; }
.bar { display: flex; gap: 6px; height: max(22vh, 168px); }
.seg { flex: var(--g) 1 0; min-width: 12%; padding: 20px var(--pad); border-radius: var(--r); transform-origin: left center; }
.seg .d { display: block; font-size: var(--step-lead); line-height: 1.1; font-weight: 600; letter-spacing: -0.01em; }
.seg.s1 { background: var(--surface); }
.seg.s2 { background: var(--field-1); }
.seg.s3 { background: var(--field-2); }
.seg.s4 { background: var(--ink); color: var(--accent); }
.seg .c { display: none; }
.clauses { display: flex; gap: 6px; margin-top: 16px; }
.clauses li { flex: var(--g) 1 0; min-width: 12%; padding: 0 var(--pad); }
.clauses span { display: block; max-width: 24ch; font-size: var(--step-body); line-height: 1.4; }

/* ---------- the signature move: a club's day in one sideways line ---------- */
.marquee { margin-top: var(--section); padding: 28px 0 34px; background: var(--accent); overflow: hidden; }
.marquee-track { display: flex; width: max-content; animation: marquee 48s linear infinite; }
.marquee span { display: inline-flex; align-items: center; padding-right: 0.5em; font-size: var(--step-head); line-height: 1; letter-spacing: -0.03em; font-weight: 600; white-space: nowrap; }
.marquee span::after { content: ""; width: 0.42em; height: 0.42em; margin-left: 0.5em; border-radius: 50%; background: var(--ink); }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- what Rally does ---------- */
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); margin-top: var(--gap); padding: 0 var(--m); }
.cell { display: flex; flex-direction: column; justify-content: space-between; gap: 48px; min-height: 90svh; padding: clamp(32px, 4vw, 56px) var(--pad) var(--pad); border-radius: var(--r); background: var(--surface); }
.cell h2 span { display: block; }
.cell h2 .push { text-align: right; }
.cell-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.cell-foot p { max-width: 30ch; }
.rows { display: grid; grid-template-rows: repeat(5, minmax(0, 1fr)); border-radius: var(--r); overflow: hidden; }
.rows > li { display: grid; grid-template-columns: 4fr 6fr 3fr; gap: 24px; padding: 28px var(--pad); background: var(--ink); color: var(--on-ink); }
.rows > li:nth-child(even) { background: var(--ink-2); }
.rows h3 { font-size: var(--step-lead); line-height: 1.1; font-weight: 600; letter-spacing: -0.01em; }
.rows p { font-size: var(--step-body); line-height: 1.45; color: var(--on-ink); }
.terms { display: grid; gap: 4px; font-size: var(--step-small); line-height: 1.4; color: var(--accent); font-weight: 500; }

/* ---------- one court or twelve ---------- */
.clubs { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); margin-top: var(--section); padding: 0 var(--m); }
.clubs-head { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: end; margin-bottom: 40px; padding: 0 var(--pad); }
.clubs-head h2 { grid-column: 1 / 7; }
.clubs-head p { grid-column: 8 / 13; max-width: 44ch; }
.clubs figure { display: grid; grid-template-rows: minmax(0, 1fr) auto; height: clamp(360px, 40vw, 560px); }
.clubs figure img { min-height: 0; transition: transform 1200ms var(--ease-out); }
.clubs figcaption { padding: 14px var(--pad) 16px; background: var(--surface); font-size: var(--step-small); font-weight: 500; }
.clubs .c1 { grid-column: 1 / 4; }
.clubs .c2 { grid-column: 4 / 8; }
.clubs .c3 { grid-column: 8 / 13; }
@media (hover: hover) and (pointer: fine) { .clubs figure:hover img { transform: scale(1.04); } }

/* ---------- pricing: plans that step up ---------- */
.pricing { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: 120px 120px 420px; column-gap: var(--gap); margin-top: var(--section); padding: 0 var(--m); }
.pricing-head { grid-column: 1 / 5; grid-row: 1 / 3; padding: 0 var(--pad) 24px; }
.pricing-head p { margin-top: 16px; max-width: 34ch; font-size: var(--step-small); color: var(--muted); }
.plan { position: relative; display: flex; flex-direction: column; padding: 28px var(--pad) 88px; border-radius: var(--r); overflow: hidden; }
.plan.p1 { grid-column: 1 / 5; grid-row: 3; background: var(--surface); --strip: #dadada; }
.plan.p2 { grid-column: 5 / 9; grid-row: 2 / 4; background: var(--field-1); --strip: #bccbc1; }
.plan.p3 { grid-column: 9 / 13; grid-row: 1 / 4; background: var(--ink); color: var(--on-ink); --strip: #061a10; }
.plan h3 { font-size: var(--step-lead); line-height: 1.1; font-weight: 600; }
.price { margin-top: 6px; font-size: var(--step-head); line-height: 1; letter-spacing: -0.03em; font-weight: 600; font-variant-numeric: tabular-nums; }
.price span { font-size: var(--step-body); letter-spacing: 0; font-weight: 500; }
.plan ul { display: grid; gap: 6px; margin-top: 24px; }
.plan li { line-height: 1.35; }
.plan li:first-child { font-weight: 600; }
.strip { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; height: 64px; padding: 0 var(--pad); background: var(--strip); font-weight: 600; transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
.plan.p3 .strip { color: var(--accent); }
@media (hover: hover) and (pointer: fine) { .strip:hover { background: var(--accent); color: var(--ink) !important; } }
.strip:active { transform: translateY(1px); }

/* ---------- questions ---------- */
.faq { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); margin-top: var(--section); padding: 0 var(--m); align-items: start; }
.faq h2 { grid-column: 1 / 5; position: sticky; top: 96px; padding: 0 var(--pad); }
.qs { grid-column: 5 / 13; display: grid; gap: var(--gap); }
.qs details { border-radius: var(--r); background: var(--surface); transition: background-color var(--t-ui) ease; }
.qs summary { position: relative; display: flex; align-items: center; min-height: 72px; padding: 18px 72px 18px var(--pad); font-size: var(--step-lead); line-height: 1.2; font-weight: 500; letter-spacing: -0.01em; cursor: pointer; list-style: none; }
.qs summary::-webkit-details-marker { display: none; }
.qs summary::before, .qs summary::after { content: ""; position: absolute; right: var(--pad); top: 50%; width: 16px; height: 3px; margin-top: -1.5px; background: currentColor; transition: transform var(--t-ui) var(--ease-out); }
.qs summary::after { transform: rotate(90deg); }
.qs details[open] { background: var(--accent); }
.qs details[open] summary::after { transform: rotate(0deg); }
.qs details p { max-width: 52ch; padding: 0 var(--pad) 26px; }
@media (hover: hover) and (pointer: fine) { .qs details:not([open]):hover { background: var(--field-1); } }

/* ---------- the action tile ---------- */
.cta { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); margin-top: var(--section); padding: 0 var(--m); overflow: hidden; }
.cta > * { min-height: 360px; }
.flank-l { grid-column: 1 / 3; margin-left: -80px; }
.flank-r { grid-column: 11 / 13; margin-right: -80px; background: var(--ink); }
.action-tile { grid-column: 3 / 11; display: flex; flex-direction: column; justify-content: center; padding: 40px clamp(24px, 4vw, 56px); border-radius: var(--r); background: var(--accent); }
.action-tile h2 { max-width: 16ch; }
.action-tile > p { margin-top: 16px; max-width: 44ch; }
.signup { position: relative; width: min(100%, 460px); margin-top: 28px; }
.signup input { width: 100%; height: 60px; padding: 0 182px 0 20px; border: 0; border-radius: var(--r); background: var(--bg); }
.signup input::placeholder { color: var(--muted); }
.signup button { position: absolute; top: 6px; right: 6px; bottom: 6px; padding: 0 18px; border: 0; border-radius: 4px; background: var(--ink); color: var(--accent); font-weight: 600; cursor: pointer; transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease; }
.signup button:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .signup button:hover { background: var(--ink-2); } }
.form-note { margin-top: 12px; font-size: var(--step-small); }

/* ---------- footer: the name, built from blocks ---------- */
.footer { margin-top: var(--section); padding: 0 var(--m) var(--m); }
.mark { display: flex; align-items: flex-end; gap: 4px; height: 34svh; min-height: 220px; }
.mark span { flex: 1 1 0; display: grid; height: var(--h); padding: 0 4%; border-radius: var(--r); background: var(--c); color: var(--k); overflow: hidden; transform-origin: bottom; }
.mark svg { width: 100%; height: 100%; min-width: 0; overflow: visible; }
.mark text { font-family: var(--font); font-size: 100px; font-weight: 700; letter-spacing: -2px; fill: currentColor; }
.foot-cols { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 32px var(--gap); margin-top: 56px; padding: 0 var(--pad); font-size: var(--step-small); }
.foot-cols h3 { font-size: var(--step-small); font-weight: 600; margin-bottom: 10px; }
.foot-cols ul { display: grid; gap: 6px; }
.foot-cols > div:nth-child(1) { grid-column: 1 / 3; }
.foot-cols > div:nth-child(2) { grid-column: 3 / 5; }
.foot-cols > div:nth-child(3) { grid-column: 5 / 7; }
.foot-cols > div:nth-child(4) { grid-column: 7 / 11; }
.foot-cols address { grid-column: 11 / 13; font-style: normal; line-height: 1.5; }
.foot-cols a { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.2em; transition: text-decoration-color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) { .foot-cols a:hover { text-decoration-color: currentColor; } }
.credits { line-height: 1.5; color: var(--muted); max-width: 60ch; }
.foot-last { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 48px; padding: 0 var(--pad); font-size: var(--step-small); }

/* ---------- motion: content is visible without script; entrances run once ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-rise] { opacity: 0; transform: translateY(20px); animation: rise var(--t-reveal) var(--ease-expo) forwards; animation-delay: calc(var(--i, 0) * 80ms + 80ms); }
  .js .band[data-rise] h1 { transform: translateY(40%); animation: rise-h 1100ms var(--ease-expo) 120ms forwards; }
  .js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-expo); transition-delay: calc(var(--i, 0) * 80ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .js .board .row { opacity: 0; transform: translateY(16px); transition: opacity 500ms var(--ease-out), transform 700ms var(--ease-expo), background-color var(--t-hover) ease, color var(--t-hover) ease; transition-delay: calc(var(--i, 0) * 60ms), calc(var(--i, 0) * 60ms), 0ms, 0ms; }
  .js .board.is-in .row { opacity: 1; transform: none; }
  .js .bar [data-grow] { transform: scaleX(0.2); opacity: 0; transition: transform 1000ms var(--ease-expo), opacity 500ms var(--ease-out); }
  .js .bar [data-grow]:nth-child(2) { transition-delay: 90ms; } .js .bar [data-grow]:nth-child(3) { transition-delay: 180ms; } .js .bar [data-grow]:nth-child(4) { transition-delay: 270ms; }
  .js .bar.is-in [data-grow] { transform: none; opacity: 1; }
  .js .mark span { transform: scaleY(0.55); transition: transform 1000ms var(--ease-expo); }
  .js .mark span:nth-child(2) { transition-delay: 70ms; } .js .mark span:nth-child(3) { transition-delay: 140ms; } .js .mark span:nth-child(4) { transition-delay: 210ms; } .js .mark span:nth-child(5) { transition-delay: 280ms; }
  .js .mark.is-in span { transform: none; }
  .js .plan[data-reveal] { transform: translateY(48px); }
  .js .plan[data-reveal].is-in { transform: none; }
}
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes rise-h { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* ---------- tablet ---------- */
@media (max-width: 1100px) {
  .board-intro h2 { grid-column: 1 / -1; }
  .board-intro p { grid-column: 1 / -1; margin-top: 16px; }
  .board .name { grid-column: 1 / 7; }
  .board .court { grid-column: 7 / 9; }
  .board .time { grid-column: 9 / 11; }
  .board .players { display: none; }
  .board .status { grid-column: 11 / 13; }
  .features { grid-template-columns: minmax(0, 1fr); }
  .cell { min-height: 60svh; }
  .rows > li { grid-template-columns: 1fr 1fr; }
  .rows > li .terms { grid-column: 2; }
  .pricing { grid-template-rows: auto 80px 80px 440px; row-gap: 0; }
  .pricing-head { grid-column: 1 / -1; grid-row: 1; padding-bottom: 32px; }
  .plan.p1 { grid-row: 4; } .plan.p2 { grid-row: 3 / 5; } .plan.p3 { grid-row: 2 / 5; }
  .faq h2 { grid-column: 1 / -1; position: static; margin-bottom: 24px; }
  .qs { grid-column: 1 / -1; }
  .foot-cols > div:nth-child(1) { grid-column: 1 / 4; }
  .foot-cols > div:nth-child(2) { grid-column: 4 / 7; }
  .foot-cols > div:nth-child(3) { grid-column: 7 / 10; }
  .foot-cols address { grid-column: 10 / 13; }
  .foot-cols > div:nth-child(4) { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 900px) {
  .bar { flex-direction: column; height: auto; min-height: 70svh; }
  .seg { flex-basis: auto; min-width: 0; min-height: 72px; transform-origin: center top; }
  .seg .c { display: block; margin-top: 8px; font-size: var(--step-body); line-height: 1.35; max-width: 52ch; }
  .clauses { display: none; }
  .js .bar [data-grow] { transform: translateY(16px); }
  .js .bar.is-in [data-grow] { transform: none; }
  .stage { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr) auto; }
  .main { grid-column: 1 / -1; }
  .rail-left { display: none; }
  .rail-right { grid-column: 1 / -1; grid-template-rows: none; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.5fr); height: 132px; }
  .rail-right li { font-size: var(--step-small); }
  .main { order: 2; } .rail-right { order: 1; }
  .stage { grid-template-rows: auto minmax(0, 1fr); }
  .board-section { margin-top: 48px; }
}

/* ---------- phone: its own board, two columns ---------- */
@media (max-width: 640px) {
  :root { --m: 8px; --pad: 16px; --gap: 6px; }
  .hero { height: auto; min-height: 0; max-height: none; grid-template-rows: auto; }
  .band { height: 110px; }
  .band h1 { margin-top: 10px; }
  .links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .links a { padding: 16px; min-height: 56px; }
  .stage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; }
  .main { grid-column: 1 / -1; display: grid; grid-template-rows: auto auto; background: transparent; }
  .main video { aspect-ratio: 4 / 3; height: auto; border-radius: var(--r); }
  .statement { position: static; width: auto; margin-top: var(--gap); padding: 18px var(--pad) 20px; border-radius: var(--r); background: var(--surface); font-size: var(--step-lead); }
  .main { order: 1; } .rail-right { order: 2; } .rail-left { order: 3; }
  .rail-left { display: grid; grid-column: 1 / -1; grid-template-rows: none; grid-template-columns: 1fr 1fr; }
  .rail-left .portrait { aspect-ratio: 3 / 4; }
  .rail-right { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: none; height: auto; }
  .rail-right li { min-height: 88px; font-size: var(--step-body); }
  .rail-right .t4 { grid-column: 1 / 2; }
  .rail-right .t5 { grid-column: 2 / 3; }
  .rail-right .t3 { grid-column: 1 / -1; min-height: 64px; }
  .board-section { padding-top: 56px; }
  .board-window { margin: 40px -8px 0; }
  .board { margin: -32px 0; }
  .board .row { grid-template-columns: minmax(0, 1fr) auto; min-height: 64px; padding: 0 12px; }
  .board .name { grid-column: 1; }
  .board .court, .board .time, .board .players { display: none; }
  .board .status { grid-column: 2; }
  .board .row.open { min-height: 200px; }
  .board .row.open .court, .board .row.open .time, .board .row.open .players { display: block; grid-column: 1 / -1; font-size: var(--step-body); margin-top: 6px; }
  .board .row.open .court { margin-top: 12px; }
  .board .detail { grid-column: 1 / -1; margin-top: 12px; }
  .refill h2 { margin-bottom: 32px; }
  .bar { flex-direction: column; height: 70svh; }
  .seg { min-width: 0; min-height: 72px; transform-origin: center top; }
  .clauses { display: none; }
  .seg .c { display: block; margin-top: 8px; font-size: var(--step-body); line-height: 1.35; }

  .cell { min-height: 0; gap: 40px; }
  .cell-foot { flex-direction: column; align-items: flex-start; }
  .rows > li { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 22px var(--pad); }
  .rows > li .terms { grid-column: 1; display: block; }
  .terms li { display: inline; }
  .terms li:not(:last-child)::after { content: ", "; }
  .clubs-head { grid-template-columns: minmax(0, 1fr); }
  .clubs-head h2, .clubs-head p { grid-column: 1; }
  .clubs-head p { margin-top: 16px; }
  .clubs figure { grid-column: 1 / -1 !important; height: 300px; }
  .pricing { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; row-gap: 24px; }
  .pricing-head, .plan.p1, .plan.p2, .plan.p3 { grid-column: 1; grid-row: auto; }

  .qs summary { min-height: 64px; padding-right: 56px; }
  .qs details p { padding-bottom: 20px; }
  .cta { grid-template-columns: 1fr 1fr; }
  .cta > * { min-height: 0; }
  .action-tile { grid-column: 1 / -1; padding: 28px var(--pad); min-height: 300px; }

  .signup input { padding-right: 20px; }
  .signup button { position: static; width: 100%; height: 52px; margin-top: 8px; }
  .flank-l { grid-column: 1 / 2; grid-row: 2; margin-left: 0; height: 120px; min-height: 120px; }
  .flank-r { grid-column: 2 / 3; grid-row: 2; margin-right: 0; height: 120px; min-height: 120px; }
  .mark { height: 22svh; min-height: 140px; }

  .foot-cols { grid-template-columns: 1fr 1fr; gap: 28px 16px; }
  .foot-cols > div:nth-child(n), .foot-cols address { grid-column: auto; grid-row: auto; }
  .foot-cols > div:nth-child(4), .foot-cols address { grid-column: 1 / -1; }
}
