/* =============================================================================
   RESET + TYPOGRAPHY + LAYOUT PRIMITIVES
============================================================================= */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* keep content clear of the iOS home indicator / notch */
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-variant-numeric: tabular-nums;
}

/* A faint paper grain. Pure CSS — no image request, and it survives offline. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.32;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 8px;
}

::selection { background: var(--gold); color: var(--club-night); }

/* ---- headings ------------------------------------------------------------ */
h1, h2, h3, h4, h5 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: var(--track-display);
  text-transform: uppercase;
  font-stretch: 88%;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

/* ---- utility type -------------------------------------------------------- */
.eyebrow {
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--ink-4);
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  line-height: 1.5;
}
.eyebrow::before {
  content: '';
  width: 1.6rem;
  height: 1px;
  background: var(--gold);
  flex: none;
  /* pinned to the first line so a wrapped eyebrow does not orphan the rule */
  margin-top: 0.72em;
}
.eyebrow--plain::before { display: none; }
.eyebrow--gold { color: var(--gold-ink); }
.on-dark .eyebrow { color: var(--ink-5); }

.lede {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.6;
  color: var(--ink-3);
  max-width: var(--maxw-text);
}
.on-dark .lede { color: rgba(255, 255, 255, 0.68); }

.mono {
  font-family: var(--font-mono);
  font-size: 0.86em;
  letter-spacing: 0.02em;
}

.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }

.muted { color: var(--ink-4); }
.tiny { font-size: var(--t-micro); letter-spacing: var(--track-label); text-transform: uppercase; font-weight: 600; }

/* ---- layout -------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: 1080px; }
.wrap--text { max-width: 820px; }

.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section--flush-top { padding-top: 0; }

/* -----------------------------------------------------------------------------
   DARK SURFACES
   Rather than overriding each component, the ink ramp is rebound here. Anything
   using --ink-3/4/5 becomes legible on a dark ground automatically:
     ink-3 13.7:1 · ink-4 8.2:1 · ink-5 5.8:1  (all AA, most AAA)
----------------------------------------------------------------------------- */
.on-dark, .hero, .footer, .ticker, .score-status, .drawer, .card--dark,
.split__panel, .course-hero, .login {
  --ink-2: #E4E4E4;
  --ink-3: #C9C9C9;
  --ink-4: #A8A8A8;
  --ink-5: #8C8C8C;
  --line:  var(--line-dark);
  --line-2: rgba(255, 255, 255, 0.32);
  --live:  #FF8A72;
  --live-ink: #FF8A72;
  --win:   #3FBF87;   /* 8.4:1 on near-black */
  --gold-ink: var(--gold-2);
}
/* The login card is a light island inside a dark page, so it opts back out. */
.login__card {
  --ink-2: #2E2E2E;
  --ink-3: #545454;
  --ink-4: #6E6E6E;
  --ink-5: #8C8C8C;
  --line:  rgba(16, 16, 16, 0.12);
  --line-2: rgba(16, 16, 16, 0.24);
  --live:  #C8482F;
  --gold-ink: #6B4F10;
}

.on-dark {
  background: var(--night);
  color: var(--paper);
}
.on-dark h1, .on-dark h2, .on-dark h3 { color: var(--paper); }
.on-dark .muted { color: var(--ink-4); }
.on-dark .eyebrow, .hero .eyebrow { color: var(--ink-4); }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }
.on-dark .rule { background: var(--line-dark); }

/* Section header: eyebrow + title + optional action, stacked on phones. */
.sec-head {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin-bottom: var(--s-6);
}
.sec-head__title { font-size: var(--t-d2); }
.sec-head__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4);
}

@media (min-width: 760px) {
  .sec-head { margin-bottom: var(--s-7); }
}

/* ---- grid ---------------------------------------------------------------- */
.grid { display: grid; gap: var(--s-4); }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: repeat(2, 1fr); }

@media (min-width: 640px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .grid { gap: var(--s-5); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

.stack { display: flex; flex-direction: column; gap: var(--s-4); }
.row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.spacer { flex: 1 1 auto; }

/* Anything that must scroll sideways does it inside its own box, never the page. */
.scroll-x {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}
.scroll-x::-webkit-scrollbar { height: 6px; }
.scroll-x::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--s-4); top: -100px; z-index: 10000;
  background: var(--ink); color: var(--paper);
  padding: 0.7rem 1.1rem; border-radius: var(--r-sm);
  font-size: var(--t-small); font-weight: 700;
  transition: top var(--dur-1);
}
.skip-link:focus { top: var(--s-4); }

/* The club pages' icon sprite sits in app.html so any page can <use> it. It
   must never take up space -- the club stylesheet hides it too, but on a
   tour page that stylesheet is switched off. */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
