/* ==========================================================================
   Design tokens — approved "Founders' Society" system
   Palette, type choices and crest treatment are approved and unchanged.
   This pass adds a fluid type scale, an 8px-derived spacing system, an
   elevation system, and motion tokens — the execution layer, not the identity.
   ========================================================================== */
:root {
  /* Brand colours — approved, do not change */
  --navy: #16202E;
  --navy-2: #1C2740;
  --navy-3: #212D48;              /* one step up for layered surfaces */
  --red: #E31E25;
  --red-deep: #B01218;
  --cream: #F1ECDF;
  --mist: #B9B29D;
  --hairline: rgba(227, 30, 37, 0.35);
  --hairline-soft: rgba(241, 236, 223, 0.14);

  --font-display: "Cormorant Garamond", serif;
  --font-body: "EB Garamond", serif;
  --font-mono: "IBM Plex Mono", monospace;

  --wrap: 1100px;

  /* Spacing — everything derives from an 8px base ------------------------- */
  --space-2xs: 4px;
  --space-xs:  8px;
  --space-sm:  16px;
  --space-md:  24px;
  --space-lg:  32px;
  --space-xl:  48px;
  --space-2xl: 64px;
  --space-3xl: 96px;

  /* Fluid type scale — smooth from mobile to desktop, no breakpoint jumps -- */
  --fs-hero:   clamp(2.75rem, 1.85rem + 4.3vw, 4.25rem);
  --fs-h1:     clamp(2.1rem, 1.62rem + 2.3vw, 2.9rem);
  --fs-h2:     clamp(1.5rem, 1.3rem + 0.95vw, 1.85rem);
  --fs-h3:     clamp(1.24rem, 1.14rem + 0.5vw, 1.45rem);
  --fs-lede:   clamp(1.06rem, 1rem + 0.3vw, 1.22rem);
  --fs-body:   1.0625rem;         /* 17px */
  --fs-small:  0.8125rem;         /* 13px */
  --fs-stat:   clamp(1.7rem, 1.4rem + 1.4vw, 2.15rem);

  /* Motion --------------------------------------------------------------- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 180ms;
  --dur-med:  340ms;
  --dur-slow: 620ms;

  /* Elevation — soft shadow reads against the dark ground ---------------- */
  --shadow-1: 0 1px 2px rgba(0,0,0,0.28), 0 10px 26px -14px rgba(0,0,0,0.55);
  --shadow-2: 0 2px 5px rgba(0,0,0,0.32), 0 20px 44px -18px rgba(0,0,0,0.65);
  --radius: 6px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Guard against sideways scroll on mobile: full-bleed decorations (the hero
   aurora/flow-field at 100vw+) are allowed to reach the viewport edges, but
   never push the page wider than it. No sticky elements depend on this. */
html, body { overflow-x: hidden; }

body {
  margin: 0;
  max-width: 100%;
  background: var(--navy);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
}

/* Paper-like grain — rugby clubhouses are physical, textured places.
   A barely-there fractal-noise overlay stops the navy reading as a flat
   digital fill. Fixed so it feels like the grain of the surface, not the
   content. Baked as an inline SVG data URI, so it adds no request weight.  */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* Keep all real content above the grain layer */
.site-header, main, .site-footer { position: relative; z-index: 1; }
/* Header (and its mobile dropdown) must stack above main's content */
.site-header { z-index: 50; }

a { color: inherit; }
img { max-width: 100%; display: block; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* Shown only when the enhancement layer is live */
.js-only { display: none; }
.js .js-only { display: inline; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ==========================================================================
   Motion system: scroll reveals + reduced-motion floor
   ==========================================================================
   Reveal state is applied ONLY when JS is present (html.js), so with JS
   disabled every .reveal is fully visible and nothing is ever hidden.      */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-med) var(--ease-out),
              transform var(--dur-med) var(--ease-out);
  will-change: opacity, transform;
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Accessibility floor — honoured everywhere, without exception.            */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  /* No entrance choreography at all — content simply is where it belongs.  */
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .js .hero > * { opacity: 1 !important; transform: none !important; }
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--hairline-soft);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}
.brand img {
  height: 40px;
  width: 40px;
  filter: drop-shadow(0 0 10px rgba(227, 30, 37, 0.35));
  transition: filter var(--dur-med) var(--ease-out);
}
.brand:hover img { filter: drop-shadow(0 0 14px rgba(227, 30, 37, 0.55)); }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream);
}
.site-nav {
  display: flex;
  gap: var(--space-lg);
}
.site-nav a {
  position: relative;
  color: var(--mist);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-bottom: 4px;
  transition: color var(--dur-fast) var(--ease-out);
}
/* Hover micro-interaction: a red rule draws in from the left under the link */
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1.5px;
  width: 100%;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-med) var(--ease-out);
}
.site-nav a:hover { color: var(--red); }
.site-nav a:hover::after { transform: scaleX(1); }
.site-nav a.active { color: var(--red); }
.site-nav a.active::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--hairline-soft);
  border-radius: 4px;
  color: var(--cream);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.nav-toggle:hover { border-color: var(--hairline); }

@media (max-width: 760px) {
  .site-nav {
    position: absolute;
    top: 100%;                     /* flush to the header's bottom edge */
    left: 0;
    right: 0;
    background: var(--navy-2);
    border-top: 1px solid var(--hairline-soft);
    border-bottom: 1px solid var(--hairline-soft);
    box-shadow: var(--shadow-2);
    flex-direction: column;
    gap: 0;
    display: none;
    z-index: 30;
  }
  .site-nav.open { display: flex; }
  .site-nav a {
    padding: 16px var(--space-lg);
    letter-spacing: 0.14em;
  }
  .site-nav a + a {
    border-top: 1px solid var(--hairline-soft);
  }
  .site-nav a::after { display: none; }
  .nav-toggle { display: flex; }
}

/* ==========================================================================
   Signature element: crest with a slow, ambient glow
   ==========================================================================
   This is the site's one recurring atmospheric device. The glow breathes at
   a barely-perceptible pace — the kind of thing you only notice if you stare.
   It is deliberately NOT reused elsewhere, so it stays a signature.         */
.crest-glow {
  display: block;
  margin: 0 auto;
  position: relative;
  width: max-content;
}
.crest-glow img {
  position: relative;
  z-index: 1;
  background: var(--cream);
  border-radius: 10px;
  padding: 14px;
}
.crest-glow::before {
  content: "";
  position: absolute;
  inset: -30px;
  background: radial-gradient(circle, rgba(227, 30, 37, 0.30), transparent 70%);
  z-index: 0;
  animation: crest-breathe 7s var(--ease-out) infinite;
}
@keyframes crest-breathe {
  0%, 100% { opacity: 0.72; transform: scale(0.98); }
  50%      { opacity: 1;    transform: scale(1.05); }
}

.rule {
  width: 64px;
  height: 1px;
  background: var(--red);
  margin: var(--space-md) auto;
  border: none;
}
.rule.left { margin: var(--space-md) 0; }

/* ==========================================================================
   Hero (home) — a considered load sequence, not content that just appears
   ==========================================================================
   Eyebrow -> headline -> rule -> lede -> stats arrive in sequence, each with
   a small upward settle. Choreography lives under html.js so the no-JS view
   is fully visible; reduced-motion strips it entirely (rule above).         */
.hero {
  /* padding-block only — horizontal gutter comes from .wrap and must survive */
  padding-block: var(--space-3xl) var(--space-2xl);
  text-align: center;
  position: relative;
  isolation: isolate;          /* own stacking context for the aurora layers */
}

/* ==========================================================================
   Dynamic hero aurora — two counter-drifting fields of club-red light that
   slowly breathe behind the hero. Full-bleed, GPU-composited (transform +
   opacity only), masked to dissolve into the navy at the edges. The global
   reduced-motion rule freezes both layers into a static glow.
   ========================================================================== */
/* Interactive flow-field canvas (JS-injected) — sits above the aurora,
   below the hero content. Full-bleed, masked to melt into the navy. */
.hero-canvas {
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 130%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  -webkit-mask-image: radial-gradient(72% 62% at 50% 45%, #000 45%, transparent 100%);
          mask-image: radial-gradient(72% 62% at 50% 45%, #000 45%, transparent 100%);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: -2;
  top: 50%;
  left: 50%;
  width: 130vw;
  aspect-ratio: 1 / 1;
  max-width: 1500px;
  border-radius: 46% 54% 58% 42% / 48% 44% 56% 52%;
  pointer-events: none;
  will-change: transform, opacity;
  /* dissolve the layer's own edges so no hard shape shows */
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 55%, transparent 100%);
}

/* Warm layer — the club red, drawn as three offset glows for organic depth */
.hero::before {
  background:
    radial-gradient(38% 38% at 32% 34%, rgba(227, 30, 37, 0.42), transparent 70%),
    radial-gradient(34% 34% at 70% 62%, rgba(176, 18, 24, 0.38), transparent 72%),
    radial-gradient(46% 46% at 54% 46%, rgba(227, 30, 37, 0.16), transparent 75%);
  filter: blur(28px);
  animation: aurora-drift-a 26s var(--ease-out) infinite;
}

/* Cool counter-layer — a lifted navy highlight that keeps it from reading
   as a single red smear and adds dimensional movement */
.hero::after {
  width: 108vw;
  max-width: 1240px;
  background:
    radial-gradient(40% 40% at 62% 30%, rgba(33, 45, 72, 0.55), transparent 70%),
    radial-gradient(36% 36% at 34% 66%, rgba(28, 39, 64, 0.5), transparent 72%),
    radial-gradient(30% 30% at 50% 52%, rgba(241, 236, 223, 0.06), transparent 76%);
  filter: blur(30px);
  animation: aurora-drift-b 34s var(--ease-out) infinite;
}

@keyframes aurora-drift-a {
  0%   { transform: translate(-50%, -50%) rotate(0deg)   scale(1);    opacity: 0.9; }
  50%  { transform: translate(-44%, -54%) rotate(180deg) scale(1.14); opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(360deg) scale(1);    opacity: 0.9; }
}
@keyframes aurora-drift-b {
  0%   { transform: translate(-50%, -50%) rotate(0deg)    scale(1.08); opacity: 0.75; }
  50%  { transform: translate(-56%, -46%) rotate(-180deg) scale(1);    opacity: 0.95; }
  100% { transform: translate(-50%, -50%) rotate(-360deg) scale(1.08); opacity: 0.75; }
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--red);
  margin: var(--space-md) 0 10px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-hero);
  line-height: 1.08;
  margin: 0 0 var(--space-xs);
  letter-spacing: 0.01em;
}
.lede {
  font-style: italic;
  color: var(--mist);
  font-size: var(--fs-lede);
  max-width: 52ch;
  margin: 0 auto var(--space-lg);
}

.js .hero.seq > * {
  opacity: 0;
  transform: translateY(14px);
  animation: hero-rise var(--dur-slow) var(--ease-out) forwards;
}
.js .hero.seq > *:nth-child(1) { animation-delay: 60ms; }
.js .hero.seq > *:nth-child(2) { animation-delay: 160ms; }
.js .hero.seq > *:nth-child(3) { animation-delay: 260ms; }
.js .hero.seq > *:nth-child(4) { animation-delay: 360ms; }
.js .hero.seq > *:nth-child(5) { animation-delay: 470ms; }
.js .hero.seq > *:nth-child(6) { animation-delay: 580ms; }
@keyframes hero-rise {
  to { opacity: 1; transform: none; }
}

/* Honours / stat row — reused across pages */
.stat-row {
  display: flex;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}
.stat {
  padding: 0 var(--space-lg);
  border-right: 1px solid var(--hairline);
  text-align: center;
}
.stat:last-child { border-right: none; }
.stat .n {
  font-family: var(--font-display);
  font-size: var(--fs-stat);
  color: var(--red);
  font-variant-numeric: tabular-nums;
}
.stat .l {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mist);
  margin-top: var(--space-2xs);
}
@media (max-width: 560px) {
  .stat-row { flex-direction: column; gap: var(--space-sm); }
  .stat { border-right: none; padding: 0; }
}

/* ==========================================================================
   Generic page hero (non-home pages)
   ========================================================================== */
.page-hero {
  padding-block: var(--space-2xl) var(--space-xl);
  text-align: center;
  border-bottom: 1px solid var(--hairline-soft);
}
.page-hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-h1);
  margin: var(--space-xs) 0 var(--space-sm);
}
.page-hero .lede { margin-bottom: 0; }

/* ==========================================================================
   Sections & cards
   ========================================================================== */
section.block { padding-block: var(--space-2xl); }
section.block.tight { padding-block: var(--space-xl); }
.section-heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-h2);
  text-align: center;
  margin: 0 0 var(--space-xs);
}
.section-lede {
  text-align: center;
  color: var(--mist);
  max-width: 60ch;
  margin: 0 auto var(--space-lg);
  font-style: italic;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}
@media (max-width: 820px) {
  .card-grid { grid-template-columns: 1fr; }
}

.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
}
.sponsor-card {
  background: var(--navy-2);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius);
  padding: var(--space-sm);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.sponsor-card img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 4px;
}

/* Refined elevation system — one card treatment used everywhere:
   soft shadow at rest, a hairline that warms and a short red rule that
   extends on hover, plus a small lift. Consistent across the whole site.   */
.card {
  position: relative;
  background: var(--navy-2);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  text-decoration: none;
  color: var(--cream);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition: border-color var(--dur-med) var(--ease-out),
              transform var(--dur-med) var(--ease-out),
              box-shadow var(--dur-med) var(--ease-out);
}
.card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0.35);
  transform-origin: center;
  width: 88px;
  height: 2px;
  background: var(--red);
  transition: transform var(--dur-med) var(--ease-out);
}
.card:hover,
.card:focus-visible {
  border-color: var(--hairline);
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
}
.card:hover::after,
.card:focus-visible::after { transform: translateX(-50%) scaleX(1); }
.card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-h3);
  margin: var(--space-xs) 0 10px;
}
.card p {
  color: var(--mist);
  font-size: 15px;
  margin: 0;
}

/* Next fixture callout */
.next-fixture {
  max-width: 560px;
  margin: 0 auto;
  background: var(--navy-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
  text-align: center;
  box-shadow: var(--shadow-1);
}
.next-fixture .rd {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}
.next-fixture .teams {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 600;
  margin: var(--space-xs) 0;
}
.next-fixture .teams .v { color: var(--mist); font-style: italic; }
.next-fixture .meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--mist);
  margin: 0;
}

/* Live countdown to kickoff — computed client-side, so always current.
   Hidden until JS fills it in (no JS => it simply never appears).          */
.countdown {
  display: none;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--hairline-soft);
  justify-content: center;
  gap: var(--space-md);
}
.countdown.ready { display: flex; }
.countdown .unit { text-align: center; min-width: 52px; }
.countdown .unit .cd-n {
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}
.countdown .unit .cd-l {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mist);
  margin-top: 6px;
}
.countdown .cd-live {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--red);
  letter-spacing: 0.06em;
  align-self: center;
}

/* ==========================================================================
   Fixtures / Results / Table
   ========================================================================== */

/* Segmented filter control — All / Upcoming / Results.
   Shown only with JS; without it, the fixtures simply render in full.       */
.fixture-filter {
  display: none;
  gap: 2px;
  padding: 3px;
  background: var(--navy-2);
  border: 1px solid var(--hairline-soft);
  border-radius: 999px;
  margin: 0 auto var(--space-xl);
  width: max-content;
}
.js .fixture-filter { display: inline-flex; }
.fixture-filter button {
  appearance: none;
  border: none;
  background: none;
  color: var(--mist);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}
.fixture-filter button:hover { color: var(--cream); }
.fixture-filter button[aria-pressed="true"] {
  background: var(--red);
  color: #fff;
}

.fixture-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}
@media (max-width: 760px) { .fixture-columns { grid-template-columns: 1fr; } }
/* When a single filter is active, JS collapses to one column */
.fixture-columns.single { grid-template-columns: 1fr; max-width: 640px; margin: 0 auto; }
.fixture-col[hidden] { display: none; }

.fixture-list { list-style: none; margin: 0; padding: 0; }
.fixture-row {
  display: grid;
  grid-template-columns: 46px 90px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 13px 12px;
  border-bottom: 1px solid var(--hairline-soft);
  border-radius: 4px;
  transition: background var(--dur-fast) var(--ease-out);
}
.fixture-row:hover { background: rgba(241, 236, 223, 0.03); }
.fixture-row.result { grid-template-columns: 46px 90px 1fr; }
.fixture-round { font-family: var(--font-mono); font-size: 11px; color: var(--red); }
.fixture-date { font-family: var(--font-mono); font-size: 12px; color: var(--mist); }
.fixture-teams { font-size: 16px; }
.fixture-teams .v { color: var(--mist); margin: 0 8px; font-style: italic; }
.fixture-teams .score {
  font-family: var(--font-mono);
  font-weight: 500;
  margin: 0 10px;
  background: var(--navy);
  padding: 2px 9px;
  border-radius: 3px;
}
.fixture-venue { font-size: 11px; color: var(--mist); text-transform: uppercase; letter-spacing: 0.05em; }
.fixture-row.home .fixture-teams strong:first-child { color: var(--red); }
.empty-note { color: var(--mist); font-style: italic; }

/* Small phones: the 4-track grid crushes team names, so put the meta
   (round · date · venue) on one line and give the teams a full-width line
   beneath. Declared AFTER the base .fixture-row so it wins on source order. */
@media (max-width: 560px) {
  .fixture-row,
  .fixture-row.result {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 10px;
    row-gap: 6px;
    padding: 13px 14px;
  }
  .fixture-round { order: 0; }
  .fixture-date { order: 1; }
  .fixture-venue { order: 2; margin-left: auto; white-space: nowrap; }
  .fixture-teams {
    order: 3;
    flex: 1 0 100%;
    font-size: 15px;
  }
}

.table-wrap { overflow-x: auto; }
.league-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.league-table th, .league-table td { padding: 11px 12px; border-bottom: 1px solid var(--hairline-soft); text-align: left; }
.league-table th {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mist);
  font-weight: 500;
}
.league-table td.num, .league-table th.num { text-align: center; }
.league-table td.pts { font-weight: 600; color: var(--red); }
.league-table tr.malone-row { background: var(--navy-2); font-weight: 600; }
.league-table tbody tr { transition: background var(--dur-fast) var(--ease-out); }
.league-table tbody tr:hover { background: rgba(241, 236, 223, 0.03); }
.table-note { font-size: 13px; color: var(--mist); margin-top: var(--space-sm); }

/* Sortable table headers — only interactive when JS upgrades them */
.league-table th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out);
}
.league-table th.sortable:hover { color: var(--cream); }
.league-table th.sortable .arrow {
  display: inline-block;
  width: 0.7em;
  opacity: 0.4;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.league-table th[aria-sort="ascending"] .arrow::after  { content: "\2191"; }
.league-table th[aria-sort="descending"] .arrow::after { content: "\2193"; }
.league-table th[aria-sort="ascending"] .arrow,
.league-table th[aria-sort="descending"] .arrow { opacity: 1; }
.league-table th[aria-sort="ascending"],
.league-table th[aria-sort="descending"] { color: var(--cream); }

/* ==========================================================================
   Teams page — a distinct but harmonious treatment per age grade.
   ==========================================================================
   Each grade gets its own accent tint and a textured placeholder panel that
   reads as an intentional slot for the club's own photography, not a grey
   "image here" box. Drop a real photo into .team-media img and it takes over. */
.team-grid {
  display: grid;
  gap: var(--space-lg);
}
.team-card {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--space-xl);
  align-items: center;
  padding: var(--space-lg);
  background: var(--navy-2);
  border: 1px solid var(--hairline-soft);
  border-left: 3px solid var(--grade-accent, var(--red));
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  transition: transform var(--dur-med) var(--ease-out),
              box-shadow var(--dur-med) var(--ease-out),
              border-color var(--dur-med) var(--ease-out);
}
.team-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
  border-color: var(--hairline);
}
.team-card:nth-child(even) { grid-template-columns: 1fr 300px; }
.team-card:nth-child(even) .team-media { order: 2; }
@media (max-width: 720px) {
  .team-card, .team-card:nth-child(even) { grid-template-columns: 1fr; gap: var(--space-md); }
  .team-card:nth-child(even) .team-media { order: 0; }
}

/* Textured placeholder — a tint of the grade's accent over a fine crest
   motif, clearly a considered slot. Swap for a real <img> when supplied.    */
.team-media {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 5px;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--grade-accent) 42%, transparent), transparent 60%),
    linear-gradient(150deg, var(--navy-3), var(--navy));
  border: 1px solid var(--hairline-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
.team-media::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.team-media img { width: 100%; height: 100%; object-fit: cover; }
.team-media .slot-label {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0.55;
  border: 1px solid var(--hairline-soft);
  border-radius: 999px;
  padding: 6px 14px;
  background: rgba(22, 32, 46, 0.5);
}
.team-card .team-body h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  margin: 0 0 var(--space-2xs);
}
.team-card .tagline {
  color: var(--grade-accent, var(--red));
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 var(--space-sm);
}
.team-card .team-body p { color: var(--mist); max-width: 60ch; margin: 0; }
.team-card .team-body a { color: var(--red); }

/* ==========================================================================
   News page — a clear entry point: the latest post gets a featured
   treatment, distinct from the list beneath it.
   ========================================================================== */
.news-featured {
  max-width: 860px;
  margin: 0 auto var(--space-2xl);
  background: var(--navy-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: var(--space-xl);
  box-shadow: var(--shadow-1);
  position: relative;
  overflow: hidden;
}
.news-featured::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: var(--red);
}
.news-featured .tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: var(--space-md);
}
.news-featured .date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mist);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 var(--space-xs);
}
.news-featured h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 1.4rem + 1.4vw, 2.3rem);
  margin: 0 0 var(--space-sm);
  line-height: 1.15;
}
.news-featured p { color: var(--cream); margin: 0; max-width: 62ch; }

.news-list { max-width: 720px; margin: 0 auto; }
.news-list .list-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mist);
  border-bottom: 1px solid var(--hairline-soft);
  padding-bottom: var(--space-xs);
  margin-bottom: var(--space-xs);
}
.news-item {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--hairline-soft);
}
.news-item .date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-xs);
}
.news-item h2 { font-family: var(--font-display); font-size: var(--fs-h3); margin: 0 0 10px; }
.news-item p { color: var(--mist); margin: 0; }

/* ==========================================================================
   Join / form
   ========================================================================== */
.join-contacts {
  display: flex;
  justify-content: center;
  margin-top: var(--space-md);
}
.join-contacts-card {
  max-width: 620px;
  width: 100%;
  background: var(--navy-2);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius);
  padding: var(--space-lg);
  box-shadow: var(--shadow-1);
}
.join-contacts-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 var(--space-sm);
}
.join-contacts-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
  color: var(--mist);
  line-height: 1.6;
}
.join-contacts-list strong {
  color: var(--cream);
  display: inline-block;
  margin-bottom: 4px;
}
@media (max-width: 760px) {
  .join-contacts-list { grid-template-columns: 1fr; }
}
.join-form {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist);
  margin-bottom: var(--space-xs);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--navy-2);
  border: 1px solid var(--hairline-soft);
  border-radius: 4px;
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 16px;
  padding: 12px 14px;
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--red);
  outline: none;
  box-shadow: 0 0 0 3px rgba(227, 30, 37, 0.15);
}
.field textarea { resize: vertical; min-height: 100px; }

/* Real-time validation — calm, never aggressive. A quiet green when a field
   is satisfied, a measured note (not a flashing red border) when it isn't.  */
.field.valid input,
.field.valid select,
.field.valid textarea {
  border-color: rgba(120, 170, 120, 0.55);
}
.field.invalid input,
.field.invalid select,
.field.invalid textarea {
  border-color: rgba(227, 30, 37, 0.55);
}
.field .hint {
  display: block;
  min-height: 1.1em;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--mist);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.field.invalid .hint { opacity: 1; transform: none; color: #E88; }
.field.valid .hint::before { content: "\2713  Looks good"; opacity: 1; }
.field.valid .hint { opacity: 0.75; transform: none; color: rgba(150, 190, 150, 0.9); }

.btn {
  display: inline-block;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.03em;
  padding: 14px var(--space-lg);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: background var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.btn:hover { background: var(--red-deep); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(0); }

/* Confirmation — a small moment of ceremony for someone joining the club.   */
.confirm-banner {
  max-width: 560px;
  margin: 0 auto var(--space-md);
  background: var(--navy-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: var(--space-lg);
  text-align: center;
  color: var(--cream);
  box-shadow: var(--shadow-1);
  position: relative;
  overflow: hidden;
}
.confirm-banner::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--red);
}
.confirm-banner .seal {
  width: 46px;
  height: 46px;
  margin: 0 auto var(--space-sm);
  border-radius: 50%;
  border: 1.5px solid var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  font-size: 22px;
  animation: seal-in var(--dur-slow) var(--ease-out) both;
}
@keyframes seal-in {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}
.confirm-banner strong {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  display: block;
  margin-bottom: var(--space-2xs);
}
.confirm-banner .sub { color: var(--mist); font-size: 15px; }

/* ==========================================================================
   Club history prose
   ========================================================================== */
.prose { max-width: 720px; margin-inline: auto; text-align: center; }
.prose p { margin: 0 0 var(--space-md); }

/* ==========================================================================
   Contact page
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-line { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--hairline-soft); }
.contact-line .label { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mist); min-width: 90px; }
.contact-line a { color: var(--cream); text-decoration: none; transition: color var(--dur-fast) var(--ease-out); }
.contact-line a:hover { color: var(--red); }
.review-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--mist);
  margin-top: var(--space-sm);
}
.review-badge b { color: var(--red); }
.map-frame {
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
  box-shadow: var(--shadow-1);
}
.map-frame iframe { width: 100%; height: 100%; border: 0; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--hairline-soft);
  padding: var(--space-xl) 0;
  margin-top: var(--space-xl);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand img { height: 30px; width: 30px; }
.footer-brand span { font-family: var(--font-display); font-size: 15px; letter-spacing: 0.05em; }
.footer-meta { font-size: 13px; color: var(--mist); text-align: right; }
.footer-meta a { color: var(--mist); text-decoration: underline; }
@media (max-width: 560px) {
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-meta { text-align: center; }
}

/* ==========================================================================
   Club history timeline
   A single red spine with year-stamped milestones. Each item reveals as it
   scrolls into view (reuses the .reveal machinery via the parent section).
   ========================================================================== */
.timeline {
  list-style: none;
  margin: var(--space-md) auto 0;
  padding: 0;
  max-width: 760px;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 120px;
  width: 2px;
  background: linear-gradient(var(--hairline), var(--hairline-soft));
}
.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--space-lg);
  padding-bottom: var(--space-xl);
}
.tl-item:last-child { padding-bottom: 0; }
.tl-year {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--red);
  text-align: right;
  padding-top: 2px;
}
.tl-body { position: relative; padding-left: var(--space-lg); }
.tl-body::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px var(--navy);
}
.tl-body h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-h3);
  margin: 0 0 var(--space-2xs);
}
.tl-body p { margin: 0; color: var(--mist); }
@media (max-width: 620px) {
  .timeline::before { left: 5px; }
  .tl-item { grid-template-columns: 1fr; gap: var(--space-2xs); }
  .tl-year { text-align: left; padding-left: var(--space-lg); }
  .tl-body { padding-left: var(--space-lg); }
  .tl-body::before { left: 0; }
}

/* ==========================================================================
   Photo gallery — masonry-feel grid of lazy thumbnails + a lightbox viewer
   ========================================================================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: var(--space-xs);
}
.gallery-item {
  display: block;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--hairline-soft);
  background: var(--navy-2);
  box-shadow: var(--shadow-1);
  cursor: pointer;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-med) var(--ease-out),
              opacity var(--dur-med) var(--ease-out);
}
.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(22,32,46,0.45));
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease-out);
}
.gallery-item:hover img { transform: scale(1.05); }
.gallery-item:hover::after { opacity: 1; }
.gallery-item:hover { border-color: var(--hairline); }
@media (max-width: 560px) {
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* Lightbox — full-screen viewer, only ever shown by JS. */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: rgba(11, 16, 24, 0.94);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease-out);
}
.lightbox.open { opacity: 1; }
.lb-stage {
  margin: 0;
  max-width: min(1100px, 92vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}
.lb-img {
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  object-fit: contain;
}
.lb-count {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--mist);
}
.lb-close,
.lb-nav {
  flex: none;
  background: rgba(241, 236, 223, 0.08);
  color: var(--cream);
  border: 1px solid var(--hairline-soft);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.lb-close:hover,
.lb-nav:hover { background: var(--red); border-color: var(--red); }
.lb-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
}
@media (max-width: 640px) {
  .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); }
  .lb-prev { left: var(--space-xs); }
  .lb-next { right: var(--space-xs); }
  .lb-close { top: var(--space-xs); right: var(--space-xs); }
}
