/* Dutch Downhill Division: site.css
   Structure follows docs/design-framework.md: tokens, base, layout, components, utilities. */

/* ---------- Fonts (self-hosted, SIL OFL) ---------- */
@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/barlow-condensed-800-italic.woff2") format("woff2");
  font-weight: 800; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/barlow-condensed-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-variable.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --c-bg: #0D0E10;
  --c-surface: #17191C;
  --c-line: #2A2D32;
  --c-muted: #9BA1A9;
  --c-text: #F3F1EC;
  --c-accent: #FF5B1F;
  --c-accent-ink: #0D0E10;
  --c-sky: #7CC4FF;

  --f-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --f-label: "Barlow Condensed", "Arial Narrow", sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --t-hero: clamp(3rem, 11vw, 8.5rem);
  --t-h2: clamp(2.25rem, 6vw, 4.5rem);
  --t-h3: clamp(1.5rem, 3vw, 2rem);
  --t-body: 1.0625rem;
  --t-small: 0.875rem;
  --t-label: 0.8125rem;

  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem;
  --s-5: 1.5rem; --s-6: 2.5rem; --s-7: 4rem; --s-8: 7rem;

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --max: 76rem;
  --measure: 65ch;
  --radius: 4px;
  --lean: -8deg;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --dur: 200ms;
  --header-h: 4.25rem;

  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  background: var(--c-bg);
  color: var(--c-text);
  font: 400 var(--t-body)/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, picture, svg, iframe { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3 {
  font-family: var(--f-display);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  line-height: .95;
  letter-spacing: -.005em;
  text-wrap: balance;
}
h2 { font-size: var(--t-h2); margin-bottom: var(--s-5); }
h3 { font-size: var(--t-h3); margin-bottom: var(--s-3); }
p { max-width: var(--measure); text-wrap: pretty; }
p + p { margin-top: var(--s-4); }
strong { font-weight: 650; }
a { color: inherit; text-decoration-color: var(--c-accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--c-accent); }
a[target="_blank"]:where(:not(.btn, .plain))::after { content: " ↗"; font-size: .85em; }
:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; }
[id] { scroll-margin-top: calc(var(--header-h) + var(--s-4)); }
::selection { background: var(--c-accent); color: var(--c-accent-ink); }

.skip {
  position: absolute; left: var(--s-4); top: -10rem; z-index: 100;
  background: var(--c-accent); color: var(--c-accent-ink);
  padding: var(--s-3) var(--s-4); font-weight: 650;
}
.skip:focus { top: var(--s-4); }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--s-7); }
@media (min-width: 52rem) { .section { padding-block: var(--s-8); } }
.section--light {
  --c-bg: #F3F1EC; --c-surface: #FFFFFF; --c-text: #0D0E10; --c-muted: #4A4F57; --c-line: #D9D5CC;
  background: var(--c-bg); color: var(--c-text);
  color-scheme: light;
}
.section--light a:hover { color: inherit; text-decoration-color: currentColor; }
.section--surface { background: var(--c-surface); }
.grid {
  display: grid; gap: var(--s-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min, 18rem)), 1fr));
}
.grid--narrow { --min: 15rem; }
.grid--wide { --min: 20rem; }
.split { display: grid; gap: var(--s-6); align-items: start; }
@media (min-width: 52rem) {
  .split { grid-template-columns: 1fr 1fr; gap: var(--s-7); }
  .split--wide-start { grid-template-columns: 1.3fr 1fr; }
}
.stack > * + * { margin-top: var(--s-4); }
.section-head { margin-bottom: var(--s-6); }
.section-head p:not(.eyebrow) { color: var(--c-muted); font-size: 1.125rem; }

/* ---------- Components ---------- */

/* Site header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--c-bg) 82%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: var(--s-3); text-decoration: none; }
.brand img { width: auto; height: 2.5rem; }
.brand span {
  font-family: var(--f-display); font-weight: 800; font-style: italic; text-transform: uppercase;
  font-size: 1.25rem; line-height: .9; letter-spacing: .01em;
}
.brand:hover { color: inherit; }
@media (max-width: 30rem) { .brand span { display: none; } }
.site-nav ul { display: flex; gap: clamp(var(--s-4), 3vw, var(--s-6)); list-style: none; padding: 0; }
.site-nav a {
  font-family: var(--f-label); font-weight: 600; text-transform: uppercase;
  font-size: 1rem; letter-spacing: .12em; text-decoration: none;
  display: inline-block; padding-block: var(--s-3);
  border-bottom: 2px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.site-nav a[aria-current="page"] { border-color: var(--c-accent); }

/* Hero */
.hero {
  position: relative; isolation: isolate;
  min-height: min(88svh, 52rem);
  display: grid; align-items: end;
  overflow: hidden;
}
.hero__media, .hero__media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2;
}
.hero__media img { object-position: 50% 35%; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to right, rgb(13 14 16 / .7) 0%, rgb(13 14 16 / 0) 70%),
    linear-gradient(to top, var(--c-bg) 0%, rgb(13 14 16 / .85) 30%, rgb(13 14 16 / .35) 65%, rgb(13 14 16 / .55) 100%);
}
.hero__content { padding-block: var(--s-8) var(--s-7); }
.hero h1 { font-size: var(--t-hero); max-width: 12ch; margin-bottom: var(--s-5); }
.hero h1 em { font-style: inherit; color: var(--c-accent); }
.hero p { font-size: clamp(1.0625rem, 1.6vw, 1.25rem); max-width: 52ch; margin-bottom: var(--s-6); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s-4); }

/* Reel: full-bleed band with a muted loop that plays only while on screen (site.js).
   Without JS, under reduced motion or Save-Data, the poster stays as a still. */
.reel {
  position: relative; isolation: isolate;
  min-height: min(72svh, 42rem);
  display: grid; align-items: end;
  overflow: hidden; background: var(--c-bg);
}
.reel__media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.reel::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to right, rgb(13 14 16 / .75) 0%, rgb(13 14 16 / 0) 65%),
    linear-gradient(to top, rgb(13 14 16 / .9) 0%, rgb(13 14 16 / .2) 55%, rgb(13 14 16 / .5) 100%);
}
.reel__content { padding-block: var(--s-8) var(--s-7); }
.reel h2 { font-size: var(--t-h2); max-width: 14ch; margin-bottom: var(--s-5); }
.reel__toggle {
  position: absolute; top: var(--s-4); right: var(--s-4);
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem;
  color: var(--c-text); background: rgb(13 14 16 / .6);
  border: 1px solid rgb(243 241 236 / .4); border-radius: 50%; cursor: pointer;
  transition: border-color var(--dur) var(--ease);
}
.reel__toggle:hover { border-color: var(--c-text); }
.reel__toggle svg { width: 1.1rem; height: 1.1rem; }
@media (max-width: 40rem) { .reel { min-height: 26rem; } }

/* Compact page head for sub-pages */
.page-head { padding-block: var(--s-8) var(--s-6); border-bottom: 1px solid var(--c-line); }
.page-head h1 { font-size: clamp(3rem, 9vw, 6.5rem); margin-bottom: var(--s-4); }
.page-head p:not(.eyebrow) { color: var(--c-muted); font-size: 1.125rem; }

/* Eyebrow */
.eyebrow {
  font-family: var(--f-label); font-weight: 600; text-transform: uppercase;
  font-size: var(--t-label); letter-spacing: .14em; color: var(--c-accent);
  display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-4);
}
.eyebrow::before { content: ""; width: 1.5rem; height: 2px; background: currentColor; }
.section--light .eyebrow { color: var(--c-text); }
.section--light .eyebrow::before { background: var(--c-accent); }

/* Button */
.btn {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 3rem; padding: var(--s-3) var(--s-5);
  font-family: var(--f-label); font-weight: 600; text-transform: uppercase;
  font-size: 1.0625rem; letter-spacing: .1em; text-decoration: none;
  color: var(--c-accent-ink);
  transition: transform var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--c-accent); transform: skewX(var(--lean));
  border-radius: 2px;
  transition: background var(--dur) var(--ease);
}
.btn:hover { color: var(--c-accent-ink); transform: translateX(3px); }
.btn:hover::before { background: var(--c-text); }
.btn--ghost { color: var(--c-text); }
.btn--ghost::before { background: transparent; border: 1px solid var(--c-text); }
.btn--ghost:hover { color: var(--c-bg); }
.btn--ghost:hover::before { background: var(--c-text); }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }

/* Road line */
.roadline {
  height: 4px; width: 100%;
  background: repeating-linear-gradient(90deg, var(--c-accent) 0 2.5rem, transparent 2.5rem 4.5rem);
}

/* Card */
.card {
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius);
  padding: var(--s-5);
  display: flex; flex-direction: column;
}
.card__media { margin: calc(var(--s-5) * -1) calc(var(--s-5) * -1) var(--s-5); overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; }
.card p { color: var(--c-muted); }
.card h3 { font-size: 1.75rem; }

/* Facts (Onze sport) */
.facts { list-style: none; padding: 0; display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.facts li { border-top: 2px solid var(--c-accent); padding-top: var(--s-5); }
.facts .num {
  display: block; font-family: var(--f-display); font-weight: 800; font-style: italic;
  font-size: clamp(3.5rem, 7vw, 5rem); line-height: .9; margin-bottom: var(--s-3);
}
.facts .num small { font-size: .4em; color: var(--c-muted); margin-left: .15em; }
.facts h3 { font-size: 1.5rem; }
.facts p { color: var(--c-muted); }

/* Level meter */
.level {
  display: inline-flex; align-items: center; gap: var(--s-3);
  font-family: var(--f-label); font-weight: 600; text-transform: uppercase;
  font-size: var(--t-label); letter-spacing: .14em; color: var(--c-sky);
}
.level__bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 14px; }
.level__bars i { width: 5px; border-radius: 1px; background: var(--c-line); }
.level__bars i:nth-child(1) { height: 6px; }
.level__bars i:nth-child(2) { height: 10px; }
.level__bars i:nth-child(3) { height: 14px; }
/* Filled bars carry .on in the HTML */
.level__bars i.on { background: var(--c-sky); }

/* Spot card */
.spot { gap: var(--s-3); }
.spot h3 { margin-bottom: 0; }
.spot .place { color: var(--c-muted); font-size: var(--t-small); margin-top: calc(var(--s-2) * -1); }
.spot p:not(.place, .spot__links) { flex: 1; }
.spot .route {
  align-self: flex-start; margin-top: var(--s-2);
  font-family: var(--f-label); font-weight: 600; text-transform: uppercase; letter-spacing: .12em;
  font-size: var(--t-small); text-decoration: none; color: var(--c-accent);
  padding-block: var(--s-2);
}
.spot .route:hover { color: var(--c-text); }

/* Person card */
.person { margin: 0; }
.person img { width: 100%; border-radius: var(--radius); background: var(--c-surface); }
.person figcaption { margin-top: var(--s-4); }
.person strong { display: block; font-family: var(--f-display); font-weight: 800; font-style: italic; text-transform: uppercase; font-size: 1.75rem; line-height: 1; }
.person span { color: var(--c-muted); font-size: var(--t-small); }

/* Gear list */
.gear { display: grid; gap: 0; border-top: 1px solid var(--c-line); }
.gear div { display: grid; gap: var(--s-1); padding-block: var(--s-4); border-bottom: 1px solid var(--c-line); }
@media (min-width: 36rem) { .gear div { grid-template-columns: 10rem 1fr; gap: var(--s-4); } }
.gear dt { font-family: var(--f-label); font-weight: 600; text-transform: uppercase; letter-spacing: .14em; font-size: var(--t-label); color: var(--c-muted); padding-top: .2em; }
.gear dd { margin: 0; font-weight: 550; }

/* Callout (must-have notice) */
.callout {
  border-left: 4px solid var(--c-accent); background: var(--c-surface);
  padding: var(--s-4) var(--s-5); border-radius: 0 var(--radius) var(--radius) 0;
}

/* Video facade */
.video {
  position: relative; aspect-ratio: 16 / 9; background: var(--c-surface);
  border-radius: var(--radius); overflow: hidden;
}
.video a, .video img, .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video img { object-fit: cover; transition: transform 400ms var(--ease), opacity var(--dur) var(--ease); opacity: .85; }
.video a:hover img { transform: scale(1.03); opacity: 1; }
.video a::after { content: none !important; }
.video .play {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  width: 4.5rem; height: 3.25rem; display: grid; place-items: center;
  color: var(--c-accent-ink);
}
.video .play::before { content: ""; position: absolute; inset: 0; background: var(--c-accent); transform: skewX(var(--lean)); border-radius: 2px; transition: background var(--dur) var(--ease); }
.video a:hover .play::before { background: var(--c-text); }
.video .play svg { position: relative; width: 1.5rem; height: 1.5rem; }
.video-item h2 { font-size: var(--t-h3); margin: var(--s-4) 0 var(--s-1); }
.video-item .meta { color: var(--c-muted); font-size: var(--t-small); }
.video-item:first-child { grid-column: 1 / -1; }
.video-item:first-child h2 { font-size: clamp(1.75rem, 4vw, 2.75rem); }

/* Link list */
.linklist { list-style: none; padding: 0; border-top: 1px solid var(--c-line); }
.linklist a {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--s-4);
  padding-block: var(--s-5); border-bottom: 1px solid var(--c-line);
  text-decoration: none; transition: padding var(--dur) var(--ease), color var(--dur) var(--ease);
}
.linklist a::after { content: "↗"; font-size: 1.5rem; color: var(--c-accent); transition: transform var(--dur) var(--ease); }
.linklist a:hover { padding-left: var(--s-3); color: var(--c-text); }
.linklist a:hover::after { transform: translate(3px, -3px); }
.linklist strong { display: block; font-family: var(--f-display); font-weight: 800; font-style: italic; text-transform: uppercase; font-size: clamp(1.375rem, 3vw, 1.875rem); line-height: 1.05; }
.linklist strong + span { color: var(--c-muted); font-size: var(--t-small); }
.link-group + .link-group { margin-top: var(--s-7); }
.link-group h2 { font-size: var(--t-h3); margin-bottom: var(--s-4); }

/* CTA band */
.cta { background: var(--c-accent); color: var(--c-accent-ink); padding-block: var(--s-7); }
.cta .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-5); }
.cta h2 { margin: 0; max-width: 14ch; }
.cta p { font-weight: 550; margin-top: var(--s-3); }
.cta .btn { --c-accent: var(--c-bg); color: var(--c-text); }
.cta .btn:hover { color: var(--c-bg); }
.cta .btn--ghost { color: var(--c-accent-ink); }
.cta .btn--ghost::before { border-color: var(--c-accent-ink); }
.cta .btn--ghost:hover { color: #F3F1EC; }
.cta .btn--ghost:hover::before { background: var(--c-accent-ink); }
.cta a:focus-visible { outline-color: var(--c-accent-ink); }

/* Spot card: two outbound links */
.spot__links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin-top: var(--s-2); }
.spot__links .route { margin-top: 0; }
.card__title { font-size: 1.75rem; margin-bottom: var(--s-3); }
.card .route { margin-top: auto; padding-top: var(--s-4); font-family: var(--f-label); font-weight: 600; text-transform: uppercase; letter-spacing: .12em; font-size: var(--t-small); text-decoration: none; color: var(--c-accent); }
.card .route:hover { color: var(--c-text); }

/* Partner band (Downhill Roads) */
.partner { position: relative; overflow: hidden; isolation: isolate; }
.partner__profile { position: absolute; inset: auto 0 0 0; width: 100%; height: 28%; z-index: -1; opacity: .5; }
.partner__logo { display: inline-block; margin-top: var(--s-5); }
.partner__logo img { width: min(17rem, 70vw); height: auto; }
.partner__logo::after { content: none !important; }

/* Race list */
.races { list-style: none; padding: 0; border-top: 1px solid var(--c-line); }
.race {
  display: grid; gap: var(--s-2) var(--s-5); padding-block: var(--s-5);
  border-bottom: 1px solid var(--c-line);
  grid-template-columns: 1fr;
}
@media (min-width: 52rem) {
  .race { grid-template-columns: 11rem 1fr auto; align-items: baseline; }
  .split .race { grid-template-columns: 9rem 1fr; }
  .split .race__links { grid-column: 2; }
}
.race__date { font-family: var(--f-label); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; font-size: var(--t-small); color: var(--c-accent); }
.race h3 { font-size: 1.5rem; margin: 0; }
.race__place { color: var(--c-muted); font-size: var(--t-small); margin-top: var(--s-1); }
.race__tags { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); }
.tag {
  font-family: var(--f-label); font-weight: 600; text-transform: uppercase; letter-spacing: .1em;
  font-size: .75rem; padding: .15rem .5rem; border: 1px solid var(--c-line); border-radius: 2px; color: var(--c-muted);
}
.tag--series { border-color: var(--c-sky); color: var(--c-sky); }
.race__links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); }
.race__links a { font-family: var(--f-label); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; font-size: var(--t-small); text-decoration: none; color: var(--c-accent); padding-block: var(--s-2); }
.race__links a:hover { color: var(--c-text); }
.race--past .race__date { color: var(--c-muted); }
.more summary {
  cursor: pointer; padding-block: var(--s-4);
  font-family: var(--f-label); font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--c-text);
}
.more summary:hover { color: var(--c-accent); }
.source { color: var(--c-muted); font-size: var(--t-small); }

/* Site footer */
.site-footer { border-top: 1px solid var(--c-line); padding-block: var(--s-7) var(--s-6); color: var(--c-muted); font-size: var(--t-small); }
.site-footer .wrap { display: grid; gap: var(--s-6); }
@media (min-width: 52rem) { .site-footer .wrap { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer .brand { color: var(--c-text); margin-bottom: var(--s-4); }
.site-footer h2 { font-family: var(--f-label); font-style: normal; font-weight: 600; font-size: var(--t-label); letter-spacing: .14em; color: var(--c-text); margin-bottom: var(--s-3); }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: var(--s-2); }
.site-footer a { text-decoration: none; display: inline-block; padding-block: var(--s-1); }
.site-footer a:hover { color: var(--c-accent); }
.site-footer .legal { grid-column: 1 / -1; max-width: none; padding-top: var(--s-5); border-top: 1px solid var(--c-line); }

/* ---------- Utilities ---------- */
.muted { color: var(--c-muted); }
.mt-5 { margin-top: var(--s-5); }
.mt-6 { margin-top: var(--s-6); }
.wide { max-width: none; }
.lead { font-size: clamp(1.125rem, 1.8vw, 1.375rem); line-height: 1.5; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}
