/* ==========================================================================
   RaceCheckIn — 2026 redesign
   Design tokens first. Everything derives from these.
   ========================================================================== */

:root {
  /* Color — "asphalt at dawn" ink, bib-white paper, course-flag magenta */
  --ink:        #0F1626;   /* primary text, dark sections */
  --ink-soft:   #1C2740;   /* cards on dark */
  --slate:      #5B6474;   /* secondary text */
  --paper:      #F6F7F9;   /* page background (cool, not cream) */
  --white:      #FFFFFF;
  --flag:       #E4315B;   /* accent: trail flagging-tape magenta */
  --flag-dark:  #C21F47;
  --timing:    #16B981;    /* success / "checked" only */
  --line:       #E2E5EB;   /* hairlines on light */
  --line-dark:  #2A3650;   /* hairlines on dark */

  /* Type */
  --font-display: "Anton", "Arial Narrow", sans-serif;        /* bib numerals */
  --font-body:    "Archivo", "Helvetica Neue", sans-serif;
  --font-mono:    "IBM Plex Mono", "Courier New", monospace;  /* timing clock */

  /* Scale */
  --step--1: 0.875rem;
  --step-0:  1rem;
  --step-1:  1.25rem;
  --step-2:  1.625rem;
  --step-3:  2.25rem;
  --step-4:  clamp(2.75rem, 6vw, 4.5rem);

  --radius: 14px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 2px rgba(15,22,38,.06), 0 12px 32px -12px rgba(15,22,38,.18);
  --shadow-bib: 8px 8px 0 rgba(15,22,38,.9); /* hard bib shadow, signature */
  --container: 1160px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

/* Reset & base ----------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--flag); outline-offset: 3px; }

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

/* Type roles -------------------------------------------------------------- */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 1.02;
  letter-spacing: .005em;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: .8125rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--flag);
  display: inline-flex;
  align-items: center;
  gap: .6em;
  margin: 0 0 1rem;
}
.eyebrow::before { content: ""; width: 26px; height: 3px; background: var(--flag); }
.lede { font-size: var(--step-1); color: var(--slate); max-width: 56ch; }

/* Buttons ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-body); font-weight: 600; font-size: var(--step-0);
  padding: .8rem 1.5rem; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--flag); color: var(--white); box-shadow: 0 8px 20px -8px rgba(228,49,91,.6); }
.btn-primary:hover { background: var(--flag-dark); }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost.on-dark { border-color: var(--white); color: var(--white); }
.btn-lg { padding: 1rem 2rem; font-size: var(--step-1); }

/* Header -------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246,247,249,.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 2rem; min-height: 72px; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 700; }
.brand img { height: 40px; width: auto; }
.nav-links { display: flex; gap: 1.75rem; list-style: none; margin: 0 0 0 auto; padding: 0; }
.nav-links a { text-decoration: none; font-weight: 500; color: var(--slate); }
.nav-links a:hover { color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 1rem; }
.lang-toggle {
  font-family: var(--font-mono); font-size: .8125rem; letter-spacing: .08em;
  border: 1px solid var(--line); border-radius: 999px; overflow: hidden; display: inline-flex;
}
.lang-toggle button {
  border: 0; background: transparent; padding: .35rem .7rem; cursor: pointer;
  font: inherit; color: var(--slate);
}
.lang-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.nav-burger { display: none; }

/* Hero ------------------------------------------------------------------------ */
.hero { position: relative; overflow: hidden; padding-block: clamp(3rem, 8vw, 6.5rem) 0; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { font-size: var(--step-4); margin: 0 0 1.25rem; }
.hero h1 .accent { color: var(--flag); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.hero-meta {
  display: flex; gap: 2rem; margin-top: 2.5rem;
  font-family: var(--font-mono); font-size: .8125rem; color: var(--slate);
}
.hero-meta strong { display: block; font-size: 1.35rem; color: var(--ink); font-family: var(--font-display); letter-spacing: .02em; }

.hero-visual { position: relative; }
.hero-photo {
  border-radius: var(--radius);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  width: 100%;
  box-shadow: var(--shadow-card);
}

/* Signature element: the floating race bib with QR */
.bib-card {
  position: absolute; left: -12%; bottom: 8%;
  width: min(300px, 78%);
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-bib);
  padding: 1rem 1.25rem 1.25rem;
  transform: rotate(-3deg);
}
.bib-card::before, .bib-card::after {
  /* safety-pin punch holes */
  content: ""; position: absolute; top: 10px; width: 10px; height: 10px;
  border: 2px solid var(--ink); border-radius: 50%; background: var(--paper);
}
.bib-card::before { left: 12px; }
.bib-card::after { right: 12px; }
.bib-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--slate);
  border-bottom: 2px dashed var(--line); padding: .5rem 0 .6rem;
}
.bib-number {
  font-family: var(--font-display); font-size: 3.4rem; line-height: 1;
  text-align: center; padding: .75rem 0 .25rem; letter-spacing: .04em;
}
.bib-status {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-top: .5rem; padding-top: .75rem; border-top: 2px dashed var(--line);
}
.bib-qr { width: 64px; height: 64px; border-radius: 4px; }
.bib-check {
  font-family: var(--font-mono); font-size: .75rem; color: var(--timing);
  display: flex; align-items: center; gap: .4rem; font-weight: 600;
}
.bib-check::before { content: "✓"; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--timing); color: var(--white); font-size: .7rem; }

/* Elevation-profile divider (SVG lives in HTML) */
.elevation { display: block; width: 100%; height: 70px; margin-top: clamp(2rem, 6vw, 4rem); }
.elevation path { fill: none; stroke: var(--ink); stroke-width: 2; }
.elevation .fill { fill: var(--ink); opacity: .05; stroke: none; }

/* Sections --------------------------------------------------------------------- */
.section { padding-block: clamp(3.5rem, 9vw, 6.5rem); }
.section-head { max-width: 62ch; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-head h2 { font-size: var(--step-3); margin: 0 0 .75rem; }

/* Feature grid */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.feature {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.75rem; box-shadow: var(--shadow-card);
  transition: transform .2s ease, border-color .2s ease;
}
.feature:hover { transform: translateY(-4px); border-color: var(--flag); }
.feature .icon {
  width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--flag) 10%, var(--white)); color: var(--flag); margin-bottom: 1rem;
}
.feature h3 { margin: 0 0 .4rem; font-size: var(--step-1); }
.feature p { margin: 0; color: var(--slate); font-size: var(--step--1); }

/* How it works — dark "night race" band with KM course markers */
.course { background: var(--ink); color: var(--white); }
.course .section-head h2, .course .lede { color: inherit; }
.course .lede { color: #A8B1C4; }
.course-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; position: relative; }
.course-steps::before {
  /* the course line connecting markers */
  content: ""; position: absolute; top: 34px; left: 6%; right: 6%; height: 2px;
  background: repeating-linear-gradient(90deg, var(--flag) 0 14px, transparent 14px 26px);
}
.km {
  background: var(--ink-soft); border: 1px solid var(--line-dark); border-radius: var(--radius);
  padding: 1.75rem; position: relative;
}
.km-marker {
  font-family: var(--font-display); font-size: 1.1rem; letter-spacing: .06em;
  background: var(--flag); color: var(--white); display: inline-block;
  padding: .4rem .8rem; border-radius: 6px; margin-bottom: 1.25rem; position: relative; z-index: 1;
}
.km h3 { margin: 0 0 .75rem; font-size: var(--step-2); font-family: var(--font-display); font-weight: 400; text-transform: uppercase; letter-spacing: .02em; }
.course .km h3 { color: var(--white); }
.km ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; color: #C4CCDB; font-size: var(--step--1); }
.km li { padding-left: 1.5rem; position: relative; }
.km li::before { content: "✓"; position: absolute; left: 0; color: var(--timing); font-weight: 700; }
.course-note {
  margin-top: 2.5rem; font-family: var(--font-mono); font-size: .8125rem; color: #A8B1C4;
  border-left: 3px solid var(--flag); padding-left: 1rem; max-width: 70ch;
}

/* Event page showcase */
.showcase-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.browser {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-card); overflow: hidden;
}
.browser-bar { display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
.browser-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.browser-bar .url {
  flex: 1; width: auto; height: auto; border-radius: 6px; background: var(--paper);
  font-family: var(--font-mono); font-size: .72rem; color: var(--slate); padding: .3rem .75rem;
}
.browser img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.checklist { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: .75rem; }
.checklist li { display: flex; gap: .75rem; align-items: baseline; color: var(--slate); }
.checklist li::before { content: "→"; color: var(--flag); font-weight: 700; }

/* Organizer tools */
.tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.tool { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1.25rem; }
.tool h3 { margin: 0 0 .35rem; font-size: var(--step-0); }
.tool p { margin: 0; font-size: .85rem; color: var(--slate); }
.tool .tag { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; color: var(--flag); text-transform: uppercase; display: block; margin-bottom: .6rem; }

/* ID Angel band */
.idangel {
  background: linear-gradient(120deg, var(--white), var(--paper));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.75rem, 4vw, 3rem);
  display: grid; grid-template-columns: auto 1fr; gap: 2rem; align-items: center;
}
.idangel .pulse {
  width: 72px; height: 72px; border-radius: 50%; background: var(--flag); color: var(--white);
  display: grid; place-items: center; font-size: 2rem; position: relative;
}
.idangel .pulse::after {
  content: ""; position: absolute; inset: -10px; border-radius: 50%;
  border: 2px solid var(--flag); opacity: .4; animation: pulse 2s ease-out infinite;
}
@keyframes pulse { from { transform: scale(.8); opacity: .5; } to { transform: scale(1.25); opacity: 0; } }
.idangel h2 { margin: 0 0 .5rem; font-size: var(--step-2); }
.idangel p { margin: 0; color: var(--slate); }

/* Final CTA + contact */
.cta-band { background: var(--ink); color: var(--white); border-radius: var(--radius); padding: clamp(2.5rem, 6vw, 4.5rem); position: relative; overflow: hidden; }
.cta-band::after {
  /* finish-line checker strip */
  content: ""; position: absolute; inset: auto 0 0 0; height: 18px;
  background:
    repeating-conic-gradient(var(--white) 0% 25%, var(--ink) 0% 50%) 0 0 / 18px 18px;
  opacity: .9;
}
.cta-band h2 { font-size: var(--step-3); margin: 0 0 1rem; max-width: 20ch; }
.cta-band p { color: #A8B1C4; max-width: 55ch; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); margin-top: clamp(2.5rem, 6vw, 4rem); }
.contact-form { display: grid; gap: 1rem; }
.contact-form label { font-size: .85rem; font-weight: 600; }
.contact-form input, .contact-form textarea {
  width: 100%; font: inherit; padding: .8rem 1rem; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--white);
}
.contact-form textarea { min-height: 130px; resize: vertical; }
.hp-field { position: absolute; left: -9999px; } /* honeypot (existing "Company" anti-spam field) */

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 2.5rem; color: var(--slate); font-size: .875rem; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 2rem; align-items: center; justify-content: space-between; }
.footer-powered { display: flex; gap: .5rem; align-items: center; }
.footer-powered-label { font-size: .75rem; color: var(--slate); letter-spacing: .02em; }
.footer-powered img { height: 14px; width: auto; filter: grayscale(1); opacity: .65; transition: opacity .2s, filter .2s; }
.footer-powered a:hover img { filter: none; opacity: 1; }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Responsive ------------------------------------------------------------------ */
@media (max-width: 980px) {
  .hero-grid, .showcase-grid, .contact-grid { grid-template-columns: 1fr; }
  .features, .course-steps { grid-template-columns: 1fr 1fr; }
  .course-steps::before { display: none; }
  .tools { grid-template-columns: 1fr 1fr; }
  .bib-card { left: auto; right: -4%; bottom: -6%; }
  .hero-visual { margin-bottom: 2rem; }
}
@media (max-width: 680px) {
  .nav-links { display: none; }
  .nav-burger {
    display: inline-grid; place-items: center; margin-left: auto;
    width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px;
    background: var(--white); cursor: pointer; font-size: 1.1rem;
  }
  .nav[data-open="true"] .nav-links {
    display: grid; position: absolute; top: 72px; left: 0; right: 0;
    background: var(--white); padding: 1.25rem var(--gutter); gap: 1rem;
    border-bottom: 1px solid var(--line);
  }
  .nav-actions .btn-ghost { display: none; }
  .features, .course-steps, .tools { grid-template-columns: 1fr; }
  .idangel { grid-template-columns: 1fr; }
  .hero-photo { aspect-ratio: 4 / 4.4; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .idangel .pulse::after { animation: none; }
  .btn:hover, .feature:hover { transform: none; }
}
