@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/bricolage-grotesque-semibold.ttf") format("truetype");
  font-display: swap;
  font-weight: 600;
  font-style: normal;
}
@font-face {
  font-family: Chrono;
  src: url("/assets/chrono-bold.ttf") format("truetype");
  font-display: swap;
  font-weight: 800;
}
:root {
  --dark: #202819;
  --cream: #f7eed6;
  --orange: #e47243;
  --pink: #e79ab3;
  --yellow: #f1ca49;
  --blue: #577eca;
  --green: #3b846c;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--dark);
  background: var(--cream);
  font-synthesis: none;
  scroll-behavior: smooth;
  scroll-padding-top: 20px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px dashed currentColor;
  outline-offset: 5px;
}
a {
  color: inherit;
}
.race-section {
  height: 210svh;
  background: var(--dark);
  color: var(--cream);
  position: relative;
}
.race-sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  min-height: 650px;
  overflow: hidden;
  isolation: isolate;
}
.race-title {
  width: 92%;
  max-width: 1440px;
  margin: clamp(60px, 12svh, 120px) auto 0;
  position: relative;
  z-index: 4;
}
h1 {
  font-family: Chrono, Arial, sans-serif;
  font-weight: 800;
  font-size: clamp(90px, 20.4vw, 319px);
  line-height: 0.88;
  letter-spacing: -0.075em;
  margin: 0 0 0 -0.018em;
  position: relative;
  white-space: nowrap;
}
.scene {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 49%;
  min-height: 300px;
  z-index: 2;
}
.track {
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: -30px;
  height: 65%;
  background: var(--orange);
  transform: rotate(-2deg);
  border-top: 9px solid var(--pink);
}
.track-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 2px solid #f7eed685;
}
.line-one {
  top: 25%;
}
.line-two {
  top: 53%;
}
.line-three {
  /* Garder la ligne au-dessus du bloc suivant, même avec la piste inclinée. */
  top: min(81%, calc(100% - 42px - 1.82vw));
}
.runners {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.runner-person {
  position: absolute;
  bottom: 29%;
  left: 0;
  width: clamp(110px, 12vw, 185px);
  will-change: transform;
}
.runner-person .human {
  width: 100%;
  display: block;
  overflow: visible;
}
.runner-person .sweat {
  opacity: var(--sweat, 0.2);
}
.runner-0 {
  z-index: 1;
  bottom: 35%;
}
.runner-1 {
  z-index: 2;
  bottom: 30%;
}
.runner-2 {
  z-index: 4;
  bottom: 19%;
  width: clamp(125px, 14vw, 210px);
}
.runner-3 {
  z-index: 1;
  bottom: 41%;
  width: clamp(100px, 10vw, 155px);
}
.runner-4 {
  z-index: 5;
  bottom: 10%;
  width: clamp(130px, 15vw, 220px);
}
.runner-5 {
  z-index: 3;
  bottom: 25%;
}
.runner-6 {
  z-index: 4;
  bottom: 15%;
}
.finish {
  position: absolute;
  left: 83%;
  width: 75px;
  height: 68%;
  bottom: 10%;
  z-index: 3;
  transform: rotate(3deg);
  pointer-events: none;
}
.finish-post {
  position: absolute;
  top: 32px;
  bottom: 10px;
  width: 6px;
  background: var(--cream);
  border: 1px solid var(--dark);
}
.post-left {
  left: 0;
}
.post-right {
  right: 0;
}
.finish-banner {
  position: absolute;
  top: 0;
  left: -11px;
  right: -11px;
  background: var(--yellow);
  color: var(--dark);
  padding: 9px 0;
  text-align: center;
  font-family: Chrono, Arial;
  font-size: 12px;
  transform: rotate(-5deg);
  z-index: 2;
}
.finish-checkers {
  position: absolute;
  bottom: -18px;
  left: -5px;
  right: -5px;
  height: 29px;
  transform: skewX(-28deg);
  background: conic-gradient(
      var(--cream) 25%,
      var(--dark) 0 50%,
      var(--cream) 0 75%,
      var(--dark) 0
    )
    0 0/18px 18px;
}
.finish-ribbon {
  position: absolute;
  top: 42%;
  left: -4px;
  right: -4px;
  height: 16px;
  border: 2px solid var(--cream);
  background: var(--pink);
  transform: rotate(-12deg);
  transform-origin: right center;
  transition:
    transform 0.25s,
    opacity 0.25s;
}
.has-finished .finish-ribbon {
  transform: rotate(-65deg);
  opacity: 0.5;
}
.scroll-cue {
  position: absolute;
  bottom: 18px;
  left: 4%;
  right: 4%;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--dark);
  z-index: 8;
  font:
    9px "Courier New",
    monospace;
  font-weight: bold;
}
.progress-track {
  height: 3px;
  width: 90px;
  margin-left: auto;
  background: #20281940;
}
.progress-track i {
  display: block;
  height: 100%;
  width: calc(var(--progress, 0) * 100%);
  background: var(--dark);
}
.calculator {
  padding: 65px 4% 30px;
  max-width: 1560px;
  margin: 0 auto;
  scroll-margin-top: 20px;
  position: relative;
}
h2 {
  font:
    800 clamp(40px, 7.1vw, 106px)/1 Chrono,
    Arial,
    sans-serif;
  letter-spacing: -0.065em;
  margin: 12px 0 0;
}
h2 span {
  color: var(--green);
}
.step {
  font-family: "Courier New", monospace;
  font-size: 10px;
  font-weight: normal;
  margin-right: 8px;
}
.distances {
  display: flex;
  gap: 9px;
  width: 100%;
  align-items: center;
}
.distances button {
  flex: 1;
  min-height: 46px;
  background: transparent;
  border: 1.5px solid var(--dark);
  border-radius: 48% 45% 43% 47% / 28% 33% 30% 28%;
  padding: 9px 14px;
  font-size: 16px;
  font-weight: bold;
  white-space: nowrap;
  transition:
    transform 0.15s,
    background 0.15s;
  position: relative;
}
.distances button span {
  font-size: 10px;
}
.distances button:nth-child(odd) {
  transform: rotate(-1deg);
}
.distances button:nth-child(4) {
  transform: rotate(1deg);
}
.distances button:hover {
  background: var(--pink);
  transform: translateY(-3px) rotate(-2deg);
}
.distances button[aria-pressed="true"] {
  background: var(--orange);
  color: var(--dark);
  transform: rotate(-3deg);
  box-shadow: 3px 3px 0 var(--dark);
}
.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  gap: 18px;
}
.control-panel {
  padding: 25px 28px 20px;
  min-width: 0;
  border: 1.5px solid var(--dark);
  border-radius: 9px 4px 8px 5px;
  box-shadow: 3px 4px 0 var(--dark);
}
.time-panel {
  background: var(--yellow);
  transform: rotate(-0.45deg);
}
.pace-panel {
  background: var(--blue);
  color: var(--cream);
  transform: rotate(0.5deg);
}
.panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.panel-top label {
  font-size: 12px;
  font-weight: bold;
}
.readout {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 20px 0 22px;
  min-height: 94px;
}
.readout output {
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(42px, 8vw, 120px);
  line-height: 1;
  letter-spacing: -0.075em;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pace-unit {
  font-size: 13px;
  font-weight: bold;
  margin-left: 8px;
}
.pace-readout #approx {
  font-size: 24px;
  opacity: 0.65;
}
input[type="range"] {
  --progress: 16.67%;
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  height: 30px;
  margin: 0;
  background: transparent;
  cursor: grab;
}
input[type="range"]:active {
  cursor: grabbing;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  background: linear-gradient(
    to right,
    var(--dark) var(--progress),
    #20281940 var(--progress)
  );
}
input[type="range"]::-moz-range-track {
  height: 5px;
  background: linear-gradient(
    to right,
    var(--dark) var(--progress),
    #20281940 var(--progress)
  );
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 28px;
  height: 29px;
  margin-top: -12px;
  border: 2px solid var(--dark);
  border-radius: 43% 48% 42% 46%;
  background: var(--cream);
  box-shadow: 2px 2px 0 var(--dark);
  transition: transform 0.15s;
}
input[type="range"]::-moz-range-thumb {
  width: 25px;
  height: 26px;
  border: 2px solid var(--dark);
  border-radius: 44%;
  background: var(--cream);
  box-shadow: 2px 2px 0 var(--dark);
}
input[type="range"]:hover::-webkit-slider-thumb {
  transform: rotate(13deg) scale(1.07);
}
.pace-panel input[type="range"]::-webkit-slider-runnable-track {
  background: linear-gradient(
    to right,
    var(--cream) var(--progress),
    #f7eed650 var(--progress)
  );
}
.pace-panel input[type="range"]::-moz-range-track {
  background: linear-gradient(
    to right,
    var(--cream) var(--progress),
    #f7eed650 var(--progress)
  );
}
.pace-panel input[type="range"]::-webkit-slider-thumb {
  background: var(--pink);
}
.pace-panel input[type="range"]::-moz-range-thumb {
  background: var(--pink);
}
.speed {
  margin-left: auto;
  font-weight: bold;
}
@media (min-width: 1565px) {
  h1 {
    font-size: 319px;
  }
}
@media (max-height: 760px) and (min-width: 681px) {
  .race-title {
    margin-top: 70px;
  }
  h1 {
    font-size: 17.5vw;
    max-width: 1300px;
    margin: auto;
    text-align: center;
  }
  .scene {
    height: 48%;
  }
  .runner-person {
    width: 140px;
  }
  .runner-2,
  .runner-4 {
    width: 160px;
  }
  .runner-3 {
    width: 115px;
  }
}
@media (max-width: 1050px) {
  .readout {
    min-height: 68px;
  }
  .control-panel {
    padding: 22px 20px 18px;
  }
  .distances button {
    font-size: 14px;
    padding: 8px;
  }
  .scene {
    height: 52%;
  }
  .race-title {
    margin-top: clamp(70px, 13svh, 110px);
  }
}
@media (max-width: 680px) {
  :root {
    scroll-padding-top: 10px;
  }
  .race-section {
    height: 185svh;
    background: var(--orange);
  }
  .race-sticky {
    /* Laisser une marge sous les coureurs pour les barres du navigateur mobile. */
    height: min(calc(68 * var(--mobile-vh, 1svh)), 530px);
    min-height: 0;
    background: var(--dark);
  }
  .race-title {
    width: 90%;
    margin-top: clamp(24px, calc(7 * var(--mobile-vh, 1svh)), 56px);
  }
  h1 {
    font-size: 20vw;
    letter-spacing: -0.075em;
  }
  .scene {
    height: 64%;
    min-height: 0;
    bottom: -10px;
  }
  .track {
    height: 61%;
    bottom: -12px;
  }
  .line-three {
    top: min(81%, calc(100% - 24px - 1.82vw));
  }
  .runner-person {
    width: min(100px, calc(15 * var(--mobile-vh, 1svh)));
  }
  .runner-2 {
    width: min(113px, calc(17 * var(--mobile-vh, 1svh)));
  }
  .runner-4 {
    width: min(120px, calc(18 * var(--mobile-vh, 1svh)));
  }
  .runner-3 {
    width: min(88px, calc(13 * var(--mobile-vh, 1svh)));
  }
  .runner-0 {
    bottom: 34%;
  }
  .runner-1 {
    bottom: 29%;
  }
  .runner-2 {
    bottom: 19%;
  }
  .runner-3 {
    bottom: 42%;
  }
  .runner-4 {
    bottom: 11%;
  }
  .runner-5 {
    bottom: 24%;
  }
  .runner-6 {
    bottom: 16%;
  }
  .finish {
    left: 60%;
    width: 49px;
    height: 59%;
    bottom: 12%;
  }
  .finish-banner {
    font-size: 9px;
    padding: 7px 0;
    left: -8px;
    right: -8px;
  }
  .finish-post {
    width: 4px;
    top: 26px;
  }
  .finish-checkers {
    height: 24px;
    background-size: 12px 12px;
  }
  .finish-ribbon {
    height: 13px;
  }
  .scroll-cue {
    left: 5%;
    right: 5%;
    font-size: 7px;
    gap: 7px;
    bottom: 16px;
  }
  .progress-track {
    width: 40px;
  }
  .calculator {
    padding: 42px 5% 20px;
  }
  h2 {
    font-size: 9.3vw;
    margin-top: 12px;
  }
  .distances {
    gap: 7px;
  }
  .distances button {
    font-size: 12px;
    min-height: 40px;
    padding: 8px 5px;
  }
  .distances button span {
    font-size: 8px;
  }
  .controls {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .control-panel {
    padding: 20px 20px 14px;
  }
  .panel-top label {
    font-size: 11px;
  }
  .readout {
    min-height: 0;
    margin: 19px 0 18px;
  }
  .readout output {
    font-size: clamp(58px, 16.2vw, 104px);
  }
  .pace-unit {
    font-size: 12px;
  }
  .speed {
    font-size: 9px;
  }
}
@media (max-width: 350px) {
  .distances {
    gap: 5px;
  }
  .distances button {
    font-size: 10px;
  }
  .control-panel {
    padding-left: 15px;
    padding-right: 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  :root {
    scroll-behavior: auto;
  }
  .race-section {
    height: 100svh;
    min-height: 570px;
  }
  .race-sticky {
    position: relative;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

.hero-tagline {
  margin: 20px 0 0;
  text-align: center;
  font:
    600 clamp(17px, 2.25vw, 32px)/1.3 "Bricolage Grotesque",
    sans-serif;
  color: var(--cream);
}
.hero-tagline span {
  color: var(--yellow);
  font-weight: inherit;
}
@media (max-width: 680px) {
  .hero-tagline {
    margin-top: 12px;
    padding: 0 6px;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
  }
}

.simulator-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 18px;
  background: var(--pink);
  color: var(--dark);
  border: 2px solid var(--dark);
  border-radius: 48% 45% 44% 46% / 47% 43% 48% 45%;
  box-shadow: 1px 2px 0 var(--dark);
  transform: rotate(-2deg);
  font:
    600 12px/1.2 "Bricolage Grotesque",
    sans-serif;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
  transition:
    transform 0.16s,
    box-shadow 0.16s,
    background 0.16s;
}
.simulator-cta:hover {
  transform: translateY(-2px) rotate(1deg);
  box-shadow: 2px 4px 0 var(--dark);
  background: #f0aac0;
}
.simulator-cta:active {
  transform: translateY(1px) rotate(-1deg);
  box-shadow: 0 0 0 var(--dark);
}
@media (max-width: 680px) {
  .simulator-cta {
    font-size: 10px;
    letter-spacing: 0;
    padding: 10px 14px;
    gap: 9px;
  }
}

.finish-confetti {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .finish-confetti {
    display: none;
  }
}

.chrono-wordmark {
  height: 0.88em;
  line-height: 0;
}
.chrono-wordmark > svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  color: var(--cream);
}
.water-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .water-backdrop {
    display: none;
  }
}
@media (max-width: 680px) and (prefers-reduced-motion: reduce) {
  .race-section {
    min-height: 0;
  }
}

/* Le trajet est piloté au scroll ; sur mobile, le bouton reste sous la phrase. */
.race-sticky > .simulator-cta {
  position: absolute;
  left: var(--cta-left, calc(5% + 90px));
  top: var(--cta-top, calc(100% - 50px));
  z-index: 10;
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) rotate(var(--cta-rotate, -2deg))
    scale(var(--cta-scale, 0.76));
  transform-origin: center;
  transition:
    background 0.16s,
    box-shadow 0.16s;
  white-space: nowrap;
  font-size: clamp(15px, 2vw, 23px);
  padding: 19px 30px;
  min-height: 66px;
  gap: 14px;
  box-shadow: 4px 5px 0 var(--dark);
}

.race-sticky > .simulator-cta:hover {
  transform: translate(-50%, calc(-50% - 3px)) rotate(var(--cta-rotate, -2deg))
    scale(var(--cta-scale, 0.76));
  box-shadow: 6px 7px 0 var(--dark);
}
@media (max-width: 680px) {
  .race-sticky > .simulator-cta {
    font-size: 15px;
    padding: 16px 23px;
    min-height: 58px;
    gap: 10px;
  }
}

/* Forme irrégulière dessinée à la main pour le fond du bouton. */
.race-sticky > .simulator-cta {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  isolation: isolate;
  padding: 22px 34px;
  min-height: 72px;
}
.race-sticky > .simulator-cta .cta-blob {
  position: absolute;
  inset: -5px;
  width: calc(100% + 10px);
  height: calc(100% + 10px);
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}
.race-sticky > .simulator-cta .cta-label {
  position: relative;
  z-index: 1;
}
.race-sticky > .simulator-cta:hover {
  background: transparent;
  box-shadow: none;
}
@media (max-width: 680px) {
  .race-sticky > .simulator-cta {
    padding: 17px 25px;
    min-height: 62px;
  }
}

/* Le fond et le texte partagent le même balancement, autour du même centre. */
@media (prefers-reduced-motion: no-preference) {
  .race-sticky > .simulator-cta :is(.cta-blob, .cta-label) {
    animation: cta-sur-place 3s ease-in-out infinite;
    transform-origin: center;
  }
  .race-sticky
    > .simulator-cta:is(:hover, :focus-visible)
    :is(.cta-blob, .cta-label) {
    animation-play-state: paused;
  }
}

@keyframes cta-sur-place {
  0%,
  100% {
    transform: rotate(-2deg) scale(1);
  }
  50% {
    transform: rotate(2deg) scale(1.025);
  }
}
@font-face {
  font-family: "Chrono Lettering";
  src: url("/assets/chrono-lettering.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
/* Habillage du calculateur, indépendant des animations de la course. */
.track-calculator {
  background: var(--dark);
  color: var(--cream);
  max-width: none;
  width: 100%;
  margin: 0;
  padding: clamp(150px, 12vw, 185px) 5% 22px;
  scroll-margin-top: 0;
  overflow: hidden;
  isolation: isolate;
}
.track-calculator::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.1;
  background-image: url("/assets/bib-grain.svg");
  background-size: 180px 180px;
}
.track-calculator .calculator-lanes {
  position: absolute;
  inset: -1px 0 auto;
  width: 100%;
  height: clamp(120px, 10vw, 155px);
  z-index: -1;
  pointer-events: none;
}
.track-calculator .track-message {
  position: absolute;
  top: 12px;
  left: 8%;
  right: 8%;
  width: 84%;
  max-width: 640px;
  height: 78px;
  margin: 0 auto;
  padding: 0;
  pointer-events: none;
  opacity: 0.94;
  overflow: visible;
}
.track-calculator .track-message picture,
.track-calculator .track-message img {
  display: block;
  width: 100%;
  height: 100%;
}
.track-calculator .track-message img {
  object-fit: contain;
}
.track-calculator .track-message.tag-scroll-enabled {
  opacity: var(--tag-opacity, 0.94);
}
@media (max-width: 700px) {
  .track-calculator .track-message {
    top: 7px;
    height: 56px;
  }
}
@media (max-width: 680px) {
  .track-calculator {
    padding-top: 25px;
  }
  .track-calculator > .calculator-lanes,
  .track-calculator > .track-message {
    display: none;
  }
}
.track-calculator .calculator-inner {
  width: 100%;
  max-width: 1320px;
  margin: auto;
}
.track-calculator .distances {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.1vw, 32px);
  width: 100%;
  margin: 0 auto clamp(38px, 4vw, 58px);
}
.track-calculator .distances button {
  --tilt: -3deg;
  position: relative;
  isolation: isolate;
  flex: 0 1 190px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  color: var(--dark);
  padding: 19px 10px;
  min-height: 72px;
  font:
    700 clamp(16px, 1.8vw, 25px)/1.1 "Chrono Lettering",
    sans-serif;
  white-space: nowrap;
  transform: rotate(var(--tilt));
  transition:
    transform 0.16s,
    color 0.16s;
}
.track-calculator .distances button:nth-child(2) {
  --tilt: -5deg;
}
.track-calculator .distances button:nth-child(3) {
  --tilt: 2deg;
}
.track-calculator .distances button:nth-child(4) {
  --tilt: -2deg;
  flex-basis: 220px;
}
.track-calculator .distances button:nth-child(5) {
  --tilt: 3deg;
}
.track-calculator .distances button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--cream);
  clip-path: polygon(
    1% 3%,
    31% 0,
    58% 2%,
    98% 0,
    100% 32%,
    99% 62%,
    100% 97%,
    75% 99%,
    42% 97%,
    1% 100%,
    0 71%,
    1% 44%
  );
  transition: background 0.16s;
}
.track-calculator .distances button::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 9px 9px, var(--dark) 0 3px, transparent 3.5px),
    radial-gradient(
      circle at calc(100% - 9px) 9px,
      var(--dark) 0 3px,
      transparent 3.5px
    ),
    radial-gradient(
      circle at 9px calc(100% - 9px),
      var(--dark) 0 3px,
      transparent 3.5px
    ),
    radial-gradient(
      circle at calc(100% - 9px) calc(100% - 9px),
      var(--dark) 0 3px,
      transparent 3.5px
    );
}
.track-calculator .distances button[aria-pressed="true"]::before {
  background: var(--pink);
}
.track-calculator .distances button:hover {
  background: transparent;
  transform: translateY(-4px) rotate(var(--tilt));
}
.track-calculator .distances button:focus-visible {
  outline-color: var(--cream);
  outline-offset: 7px;
}
.track-calculator .controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 8vw, 110px);
}
.track-calculator .controls::after {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: var(--cream);
  clip-path: polygon(
    40% 0,
    100% 3%,
    65% 27%,
    100% 43%,
    60% 66%,
    100% 81%,
    55% 100%,
    0 98%,
    25% 74%,
    0 55%,
    25% 25%,
    0 6%
  );
  transform: rotate(0.5deg);
}
.track-calculator .control-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  color: var(--cream);
  transform: none;
  min-width: 0;
}
.track-calculator .panel-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(10px, 1.2vw, 18px);
  position: relative;
  padding: 0;
  min-height: 56px;
}
.track-calculator .panel-icon {
  display: block;
  flex: none;
  width: clamp(44px, 4.8vw, 66px);
  height: clamp(46px, 5vw, 68px);
  overflow: visible;
  pointer-events: none;
}
.track-calculator .panel-top label {
  font:
    700 clamp(24px, 2.8vw, 40px)/1.1 "Chrono Lettering",
    sans-serif;
  letter-spacing: -0.035em;
  white-space: nowrap;
}
.track-calculator .readout {
  margin: 18px 0 20px;
  min-height: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--cream);
}
.track-calculator .readout output {
  font:
    600 clamp(42px, 7.1vw, 102px)/1.12 "Bricolage Grotesque",
    sans-serif;
  letter-spacing: 0.012em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.track-calculator .readout output[hidden] {
  display: none;
}
.track-calculator .editable-readout {
  display: flex;
  align-items: baseline;
  min-width: 0;
  white-space: nowrap;
  font:
    600 clamp(42px, 7.1vw, 102px)/1.12 "Bricolage Grotesque",
    sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.012em;
}
.track-calculator .editable-readout input {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 2.13ch;
  min-width: 0;
  height: 1.12em;
  margin: 0;
  padding: 0 0 0.025em;
  border: 0;
  border-bottom: 3px dotted var(--pink);
  border-radius: 0;
  background: transparent;
  color: var(--cream);
  font: inherit;
  font-variant-numeric: tabular-nums;
  letter-spacing: inherit;
  text-align: center;
  caret-color: var(--pink);
  touch-action: manipulation;
}
.track-calculator .editable-readout input:hover {
  border-bottom-style: solid;
}
.track-calculator .editable-readout input:focus {
  background: var(--pink);
  color: var(--dark);
  border-bottom-color: var(--dark);
  border-radius: 10% 5% 8% 7%/9% 7% 12% 6%;
  caret-color: var(--dark);
}
.track-calculator .editable-readout input:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 2px;
}
.track-calculator .editable-readout input::selection {
  background: var(--dark);
  color: var(--cream);
}
.track-calculator .digit-divider {
  display: inline-block;
  flex: none;
  margin: 0 clamp(1px, 0.35vw, 6px);
  color: var(--cream);
}
.track-calculator .pace-edit .digit-divider {
  color: var(--cream);
  margin-left: clamp(2px, 0.45vw, 8px);
}
.track-calculator .pace-readout {
  flex-wrap: nowrap;
  column-gap: clamp(16px, 2vw, 26px);
  position: relative;
}
.track-calculator .pace-unit {
  font:
    600 clamp(16px, 2.2vw, 30px)/1 "Bricolage Grotesque",
    sans-serif;
  letter-spacing: 0;
  margin: 0;
}
.track-calculator .pace-readout #approx {
  font:
    600 18px/1 "Bricolage Grotesque",
    sans-serif;
  opacity: 0.7;
  align-self: flex-start;
  margin: 0 -14px;
}
.track-calculator .pace-panel {
  position: relative;
}
.track-calculator .speed-corners {
  position: absolute;
  top: clamp(11px, 1.4vw, 24px);
  right: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: clamp(82px, 7vw, 98px);
  height: clamp(70px, 5.6vw, 78px);
  color: var(--cream);
  pointer-events: none;
  transform: rotate(-4deg);
}
.track-calculator .speed-corners::before,
.track-calculator .speed-corners::after {
  content: "";
  position: absolute;
  width: 36%;
  height: 34%;
  pointer-events: none;
}
.track-calculator .speed-corners::before {
  top: 0;
  left: 0;
  border-top: 5px solid var(--orange);
  border-left: 5px solid var(--orange);
  transform: skew(-9deg) rotate(-3deg);
}
.track-calculator .speed-corners::after {
  right: 0;
  bottom: 0;
  border-right: 5px solid var(--orange);
  border-bottom: 5px solid var(--orange);
  transform: skew(7deg) rotate(3deg);
}
.track-calculator .speed-corners #speed-display {
  font:
    600 clamp(24px, 2.2vw, 28px)/1 "Bricolage Grotesque",
    sans-serif;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
.track-calculator .speed-corners span:last-child {
  font:
    700 clamp(12px, 1.1vw, 13px)/1 "Chrono Lettering",
    "Bricolage Grotesque",
    sans-serif;
}
.track-calculator .slider-wrap {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 16px;
}
.track-calculator .adjust-second {
  display: grid;
  place-content: center;
  width: 100%;
  aspect-ratio: 1;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 47% 53% 45% 55%/53% 45% 55% 47%;
  background: var(--cream);
  color: var(--dark);
  font:
    600 35px/1 "Bricolage Grotesque",
    sans-serif;
  transition:
    transform 0.15s,
    background 0.15s;
}
.track-calculator .adjust-symbol {
  font-size: 35px;
  line-height: 1;
}
.track-calculator .adjust-second:hover {
  background: var(--pink);
  transform: rotate(-6deg);
}
.track-calculator .adjust-second:active {
  transform: scale(0.92);
}
.track-calculator .adjust-second {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.track-calculator .adjust-second.is-adjusting {
  background: var(--pink);
  transform: scale(0.94) rotate(-3deg);
}
.track-calculator .adjust-second:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}
.track-calculator input[type="range"] {
  height: 58px;
  width: 100%;
  padding: 0;
  margin: 0;
  touch-action: pan-y;
  color: var(--cream);
}
.track-calculator input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 40%;
  background: var(--cream);
}
.track-calculator input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 40%;
  background: var(--cream);
}
.track-calculator input[type="range"]::-webkit-slider-thumb {
  width: 56px;
  height: 58px;
  margin-top: -26px;
  border: 0;
  border-radius: 0;
  background: transparent url("/assets/slider-heart.svg") center/contain
    no-repeat;
  box-shadow: none;
}
.track-calculator input[type="range"]::-moz-range-thumb {
  width: 56px;
  height: 58px;
  border: 0;
  border-radius: 0;
  background: transparent url("/assets/slider-heart.svg") center/contain
    no-repeat;
  box-shadow: none;
}
.track-calculator input[type="range"]:hover::-webkit-slider-thumb {
  transform: rotate(-2deg) scale(1.04);
}
.track-calculator input[type="range"]:hover::-moz-range-thumb {
  transform: rotate(-2deg) scale(1.04);
}
.track-calculator .calculator-reset {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}
.track-calculator .calculator-reset button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  height: 44px;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--cream);
  opacity: 0.7;
}
.track-calculator .calculator-reset button:hover {
  background: #f7eed619;
  opacity: 1;
}
.track-calculator .calculator-reset svg {
  width: 23px;
  height: 23px;
}
.track-calculator .calculator-sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
@media (max-width: 700px) {
  .track-calculator {
    padding: 110px 5% 16px;
  }
  .track-calculator .calculator-lanes {
    height: 85px;
    width: 100%;
  }
  .track-calculator .distances {
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    max-width: 480px;
  }
  .track-calculator .distances button {
    flex: 0 1 27%;
    font-size: 16px;
    padding: 13px 12px;
    min-height: 52px;
  }
  .track-calculator .distances button:nth-child(4) {
    flex-basis: 45%;
    font-size: 14px;
  }
  .track-calculator .distances button:nth-child(5) {
    flex-basis: 36%;
  }
  .track-calculator .controls {
    gap: 24px;
    grid-template-columns: 1fr;
  }
  .track-calculator .controls::after {
    display: none;
  }
  .track-calculator .panel-top {
    padding: 0;
    min-height: 46px;
    gap: 12px;
  }
  .track-calculator .panel-top label {
    font-size: 24px;
  }
  .track-calculator .readout {
    margin: 8px 0 5px;
  }
  .track-calculator .readout output {
    font-size: clamp(42px, 14vw, 88px);
    line-height: 1.05;
  }
  .track-calculator .editable-readout {
    font-size: clamp(42px, 14vw, 88px);
    line-height: 1.05;
  }
  .track-calculator .editable-readout input {
    height: 1.1em;
  }
  .track-calculator .pace-unit {
    font-size: 22px;
  }
  .track-calculator .speed-corners {
    top: 8px;
    right: 0;
    width: 82px;
    height: 66px;
  }
  .track-calculator .speed-corners #speed-display {
    font-size: 24px;
  }
  .track-calculator .speed-corners span:last-child {
    font-size: 12px;
  }
  .track-calculator .slider-wrap {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 16px;
  }
  .track-calculator input[type="range"] {
    height: 44px;
  }
  .track-calculator input[type="range"]::-webkit-slider-thumb {
    width: 48px;
    height: 50px;
    margin-top: -22px;
  }
  .track-calculator input[type="range"]::-moz-range-thumb {
    width: 48px;
    height: 50px;
  }
  .track-calculator .calculator-reset {
    margin-top: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .track-calculator * {
    transition: none !important;
  }
  .track-calculator .track-message.tag-scroll-enabled {
    opacity: 0.94;
  }
}
/* Sur mobile, le décor et son introduction suivent le défilement de la page. */
.race-pin {
  display: contents;
}
.race-preview {
  display: none;
}
@media (max-width: 680px) {
  .race-section {
    height: auto;
  }
  .race-pin {
    display: block;
    position: relative;
  }
  .race-sticky {
    position: relative;
  }
  .race-preview {
    display: block;
    position: relative;
    height: 85px;
    background: var(--dark);
  }
  .race-preview .calculator-lanes {
    position: absolute;
    top: -1px;
    width: 100%;
    height: 86px;
    opacity: 1;
  }
  .race-preview .track-message {
    position: absolute;
    inset: 7px 8% auto;
    height: 56px;
    margin: 0;
    opacity: 0.94;
  }
  .race-preview picture,
  .race-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  .track-calculator {
    padding-top: 25px;
  }
}
@media (max-width: 680px) and (prefers-reduced-motion: reduce) {
  .race-section {
    height: auto;
  }
  .race-pin {
    position: relative;
  }
}
@media (max-width: 680px) {
  .water-backdrop {
    display: none;
  }
  .scroll-cue {
    display: none;
  }
  /* Même fond uni que le bord ondulé au-dessus du calculateur. */
  .track-calculator::after {
    display: none;
  }
}
/* La piste orange continue sous le calculateur et entoure le texte. */
.track-calculator .chrono-about {
  position: relative;
  isolation: isolate;
  display: block;
  margin: clamp(56px, 6vw, 88px) 0 -22px;
  padding: clamp(56px, 6vw, 82px) clamp(60px, 9vw, 130px) 118px;
  color: var(--dark);
  /* Masquer les traits derrière le bord découpé de la section noire. */
  clip-path: polygon(
    calc(50% - 50vw) -5px,
    calc(50% - 33vw) -11px,
    calc(50% - 16vw) -2px,
    calc(50% + 2vw) -19px,
    calc(50% + 20vw) -13px,
    calc(50% + 36vw) -27px,
    calc(50% + 50vw) -30px,
    calc(50% + 50vw) 100%,
    calc(50% - 50vw) 100%
  );
}
.track-calculator .chrono-about::before {
  content: "";
  position: absolute;
  top: -30px;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: -1;
  background: var(--orange);
  clip-path: polygon(
    0 25px,
    17% 19px,
    34% 28px,
    52% 11px,
    70% 17px,
    86% 3px,
    100% 0,
    100% 100%,
    0 100%
  );
}
.track-calculator .about-lanes {
  position: absolute;
  inset: -8px 0 24px;
  pointer-events: none;
  z-index: 0;
}
.track-calculator .about-lanes svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.track-calculator .about-lanes path {
  fill: none;
  stroke: var(--cream);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.track-calculator .about-lanes path[data-lane="2"] {
  stroke-width: 2;
}
.track-calculator .about-finish-mark {
  position: absolute;
  right: 12%;
  bottom: 44px;
  width: 90px;
  height: 32px;
  transform: rotate(52deg);
  background: conic-gradient(
      var(--dark) 25%,
      var(--cream) 0 50%,
      var(--dark) 0 75%,
      var(--cream) 0
    )
    0 0/16px 16px;
  pointer-events: none;
  z-index: 1;
}
.track-calculator .about-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: block;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}
.track-calculator .about-intro,
.track-calculator .about-story {
  min-width: 0;
}
.track-calculator .chrono-about h2 {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.22em;
  margin: 0;
  white-space: nowrap;
  color: var(--dark);
  font:
    700 clamp(26px, 4vw, 52px)/1.1 "Chrono Lettering",
    sans-serif;
  letter-spacing: -0.035em;
}
.track-calculator .chrono-about h2 span {
  color: #fff;
  font:
    600 0.6em/1.2 "Bricolage Grotesque",
    sans-serif;
  letter-spacing: 0;
}
.track-calculator .about-story {
  max-width: 720px;
  margin: 34px auto 0;
}
.track-calculator .about-copy .about-story p {
  max-width: 50ch;
  margin: 0 auto 25px;
  font:
    400 19px/1.6 "Bricolage Grotesque",
    Arial,
    sans-serif;
  text-wrap: pretty;
}
.track-calculator .about-copy .about-story .about-opening {
  font-size: 25px;
  line-height: 1.75;
  font-weight: 600;
  transform: rotate(-1deg);
  margin-bottom: 27px;
}
.track-calculator .about-cut-line {
  display: inline;
  padding: 4px 9px;
  background: var(--cream);
  color: var(--dark);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.track-calculator .about-performance {
  background: var(--yellow);
  padding: 0 3px;
}
.track-calculator .about-copy .about-story .about-explanation {
  position: relative;
  isolation: isolate;
  color: var(--dark);
  max-width: 54ch;
  padding: 27px 29px;
  font:
    400 18px/1.6 "Courier New",
    monospace;
  transform: rotate(1.2deg);
  margin: 0 auto 32px;
}
.track-calculator .about-explanation::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--cream);
  clip-path: polygon(
    0 0.5%,
    13% 0,
    30% 0.8%,
    47% 0,
    64% 0.7%,
    81% 0,
    100% 0.5%,
    99.4% 26%,
    100% 48%,
    99.3% 73%,
    100% 99.4%,
    82% 100%,
    63% 99.3%,
    44% 100%,
    24% 99.4%,
    8% 100%,
    0 99.3%,
    0.7% 70%,
    0 41%
  );
}
.track-calculator .about-explanation::after {
  content: "";
  position: absolute;
  width: 85px;
  height: 21px;
  background: var(--pink);
  top: -10px;
  left: calc(50% - 42px);
  transform: rotate(-5deg);
  clip-path: polygon(
    0 0,
    100% 5%,
    95% 30%,
    100% 70%,
    96% 100%,
    0 94%,
    5% 62%,
    0 25%
  );
  pointer-events: none;
}
@media (max-width: 760px) {
  .track-calculator .chrono-about {
    padding: 52px 38px 105px;
    margin-top: 50px;
  }
  .track-calculator .about-lanes {
    left: -6px;
    right: -6px;
    bottom: 20px;
  }
  .track-calculator .chrono-about h2 {
    font-size: clamp(24px, 5vw, 36px);
  }
  .track-calculator .about-story {
    margin-top: 26px;
  }
  .track-calculator .about-finish-mark {
    right: 15%;
    bottom: 37px;
    width: 75px;
    height: 28px;
    background-size: 14px 14px;
  }
}
@media (max-width: 700px) {
  .track-calculator .chrono-about {
    margin-bottom: -16px;
  }
}
@media (max-width: 360px) {
  .track-calculator .chrono-about {
    padding-left: 32px;
    padding-right: 32px;
  }
}

@media (max-width: 760px) {
  .track-calculator .about-story {
    margin-top: 30px;
  }
  .track-calculator .about-copy .about-story p {
    font-size: 17px;
    margin-bottom: 24px;
  }
  .track-calculator .about-copy .about-story .about-opening {
    font-size: 21px;
    line-height: 1.8;
    margin-bottom: 27px;
  }
  .track-calculator .about-cut-line {
    padding: 3px 6px;
  }
  .track-calculator .about-copy .about-story .about-explanation {
    padding: 25px 18px;
    font-size: 16px;
    margin-bottom: 28px;
  }
}

/* La police de texte courant garde les accents et les minuscules homogènes. */
.track-calculator .about-story.about-story-compact {
  max-width: 900px;
}
.track-calculator .about-copy .about-story.about-story-compact p {
  max-width: none;
  margin: 0 auto 25px;
  font:
    600 clamp(17px, 1.5vw, 22px)/1.8 "Bricolage Grotesque",
    sans-serif;
  letter-spacing: 0.015em;
}
.track-calculator .about-copy .about-story.about-story-compact .about-features {
  position: relative;
  max-width: 38ch;
  margin: 38px auto 12px;
  padding: 12px 8px 23px;
  font-size: clamp(19px, 1.8vw, 25px);
  line-height: 1.6;
  text-wrap: balance;
  transform: rotate(-1.5deg);
}
.track-calculator .about-features::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 17%;
  bottom: 3px;
  height: 9px;
  border-bottom: 3px solid var(--dark);
  border-radius: 0 0 50% 40%;
  transform: rotate(2deg);
  pointer-events: none;
}
.track-calculator
  .about-copy
  .about-story.about-story-compact
  .about-explanation {
  padding: 15px 19px;
  margin-top: 28px;
  margin-bottom: 27px;
}
