/* Thames Valley Riders - shared stylesheet. Plain CSS, no build step. */
:root {
  --bg: #0a0a0c;
  --surface: #141418;
  --surface-2: #1c1c22;
  --line: rgba(255, 255, 255, .12);
  --text: #f5f5f6;
  --muted: #b6b6c0;
  --gold: #ffb81c;
  --gold-ink: #120d00;
  --dirt: #e2692f;
  --radius: 16px;
  --font-display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --max: 1160px;
  --header-h: 68px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1.0625rem/1.6 var(--font-body); min-width: 320px;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: #ffd36b; }
h1, h2, h3, h4 { font-family: var(--font-display); text-transform: uppercase; line-height: 1.02; letter-spacing: .01em; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(2.8rem, 9vw, 6rem); }
h2 { font-size: clamp(2rem, 5vw, 3.2rem); }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--gold-ink); padding: 10px 16px; z-index: 100; border-radius: 8px; font-weight: 700; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(100% - 32px, var(--max)); margin-inline: auto; }
.section { padding: clamp(56px, 9vw, 112px) 0; }
.section--alt { background: var(--surface); border-block: 1px solid var(--line); }
.eyebrow { font: 700 .85rem/1 var(--font-body); letter-spacing: .18em; text-transform: uppercase; color: var(--gold); margin: 0 0 14px; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(10, 10, 12, .72); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
}
.site-header .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font: 800 1.35rem/1 var(--font-display); text-transform: uppercase; letter-spacing: .04em; }
.brand img { width: 42px; height: 42px; flex: none; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 400px) { .brand { font-size: 1rem; gap: 8px; } }
.nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; align-items: center; }
.nav a { display: block; padding: 8px 12px; border-radius: 999px; color: var(--text); text-decoration: none; font-weight: 600; font-size: .98rem; }
.nav a:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.nav a[aria-current="page"] { color: var(--gold); }
.nav .btn { padding: 9px 18px; margin-left: 8px; color: var(--gold-ink); }
.nav .btn:hover { color: var(--gold-ink); background: #ffd36b; }
.header-actions { display: flex; align-items: center; gap: 8px; order: 3; }
.nav { order: 2; }
.chat-btn { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; }
.chat-btn[hidden] { display: none; }
.chat-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.chat-btn:disabled { opacity: .5; cursor: progress; }
html[data-chatwoot-pending] .woot-widget-holder, html[data-chatwoot-pending] .woot--bubble-holder { visibility: hidden !important; pointer-events: none !important; }
.menu-btn { display: none; background: transparent; border: 1px solid var(--line); color: var(--text); width: 46px; height: 46px; border-radius: 12px; cursor: pointer; }
.menu-btn span, .menu-btn span::before, .menu-btn span::after { display: block; width: 20px; height: 2px; background: currentColor; margin: auto; position: relative; transition: transform .25s, opacity .25s; }
.menu-btn span::before, .menu-btn span::after { content: ""; position: absolute; left: 0; }
.menu-btn span::before { top: -7px; } .menu-btn span::after { top: 7px; }
.menu-btn[aria-expanded="true"] span { background: transparent; }
.menu-btn[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 1180px) {
  .js .menu-btn { display: block; }
  .site-header { height: auto; min-height: var(--header-h); }
  .site-header .wrap { flex-wrap: wrap; padding-block: 11px; }
  .nav { width: 100%; order: 4; }
  .nav ul { flex-direction: column; align-items: stretch; gap: 2px; padding: 8px 0 12px; }
  .nav a { padding: 12px 14px; font-size: 1.1rem; }
  .nav .btn { margin: 8px 0 0; text-align: center; }
  .js .nav { display: none; }
  .js .nav.is-open { display: block; max-height: calc(100vh - var(--header-h)); max-height: calc(100dvh - var(--header-h)); overflow-y: auto; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 24px;
  border-radius: 999px; background: var(--gold); color: var(--gold-ink); font: 800 1rem/1 var(--font-body);
  letter-spacing: .04em; text-transform: uppercase; text-decoration: none; border: 2px solid var(--gold); cursor: pointer;
  transition: transform .2s, background .2s, box-shadow .2s;
}
.btn:hover { background: #ffd36b; border-color: #ffd36b; color: var(--gold-ink); transform: translateY(-2px); box-shadow: 0 10px 30px -8px rgba(255, 184, 28, .55); }
.btn--ghost { background: transparent; color: var(--text); border-color: rgba(255, 255, 255, .4); }
.btn--ghost:hover { background: rgba(255, 255, 255, .1); border-color: #fff; color: #fff; box-shadow: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Hero */
.hero { position: relative; min-height: min(92vh, 820px); display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; }
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10,10,12,.55) 0%, rgba(10,10,12,.35) 35%, rgba(10,10,12,.95) 100%), linear-gradient(90deg, rgba(10,10,12,.7), transparent 70%); }
.hero__body { padding: 120px 0 64px; max-width: 860px; }
.hero h1 { margin-bottom: 16px; text-shadow: 0 4px 40px rgba(0,0,0,.5); }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero .lead { color: #e2e2e8; }
.page-hero { padding: clamp(56px, 8vw, 104px) 0 clamp(32px, 5vw, 56px); background: radial-gradient(900px 400px at 80% -10%, rgba(255,184,28,.18), transparent 60%), var(--bg); border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(2.6rem, 8vw, 5rem); margin-bottom: 12px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: -40px; position: relative; z-index: 2; }
.stat { background: var(--surface); padding: 22px 20px; }
.stat b { display: block; font: 800 3rem/1 var(--font-display); color: var(--gold); }
.stat span { color: var(--muted); font-size: .95rem; }

/* Grids & cards */
.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; position: relative; transition: transform .25s, border-color .25s; }
.section--alt .card { background: var(--surface-2); }
.card:hover { border-color: rgba(255, 184, 28, .5); transform: translateY(-3px); }
.card h3 { margin-bottom: 10px; }
.card p:last-child { margin-bottom: 0; }
.card--cta { display: flex; flex-direction: column; align-items: flex-start; }
.card--cta .btn { margin-top: auto; }
.card--cta p { flex: 1; }
.price { font: 800 2.6rem/1 var(--font-display); color: var(--gold); margin: 6px 0 12px; }
.value-num { font: 800 3.2rem/1 var(--font-display); color: transparent; -webkit-text-stroke: 1.5px var(--gold); display: block; margin-bottom: 8px; }
.split { display: grid; gap: 40px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 860px) { .split { grid-template-columns: 1fr 1fr; } .split--rev > :first-child { order: 2; } }
.media { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.media img { width: 100%; }
.media figcaption { padding: 12px 16px; font-size: .92rem; color: var(--muted); }
figure { margin: 0; }
.zoom { display: block; position: relative; cursor: zoom-in; }
.zoom::after { content: "Enlarge"; position: absolute; right: 12px; bottom: 12px; background: rgba(0,0,0,.75); color: #fff; padding: 6px 12px; border-radius: 999px; font: 700 .8rem/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase; }

/* Chips and lists */
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 18px; }
.chip { display: inline-block; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 600; font-size: .95rem; }
.chip--gold { border-color: rgba(255,184,28,.6); color: var(--gold); }
.checks { list-style: none; padding: 0; margin: 0 0 1em; }
.checks li { position: relative; padding-left: 30px; margin-bottom: 10px; }
.checks li::before { content: ""; position: absolute; left: 0; top: .35em; width: 16px; height: 16px; border-radius: 50%; background: var(--gold); box-shadow: inset 0 0 0 4px var(--gold-ink); border: 2px solid var(--gold); }
.notice { border-left: 4px solid var(--gold); background: var(--surface-2); padding: 16px 20px; border-radius: 0 12px 12px 0; }

/* Tabs */
.tabs [role="tablist"] { display: none; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tabs [role="tab"] { font: 700 1rem/1 var(--font-body); padding: 13px 22px; min-height: 46px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; }
.tabs [role="tab"][aria-selected="true"] { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.tabs [role="tabpanel"] { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; margin-bottom: 16px; }
.js .tabs [role="tablist"] { display: flex; }
.js .tabs [role="tabpanel"][hidden] { display: none; }
.tabs [role="tabpanel"] h3 { font-size: 1.3rem; }
.js .tabs [role="tabpanel"] > h3:first-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sub-class { margin-top: 18px; }
.sub-class h4 { font-size: 1.2rem; margin-bottom: 8px; color: var(--gold); }

/* Accordion */
.accordion details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; }
.accordion summary { cursor: pointer; list-style: none; padding: 18px 56px 18px 20px; font: 700 1.15rem/1.3 var(--font-body); position: relative; min-height: 56px; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font: 400 1.8rem/1 var(--font-body); color: var(--gold); }
.accordion details[open] summary::after { content: "\2212"; }
.accordion details[open] { border-color: rgba(255,184,28,.5); }
.accordion .answer { padding: 0 20px 18px; color: var(--muted); }

/* Flags */
.flag { display: flex; gap: 16px; align-items: center; }
.flag__swatch { flex: none; width: 76px; height: 54px; border-radius: 8px; border: 2px solid rgba(255,255,255,.35); position: relative; overflow: hidden; }
.flag--yellow .flag__swatch { background: #ffd400; }
.flag--white .flag__swatch { background: #fff; }
.flag--black .flag__swatch { background: #000; }
.flag--red .flag__swatch { background: #d3122b; }
.flag--redcross .flag__swatch { background: #fff; }
.flag--redcross .flag__swatch::before, .flag--redcross .flag__swatch::after { content: ""; position: absolute; background: #d3122b; }
.flag--redcross .flag__swatch::before { left: 50%; top: 8px; bottom: 8px; width: 12px; transform: translateX(-50%); }
.flag--redcross .flag__swatch::after { top: 50%; left: 22px; right: 22px; height: 12px; transform: translateY(-50%); }
.flag h3 { font-size: 1.35rem; margin: 0 0 2px; }
.flag p { margin: 0; color: var(--muted); }

/* Timeline */
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 14px; }
.steps li { counter-increment: s; position: relative; padding: 18px 20px 18px 74px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.steps li::before { content: counter(s); position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; background: var(--gold); color: var(--gold-ink); font: 800 1.3rem/40px var(--font-display); text-align: center; }
.steps b { color: var(--gold); }

/* Tracks, results, contact */
.track-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.track-card .thumb { aspect-ratio: 4 / 3; background: #000; overflow: hidden; }
.track-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.track-card:hover .thumb img { transform: scale(1.05); }
.track-card .thumb--text { display: grid; place-items: center; background: linear-gradient(135deg, #2a2a30, #121216); font: 800 4rem/1 var(--font-display); color: var(--gold); }
.track-card .info { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; gap: 8px; }
.track-card h3 { margin: 0; }
.track-card .info a { margin-top: auto; font-weight: 700; }
.result-card { display: flex; flex-direction: column; gap: 10px; background: linear-gradient(160deg, #1d1d24, #121216); }
.result-card h3 { font-size: 2.2rem; }
.person h3 { font-size: 1.45rem; margin-bottom: 2px; }
.role { color: var(--gold); font-weight: 700; margin-bottom: 8px; }
.board { columns: 2 220px; list-style: none; padding: 0; margin: 0; }
.board li { padding: 10px 0; border-bottom: 1px solid var(--line); break-inside: avoid; font-weight: 600; }
.social-row { display: flex; flex-wrap: wrap; gap: 12px; }
.social-row a.badge { display: inline-block; border-radius: 10px; overflow: hidden; line-height: 0; border: 1px solid var(--line); }
.social-row a.badge img { height: 44px; width: auto; }
.signup-art { max-width: 520px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: #060608; padding: 56px 0 32px; margin-top: 0; }
.footer-grid { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.site-footer h2 { font-size: 1.1rem; color: var(--gold); letter-spacing: .12em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { text-decoration: none; color: var(--text); }
.site-footer a:hover { color: var(--gold); text-decoration: underline; }
.legal { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }

/* Lightbox */
dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100%; height: 100%; }
dialog.lightbox::backdrop { background: rgba(0,0,0,.92); }
.lightbox__inner { display: grid; place-items: center; width: 100%; height: 100%; padding: 56px 12px 12px; overflow: auto; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 80px); width: auto; height: auto; object-fit: contain; border-radius: 8px; }
.lightbox__close { width: auto; position: fixed; top: 12px; right: 12px; z-index: 2; }

/* Reveal animation */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; transition-delay: var(--d, 0s); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
@media (max-width: 480px) { .btn { width: 100%; } .btn-row { flex-direction: column; } .stat b { font-size: 2.4rem; } }
@media print { .site-header, .site-footer, .btn { display: none; } body { background: #fff; color: #000; } }
