/* FALLINFOY · Layout : le gardien en plein écran, puis une feuille tapée à la machine qui défile sous une barre en verre. */
@font-face {
  font-family: "Special Elite";
  src: url("../fonts/special-elite.woff?v=d464825d") format("woff");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fragment Mono";
  src: url("../fonts/fragment-mono.woff?v=01b76213") format("woff");
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  --noir: #050404;
  --surface: #0f0b0b;
  --papier: #efe8dc;
  --papier-doux: rgba(239, 232, 220, .8);
  --filet: rgba(239, 232, 220, .16);
  --verre: rgba(22, 16, 16, .52);
  --verre-bord: rgba(255, 255, 255, .14);
  --rouge: #e0364c;
  --machine: "Special Elite", "Courier New", Courier, monospace;
  --mono: "Fragment Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sortie: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--noir); }
body {
  margin: 0; background: var(--noir); color: var(--papier);
  font: 400 .9375rem/1.65 var(--mono); -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 1px dashed var(--papier); outline-offset: 4px; }
::selection { background: var(--rouge); color: var(--papier); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Grain de pellicule, très léger */
body::after {
  content: ""; position: fixed; inset: -50%; z-index: 5; pointer-events: none;
  background: url("../img/grain.png?v=142629ad");
  opacity: .05; mix-blend-mode: overlay;
  animation: grain .9s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0) } 20% { transform: translate(-3%, 2%) } 40% { transform: translate(2%, -4%) }
  60% { transform: translate(-4%, -1%) } 80% { transform: translate(3%, 3%) } 100% { transform: translate(0, 0) }
}

/* Le gardien */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 480px; overflow: hidden; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; animation: allumage 1.6s var(--sortie) both; }
@keyframes allumage { from { opacity: 0; transform: scale(1.045); filter: brightness(.4); } to { opacity: 1; transform: none; filter: none; } }
#visage { cursor: pointer; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 240px; pointer-events: none; background: linear-gradient(transparent, var(--noir)); }

.etiquette .signature {
  font-family: var(--machine); font-size: clamp(.9375rem, 1.4vw, 1.125rem); letter-spacing: .08em;
  color: var(--papier); display: inline-flex; align-items: center; gap: 10px;
}
.etiquette .signature::before { content: ""; width: 18px; height: 2px; background: var(--rouge); }
.etiquette {
  position: absolute; z-index: 1; top: calc(18px + env(safe-area-inset-top, 0px));
  left: max(20px, env(safe-area-inset-left, 0px)); right: max(20px, env(safe-area-inset-right, 0px));
  display: flex; justify-content: space-between; gap: 16px;
  font-size: .6875rem; letter-spacing: .14em; text-transform: uppercase; color: var(--papier-doux);
  animation: apparaitHaut 1s 1.2s var(--sortie) backwards;
}
@keyframes apparaitHaut { from { opacity: 0; transform: translateY(-6px); } }

.defiler {
  position: absolute; z-index: 1; left: 50%; bottom: calc(112px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: .6875rem; letter-spacing: .14em; text-transform: uppercase; color: var(--papier-doux);
  transition: opacity .4s; animation: apparait 1s 1.4s var(--sortie) backwards;
}
.defiler i { display: block; width: 1px; height: 34px; background: linear-gradient(var(--papier), transparent); transform-origin: top; animation: trait 2.2s 2s var(--sortie) infinite; }
@keyframes trait { 0% { transform: scaleY(0); opacity: 1 } 55% { transform: scaleY(1); opacity: 1 } 100% { transform: scaleY(1); opacity: 0 } }
@keyframes apparait { from { opacity: 0; transform: translateX(-50%) translateY(8px); } }
.defiler.parti { opacity: 0; }

/* La feuille */
.page {
  max-width: 1040px; margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  padding-block: 32px 170px;
  display: flex; flex-direction: column; gap: 128px;
}
.label {
  display: flex; align-items: center; gap: 12px; margin: 0 0 26px;
  font: 400 .6875rem/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--papier-doux);
}
.label::before { content: ""; width: 22px; height: 1px; background: currentColor; flex: none; }

h1, h3 { font-family: var(--machine); font-weight: 400; margin: 0; text-wrap: balance; }

.intro h1 { font-size: clamp(2.5rem, 7.2vw, 5.4rem); line-height: 1.02; letter-spacing: -.02em; max-width: 13ch; }
.intro h1 .sens { position: relative; color: var(--rouge); white-space: nowrap; }
.souligne { position: absolute; left: -2%; bottom: -.16em; width: 104%; height: .32em; overflow: visible; }
.souligne path { fill: none; stroke: var(--rouge); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 420; stroke-dashoffset: 0; }
.intro .cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; margin-top: 48px; max-width: 880px; }
.intro p { margin: 0; color: var(--papier-doux); }
.intro p strong { color: var(--papier); font-weight: 400; background: linear-gradient(transparent 62%, rgba(224, 54, 76, .35) 62%); }

/* Méthode : une vraie séquence, donc numérotée */
.methode { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--filet); counter-reset: m; }
.methode li { counter-increment: m; padding: 22px 24px 4px 0; min-width: 0; }
.methode li + li { padding-left: 24px; border-left: 1px solid var(--filet); }
.methode li::before { content: "0" counter(m); display: block; font-size: .75rem; color: var(--rouge); margin-bottom: 14px; }
.methode h3 { font-size: clamp(1.375rem, 2.4vw, 1.75rem); line-height: 1.1; margin-bottom: 10px; }
.methode p { margin: 0; color: var(--papier-doux); }

/* Poupées russes : chaque niveau un peu plus vif que le précédent */
.poupees { margin: 0 0 40px; font-family: var(--machine); font-size: clamp(1.5rem, 4.2vw, 3rem); line-height: 1.15; letter-spacing: -.01em; text-wrap: balance; }
.poupees .p1 { color: var(--papier-doux); }
.poupees .p2 { color: var(--papier); }
.poupees .p3 { color: var(--rouge); }

/* Services */
.services { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--filet); }
.service {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; align-items: baseline;
  padding-block: 26px; border-bottom: 1px solid var(--filet); position: relative;
}
.service::after {
  content: ""; position: absolute; left: 0; bottom: -1px; height: 1px; width: 100%; background: var(--papier);
  transform: scaleX(0); transform-origin: left; transition: transform .6s var(--sortie);
}
.service:hover::after { transform: scaleX(1); }
.service h3 { font-size: clamp(1.5rem, 2.8vw, 2rem); line-height: 1.05; transition: transform .45s var(--sortie); }
.service:hover h3 { transform: translateX(6px); }
.service p { margin: 0; color: var(--papier-doux); }
.service small { display: block; margin-top: 8px; font-size: .75rem; color: var(--papier); opacity: .78; }

/* Œuvre à la une : vidéo 16:9 et affiche carrée, même hauteur */
.une { margin-bottom: 72px; }
.une-media { display: grid; grid-template-columns: minmax(0, 16fr) minmax(0, 9fr); gap: 14px; }
.ecran, .affiche { position: relative; margin: 0; overflow: hidden; border-radius: 4px; background: var(--surface); min-width: 0; }
.ecran { aspect-ratio: 16 / 9; cursor: pointer; }
.affiche { aspect-ratio: 1 / 1; }
.ecran video, .affiche img { display: block; width: 100%; height: 100%; object-fit: cover; }
.affiche img, .affiche .regard { transition: transform .9s var(--sortie); }
.affiche:hover img, .affiche:hover .regard { transform: scale(1.04); }
.tag {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  font-size: .6875rem; letter-spacing: .1em; padding: 4px 7px; border-radius: 3px;
  background: rgba(5, 4, 4, .55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.son {
  position: absolute; right: 12px; bottom: 16px; z-index: 1;
  display: flex; align-items: center; gap: 8px; appearance: none; cursor: pointer;
  font: 400 .75rem/1 var(--mono); color: var(--papier);
  padding: 9px 12px 9px 10px; border-radius: 999px;
  background: rgba(22, 16, 16, .5); border: 1px solid var(--verre-bord);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  transition: transform 100ms ease-out, background-color .2s;
}
.son:active { transform: scale(.95); }
.son i { display: flex; align-items: flex-end; gap: 2px; width: 14px; height: 12px; }
.son i::before, .son i::after { content: ""; flex: 1; height: 30%; background: currentColor; border-radius: 1px; }
.son[aria-pressed="true"] { background: var(--rouge); border-color: transparent; }
.son[aria-pressed="true"] i::before { animation: barre .7s ease-in-out infinite alternate; }
.son[aria-pressed="true"] i::after { animation: barre .7s .25s ease-in-out infinite alternate; }
@keyframes barre { from { height: 25%; } to { height: 100%; } }
.progression { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(239, 232, 220, .15); }
.progression i { display: block; height: 100%; width: 100%; background: var(--rouge); transform: scaleX(0); transform-origin: left; }
.une-texte { display: grid; grid-template-columns: minmax(0, 16fr) minmax(0, 9fr); gap: 14px; margin-top: 18px; align-items: start; }
.une-texte .surtitre { margin: 0 0 6px; font-size: .6875rem; letter-spacing: .14em; text-transform: uppercase; color: var(--rouge); }
.une-texte h3 { font-size: clamp(2rem, 4.6vw, 3.5rem); line-height: 1; letter-spacing: -.02em; }
.une-texte p { margin: 0; color: var(--papier-doux); font-size: .875rem; }
.une-texte cite { font-style: normal; color: var(--papier); }
.une-texte .meta { margin-top: 12px; font-size: .75rem; color: var(--papier); opacity: .78; }

/* Œuvres */
.oeuvres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.oeuvre { margin: 0; min-width: 0; }
.oeuvre .cadre { position: relative; overflow: hidden; border-radius: 4px; background: var(--surface); aspect-ratio: 4 / 5; max-width: 100%; }
.oeuvre img, .oeuvre .regard { display: block; width: 100%; height: 100%; object-fit: cover; filter: grayscale(.35) contrast(1.02); transition: transform .9s var(--sortie), filter .6s; }
.oeuvre:hover img, .oeuvre:hover .regard { transform: scale(1.04); filter: none; }
.regard { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.oeuvre .cadre::after {
  content: attr(data-n); position: absolute; top: 12px; left: 12px;
  font-size: .6875rem; letter-spacing: .1em; padding: 4px 7px; border-radius: 3px;
  background: rgba(5, 4, 4, .55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.oeuvre figcaption { margin-top: 14px; }
.oeuvre figcaption .ligne { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.oeuvre figcaption b { font-family: var(--machine); font-weight: 400; font-size: 1.25rem; line-height: 1.1; }
.oeuvre figcaption span { font-size: .75rem; color: var(--papier-doux); text-align: right; }
.oeuvre figcaption p { margin: 6px 0 0; font-size: .8125rem; line-height: 1.5; color: var(--papier-doux); }
.cas { margin: 10px 0 0; display: grid; gap: 2px; font-size: .8125rem; line-height: 1.5; }
.cas dt { font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--rouge); margin-top: 8px; }
.cas dt:first-child { margin-top: 0; }
.cas dd { margin: 0; color: var(--papier-doux); }
.cas a { color: var(--papier); text-decoration-color: var(--rouge); text-underline-offset: 3px; }

/* Règlement */
.regles { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--filet); }
.regles li {
  display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; align-items: baseline;
  padding-block: 22px; border-bottom: 1px solid var(--filet);
  font-family: var(--machine); font-size: clamp(1.25rem, 2.4vw, 1.75rem); line-height: 1.25;
}
.regles li > span { font-family: var(--mono); font-size: .75rem; line-height: 1.4; color: var(--papier-doux); }
.regles li > span em { display: block; font-style: normal; color: var(--rouge); }
.regles .rouge { color: var(--rouge); font-weight: 400; }

/* Contact */
.contact h2.titre { font-family: var(--machine); font-weight: 400; margin: 0; text-wrap: balance; font-size: clamp(2.25rem, 6vw, 4.6rem); line-height: 1.02; letter-spacing: -.02em; }
.contact > p { margin: 20px 0 30px; color: var(--papier-doux); max-width: 46ch; }
.mailrow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.mailrow a {
  font-family: var(--machine); font-size: clamp(1.25rem, 3.4vw, 1.875rem); line-height: 1.2; color: var(--papier); text-decoration: none; overflow-wrap: anywhere;
  background: linear-gradient(var(--rouge), var(--rouge)) 0 100% / 0 2px no-repeat; padding-bottom: 4px;
  transition: background-size .6s var(--sortie);
}
.mailrow a:hover, .mailrow a:focus-visible { background-size: 100% 2px; }

.reseaux { list-style: none; margin: 34px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.reseaux a {
  display: inline-flex; align-items: baseline; gap: 10px; padding: 10px 14px; border-radius: 999px;
  color: var(--papier); text-decoration: none; font-size: .8125rem; box-shadow: inset 0 0 0 1px var(--filet);
  transition: box-shadow .3s, transform 100ms ease-out;
}
.reseaux a span { color: var(--papier-doux); font-size: .75rem; }
.reseaux a:hover, .reseaux a:focus-visible { box-shadow: inset 0 0 0 1px var(--rouge); }
.reseaux a:active { transform: scale(.97); }

footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-size: .75rem; color: var(--papier-doux); border-top: 1px solid var(--filet); padding-top: 24px; margin-top: -60px; }
footer img { height: 34px; width: auto; opacity: .85; }

/* Mentions légales */
.legal { gap: 56px; padding-top: 40px; }
.legal h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); line-height: 1.02; letter-spacing: -.02em; }
.legal .maj { margin: 14px 0 0; font-size: .75rem; color: var(--papier-doux); }
.legal .retour { margin: 0; font-size: .8125rem; }
.legal a { color: var(--papier); text-decoration-color: var(--rouge); text-underline-offset: 3px; }
.legal .retour a { text-decoration: none; color: var(--papier-doux); }
.legal .retour a:hover { color: var(--papier); }
.bloc-legal { border-top: 1px solid var(--filet); padding-top: 22px; max-width: 70ch; }
.bloc-legal .label { margin-bottom: 18px; }
.bloc-legal p { margin: 0 0 14px; color: var(--papier-doux); }
.bloc-legal p:last-child { margin-bottom: 0; }
.legal footer { margin-top: 0; }
footer .liens { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
footer a { color: var(--papier-doux); text-underline-offset: 3px; }
footer a:hover { color: var(--papier); }

/* Apparition au défilement, là où le navigateur la gère */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .monte { animation: monte linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
    .oeuvre:nth-child(2), .methode li:nth-child(2) { animation-range: entry 8% entry 63%; }
    .oeuvre:nth-child(3), .methode li:nth-child(3) { animation-range: entry 16% entry 71%; }
    .poupees .p1 { animation: poupee linear both; animation-timeline: view(); animation-range: entry 10% entry 60%; }
    .poupees .p2 { animation: poupee linear both; animation-timeline: view(); animation-range: entry 35% entry 85%; }
    .poupees .p3 { animation: poupee linear both; animation-timeline: view(); animation-range: entry 60% cover 50%; }
    .souligne path { animation: trace linear both; animation-timeline: view(); animation-range: entry 40% cover 45%; }
  }
}
@keyframes monte { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes poupee { from { opacity: .08; } to { opacity: 1; } }
@keyframes trace { from { stroke-dashoffset: 420; } to { stroke-dashoffset: 0; } }

/* Barre en verre */
.barre {
  position: fixed; z-index: 4;
  left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  width: min(620px, calc(100% - 2 * max(16px, env(safe-area-inset-left, 0px))));
  display: flex; align-items: center; gap: 16px;
  padding: 10px 10px 10px 18px; border-radius: 20px;
  background: var(--verre);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid var(--verre-bord); border-top-color: rgba(255, 255, 255, .24);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .8);
  transform: translateX(-50%);
}
.barre .logo { height: 34px; width: auto; flex: none; display: block; }
.identite { min-width: 0; flex: 1; border-left: 1px solid var(--filet); padding-left: 14px; }
.identite span { display: block; font-size: .75rem; line-height: 1.35; color: var(--papier); min-height: 2.7em; }
.identite span::after { content: "\258C"; margin-left: 1px; color: var(--rouge); animation: curseur 1s steps(1) infinite; }
@keyframes curseur { 50% { opacity: 0; } }
.bouton {
  flex: none; appearance: none; border: 0; cursor: pointer;
  font: 400 .8125rem/1 var(--mono); color: #120d0d; background: var(--papier);
  padding: 12px 15px; border-radius: 13px;
  transition: transform 100ms ease-out, background-color 150ms;
}
.bouton:active { transform: scale(.96); }
.bouton.ok { background: #bfe7c9; }
.bouton.fantome { background: transparent; color: var(--papier); box-shadow: inset 0 0 0 1px var(--filet); }

@media (max-width: 760px) {
  .page { gap: 96px; padding-bottom: 150px; }
  .intro .cols { grid-template-columns: 1fr; gap: 20px; }
  .methode { grid-template-columns: 1fr; }
  .methode li, .methode li + li { padding: 20px 0; border-left: 0; border-bottom: 1px solid var(--filet); }
  .service { grid-template-columns: 1fr; gap: 8px; }
  .une { margin-bottom: 56px; }
  .une-media, .une-texte { grid-template-columns: 1fr; }
  .une-texte { gap: 12px; }
  .oeuvres { grid-template-columns: 1fr; gap: 40px; }
  .oeuvre .cadre { aspect-ratio: 1 / 1; }
  .regles li { grid-template-columns: 1fr; gap: 6px; }
  footer { margin-top: -40px; }
  .etiquette span + span { display: none; }
}
@media (max-width: 420px) {
  .barre { gap: 10px; padding-left: 14px; }
  .barre .logo { height: 28px; }
  .identite { padding-left: 10px; }
  .bouton { padding: 11px 12px; }
}
@media (prefers-reduced-transparency: reduce) {
  .barre { background: #1b1414; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .barre { background: #000; border-color: var(--papier); }
  :root { --papier-doux: var(--papier); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
