@font-face {
  font-family: 'Archivo';
  src: url('../fonts/archivo-latin.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jetbrainsmono-latin.woff2') format('woff2');
  font-weight: 500 700;
  font-display: swap;
}

:root {
  --bg: #000;
  --ink: #f2ede4;
  --muted: #8f8a82;
  --line: rgba(242, 237, 228, 0.14);
  --accent: #e0d4be;
  --gutter: clamp(16px, 4vw, 56px);
  --display: 'Archivo', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --progress: 0;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--display);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
::selection { background: var(--accent); color: #000; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: #000; padding: 8px 14px; }
.skip:focus { left: 8px; }

.maquette {
  position: fixed; left: var(--gutter); bottom: 16px; z-index: 50; margin: 0;
  max-width: min(440px, calc(100vw - 2 * var(--gutter)));
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(6px);
  font: 500 11px/1.45 var(--mono); letter-spacing: 0.04em; color: var(--muted);
}
.maquette strong { color: var(--ink); text-transform: uppercase; letter-spacing: 0.14em; }

/* Calques ------------------------------------------------------------ */

#scene { position: fixed; inset: 0; z-index: 1; pointer-events: none; }

.grain {
  position: fixed; inset: -50%; z-index: 40; pointer-events: none; opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -1%); } 100% { transform: translate(0, 0); }
}
@media (prefers-reduced-motion: reduce) { .grain { animation: none; } }

.backword {
  position: absolute; top: 0; left: 0; right: 0; height: 100svh; z-index: 0;
  display: grid; place-items: center; overflow: hidden; pointer-events: none;
}
.backword span {
  font: 900 clamp(120px, 30vw, 520px)/0.8 var(--display);
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(242, 237, 228, 0.16);
  transform: translateY(-6vh);
  animation: rise 1.6s cubic-bezier(.2, .7, .1, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(4vh) scale(.96); } }

/* En-tête ------------------------------------------------------------- */

.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; gap: 24px;
  padding: 18px var(--gutter);
  background: linear-gradient(#000 0%, rgba(0, 0, 0, 0) 100%);
}
.brand { font: 900 22px/1 var(--display); letter-spacing: 0.02em; text-decoration: none; display: flex; align-items: baseline; gap: 6px; }
.brand span { font: 500 11px/1 var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.top nav { display: flex; gap: 28px; margin-left: auto; }
.top nav a { font: 500 12px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; color: var(--muted); transition: color .2s; }
.top nav a:hover { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 26px; border-radius: 999px;
  background: var(--ink); color: #000; text-decoration: none;
  font: 700 14px/1 var(--display); letter-spacing: 0.04em; text-transform: uppercase;
  transition: transform .25s cubic-bezier(.2, .7, .1, 1), background .2s;
}
.btn:hover { transform: translateY(-2px); background: #fff; }
.btn-sm { min-height: 38px; padding: 0 18px; font-size: 12px; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { background: rgba(242, 237, 228, 0.08); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Rail de progression -------------------------------------------------- */

.rail {
  position: fixed; right: var(--gutter); top: 50%; z-index: 20; transform: translateY(-50%);
  list-style: none; margin: 0; padding: 0 0 0 18px; display: grid; gap: 14px;
  border-left: 1px solid var(--line);
  font: 500 10px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: rgba(143, 138, 130, .5);
}
.rail::before {
  content: ''; position: absolute; left: -1px; top: 0; width: 1px; height: calc(var(--progress) * 100%);
  background: var(--ink);
}
.rail li { position: relative; transition: color .3s; }
.rail li::before { content: ''; position: absolute; left: -21px; top: 50%; width: 5px; height: 5px; border-radius: 50%; background: #333; transform: translateY(-50%); transition: background .3s; }
.rail li.on { color: var(--ink); }
.rail li.on::before { background: var(--ink); }

/* Sections ------------------------------------------------------------- */

main { position: relative; z-index: 10; }
section { position: relative; padding: 0 var(--gutter); }

.eyebrow, .num {
  font: 500 12px/1 var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 22px;
}

.hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: clamp(32px, 7vh, 72px); }
.hero h1 {
  font: 900 clamp(44px, 7.4vw, 124px)/0.9 var(--display);
  letter-spacing: -0.035em; text-transform: uppercase;
  margin: 0 0 28px; max-width: 12ch;
}
.hero h1 span { display: block; }
.hero h1 span:nth-child(2) { color: transparent; -webkit-text-stroke: 1.5px var(--ink); }
.hero-foot { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.hero-foot p { max-width: 34ch; margin: 0; color: var(--muted); }
.scroll-cue {
  font: 500 11px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.scroll-cue::after { content: ''; width: 1px; height: 54px; background: linear-gradient(var(--ink), transparent); animation: cue 2s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

.chap { min-height: 130svh; display: flex; align-items: center; }
.col { max-width: 520px; }
.col h2, .collection-head h2 {
  font: 900 clamp(38px, 5.2vw, 84px)/0.95 var(--display);
  letter-spacing: -0.03em; text-transform: uppercase; margin: 0 0 24px;
}
.col p { color: #c9c3b9; margin: 0 0 16px; max-width: 42ch; }
.col em { font-style: normal; color: var(--ink); border-bottom: 1px solid var(--accent); }

.anatomy { margin: 32px 0 0; display: grid; gap: 0; }
.anatomy div { display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.anatomy dt { font: 500 12px/1.5 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.anatomy dd { margin: 0; color: #b6b0a6; font-size: 15px; }

.steps { list-style: none; counter-reset: s; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.steps li { counter-increment: s; background: #000; padding: 20px 18px; color: #b6b0a6; font-size: 15px; line-height: 1.45; }
.steps li::before { content: counter(s, decimal-leading-zero); display: block; font: 500 11px/1 var(--mono); color: var(--muted); margin-bottom: 14px; letter-spacing: .14em; }
.steps strong { display: block; color: var(--ink); font-weight: 800; text-transform: uppercase; letter-spacing: .02em; margin-bottom: 4px; }

.final { min-height: 110svh; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* Collection ----------------------------------------------------------- */

.collection { padding-top: 22vh; padding-bottom: 22vh; }
.collection-head { max-width: 640px; margin-bottom: 48px; }
.collection-head p:last-child { color: var(--muted); margin: 0; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(10px, 1.4vw, 20px); max-width: 1160px; }
.card {
  margin: 0; position: relative; overflow: hidden; border-radius: 4px; background: #0b0b0b;
  aspect-ratio: 1; box-shadow: 0 0 0 1px var(--line);
  opacity: 0; transform: translateY(40px);
  transition: opacity .9s cubic-bezier(.2, .7, .1, 1) calc(var(--i) * 70ms), transform .9s cubic-bezier(.2, .7, .1, 1) calc(var(--i) * 70ms), box-shadow .3s;
}
.card.in { opacity: 1; transform: none; }
.card img, .card canvas { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.2s cubic-bezier(.2, .7, .1, 1); }
.card:hover img, .card:hover canvas, .card:focus-visible canvas { transform: scale(1.06); }
.card:hover { box-shadow: 0 0 0 1px rgba(242, 237, 228, .4); }
.card figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px;
  display: flex; gap: 12px; align-items: baseline;
  font: 800 15px/1 var(--display); text-transform: uppercase; letter-spacing: .02em;
  background: linear-gradient(transparent, rgba(0, 0, 0, .75));
}
.card figcaption span { font: 500 11px/1 var(--mono); color: var(--muted); }
.more { margin: 36px 0 0; }
.more a { font: 500 13px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.more a:hover { border-color: var(--ink); }

/* Pied de page --------------------------------------------------------- */

.foot {
  position: relative; z-index: 10; display: flex; flex-wrap: wrap; gap: 12px 28px;
  padding: 28px var(--gutter) calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #000;
  font: 500 11px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.foot span:first-child { margin-right: auto; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* Apparitions ------------------------------------------------------------ */

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s cubic-bezier(.2, .7, .1, 1), transform 1s cubic-bezier(.2, .7, .1, 1); }
.reveal.in { opacity: 1; transform: none; }
.hero .reveal { transition-delay: .3s; }
.hero h1.reveal { transition-delay: .15s; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .card { opacity: 1; transform: none; transition: none; }
}

/* Mobile ----------------------------------------------------------------- */

@media (max-width: 1100px) { .rail { display: none; } }

@media (max-width: 899px) {
  body { font-size: 16px; }
  .top nav { display: none; }
  .top .btn-sm { margin-left: auto; }
  .hero h1 { font-size: clamp(40px, 13vw, 72px); }
  .hero-foot { flex-direction: column; align-items: flex-start; }
  .scroll-cue { display: none; }
  .chap { align-items: flex-end; min-height: 120svh; padding-bottom: 12vh; }
  .col {
    padding: 28px 22px; margin: 0 -6px; border-radius: 6px;
    background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 0 0 1px var(--line);
  }
  .grid { grid-template-columns: 1fr 1fr; }
  .anatomy div { grid-template-columns: 1fr; gap: 4px; }
  .steps { grid-template-columns: 1fr; }
}
