/* ==========================================================================
   6 Uren van Kortrijk — design system
   Palette grounded in the event itself: night asphalt, roadbook paper,
   and the red / amber / green rally start-lights.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@600;700;800;900&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&display=swap');

:root{
  /* --- colour tokens --- */
  --asphalt-950: #101215;
  --asphalt-900: #16181c;
  --asphalt-800: #21242a;
  --asphalt-700: #33373f;
  --line-grey:   #565c66;
  --paper:       #f2efe6;
  --paper-dim:   #e7e2d4;
  --white:       #ffffff;
  --rally-red:   #e0392c;
  --rally-red-dark: #b12b21;
  --rally-amber: #f2a93b;
  --rally-green: #3fa66a;

  --ink:         #16181c;
  --ink-soft:    #454a52;

  /* --- type --- */
  --font-display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* --- layout --- */
  --maxw: 1200px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius-s: 4px;
  --radius-m: 8px;

  --shadow-card: 0 1px 2px rgba(16,18,21,0.06), 0 8px 24px rgba(16,18,21,0.08);
}

/* --- reset --- */
*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
@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; }
}
body{
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
ul{ margin: 0; padding: 0; list-style: none; }
h1,h2,h3,h4{ margin: 0; font-family: var(--font-display); font-weight: 800; letter-spacing: 0.01em; line-height: 1.02; }
p{ margin: 0 0 1em; }
button{ font-family: inherit; }

:focus-visible{
  outline: 3px solid var(--rally-amber);
  outline-offset: 2px;
}

.wrap{
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden{
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

/* ==========================================================================
   Header / navigation
   ========================================================================== */
.site-header{
  position: sticky; top: 0; z-index: 100;
  background: var(--asphalt-950);
  border-bottom: 1px solid var(--asphalt-800);
}
.site-header .wrap{
  display: flex; align-items: center; justify-content: space-between;
  height: 76px;
}
.brand{ display: flex; align-items: center; gap: .7rem; }
.brand img{ height: 42px; width: auto; }
.brand-text{
  font-family: var(--font-display);
  color: var(--paper);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}
.brand-text small{
  display: block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--rally-amber);
  margin-top: 3px;
}

.nav-toggle{
  display: none;
  background: none; border: 1px solid var(--asphalt-700);
  border-radius: var(--radius-s);
  width: 44px; height: 44px;
  color: var(--paper);
  cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle svg{ width: 22px; height: 22px; }

.main-nav{ display: flex; align-items: center; }
.main-nav > ul{ display: flex; align-items: center; gap: 0.15rem; }
.main-nav a{
  display: block;
  padding: 0.6rem 0.85rem;
  color: var(--paper-dim);
  font-size: 0.93rem;
  font-weight: 600;
  border-radius: var(--radius-s);
  transition: color .15s ease, background-color .15s ease;
}
.main-nav a:hover{ color: var(--white); background: var(--asphalt-800); }
.main-nav a.is-active{ color: var(--white); }
.main-nav a.cta{
  background: var(--rally-red);
  color: var(--white);
  margin-left: .35rem;
}
.main-nav a.cta:hover{ background: var(--rally-red-dark); }

.has-sub{ position: relative; }
.has-sub > button.sub-trigger{
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.6rem 0.85rem;
  background: none; border: none; cursor: pointer;
  color: var(--paper-dim);
  font-size: 0.93rem; font-weight: 600; font-family: inherit;
  border-radius: var(--radius-s);
}
.has-sub > button.sub-trigger:hover{ color: var(--white); background: var(--asphalt-800); }
.has-sub .chev{ width: 10px; height: 10px; transition: transform .15s ease; }
.has-sub.open .chev{ transform: rotate(180deg); }
.sub-menu{
  position: absolute; top: 100%; left: 0;
  background: var(--asphalt-900);
  border: 1px solid var(--asphalt-800);
  border-radius: var(--radius-m);
  min-width: 220px;
  padding: 0.4rem;
  box-shadow: 0 16px 32px rgba(0,0,0,0.35);
  opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.has-sub.open .sub-menu{ opacity: 1; visibility: visible; transform: translateY(0); }
.sub-menu a{ font-size: 0.9rem; padding: 0.55rem 0.7rem; border-radius: var(--radius-s); }

@media (max-width: 980px){
  .nav-toggle{ display: inline-flex; }
  .main-nav{
    position: fixed; inset: 76px 0 0 0;
    background: var(--asphalt-950);
    transform: translateX(100%);
    transition: transform .25s ease;
    overflow-y: auto;
  }
  .main-nav.open{ transform: translateX(0); }
  .main-nav .wrap{ display: block; padding: 1rem var(--gutter) 2rem; width: 100%; }
  .main-nav > ul{ flex-direction: column; align-items: stretch; gap: 0; }
  .main-nav a, .has-sub > button.sub-trigger{ padding: .9rem .25rem; font-size: 1.05rem; width: 100%; justify-content: space-between; }
  .main-nav a.cta{ margin: .75rem 0 0; text-align: center; border-radius: var(--radius-m); }
  .sub-menu{ position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; background: var(--asphalt-800); display: none; margin: 0 0 0 .5rem; }
  .has-sub.open .sub-menu{ display: block; }
}

/* ==========================================================================
   Hero / start lights
   ========================================================================== */
.hero{
  position: relative;
  background: var(--asphalt-950);
  color: var(--paper);
  overflow: hidden;
  padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(3rem, 8vw, 6rem);
}
.hero::before{
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(115deg, rgba(255,255,255,0.035) 0 2px, transparent 2px 44px);
  pointer-events: none;
}
.hero .wrap{ position: relative; display: grid; gap: 2.5rem; grid-template-columns: 1.3fr 1fr; align-items: center; }

.startlights{ display: flex; gap: 10px; margin-bottom: 1.4rem; }
.startlights i{
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--asphalt-700);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.startlights i.on-red{ background: var(--rally-red); box-shadow: 0 0 16px 2px rgba(224,57,44,0.75); animation: light-on .6s ease forwards; animation-delay: .15s; opacity:0; }
.startlights i.on-red.two{ animation-delay: .5s; }
.startlights i.on-amber{ background: var(--rally-amber); box-shadow: 0 0 16px 2px rgba(242,169,59,0.75); animation: light-on .6s ease forwards; animation-delay: .9s; opacity:0; }
.startlights i.on-green{ background: var(--rally-green); box-shadow: 0 0 18px 3px rgba(63,166,106,0.8); animation: light-on .6s ease forwards; animation-delay: 1.3s; opacity:0; }
@keyframes light-on{ from{ opacity: 0; transform: scale(.6);} to{ opacity: 1; transform: scale(1);} }

.hero .eyebrow{
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em;
  color: var(--rally-amber); margin-bottom: 0.8rem;
}
.hero h1{
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  color: var(--white);
  margin-bottom: 0.5rem;
}
.hero h1 em{ font-style: normal; color: var(--rally-red); }
.hero .date-line{
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--paper-dim);
  margin-bottom: 1.6rem;
}
.hero p.lead{ max-width: 46ch; color: var(--paper-dim); font-size: 1.05rem; }
.hero .hero-actions{ display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }

.hero-stats{
  display: grid; grid-template-columns: 1fr; gap: 1px;
  background: var(--asphalt-800);
  border: 1px solid var(--asphalt-800);
  border-radius: var(--radius-m);
  overflow: hidden;
}
.hero-stats .stat{
  background: var(--asphalt-900);
  padding: 1.1rem 1.3rem;
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
}
.hero-stats .stat .num{ font-family: var(--font-display); font-size: 2rem; color: var(--white); }
.hero-stats .stat .lbl{ font-size: 0.85rem; color: var(--paper-dim); text-align: right; }

@media (max-width: 860px){
  .hero .wrap{ grid-template-columns: 1fr; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn{
  display: inline-flex; align-items: center; gap: .5rem;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-s);
  font-weight: 700; font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover{ transform: translateY(-1px); }
.btn-primary{ background: var(--rally-red); color: var(--white); }
.btn-primary:hover{ background: var(--rally-red-dark); }
.btn-ghost{ background: transparent; color: var(--white); border-color: var(--asphalt-700); }
.btn-ghost:hover{ border-color: var(--paper-dim); }
.btn-dark{ background: var(--asphalt-950); color: var(--white); }
.btn-dark:hover{ background: var(--asphalt-800); }
.btn-outline{ background: transparent; color: var(--ink); border-color: var(--asphalt-700); }
.btn-outline:hover{ background: var(--ink); color: var(--white); }
.btn-sm{ padding: 0.55rem 0.95rem; font-size: 0.85rem; }
.btn[disabled]{ opacity: .5; cursor: not-allowed; transform: none !important; }

/* ==========================================================================
   Sections / general layout
   ========================================================================== */
main{ display: block; }
.section{ padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-alt{ background: var(--paper-dim); }
.section-dark{ background: var(--asphalt-950); color: var(--paper); }
.section-dark h2, .section-dark h3{ color: var(--white); }

.section-head{ max-width: 62ch; margin-bottom: 2.4rem; }
.section-head .kicker{
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em;
  color: var(--rally-red); margin-bottom: 0.6rem; display: block;
}
.section-dark .section-head .kicker{ color: var(--rally-amber); }
.section-head h2{ font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin-bottom: 0.7rem; }
.section-head p{ color: var(--ink-soft); font-size: 1.02rem; }
.section-dark .section-head p{ color: var(--paper-dim); }

.page-title{
  background: var(--asphalt-950); color: var(--white);
  padding: 2.6rem 0 2.2rem;
  border-bottom: 3px solid var(--rally-red);
}
.page-title h1{ font-size: clamp(2rem, 4vw, 2.9rem); }
.page-title .breadcrumb{ font-family: var(--font-mono); font-size: 0.78rem; color: var(--rally-amber); margin-bottom: .6rem; letter-spacing: .06em; }
.page-title p{ color: var(--paper-dim); max-width: 60ch; margin-top: .6rem; margin-bottom:0; }

/* --- welcome blocks (home) --- */
.welcome-grid{ display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--asphalt-700); border-radius: var(--radius-m); overflow: hidden; }
.welcome-grid .block{ background: var(--asphalt-900); padding: 1.8rem; }
.welcome-grid .block h3{ color: var(--white); font-size: 1.25rem; margin-bottom: .6rem; }
.welcome-grid .block p{ color: var(--paper-dim); margin: 0; font-size: 0.95rem; }
@media (max-width: 700px){ .welcome-grid{ grid-template-columns: 1fr; } }

.closing-note{
  margin-top: 2.4rem; padding-top: 2rem; border-top: 1px solid var(--asphalt-800);
  color: var(--paper-dim); max-width: 70ch;
}
.closing-note .sign{ color: var(--rally-amber); font-family: var(--font-mono); margin-top: 1rem; font-size: 0.85rem;}
.free-badge{
  display: inline-flex; align-items: center; gap: .5rem;
  margin-top: 1.6rem; padding: 0.7rem 1.1rem;
  background: rgba(63,166,106,0.12); border: 1px solid rgba(63,166,106,0.4);
  color: #7fd6a3; border-radius: var(--radius-m); font-size: 0.88rem; font-weight: 600;
}

/* --- pages grid (home cards to sub-pages) --- */
.page-grid{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
@media (max-width: 900px){ .page-grid{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px){ .page-grid{ grid-template-columns: 1fr; } }
.page-card{
  background: var(--white); border-radius: var(--radius-m);
  border: 1px solid var(--paper-dim);
  padding: 1.6rem; box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: .6rem;
  transition: border-color .15s ease, transform .15s ease;
}
.page-card:hover{ border-color: var(--rally-red); transform: translateY(-3px); }
.page-card .tag{ font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: .08em; color: var(--rally-red); }
.page-card h3{ font-size: 1.3rem; }
.page-card p{ color: var(--ink-soft); font-size: 0.92rem; margin: 0; flex: 1; }
.page-card .go{ font-weight: 700; font-size: 0.88rem; display: inline-flex; align-items: center; gap: .4rem; }
.page-card .go svg{ width: 14px; height: 14px; transition: transform .15s ease; }
.page-card:hover .go svg{ transform: translateX(3px); }

/* --- route / stage list (numbered sequence: legit use) --- */
.route-list{ position: relative; padding-left: 2.6rem; }
.route-list::before{
  content: ""; position: absolute; left: 12px; top: 8px; bottom: 8px; width: 2px;
  background: repeating-linear-gradient(to bottom, var(--line-grey) 0 8px, transparent 8px 16px);
}
.route-item{ position: relative; padding-bottom: 1.6rem; }
.route-item:last-child{ padding-bottom: 0; }
.route-item::before{
  content: attr(data-n); position: absolute; left: -2.6rem; top: -2px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--rally-red); color: var(--white);
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.route-item h4{ font-family: var(--font-display); font-size: 1.3rem; }
.route-item .km{ font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-soft); }

/* --- sponsors --- */
.sponsor-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.sponsor-tile{
  background: var(--white); border: 1px solid var(--paper-dim); border-radius: var(--radius-m);
  padding: 1.1rem; display: flex; align-items: center; justify-content: center; height: 92px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.sponsor-tile:hover{ transform: translateY(-2px); box-shadow: var(--shadow-card); }
.sponsor-tile img{ max-height: 52px; width: auto; object-fit: contain; filter: grayscale(15%); }
.sponsor-strip-note{ text-align:center; margin-top:1.8rem; }

/* --- team --- */
.team-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1.4rem; }
.team-card{ text-align: center; }
.team-photo{
  aspect-ratio: 1; border-radius: 50%; overflow: hidden; margin: 0 auto .8rem;
  border: 3px solid var(--paper-dim); background: var(--asphalt-800);
}
.team-photo img{ width: 100%; height: 100%; object-fit: cover; }
.team-card h4{ font-size: 1rem; font-family: var(--font-body); font-weight: 700; }
.team-card .role{ font-size: 0.8rem; color: var(--ink-soft); font-family: var(--font-mono); }

/* --- documents / resident letters --- */
.doc-list{ display: grid; gap: .8rem; }
.doc-row{
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--white); border: 1px solid var(--paper-dim); border-radius: var(--radius-m);
  padding: 1rem 1.2rem;
}
.doc-row .doc-info{ display: flex; align-items: center; gap: .9rem; }
.doc-row .doc-icon{ width: 36px; height: 36px; flex-shrink: 0; color: var(--rally-red); }
.doc-row .doc-name{ font-weight: 700; }
.doc-row .doc-meta{ font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-soft); }

/* --- onboards --- */
.onboard-grid{ display: grid; grid-template-columns: repeat(auto-fit, minmax(300px,1fr)); gap: 1.6rem; }
.onboard-card{ background: var(--asphalt-900); border-radius: var(--radius-m); overflow: hidden; }
.onboard-card .frame-wrap{ position: relative; aspect-ratio: 16/9; background: var(--asphalt-800); }
.onboard-card iframe{ position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.onboard-card .cap{ padding: 1rem 1.2rem; display:flex; align-items:center; justify-content:space-between;}
.onboard-card .cap h4{ color: var(--white); font-size: 1.15rem; }
.onboard-card .cap .yr{ font-family: var(--font-mono); font-size: .75rem; color: var(--rally-amber); }

/* --- info / rule lists --- */
.rule-list{ display: grid; gap: .6rem; }
.rule-list li{ display: flex; gap: .8rem; padding: .2rem 0; }
.rule-list li::before{ content: "—"; color: var(--rally-red); font-weight: 700; flex-shrink: 0; }
.callout{
  border-left: 4px solid var(--rally-amber); background: rgba(242,169,59,0.1);
  padding: 1rem 1.2rem; border-radius: 0 var(--radius-m) var(--radius-m) 0; margin: 1.6rem 0;
  font-size: 0.95rem;
}
.callout.danger{ border-color: var(--rally-red); background: rgba(224,57,44,0.08); }

/* --- map --- */
.map-frame{ border-radius: var(--radius-m); overflow: hidden; border: 1px solid var(--paper-dim); }
.map-frame iframe{ width: 100%; height: 380px; border: 0; display: block; }

/* --- two column layout helper --- */
.cols-2{ display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2.5rem; align-items: start; }
@media (max-width: 860px){ .cols-2{ grid-template-columns: 1fr; } }

/* --- contact form --- */
.form-grid{ display: grid; gap: 1rem; max-width: 560px; }
.field label{ display:block; font-size: 0.85rem; font-weight: 700; margin-bottom: .35rem; }
.field input, .field textarea, .field select{
  width: 100%; padding: .75rem .9rem; border: 1px solid var(--asphalt-700); border-radius: var(--radius-s);
  font-family: inherit; font-size: 0.95rem; background: var(--white); color: var(--ink);
}
.field textarea{ min-height: 130px; resize: vertical; }
.form-msg{ font-size: 0.9rem; padding: .7rem 1rem; border-radius: var(--radius-s); display:none; }
.form-msg.show{ display:block; }
.form-msg.ok{ background: rgba(63,166,106,0.12); color: #2f7d4f; }
.form-msg.err{ background: rgba(224,57,44,0.12); color: var(--rally-red-dark); }

/* --- tickets pricing style card --- */
.ticket-card{ background: var(--white); border:1px solid var(--paper-dim); border-radius: var(--radius-m); padding: 2rem; box-shadow: var(--shadow-card); }
.ticket-card .price-tag{ font-family: var(--font-display); font-size: 2.4rem; color: var(--rally-red); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer{ background: var(--asphalt-950); color: var(--paper-dim); padding: 3.5rem 0 1.6rem; }
.footer-grid{ display: grid; grid-template-columns: 1.4fr repeat(2, 1fr); gap: 2.5rem; padding-bottom: 2.4rem; border-bottom: 1px solid var(--asphalt-800); }
@media (max-width: 760px){ .footer-grid{ grid-template-columns: 1fr; gap: 2rem; } }
.footer-grid h5{ color: var(--white); font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: .1em; margin-bottom: 1rem; }
.footer-brand .brand-text{ margin-bottom: .8rem; }
.footer-brand p{ font-size: 0.88rem; max-width: 40ch; }
.footer-social{ display: flex; gap: .7rem; margin-top: 1rem; }
.footer-social a{ width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--asphalt-700); display:flex; align-items:center; justify-content:center; transition: background .15s ease, border-color .15s ease; }
.footer-social a:hover{ background: var(--rally-red); border-color: var(--rally-red); }
.footer-social svg{ width: 17px; height: 17px; }
.footer-nav li{ margin-bottom: .55rem; }
.footer-nav a{ font-size: 0.9rem; }
.footer-nav a:hover{ color: var(--white); }
.footer-bottom{ display: flex; justify-content: space-between; align-items:center; flex-wrap: wrap; gap: .6rem; padding-top: 1.4rem; font-size: 0.8rem; }
.footer-bottom a{ color: var(--rally-amber); }

/* ==========================================================================
   Admin banner (shown only if editable content missing)
   ========================================================================== */
.skeleton{ opacity: .5; }

/* checkered accent divider, used once, sparingly */
.flag-divider{
  height: 10px;
  background-image: repeating-linear-gradient(45deg, var(--asphalt-950) 0 10px, var(--paper) 10px 20px);
  background-size: 28px 28px;
}
