/* RallyReel — colours from the logo */
:root {
  --cream: #FDF4DF;
  --paper: #FFFAEE;
  --ink: #251106;
  --walnut: #79340B;
  --red: #E90504;
  --deep-red: #B40201;
  --gold: #FBB906;
  --line: #EAD9B4;
  --display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --body: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --measure: 68ch;
}

*, *::before, *::after { box-sizing: border-box; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 72px); }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; }
a { color: var(--deep-red); text-underline-offset: 0.18em; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

/* Header */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  background: color-mix(in srgb, var(--cream) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.6rem; }
.brand { display: flex; align-items: center; gap: 0.55rem; text-decoration: none; color: var(--ink); }
.brand img { width: 38px; height: 38px; }
.brand span { font-family: var(--display); font-weight: 800; font-size: 1.55rem; letter-spacing: 0.01em; }
.site-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 600; }
.site-nav a[aria-current="page"], .site-nav a:hover { color: var(--red); }

.wrap { width: min(1100px, 100% - 2.5rem); margin-inline: auto; }

/* Buttons */
.button {
  display: inline-block; padding: 0.8rem 1.4rem; border-radius: 999px;
  background: var(--red); color: #fff; font-weight: 700; text-decoration: none;
  box-shadow: 0 2px 0 var(--deep-red);
}
.button:hover { background: var(--deep-red); color: #fff; }
.button.quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.button.quiet:hover { background: var(--ink); color: var(--cream); }

/* Hero */
.hero { padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(2rem, 5vw, 3.5rem); }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.hero h1 {
  font-family: var(--display); font-weight: 800; line-height: 0.95;
  font-size: clamp(2.8rem, 7vw, 5rem); margin: 0 0 1rem; letter-spacing: -0.01em;
}
.hero p.lead { font-size: 1.2rem; max-width: 44ch; margin: 0 0 1.5rem; color: var(--walnut); }
.hero .actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.hero .logo { justify-self: center; width: min(420px, 100%); }   /* the image has its own soft shadow */

/* The scoreboard: the same look as the graphics on a RallyReel video */
.scoreboard {
  margin-top: 1.75rem; display: inline-grid; grid-template-columns: auto auto auto; column-gap: 1.1rem; row-gap: 0.2rem;
  align-items: center; padding: 0.7rem 1.1rem; border-radius: 10px;
  background: linear-gradient(#3A1C0C, #1E0D05); border: 2px solid var(--gold);
  color: var(--cream); font-family: var(--display); font-weight: 700; font-size: 1.35rem; line-height: 1.25;
  font-variant-numeric: tabular-nums; box-shadow: 0 10px 24px rgba(37, 17, 6, 0.25);
}
.scoreboard .player { display: flex; align-items: center; gap: 0.5rem; text-transform: uppercase; letter-spacing: 0.02em; }
.scoreboard .chip { width: 0.55rem; height: 1.15rem; border-radius: 2px; }
.scoreboard .serve { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--gold); visibility: hidden; }
.scoreboard .serve.on { visibility: visible; }
.scoreboard .games { color: rgba(253, 244, 223, 0.65); text-align: center; min-width: 1.4rem; }
.scoreboard .points { min-width: 2.2ch; text-align: right; font-size: 1.6rem; }
.scoreboard .points.won { color: var(--gold); }
.scoreboard-caption { display: block; margin-top: 0.6rem; font-size: 0.9rem; color: var(--walnut); }

/* Sections */
section.block { padding: clamp(2.5rem, 6vw, 4.5rem) 0; border-top: 1px solid var(--line); }
section.block h2 {
  font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1;
  margin: 0 0 1.5rem;
}
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; counter-reset: step; }
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step); display: block; font-family: var(--display); font-weight: 800; font-size: 3.2rem;
  line-height: 1; color: var(--red); margin-bottom: 0.4rem;
}
.steps h3 { font-family: var(--display); font-weight: 700; font-size: 1.5rem; margin: 0 0 0.35rem; }
.steps p { margin: 0; }

.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 3rem; }
.features h3 { font-family: var(--display); font-weight: 700; font-size: 1.35rem; margin: 0 0 0.25rem; }
.features p { margin: 0; max-width: 46ch; }

.band { background: var(--ink); color: var(--cream); }
.band h2 { color: var(--cream); }
.band p { max-width: 60ch; color: rgba(253, 244, 223, 0.85); }
.band a { color: var(--gold); }
.band .button { margin-top: 0.5rem; }

/* Long-form pages (guide, support, privacy) */
.page { padding: clamp(2rem, 5vw, 3.5rem) 0 4rem; }
.page .layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 3rem; align-items: start; }
.page h1 { font-family: var(--display); font-weight: 800; font-size: clamp(2.4rem, 6vw, 3.6rem); line-height: 1; margin: 0 0 0.75rem; }
.page .intro { font-size: 1.15rem; color: var(--walnut); max-width: var(--measure); margin: 0 0 2rem; }
.prose { max-width: var(--measure); }
.prose h2 { font-family: var(--display); font-weight: 700; font-size: 1.8rem; line-height: 1.1; margin: 2.5rem 0 0.6rem; padding-top: 0.25rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-weight: 700; font-size: 1.1rem; margin: 1.5rem 0 0.3rem; }
.prose p, .prose li { margin: 0 0 0.75rem; }
.prose ol, .prose ul { padding-left: 1.3rem; margin: 0 0 1rem; }
.prose .note { border-left: 4px solid var(--gold); background: var(--paper); padding: 0.75rem 1rem; margin: 1rem 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 0.5rem 0 1.25rem; font-size: 0.98rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 700; }
.table-scroll { overflow-x: auto; }
.toc { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 84px); font-size: 0.95rem; }
.toc p { font-weight: 700; margin: 0 0 0.5rem; }
.toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--red); }
.updated { color: var(--walnut); font-size: 0.95rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 2.5rem; font-size: 0.95rem; color: var(--walnut); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-footer a { color: var(--walnut); }

@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero .logo { grid-row: 1; width: min(260px, 70%); }
  .steps { grid-template-columns: 1fr; gap: 1.5rem; }
  .features { grid-template-columns: 1fr; }
  .page .layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .toc { position: static; }
  .site-nav { gap: 0.9rem; font-size: 0.95rem; }
}
@media (max-width: 480px) {
  .site-nav a.hide-small { display: none; }
  .scoreboard { font-size: 1.1rem; column-gap: 0.8rem; }
  .scoreboard .points { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
