/* ============================================================
   CHARTE
   ============================================================ */

:root {
  --brand: #D4FF46;
  --brand-deep: #FFFFFF;
  --bg: #000000;
  --surface: #141414;
  --text: #FFFFFF;
  --muted: #A3A3A3;
  --rail: #333333;

  --font-display: "Krona One", "Arial Black", system-ui, sans-serif;
  --font-body: "Jost", "Futura", "Segoe UI", system-ui, -apple-system, sans-serif;

  color-scheme: dark;
}


/* ============================================================
   GLOBAL
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: env(safe-area-inset-top, 0px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}


/* ============================================================
   FRISE
   ============================================================ */

.timeline {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 6rem);
}


/* ============================================================
   STAGE
   ============================================================ */

.stage {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  height: 100vh;

  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;

  gap: clamp(1.25rem, 3vw, 2.5rem);
}


/* ============================================================
   RAIL
   ============================================================ */

.rail {
  position: relative;
  height: 62vh;
  width: 3px;

  background: var(--rail);
  border-radius: 3px;
}

.rail-fill {
  position: absolute;
  inset: 0 0 auto 0;

  height: 0%;

  background: var(--brand);
  border-radius: 3px;
}

.rail ol {
  list-style: none;
  margin: 0;
  padding: 0;

  position: absolute;
  inset: 0;
}

.rail li {
  position: absolute;
  left: 50%;

  transform: translate(-50%, -50%);
}

.rail button {
  display: block;

  width: 15px;
  height: 15px;

  padding: 0;

  border-radius: 50%;
  border: 3px solid var(--rail);

  background: var(--bg);

  cursor: pointer;

  transition:
    border-color .4s,
    background .4s,
    transform .4s;
}

.rail li.passed button {
  border-color: var(--brand);
  background: var(--brand);
}

.rail li.current button {
  border-color: var(--brand);
  background: var(--bg);

  transform: scale(1.35);
}

.rail button:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 4px;
}


/* ============================================================
   ANNÉE
   ============================================================ */

.year {
  position: relative;

  font-family: var(--font-display);
  font-weight: 400;

  font-size: clamp(3.2rem, 8vw, 7rem);
  line-height: 1;

  letter-spacing: -0.02em;

  color: var(--brand-deep);

  display: flex;
  overflow: hidden;
}

.digit {
  display: inline-flex;

  justify-content: center;

  width: .75em;
  height: 1em;

  overflow: hidden;

  transition:
    width .9s cubic-bezier(.65, 0, .2, 1);
}

.digit-strip {
  flex-shrink: 0;

  display: flex;
  flex-direction: column;
  align-items: center;

  transition:
    transform .9s cubic-bezier(.65, 0, .2, 1);
}

.digit-strip span {
  height: 1em;
  display: block;
}


/* ============================================================
   TITRE
   ============================================================ */

.stage-title {
  font-family: var(--font-display);
  font-weight: 400;

  font-size: 30px;
  line-height: 1.3;

  text-transform: uppercase;

  color: var(--brand-deep);

  margin: 0 0 2rem;
}


/* ============================================================
   ÉTAPES
   ============================================================ */

.step {
  min-height: 80vh;

  display: flex;
  flex-direction: column;
  justify-content: center;
}

.step-inner {
  opacity: .18;

  transform: translateY(48px);

  transition:
    opacity .7s ease,
    transform .9s cubic-bezier(.2, .7, .2, 1);
}

.step.is-active .step-inner {
  opacity: 1;
  transform: none;
}

.step.is-past .step-inner {
  opacity: .35;
  transform: none;
}

.step-year {
  display: none;
}

.step h3 {
  font-family: var(--font-display);
  font-weight: 400;

  font-size: 17px;
  line-height: 1.5;

  letter-spacing: .02em;

  text-transform: uppercase;

  margin: 0 0 1.5rem;

  max-width: 40ch;

  color: var(--brand);
}

.step h3::before {
  content: "";

  display: block;

  width: 0;
  height: 4px;

  background: var(--brand);

  border-radius: 2px;

  margin-bottom: 1.25rem;

  transition:
    width .9s .25s cubic-bezier(.2, .7, .2, 1);
}

.step.is-active h3::before,
.step.is-past h3::before {
  width: 3rem;
}

.step p {
  margin: 0 0 1rem;

  max-width: 60ch;

  font-family: var(--font-body);

  font-size: 17px;
  font-weight: 400;

  line-height: 28px;

  letter-spacing: .5px;
}

.step p:last-child {
  margin-bottom: 0;
}

.step strong {
  font-weight: 400;
  color: var(--brand-deep);
}


/* ============================================================
   ANIMATION DES PARAGRAPHES
   ============================================================ */

.step p {
  opacity: 0;

  transform: translateY(16px);

  transition:
    opacity .6s ease,
    transform .7s cubic-bezier(.2, .7, .2, 1);
}

.step.is-active p,
.step.is-past p {
  opacity: 1;
  transform: none;
}

.step.is-active p:nth-of-type(2) {
  transition-delay: .12s;
}

.step.is-active p:nth-of-type(3) {
  transition-delay: .24s;
}

.step.is-active p:nth-of-type(4) {
  transition-delay: .36s;
}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 820px) {

  .timeline {
    display: block;
  }

  .stage {
    top: env(safe-area-inset-top, 0px);

    height: auto;

    z-index: 5;

    background: var(--bg);

    grid-template-columns: 1fr;

    gap: .6rem;
  }

  body::before {
    content: "";

    position: fixed;
    inset: 0 0 auto;

    height: env(safe-area-inset-top, 0px);

    z-index: 10;

    background: var(--bg);
  }

  .year {
    font-size: 2.6rem;
    order: 1;
  }

  .stage-title {
    font-size: 18px;
    margin-bottom: .75rem;
  }

  .rail {
    order: 2;

    width: 100%;
    height: 3px;
  }

  .rail-fill {
    inset: 0 auto 0 0;

    height: 100% !important;
    width: 0%;
  }

  .rail li {
    top: 50% !important;
  }

  .step {
    min-height: 70vh;
  }
}


/* ============================================================
   ACCESSIBILITÉ — RÉDUCTION DES ANIMATIONS
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

  .step-inner,
  .step p,
  .digit,
  .digit-strip,
  .step h3::before,
  .rail button {
    transition: none !important;
  }

}