@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo-italic.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #F3F5F7;
  --paper-2: #E6EAEF;
  --ink: #14171C;
  --ink-2: #545D6C;
  --rule: #D3D9E1;
  --jaune: #FFD21F;
  --kom: #D7263D;
  --link: #14171C;
  --g1: #3DAA62;
  --g2: #F2C430;
  --g3: #F08A2C;
  --g4: #D93A2E;
  --g5: #23262C;
  --frame: #20242B;
  --shadow: 0 1px 2px rgba(20, 23, 28, 0.08), 0 12px 32px -12px rgba(20, 23, 28, 0.28);
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #16191E;
  --paper-2: #1F242B;
  --ink: #ECEFF3;
  --ink-2: #9AA3B2;
  --rule: #2D333D;
  --link: #ECEFF3;
  --g1: #45B96D;
  --g2: #F2C94A;
  --g3: #F39A45;
  --g4: #E8544A;
  --g5: #E9ECF1;
  --frame: #0C0E11;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -14px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 'Archivo', system-ui, sans-serif;
  font-stretch: 100%;
  overflow-x: hidden;
}

a { color: var(--link); text-decoration-color: var(--jaune); text-decoration-thickness: 3px; text-underline-offset: 0.2em; }
a:hover { background: color-mix(in srgb, var(--jaune) 45%, transparent); }
:focus-visible { outline: 3px solid var(--g3); outline-offset: 3px; border-radius: 4px; }
button { font: inherit; color: inherit; }

h1, h2, h3 { margin: 0; line-height: 1.05; font-stretch: 72%; font-weight: 800; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); }
p { margin: 0 0 1rem; text-wrap: pretty; }

.skip { position: absolute; left: 16px; top: -100px; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 6px; z-index: 50; }
.skip:focus { top: 16px; }

/* ---------- Header ---------- */

.top {
  max-width: var(--max); margin: 0 auto; padding: 20px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.wordmark { text-decoration: none; font-weight: 800; font-stretch: 80%; font-size: 1.125rem; }
.wordmark:hover { background: none; }
.top nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 28px); }
.top nav a { text-decoration: none; color: var(--ink-2); font-weight: 500; }
.top nav a:hover { color: var(--ink); background: none; }
.theme {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--rule); background: transparent; color: var(--ink-2);
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.theme:hover { color: var(--ink); border-color: var(--ink-2); }
.theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
:root[data-theme="dark"] .theme svg circle { fill: currentColor; }

/* ---------- Hero ---------- */

main > section { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

.hero { padding-top: clamp(24px, 5vw, 64px); }
.hero-copy { max-width: 46rem; }
.hero h1 {
  font-size: clamp(3.2rem, 10vw, 8rem);
  font-stretch: 64%; font-weight: 850; letter-spacing: -0.02em; line-height: 0.88;
  margin-bottom: 1.4rem;
}
.tagline { font-size: clamp(1.2rem, 2vw, 1.45rem); line-height: 1.45; max-width: 36em; }
.intro p { color: var(--ink-2); max-width: 40em; }

/* ---------- Route (stage profile) ---------- */

.route { margin-top: clamp(28px, 5vw, 56px); }
.route-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 24px; border-top: 3px solid var(--ink); padding-top: 12px; }
.route-title { font-weight: 700; font-stretch: 80%; font-size: 1.125rem; margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; font-size: 0.875rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.legend .g1, .profile .g1 { background: var(--g1); fill: var(--g1); }
.legend .g2, .profile .g2 { background: var(--g2); fill: var(--g2); }
.legend .g3, .profile .g3 { background: var(--g3); fill: var(--g3); }
.legend .g4, .profile .g4 { background: var(--g4); fill: var(--g4); }
.legend .g5, .profile .g5 { background: var(--g5); fill: var(--g5); }

.route-scroll { position: relative; margin: 4px calc(var(--gutter) * -1) 0; padding: 0 var(--gutter); overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.profile { display: block; width: 100%; min-width: 980px; height: auto; overflow: visible; }
.profile .ridge { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; }
.profile .baseline { stroke: var(--ink); stroke-width: 2; }
.profile .tick line { stroke: var(--ink); stroke-width: 1.5; }
.profile .tick text { font: 700 14px 'Archivo'; font-stretch: 75%; fill: var(--ink-2); text-anchor: middle; font-variant-numeric: tabular-nums; }
.profile .summit { cursor: pointer; text-decoration: none; }
.profile .summit:hover { background: none; }
.profile .pole { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 2 2; }
.profile .kom { fill: #fff; stroke: var(--kom); stroke-width: 2.2; transition: r 160ms; }
.profile .kom.hc { fill: var(--kom); }
.profile .cat { font: 800 9.5px 'Archivo'; font-stretch: 70%; fill: var(--kom); text-anchor: middle; pointer-events: none; }
.profile .kom.hc + .cat { fill: #fff; }
.profile .name { font: 600 13.5px 'Archivo'; font-stretch: 85%; fill: var(--ink); }
.profile .summit:hover .name, .profile .summit:focus-visible .name, .profile .summit.active .name { fill: var(--kom); }
.profile .summit:hover .kom, .profile .summit.active .kom { r: 11; }
.profile .summit:focus-visible { outline: none; }
.profile .summit:focus-visible .kom { stroke-width: 4; }

.rider {
  position: absolute; left: 0; top: 0; width: 56px; height: 46px; padding: 0; border: 0; background: none; cursor: pointer;
  transform-origin: 50% 100%; will-change: transform; z-index: 2;
}
.rider svg { width: 100%; height: 100%; overflow: visible; display: block; }
.rider:focus-visible { outline-offset: 0; border-radius: 50%; }
.bike-line { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.bike-wheel { fill: none; stroke: var(--ink); stroke-width: 2.2; }
.bike-spoke { stroke: var(--ink-2); stroke-width: 1; }
.bike-leg { fill: none; stroke: var(--ink); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.bike-leg.far { stroke: var(--ink-2); }
.bike-jersey { fill: none; stroke: var(--jaune); stroke-width: 6; stroke-linecap: round; }
.bike-head { fill: var(--ink); }
.bike-helmet { fill: var(--kom); }
.rider.ding { animation: ding 420ms ease-out; }
@keyframes ding { 30% { translate: 0 -6px; } }

.route-help { color: var(--ink-2); font-size: 0.9375rem; margin-top: 10px; max-width: 46em; }

/* ---------- Stages ---------- */

.ride { padding-top: clamp(40px, 6vw, 72px); }
.stage {
  display: grid; gap: 28px clamp(32px, 4vw, 64px); align-items: start;
  padding: clamp(40px, 6vw, 72px) 0; border-top: 1px solid var(--rule);
}
@media (min-width: 960px) { .stage { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.stage.no-shots { grid-template-columns: minmax(0, 46rem); }
.stage.draft { opacity: 0.6; }

.stage-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 14px; color: var(--ink-2); font-size: 0.9375rem; }
.stage-meta .year { font-size: 2.6rem; line-height: 0.9; font-weight: 900; font-stretch: 62%; color: var(--ink); font-variant-numeric: tabular-nums; margin-right: 4px; }
.kom-badge {
  font-weight: 800; font-stretch: 70%; font-size: 0.8125rem; color: var(--kom);
  padding: 3px 10px; border-radius: 999px;
  background: radial-gradient(circle, color-mix(in srgb, var(--kom) 28%, transparent) 1.6px, transparent 2px) 0 0 / 8px 8px, var(--paper);
  border: 1.5px solid var(--kom);
}
.kom-badge.hc { background: var(--kom); color: #fff; }
.stage-meta .count { margin-left: auto; font-variant-numeric: tabular-nums; }
.draft-badge { background: var(--ink); color: var(--paper); padding: 2px 8px; border-radius: 4px; font-size: 0.8125rem; }

.stage h2 { margin-bottom: 14px; }
.summary { font-size: 1.1875rem; line-height: 1.5; max-width: 34em; }
.body { color: var(--ink-2); max-width: 38em; }
.body ul { padding-left: 1.1em; margin: 0 0 1rem; }
.body li { margin-bottom: 0.4em; }
.body li::marker { color: var(--g3); }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 16px; }
.tags li { font-size: 0.8125rem; padding: 3px 10px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); }
.links { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.links a {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: 0.9375rem;
  padding: 8px 16px; border-radius: 999px; background: var(--ink); color: var(--paper);
}
.links a::after { content: ''; width: 7px; height: 7px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); }
.links a:hover { background: var(--jaune); color: #14171C; }

/* ---------- Gallery and frames ---------- */

.gallery { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; align-items: end; }
.shot { margin: 0; grid-column: span 6; }
.shot:first-child { grid-column: span 12; }
.shot.f-phone { grid-column: span 4; justify-self: center; width: 100%; max-width: 230px; }
.shot.f-watch { grid-column: span 6; justify-self: center; width: 100%; max-width: 250px; }
.shot.f-watch:first-child { grid-column: span 6; }
.g-phone .shot.f-phone:first-child { grid-column: span 4; }
.g-photo .shot.f-photo:not(:first-child) { grid-column: span 3; }
@media (max-width: 640px) {
  .shot.f-phone { grid-column: span 6; }
  .g-phone .shot.f-phone:first-child { grid-column: span 6; }
  .g-photo .shot.f-photo:not(:first-child) { grid-column: span 6; }
}

.zoom { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; text-align: left; }
.glass { display: block; overflow: hidden; background: var(--paper-2); }
.glass img { display: block; width: 100%; height: auto; transition: transform 300ms ease; }
.zoom:hover .glass img { transform: scale(1.015); }

.f-browser .zoom, .f-window .zoom { border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--rule); background: var(--paper); }
.bar { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; background: var(--paper-2); border-bottom: 1px solid var(--rule); font-size: 0.75rem; color: var(--ink-2); }
.bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--rule); }
.bar i:nth-child(1) { background: #FF6159; } .bar i:nth-child(2) { background: #FFBD2E; } .bar i:nth-child(3) { background: #28C941; }
.f-browser .bar span { margin-left: 10px; padding: 2px 12px; border-radius: 6px; background: var(--paper); flex: 1; max-width: 60%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-window .bar { justify-content: center; font-weight: 600; }

.f-phone .zoom { border-radius: 30px; padding: 8px; background: var(--frame); box-shadow: var(--shadow); }
.f-phone .glass { border-radius: 23px; }
.f-phone.tall .glass { aspect-ratio: 9 / 19.5; }
.f-phone.tall .glass img { height: 100%; object-fit: cover; object-position: top; }

.f-watch .zoom { border-radius: 50%; padding: 10px; background: linear-gradient(145deg, #3A3F48, #15181C); box-shadow: var(--shadow); }
.f-watch .glass { border-radius: 50%; aspect-ratio: 1; background: #111; }
.f-watch .glass img { height: 100%; object-fit: cover; }

.f-photo .zoom { padding: 10px 10px 28px; background: #FCFCFA; box-shadow: var(--shadow); rotate: -1.4deg; transition: rotate 200ms; }
.f-photo:nth-child(2n) .zoom { rotate: 1.6deg; }
.f-photo:nth-child(3n) .zoom { rotate: -0.6deg; }
.f-photo .zoom:hover { rotate: 0deg; }

.f-plain .zoom { border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }

/* ---------- Lightbox ---------- */

.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(8, 10, 13, 0.88); backdrop-filter: blur(4px); }
.lightbox img { max-width: min(94vw, 1800px); max-height: 88vh; border-radius: 8px; box-shadow: 0 30px 80px rgba(0,0,0,0.5); }
.lightbox button { position: fixed; border: 0; background: rgba(255,255,255,0.12); color: #fff; width: 48px; height: 48px; border-radius: 50%; font-size: 1.75rem; line-height: 1; cursor: pointer; }
.lightbox button:hover { background: rgba(255,255,255,0.24); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; translate: 0 -50%; }
.lb-next { right: 16px; top: 50%; translate: 0 -50%; }
.lightbox[data-single] .lb-prev, .lightbox[data-single] .lb-next { display: none; }

/* ---------- Strip (sticky mini profile) ---------- */

.strip {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  translate: 0 -100%; transition: translate 240ms ease;
}
.strip.show { translate: 0 0; }
.strip-inner { max-width: var(--max); margin: 0 auto; padding: 6px var(--gutter); display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 24px; align-items: center; }
.strip-profile { position: relative; grid-row: 1 / 3; height: 44px; }
.strip-profile svg { display: block; width: 100%; height: 44px; }
.strip-profile .ridge { fill: none; stroke: var(--ink); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.strip-profile .g1 { fill: var(--g1); } .strip-profile .g2 { fill: var(--g2); } .strip-profile .g3 { fill: var(--g3); } .strip-profile .g4 { fill: var(--g4); } .strip-profile .g5 { fill: var(--g5); }
.strip-profile .dot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--jaune); border: 2px solid var(--ink); left: 0; top: 0; }
.strip-title { margin: 0; font-weight: 700; font-stretch: 80%; font-size: 0.9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 16rem; }
.computer { display: flex; gap: 18px; margin: 0; font-size: 0.8125rem; color: var(--ink-2); }
.computer div { display: flex; gap: 6px; align-items: baseline; }
.computer dd { margin: 0; color: var(--ink); font-weight: 700; font-stretch: 75%; font-variant-numeric: tabular-nums; }
.computer dd span { font-size: 1rem; }
@media (max-width: 640px) {
  .strip-title { display: none; }
  .computer { flex-direction: column; gap: 0; }
}

/* ---------- Contact & footer ---------- */

.contact { padding-top: clamp(56px, 8vw, 96px); padding-bottom: clamp(56px, 8vw, 96px); border-top: 3px solid var(--ink); margin-top: 0; }
.contact h2 { margin-bottom: 12px; }
.contact > p { color: var(--ink-2); max-width: 36em; }
.contact-links { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: baseline; }
.contact-links a { font-weight: 700; }
.contact-links .email { font-size: clamp(1.5rem, 4vw, 2.6rem); font-weight: 800; font-stretch: 75%; overflow-wrap: anywhere; }

.bottom {
  max-width: var(--max); margin: 0 auto; padding: 20px var(--gutter) 36px; border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; gap: 16px; font-size: 0.875rem; color: var(--ink-2);
}
.bottom p { margin: 0; }
.bottom a { color: var(--ink-2); }
.link-btn { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--jaune); text-decoration-thickness: 3px; cursor: pointer; }

/* ---------- Sign-in and 404 ---------- */

.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.signin form, .signin > div { width: 100%; max-width: 26rem; }
.signin h1 { font-size: clamp(2.2rem, 6vw, 3.2rem); margin-bottom: 12px; font-stretch: 66%; }
.signin p { color: var(--ink-2); }
.signin label { display: grid; gap: 6px; font-weight: 600; margin-bottom: 16px; }
.signin input { font: inherit; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--rule); background: var(--paper-2); color: var(--ink); }
.signin button { font: 700 1rem 'Archivo'; padding: 11px 20px; border: 0; border-radius: 999px; background: var(--ink); color: var(--paper); cursor: pointer; margin-bottom: 16px; }
.signin button:hover { background: var(--jaune); color: #14171C; }
.form-error { color: var(--kom) !important; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .strip { transition: none; }
  .glass img, .f-photo .zoom { transition: none; }
}
