/* RELIQUE — site vitrine. Monochrome, tramage, rétro-technique. Les yeux-livre. */

@font-face { font-family: "Space Grotesk"; src: url("fonts/SpaceGrotesk-300.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("fonts/SpaceGrotesk-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("fonts/SpaceGrotesk-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("fonts/SpaceGrotesk-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --fond: #111111;
  --fond-2: #161615;
  --papier: #f2efe7;
  --texte: #a9a79e;
  --ligne: #2b2a27;
  --ligne-2: #3a3935;
  --accent: #c24a3a;
  --max: 1180px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--fond); }

body {
  margin: 0;
  background: var(--fond);
  color: var(--papier);
  font: 17px/1.6 "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* grain fixe, très léger */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50;
  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)' opacity='.5'/%3E%3C/svg%3E");
  opacity: .05; mix-blend-mode: overlay;
}

h1, h2, h3 { font-weight: 500; line-height: 1.05; margin: 0 0 .5em; letter-spacing: -0.02em; }
h1 { font-weight: 300; font-size: clamp(2.6rem, 8.4vw, 6.4rem); letter-spacing: -0.045em; text-transform: uppercase; }
h2 { font-weight: 400; font-size: clamp(1.6rem, 3.6vw, 2.6rem); letter-spacing: -0.03em; max-width: 18ch; }
h3 { font-size: .95rem; letter-spacing: .08em; text-transform: uppercase; }

p { margin: 0 0 1em; }
a { color: var(--papier); text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
em { font-style: normal; color: var(--papier); }

.saut { position: absolute; left: -9999px; }
.saut:focus { left: 12px; top: 12px; z-index: 100; background: var(--papier); color: var(--fond); padding: 8px 12px; }

/* --- les yeux --- */

.yeux { display: block; overflow: visible; }
.yeux .paupieres { fill: var(--papier); transform-box: fill-box; transform-origin: 50% 90%; transition: transform .12s ease-in; }
.yeux .couverture { fill: none; stroke: var(--papier); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.yeux .pupille { transition: transform .35s var(--ease); }
.yeux.cligne .paupieres { transform: scaleY(.06); transition-duration: .09s; }

/* --- barre --- */

.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(18px, 4vw, 40px);
  transition: background .4s, border-color .4s, padding .4s;
  border-bottom: 1px solid transparent;
}
.bar.pleine {
  background: rgba(17, 17, 17, .78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-color: var(--ligne); padding-top: 12px; padding-bottom: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--papier); text-decoration: none; }
.brand:hover { color: var(--papier); }
.brand .yeux { width: 44px; }
.brand span { font-weight: 600; letter-spacing: .22em; font-size: .9rem; }
.bar nav { display: flex; gap: clamp(14px, 2.4vw, 28px); }
.bar nav a { color: var(--texte); font-size: .86rem; text-decoration: none; letter-spacing: .04em; position: relative; }
.bar nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -4px; height: 1px; background: var(--accent); transition: right .35s var(--ease); }
.bar nav a:hover { color: var(--papier); }
.bar nav a:hover::after { right: 0; }

/* --- hero --- */

.hero {
  position: relative; min-height: 100svh; display: grid; place-items: center;
  padding: 120px clamp(18px, 4vw, 40px) 110px; overflow: hidden; isolation: isolate;
}
.trame { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 55% at 50% 45%, rgba(17,17,17,.92) 0%, rgba(17,17,17,.55) 55%, rgba(17,17,17,0) 100%),
              linear-gradient(0deg, var(--fond) 0%, transparent 22%);
}
.hero-in { max-width: 980px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.yeux-hero { width: clamp(220px, 34vw, 400px); margin-bottom: clamp(28px, 5vw, 48px); }
/* intro : la couverture se trace, le livre s'ouvre depuis le dos, puis les yeux s'éveillent */
.yeux-hero .couverture { stroke-dasharray: 1; stroke-dashoffset: 1; animation: tracer .9s var(--ease) .15s forwards; }
.yeux-hero .page-g, .yeux-hero .page-d { transform-box: view-box; transform-origin: 64px 0; }
.yeux-hero .page-g { animation: ouvrir-g 1.05s cubic-bezier(.3,.9,.25,1) .55s both; }
.yeux-hero .page-d { animation: ouvrir-d 1.05s cubic-bezier(.3,.9,.25,1) .55s both; }
.yeux-hero .pupille path { transform-box: fill-box; transform-origin: 60% 60%; animation: eveil .5s cubic-bezier(.3,1.6,.5,1) 1.55s both; }
@keyframes tracer { to { stroke-dashoffset: 0; } }
@keyframes ouvrir-g { 0% { transform: scaleX(.03) skewY(-14deg); opacity: .4; } 60% { opacity: 1; } 100% { transform: none; } }
@keyframes ouvrir-d { 0% { transform: scaleX(.03) skewY(14deg); opacity: .4; } 60% { opacity: 1; } 100% { transform: none; } }
@keyframes eveil { from { transform: scale(0); } to { transform: scale(1); } }

.kicker {
  opacity: 0; animation: apparaitre .8s var(--ease) 1.6s forwards;
  font-family: var(--mono); color: var(--texte); text-transform: uppercase;
  letter-spacing: .2em; font-size: .72rem; margin-bottom: 22px;
}
.kicker span { color: var(--accent); }

.cinetique span { display: inline-block; opacity: 0; transform: translateY(.5em) rotate(2deg); filter: blur(8px);
  animation: monter .9s var(--ease) forwards; }
.cinetique span:nth-child(1) { animation-delay: 1.75s; }
.cinetique span:nth-child(2) { animation-delay: 1.85s; }
.cinetique span:nth-child(3) { animation-delay: 1.95s; }
.cinetique span:nth-child(4) { animation-delay: 2.07s; }
@keyframes monter { to { opacity: 1; transform: none; filter: none; } }

.glitch { position: relative; color: var(--papier); }
.glitch::before, .glitch::after {
  content: attr(data-t); position: absolute; inset: 0; pointer-events: none; opacity: 0;
}
.glitch::before { color: var(--accent); }
.glitch::after { color: var(--papier); }
.glitch.actif::before { opacity: .9; animation: tranche-a .42s steps(2) both; }
.glitch.actif::after { opacity: 1; animation: tranche-b .42s steps(2) both; }
@keyframes tranche-a {
  0% { clip-path: inset(10% 0 70% 0); transform: translate(-6px, 0); }
  33% { clip-path: inset(55% 0 20% 0); transform: translate(5px, 0); }
  66% { clip-path: inset(30% 0 50% 0); transform: translate(-3px, 0); }
  100% { clip-path: inset(0 0 100% 0); transform: none; }
}
@keyframes tranche-b {
  0% { clip-path: inset(70% 0 8% 0); transform: translate(5px, 0); }
  50% { clip-path: inset(20% 0 62% 0); transform: translate(-6px, 0); }
  100% { clip-path: inset(100% 0 0 0); transform: none; }
}

.lede { max-width: 56ch; font-size: clamp(1rem, 1.6vw, 1.15rem); color: var(--texte); margin: 6px auto 0;
  opacity: 0; animation: apparaitre 1s var(--ease) 2.3s forwards; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 34px 0 0;
  opacity: 0; animation: apparaitre 1s var(--ease) 2.5s forwards; }
@keyframes apparaitre { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.bouton {
  position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px;
  border: 1px solid var(--papier); border-radius: 999px; overflow: hidden;
  font-weight: 500; font-size: .95rem; letter-spacing: .01em; text-decoration: none;
  background: var(--papier); color: var(--fond); isolation: isolate;
  transition: color .35s var(--ease), transform .35s var(--ease);
}
.bouton::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--fond);
  transform: translateY(101%); transition: transform .45s var(--ease);
}
.bouton:hover { color: var(--papier); }
.bouton:hover::before { transform: none; }
.bouton.ghost { background: transparent; color: var(--papier); border-color: var(--ligne-2); }
.bouton.ghost::before { background: var(--papier); }
.bouton.ghost:hover { color: var(--fond); border-color: var(--papier); }

.defiler {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: .66rem; letter-spacing: .24em; text-transform: uppercase;
  color: var(--texte); text-decoration: none;
}
.defiler i { width: 1px; height: 44px; background: linear-gradient(var(--papier), transparent); transform-origin: top; animation: goutte 2.2s var(--ease) infinite; }
@keyframes goutte { 0% { transform: scaleY(0); opacity: 1; } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* --- ruban des départements --- */

.ruban { border-block: 1px solid var(--ligne); padding: 14px 0; overflow: hidden; display: grid; gap: 8px;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.piste { display: flex; width: max-content; gap: 34px; animation: defile 120s linear infinite; white-space: nowrap; }
.piste.inverse { animation-direction: reverse; animation-duration: 150s; }
.piste span { font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--texte); }
.piste b { font-family: var(--mono); font-weight: 400; color: var(--accent); margin-right: 10px; letter-spacing: 0; }
.ruban:hover .piste { animation-play-state: paused; }
@keyframes defile { to { transform: translateX(-50%); } }

/* --- blocs --- */

main > .bloc { max-width: var(--max); margin: 0 auto; padding: clamp(80px, 12vw, 150px) clamp(18px, 4vw, 40px); }
.index { font-family: var(--mono); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.sous { color: var(--texte); max-width: 58ch; }
.note { color: var(--texte); font-size: .88rem; margin-top: 24px; }

.reveler { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveler.vu { opacity: 1; transform: none; }

/* --- carte --- */

.carte { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(30px, 6vw, 80px); align-items: center; }
.carte-vue { margin: 0; position: relative; }
#hexagone { width: 100%; display: block; cursor: crosshair; touch-action: manipulation; }
.legende { font-family: var(--mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--texte); margin-top: 14px; }
.bulle {
  position: absolute; left: 0; top: 0; pointer-events: none; z-index: 2; min-width: 170px;
  padding: 10px 14px 11px; border: 1px solid var(--ligne-2); border-radius: 10px;
  background: rgba(17,17,17,.86); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transform: translate(-50%, calc(-100% - 16px)); transition: left .12s ease-out, top .12s ease-out;
}
.bulle { white-space: nowrap; }
.bulle b { display: block; font-weight: 500; font-size: .95rem; letter-spacing: -.01em; }
.bulle b i { font-style: normal; font-family: var(--mono); color: var(--accent); font-weight: 400; margin-right: 8px; }
.bulle span { display: block; font-family: var(--mono); font-size: .72rem; color: var(--texte); margin-top: 3px; }

.chiffres { display: grid; grid-template-columns: 1fr 1fr; margin: 38px 0 0; border-top: 1px solid var(--ligne); }
.chiffres div { padding: 22px 0 18px; border-bottom: 1px solid var(--ligne); }
.chiffres div:nth-child(odd) { border-right: 1px solid var(--ligne); }
.chiffres div:nth-child(even) { padding-left: 24px; }
.chiffres dt { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 300; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.chiffres dd { margin: 8px 0 0; color: var(--texte); font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; }

/* --- cartes à lueur --- */

.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin-top: 44px; }
.lueur {
  --mx: 50%; --my: 50%;
  position: relative; padding: 28px 26px 30px; border-radius: 14px; min-height: 260px;
  background: var(--fond-2); border: 1px solid var(--ligne); overflow: hidden; isolation: isolate;
  transition: border-color .4s, transform .5s var(--ease), opacity 1s var(--ease);
}
.lueur::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; opacity: 0; transition: opacity .4s;
  background: radial-gradient(340px circle at var(--mx) var(--my), rgba(242,239,231,.10), transparent 60%);
}
.lueur::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .4s;
  background-image: radial-gradient(rgba(242,239,231,.16) 1px, transparent 1.3px); background-size: 8px 8px;
  -webkit-mask-image: radial-gradient(200px circle at var(--mx) var(--my), #000, transparent 70%);
          mask-image: radial-gradient(200px circle at var(--mx) var(--my), #000, transparent 70%);
}
.lueur:hover { border-color: var(--ligne-2); transform: translateY(-4px); }
.lueur:hover::before, .lueur:hover::after { opacity: 1; }
.lueur .tete { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 56px; }
.lueur .no { font-family: var(--mono); font-size: .72rem; color: var(--accent); }
.ico { width: 46px; height: 46px; fill: none; stroke: var(--texte); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; transition: stroke .4s, transform .6s var(--ease); }
.ico path, .ico circle, .ico rect { stroke-dasharray: 120; stroke-dashoffset: 0; }
.lueur:hover .ico { stroke: var(--papier); transform: rotate(-4deg) scale(1.06); }
.lueur:hover .ico path, .lueur:hover .ico circle, .lueur:hover .ico rect { animation: retracer 1.1s var(--ease); }
@keyframes retracer { from { stroke-dashoffset: 120; } to { stroke-dashoffset: 0; } }
.lueur p { color: var(--texte); font-size: .94rem; margin: 0; }

/* --- téléchargement --- */

.telecharger { margin-bottom: 40px; padding-bottom: 34px; border-bottom: 1px solid var(--ligne); }
.fiche { margin: 26px 0 0; display: grid; gap: 0; }
.fiche div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 10px 0; border-top: 1px solid var(--ligne); }
.fiche dt { font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--texte); padding-top: 3px; }
.fiche dd { margin: 0; font-size: .92rem; }
.fiche code { font-family: var(--mono); font-size: .72rem; color: var(--texte); word-break: break-all; }

/* --- étapes --- */

.fond { position: relative; }
.deux { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); column-gap: clamp(30px, 6vw, 80px); }
.deux > .collant { align-self: start; position: sticky; top: 120px; }
.deux > .etapes { margin-top: 0; }
.deux > .note, .deux > .telecharger, .deux > .etapes { grid-column: 2; }
.deux > .collant { grid-row: 1 / span 3; }
.etapes { --p: 0; list-style: none; margin: 48px 0 0; padding: 0; position: relative; }
.etapes::before, .etapes::after { content: ""; position: absolute; left: 21px; top: 22px; bottom: 22px; width: 2px; background: var(--ligne); }
.etapes::after { background: var(--accent); transform-origin: top; transform: scaleY(var(--p)); }
.etapes li { position: relative; z-index: 1; display: flex; gap: 26px; padding: 22px 0; }
.etapes .num {
  flex: 0 0 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--ligne-2); background: var(--fond); font-family: var(--mono); font-size: .9rem;
  transition: background .4s, color .4s, border-color .4s;
}
.etapes li.passe .num { background: var(--papier); color: var(--fond); border-color: var(--papier); }
.etapes h3 { margin: 10px 0 .4em; }
.etapes p { color: var(--texte); margin: 0; font-size: .95rem; max-width: 56ch; }

/* --- code ouvert --- */

.libre { margin-top: 44px; padding: 28px; border: 1px solid var(--ligne); border-radius: 14px; background: var(--fond-2); max-width: 720px; }
.libre .bouton { margin-top: 6px; }

/* --- pied --- */

.pied { position: relative; padding: clamp(90px, 14vw, 170px) clamp(18px, 4vw, 40px) 34px; border-top: 1px solid var(--ligne); overflow: hidden; text-align: center; }
.yeux-pied { width: clamp(120px, 16vw, 190px); margin: 0 auto 30px; }
.mot { display: flex; justify-content: center; margin: 0; font-weight: 500; line-height: .8;
  font-size: clamp(4rem, 19vw, 17rem); letter-spacing: -.06em; color: transparent; -webkit-text-stroke: 1px var(--ligne-2); }
.mot span { display: inline-block; transform: translateY(40%); opacity: 0; transition: transform 1.1s var(--ease), opacity 1.1s var(--ease), color .5s, -webkit-text-stroke-color .5s; }
.pied.vu .mot span { transform: none; opacity: 1; }
.mot span:hover { color: var(--papier); -webkit-text-stroke-color: var(--papier); }
.pied-bas { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; max-width: var(--max); margin: 60px auto 0; padding-top: 20px; border-top: 1px solid var(--ligne); text-align: left; }
.pied-bas p { margin: 0; color: var(--texte); font-size: .82rem; }
.pied-bas p:first-child { color: var(--papier); }
.vancode { display: inline-flex; align-items: center; gap: 9px; color: var(--texte); text-decoration: none; font-size: .76rem; letter-spacing: .04em; opacity: .75; transition: opacity .3s, color .3s; }
.vancode img { display: block; filter: grayscale(1); }
.vancode b { font-weight: 500; letter-spacing: .12em; }
.vancode:hover { opacity: 1; color: var(--papier); }

/* --- pages secondaires (crédits) --- */

.page { max-width: var(--max); margin: 0 auto; padding: 140px clamp(18px, 4vw, 40px) 80px; }
.page .bloc { padding: 40px 0; border-bottom: 1px solid var(--ligne); }
table { width: 100%; border-collapse: collapse; margin: 20px 0 8px; font-size: .92rem; display: block; overflow-x: auto; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--ligne); vertical-align: top; }
th { text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; color: var(--texte); font-weight: 600; }

/* --- mobile --- */

@media (max-width: 820px) {
  .carte, .deux { grid-template-columns: 1fr; }
  .deux > .collant { position: static; }
  .deux > .etapes { margin-top: 40px; }
  .deux > .note, .deux > .telecharger, .deux > .etapes { grid-column: 1; }
  .deux > .collant { grid-row: auto; }
}
@media (max-width: 640px) {
  .bar nav { display: none; }
  .kicker { letter-spacing: .12em; font-size: .64rem; }
  .chiffres div:nth-child(even) { padding-left: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
  .reveler, .mot span { opacity: 1; transform: none; }
  .piste { animation: none; }
}

@media print {
  body::after, .trame, .ruban, .defiler, .bar nav, .cta { display: none; }
  body { background: #fff; color: #000; }
}
