/* ==========================================================================
   Apollo 13 · Odyssey & Aquarius
   Grand format interactif - feuille de style principale
   ========================================================================== */

/* --------------------------------------------------------------- 1. Tokens */

:root {
  --ink:        #08090c;
  --ink-2:      #0e1116;
  --ink-3:      #171c24;
  --line:       #262d38;
  --paper:      #e9e5db;
  --muted:      #7c838f;
  --gold:       #c69b4a;
  --gold-soft:  rgba(198, 155, 74, .16);
  --alarm:      #d8442f;

  --ff-display: "Bodoni Moda", Georgia, "Times New Roman", serif;
  --ff-body:    "Inter", system-ui, -apple-system, sans-serif;
  --ff-mono:    "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

  --fs-hero:    clamp(3.4rem, 13vw, 11rem);
  --fs-h2:      clamp(2rem, 5.4vw, 4.2rem);
  --fs-h3:      clamp(1.4rem, 2.6vw, 2rem);
  --fs-lede:    clamp(1.15rem, 1.9vw, 1.5rem);
  --fs-body:    clamp(1rem, 1.15vw, 1.08rem);
  --fs-mono:    .72rem;

  --gut:        clamp(1.25rem, 5vw, 5rem);
  --stack:      clamp(4.5rem, 12vh, 9rem);
  --measure:    34rem;

  --ease:       cubic-bezier(.16, .84, .34, 1);
}

/* --------------------------------------------------------------- 2. Base */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  line-height: 1.62;
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  opacity: .5;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
}

p { margin: 0 0 1.15em; }

em { font-style: italic; }

i { font-style: normal; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--paper);
  color: var(--ink);
  padding: .6rem 1rem;
  font-family: var(--ff-mono);
  font-size: var(--fs-mono);
}

.skip:focus { left: 0; }

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

/* --------------------------------------------------------------- 3. Eyebrow */

.eyebrow {
  font-family: var(--ff-mono);
  font-size: var(--fs-mono);
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1.2rem;
}

/* --------------------------------------------------------------- 4. Barre */

.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: .95rem var(--gut);
  font-family: var(--ff-mono);
  font-size: var(--fs-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  background: linear-gradient(to bottom, rgba(8, 9, 12, .92), rgba(8, 9, 12, 0));
  backdrop-filter: blur(3px);
}

.bar__id { color: var(--paper); }

.bar__mission {
  margin-left: auto;
  color: var(--gold);
  opacity: .75;
}

.bar__prog {
  width: clamp(60px, 12vw, 160px);
  height: 1px;
  background: var(--line);
  overflow: hidden;
}

.bar__progfill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold);
  transform-origin: left center;
}

/* --------------------------------------------------------------- 5. Hero */

.hero {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 var(--gut) clamp(2rem, 6vh, 4rem);
  pointer-events: none;
}

.hero__inner { max-width: 100%; }

.hero__title {
  font-family: var(--ff-display);
  font-weight: 400;
  font-size: var(--fs-hero);
  line-height: .82;
  letter-spacing: -.03em;
  margin: 0 0 1.4rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 .3em;
}

.hero__line { display: block; }

.hero__line--gold { color: var(--gold); }

.hero__amp {
  font-size: .3em;
  color: var(--muted);
  transform: translateY(-.35em);
}

.hero__sub {
  font-family: var(--ff-body);
  font-size: var(--fs-lede);
  font-weight: 400;
  color: var(--muted);
  max-width: 26ch;
  margin: 0;
}

.hero__scroll {
  position: absolute;
  right: var(--gut);
  bottom: clamp(2rem, 6vh, 4rem);
  display: flex;
  align-items: center;
  gap: .9rem;
  font-family: var(--ff-mono);
  font-size: var(--fs-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero__rule {
  display: block;
  width: 54px;
  height: 1px;
  background: var(--gold);
  transform-origin: right center;
  animation: sweep 2.6s var(--ease) infinite;
}

@keyframes sweep {
  0%, 100% { transform: scaleX(.25); opacity: .4; }
  50%      { transform: scaleX(1);   opacity: 1; }
}

/* Hero place dans le flux des etapes de l'explorateur */
.explorer__steps .hero {
  padding-left: 0;
  padding-right: 0;
}

/* --------------------------------------------------------------- 6. Chapitres */

.chap {
  position: relative;
  z-index: 2;
  padding: var(--stack) var(--gut);
  background: var(--ink);
}

.chap__head {
  max-width: var(--measure);
  margin: 0 auto clamp(2rem, 5vh, 3.5rem);
}

.chap--wide .chap__head {
  max-width: 62rem;
}

.chap__title {
  font-family: var(--ff-display);
  font-weight: 400;
  font-size: var(--fs-h2);
  line-height: .98;
  letter-spacing: -.02em;
  margin: 0;
  text-wrap: balance;
}

.chap__note {
  font-family: var(--ff-mono);
  font-size: var(--fs-mono);
  color: var(--muted);
  letter-spacing: .06em;
  margin: 1.1rem 0 0;
}

.prose {
  max-width: var(--measure);
  margin: 0 auto;
  color: #cfcabd;
}

.prose .lede {
  font-size: var(--fs-lede);
  line-height: 1.48;
  color: var(--paper);
  margin-bottom: 1.6em;
}

.prose em { color: var(--paper); }

/* --------------------------------------------------------------- 7. Explorateur 3D */

.explorer {
  position: relative;
  z-index: 3;
  background: var(--ink);
}

.explorer__stage {
  position: sticky;
  top: 0;
  height: 100svh;
  width: 100%;
  overflow: hidden;
}

.explorer__stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to right,
    rgba(8, 9, 12, 0) 46%,
    rgba(8, 9, 12, .55) 66%,
    rgba(8, 9, 12, .88) 86%);
}

.explorer__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.explorer__leaders,
.explorer__labels {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.explorer__leaders { overflow: visible; }

.leader {
  stroke: var(--gold);
  stroke-width: 1;
  fill: none;
  opacity: 0;
  transition: opacity .35s var(--ease);
}

.leader--on { opacity: .55; }

.leader__dot {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1;
  opacity: 0;
  transition: opacity .35s var(--ease);
}

.leader__dot--on { opacity: .9; }

.tag {
  position: absolute;
  font-family: var(--ff-mono);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--paper);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .4s var(--ease);
  text-shadow: 0 1px 8px rgba(8, 9, 12, .9);
}

.tag--on { opacity: 1; }

.tag b {
  display: block;
  font-weight: 500;
  color: var(--gold);
}

.tag span {
  display: block;
  color: var(--muted);
  text-transform: none;
  letter-spacing: .04em;
  font-size: .64rem;
}

.explorer__hud {
  position: absolute;
  left: var(--gut);
  bottom: clamp(1.5rem, 5vh, 3rem);
  opacity: 0;
  transition: opacity .5s var(--ease);
  display: flex;
  align-items: baseline;
  gap: 1rem;
  font-family: var(--ff-mono);
  font-size: var(--fs-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hud__step {
  font-size: 1.5rem;
  letter-spacing: 0;
  color: var(--gold);
}

.hud__name { color: var(--muted); }

.explorer__fallback {
  position: absolute;
  inset: auto var(--gut) 45%;
  font-family: var(--ff-mono);
  font-size: var(--fs-mono);
  color: var(--muted);
}

.explorer__steps {
  position: relative;
  margin-top: -100svh;
  padding: 0 var(--gut);
  pointer-events: none;
}

.step {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 27rem;
  margin-left: auto;
  padding: 6rem 0;
  opacity: .3;
  transition: opacity .5s var(--ease);
  pointer-events: auto;
}

.step--active { opacity: 1; }

.step__num {
  font-family: var(--ff-mono);
  font-size: 2.6rem;
  line-height: 1;
  color: var(--gold);
  margin: 0 0 .6rem;
}

.step--alarm .step__num { color: var(--alarm); }

.step__title {
  font-family: var(--ff-display);
  font-weight: 400;
  font-size: var(--fs-h3);
  line-height: 1.06;
  letter-spacing: -.01em;
  margin: 0 0 1.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
}

.step p {
  color: #d6d2c7;
  font-size: .98rem;
  text-shadow: 0 1px 10px rgba(8, 9, 12, .8);
}

.specs {
  list-style: none;
  margin: 1.6rem 0 0;
  padding: 0;
  font-family: var(--ff-mono);
  font-size: var(--fs-mono);
  letter-spacing: .05em;
}

.specs li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem 0;
  border-top: 1px solid var(--line);
}

.specs li span:first-child {
  color: var(--muted);
  text-transform: uppercase;
}

.specs li span:last-child {
  color: var(--paper);
  text-align: right;
}

.specs--alarm li span:last-child { color: var(--alarm); }

/* --------------------------------------------------------------- 8. Chronologie */

.timeline {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 62rem;
  counter-reset: none;
}

.timeline__item {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: clamp(1rem, 4vw, 3rem);
  padding: 2rem 0;
  border-top: 1px solid var(--line);
}

.timeline__t {
  font-family: var(--ff-mono);
  font-size: .82rem;
  letter-spacing: .06em;
  color: var(--muted);
  padding-top: .25rem;
}

.timeline__item--key .timeline__t { color: var(--gold); }

.timeline__c h3 {
  font-family: var(--ff-display);
  font-weight: 400;
  font-size: clamp(1.25rem, 2.2vw, 1.7rem);
  line-height: 1.1;
  margin: 0 0 .6rem;
}

.timeline__c p {
  margin: 0;
  color: #b8b4aa;
  max-width: 46ch;
}

/* --------------------------------------------------------------- 9. Chiffres */

.figures {
  position: relative;
  z-index: 2;
  padding: var(--stack) var(--gut);
  background: var(--ink-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.figures__grid {
  max-width: 72rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
}

.fig__n {
  font-family: var(--ff-display);
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  line-height: .9;
  letter-spacing: -.03em;
  color: var(--gold);
  margin: 0 0 .8rem;
}

.fig__l {
  font-family: var(--ff-mono);
  font-size: var(--fs-mono);
  line-height: 1.6;
  letter-spacing: .04em;
  color: var(--muted);
  margin: 0;
  max-width: 22ch;
}

/* --------------------------------------------------------------- 10. Pied */

.foot {
  position: relative;
  z-index: 2;
  padding: var(--stack) var(--gut);
  background: var(--ink);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
  max-width: 72rem;
  margin: 0 auto;
}

.foot p {
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.65;
}

.foot i { font-style: italic; }

/* --------------------------------------------------------------- 11. Adaptatif */

@media (max-width: 900px) {
  .explorer__stage::after {
    background: linear-gradient(to top,
      rgba(8, 9, 12, .82) 0%,
      rgba(8, 9, 12, 0) 38%);
  }

  .step {
    max-width: none;
    margin-left: 0;
    padding: 0 0 4.5rem;
    justify-content: flex-end;
  }

  .step > * { position: relative; z-index: 1; }

  .step::before {
    content: "";
    position: absolute;
    left: calc(var(--gut) * -1);
    right: calc(var(--gut) * -1);
    bottom: 0;
    height: 78%;
    background: linear-gradient(to top,
      var(--ink) 0%, rgba(8, 9, 12, .96) 42%, rgba(8, 9, 12, 0) 100%);
    z-index: 0;
  }

  .step__num { font-size: 2rem; }

  .step .specs li:nth-child(n+3) { display: none; }

  .explorer__hud { display: none; }

  .tag { font-size: .58rem; }

  .tag span { font-size: .55rem; }

  .timeline__item {
    grid-template-columns: 1fr;
    gap: .5rem;
  }

  .hero__scroll { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .hero__rule { animation: none; }

  * {
    transition-duration: .01ms !important;
  }
}
