:root {
  --bg: #06110d;
  --bg-glow: #0e2a1f;
  --ink: #f2eee4;
  --ink-soft: #b9c4bc;
  --mint: #6cc79d;
  --line: rgba(214, 230, 220, 0.18);
  --ink-body: #d9ddd4;
  --btn-bg: rgba(6, 17, 13, .35);
  --veil: rgba(6, 17, 13, .55);
  --cream: #efe9dc;
  --gutter: clamp(20px, 5vw, 80px);
  --sans: "Inter Tight", system-ui, sans-serif;
  --serif: "Newsreader", Georgia, serif;
}

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

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

body {
  margin: 0;
  background: radial-gradient(120% 90% at 70% 40%, var(--bg-glow) 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* The light at the end of the path. Driven from particles.js: it glows at the
   vanishing point, then scales up until it floods the page with cream. */
#light {
  position: fixed;
  left: 0; top: 0;
  width: 100vmax;
  height: 100vmax;
  border-radius: 50%;
  background: radial-gradient(circle closest-side,
    var(--cream) 0%, var(--cream) 30%,
    rgba(239, 233, 220, .45) 48%, rgba(170, 220, 190, .12) 70%, rgba(170, 220, 190, 0) 100%);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  will-change: transform, opacity;
}

/* Past the light: dark green ink on cream. */
body { transition: color .6s ease; }
body.is-light {
  --ink: #0f2a1f;
  --ink-soft: #4a6557;
  --ink-body: #294236;
  --mint: #2f7d58;
  --line: rgba(15, 42, 31, 0.2);
  --btn-bg: transparent;
  --veil: rgba(239, 233, 220, .6);
}
body.is-light .brand img { filter: brightness(0); opacity: .8; }
body.is-light .btn:hover, body.is-light .btn:focus-visible { background: var(--ink); color: var(--cream); }
.nav-links a, .rail a, .btn, .frame, .brand img { transition: color .6s ease, border-color .6s ease, filter .6s ease, background .25s; }

.frame {
  position: fixed;
  inset: 12px;
  border: 1px solid var(--line);
  pointer-events: none;
  z-index: 3;
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 30px calc(var(--gutter) + 4px) 0;
  pointer-events: none;
}
.nav > * { pointer-events: auto; }

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--ink);
  text-decoration: none;
}
.brand img { width: 46px; height: auto; opacity: .92; }
.brand-text { display: flex; flex-direction: column; gap: 6px; }
.brand-name {
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: .55em;
  text-transform: uppercase;
  line-height: 1;
}
.brand-sub {
  font-size: 10px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.nav-links { display: flex; gap: clamp(20px, 3vw, 40px); }
.nav-links a {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink);
  text-decoration: none;
  opacity: .85;
  transition: opacity .2s;
}
.nav-links a:hover, .nav-links a:focus-visible { opacity: 1; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }

/* ---------- side rail ---------- */
.rail {
  position: fixed;
  right: calc(var(--gutter) + 4px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
/* Hidden on the hero; it arrives with step 01. */
.rail { transition: opacity .5s ease; }
.rail.is-hidden { opacity: 0; pointer-events: none; }
.rail li + li::before {
  content: "";
  display: block;
  width: 30px;
  height: 1px;
  background: var(--line);
  margin-bottom: 18px;
}
.rail a {
  display: flex;
  flex-direction: row;
  gap: .5em;
  white-space: nowrap;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color .3s;
  position: relative;
}
.rail a[aria-current="step"] { color: var(--ink); }
.rail a[aria-current="step"]::before {
  content: "";
  position: absolute;
  left: -16px; top: 4px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 10px var(--mint);
}

/* ---------- panels ---------- */
main { position: relative; z-index: 2; }

.panel {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 140px var(--gutter) 100px calc(var(--gutter) + 4px);
  position: relative;
}
.panel + .panel { min-height: 130vh; min-height: 130svh; }
/* Écouter holds longer so the voice has time to talk before it falls silent. */
#ecouter { min-height: 150vh; min-height: 150svh; }
.passage { height: 90vh; height: 90svh; }

.content { max-width: 560px; }
.hero .content { max-width: 640px; }

h1 {
  font-weight: 700;
  font-size: clamp(56px, 8.4vw, 132px);
  line-height: .92;
  letter-spacing: -.035em;
  margin: 0 0 32px;
  text-wrap: balance;
}
h2 {
  font-weight: 700;
  font-size: clamp(36px, 4.6vw, 68px);
  line-height: 1;
  letter-spacing: -.03em;
  margin: 0 0 24px;
  text-wrap: balance;
}
.lede, .body {
  font-family: var(--serif);
  font-weight: 300;
  color: var(--ink);
  margin: 0 0 40px;
}
.lede { font-size: clamp(22px, 2.3vw, 32px); line-height: 1.25; max-width: 20em; }
.body { font-size: clamp(19px, 1.6vw, 23px); line-height: 1.45; color: var(--ink-body); max-width: 28em; }
/* Named projects under a panel's body: quieter than the body, same serif. */
.proof {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(15px, 1.15vw, 17px);
  line-height: 1.5;
  color: var(--ink-body);
  max-width: 32em;
  margin: -16px 0 0;
}

.kicker {
  font-size: 12px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--mint);
  margin: 0 0 22px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  padding: 16px 30px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-size: 17px;
  font-weight: 500;
  background: var(--btn-bg);
  backdrop-filter: blur(4px);
  transition: background .25s, color .25s;
}
.btn:hover, .btn:focus-visible { background: var(--ink); color: var(--bg); }

.scroll-cue {
  position: absolute;
  left: calc(var(--gutter) + 4px);
  bottom: 48px;
  display: flex;
  align-items: flex-end;
  gap: 22px;
  font-size: 12px;
  letter-spacing: .2em;
  color: var(--ink-soft);
}
.cue-line {
  width: 1px;
  height: 54px;
  background: linear-gradient(var(--ink-soft), transparent);
  position: relative;
  overflow: hidden;
}
.cue-line::after {
  content: "";
  position: absolute;
  left: -2px; top: 0;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ink);
  animation: cue 2.4s ease-in-out infinite;
}
@keyframes cue { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(50px); opacity: 0; } }

/* Final panel: logo sits in the upper middle, text below it */
.panel.signal { min-height: 100vh; min-height: 100svh; padding-bottom: 56px; }
.signal h2 { font-size: clamp(34px, 3.8vw, 56px); }
.signal { align-items: flex-end; justify-content: center; text-align: center; }
.signal .content { max-width: 620px; }
.signal .body { margin-left: auto; margin-right: auto; }
.signal .btn { font-size: 15px; }

/* Hero, desktop: everything on the left, one line per half of the headline. */
.hero-title .t1, .hero-title .t2 { display: inline-block; }
@media (min-width: 821px) {
  .hero .content { max-width: 900px; }
  .hero-title { font-size: clamp(56px, 7.2vw, 124px); }
  .hero-title .t1, .hero-title .t2 { display: block; }
  /* Two-beat headlines: each half stays on one line, wider than .content if needed. */
  .h-line { display: block; white-space: nowrap; }
  .hero-side { max-width: 560px; }
  /* The lede reads as two set lines, broken before "que vos clients…". */
  .hero-side { max-width: none; }
  .hero-side .lede { font-size: clamp(20px, 1.7vw, 26px); white-space: nowrap; max-width: none; margin-bottom: 32px; }
}

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
.reveal:nth-child(2) { transition-delay: .08s; }
.reveal:nth-child(3) { transition-delay: .16s; }
.reveal:nth-child(4) { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { transform: none; transition: opacity .6s ease; }
  .cue-line::after { animation-duration: 4s; }
}

/* ---------- pinned steps ----------
   With JS, each step's copy is pinned in one place on screen while its
   section scrolls by underneath; the sections only provide scroll length.
   Leaving a step fades its copy out quickly, and the next step's copy fades
   in, staggered, once the old one has cleared. */
.steps .panel > .content {
  position: fixed;
  z-index: 2;
  left: calc(var(--gutter) + 4px);
  right: calc(var(--gutter) + 4px);
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  /* The whole block fades too, so a hidden step's phone veil (its
     background) never darkens the visible step pinned in the same place. */
  opacity: 0;
  transition: opacity .4s ease;
}
.steps .panel.is-active > .content { pointer-events: auto; opacity: 1; }
/* The scroll hint belongs to step 1: pinned with it, fading with it. */
.steps .hero > .scroll-cue { position: fixed; z-index: 2; opacity: 0; transition: opacity .4s ease; }
.steps .hero.is-active > .scroll-cue { opacity: 1; transition-delay: .6s; }
.steps .panel.signal > .content {
  top: auto;
  bottom: 56px;
  transform: none;
  margin: 0 auto;
}
.steps .panel:not(.is-active) .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition-duration: .4s;
  transition-delay: 0s;
}
.steps .panel.is-active .reveal { opacity: 1; transform: none; transition-delay: .3s; }
.steps .panel.is-active .reveal:nth-child(2) { transition-delay: .38s; }
.steps .panel.is-active .reveal:nth-child(3) { transition-delay: .46s; }
.steps .panel.is-active .reveal:nth-child(4) { transition-delay: .54s; }
@media (prefers-reduced-motion: reduce) {
  .steps .panel:not(.is-active) .reveal { transform: none; }
}

a:focus-visible { outline: 1px solid var(--mint); outline-offset: 4px; }

/* ---------- small screens ---------- */
@media (max-width: 820px) {
  .rail { display: none; }
  .nav { padding-top: 26px; }
  .nav-links a:not(:last-child) { display: none; }
  .nav-links a { font-size: 16px; }
  .brand img { width: 38px; }
  .brand-name { font-size: 19px; }
  .panel { align-items: flex-end; padding: 120px 28px 96px; }
  .hero { padding-bottom: 140px; }
  .scroll-cue { left: 28px; bottom: 40px; }
  .lede { margin-bottom: 30px; }
  .br-desk { display: none; }
  /* Light serif strokes fade on the dark ground at phone sizes; tight
     tracking that suits 120px headlines cramps them at 36px. */
  .lede, .body, .proof { font-weight: 400; }
  h1 { letter-spacing: -.028em; }
  h2 { letter-spacing: -.025em; }
  .content { background: radial-gradient(closest-side, var(--veil), transparent); }
  /* Pinned copy sits where the panels used to put it: low on the screen. */
  .steps .panel > .content { left: 28px; right: 28px; top: auto; bottom: 220px; transform: none; }
  .steps .panel.hero > .content { bottom: 170px; }
  .steps .panel.signal > .content { bottom: 56px; }
}
/* Short phones: steps 2-3 would climb into the nav at 190px, keep them lower. */
@media (max-width: 820px) and (max-height: 700px) {
  .steps .panel > .content { bottom: 170px; }
}
