/* Adrien Noterdaem — site 2026 · parallaxe en 6 niveaux */

@font-face {
  font-family: "Gilroy";
  src: url("../fonts/Gilroy-UltraLight.woff2") format("woff2");
  font-weight: 200;
  font-display: swap;
}
@font-face {
  font-family: "Gilroy";
  src: url("../fonts/Gilroy-Heavy.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

:root {
  --nuit: #1b1f36;
  --rose: #ad546e;
  --rose-hover: #c96784;
  --blanc: #fff;
  --s: 0.33;   /* échelle de la scène (px écran par px du PSD), mise à jour en JS */
  --u: 0.4;    /* échelle de l'interface (liens), bornée pour rester lisible */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--nuit);
  color: var(--blanc);
  font-family: "Gilroy", "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--nuit);
  touch-action: manipulation;
}

/* Chaque niveau couvre l'écran ; le JS le déplace en translate3d. */
.layer {
  position: absolute;
  inset: 0;
  will-change: transform;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.is-ready .layer { opacity: 1; }
.no-fade .layer { transition: none !important; }
.is-ready .layer[data-layer="meteores"] { transition-delay: .15s; }
.is-ready .layer[data-layer="texte"]    { transition-delay: .45s; }
.is-ready .layer[data-layer="bureau"]   { transition-delay: .25s; }
.is-ready .layer[data-layer="rochers"]  { transition-delay: .05s; }
.is-ready .layer[data-layer="ui"]       { transition-delay: .8s; }

/* Les pièces sont placées en coordonnées du PSD par le JS (left/top/width). */
.piece {
  position: absolute;
  display: block;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
}
img.piece { height: auto; }

.lueur { animation: lueur 5s ease-in-out infinite; transform-origin: 100% 50%; }
@keyframes lueur {
  0%, 100% { opacity: .8; transform: scaleX(1); }
  50%      { opacity: 1;  transform: scaleX(1.06); }
}

/* Lumière des écrans (Cintiq + portable) : respiration irrégulière, comme un écran vivant */
.lumieres { animation: ecrans 4.2s ease-in-out infinite; }
@keyframes ecrans {
  0%   { opacity: 1; }
  30%  { opacity: .7; }
  42%  { opacity: .88; }
  58%  { opacity: .66; }
  80%  { opacity: .95; }
  100% { opacity: 1; }
}

/* ---------- Niveau texte ---------- */
.titre {
  text-align: center;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  transform: translateX(-50%);
}
.titre h1 {
  font-size: calc(190px * var(--k, var(--s)));
  font-weight: inherit;
  letter-spacing: 0;
  line-height: .78;
}
.t-light { font-weight: 200; }
.t-heavy { font-weight: 800; }
.titre h1 .t-light { margin-right: .05em; }
.filet {
  display: block;
  height: max(1px, calc(6px * var(--k, var(--s))));
  margin: .26em 0 .2em;
  font-size: calc(190px * var(--k, var(--s)));
  background: rgba(255, 255, 255, .55);
}
.fonction {
  font-size: calc(79px * var(--k, var(--s)) * var(--fit, 1));
  line-height: 1;
  letter-spacing: 0;
}
.fonction .sep { font-weight: 800; }
.etincelle {
  position: absolute;
  width: calc(157px * var(--k, var(--s)));
  left: calc(50% - 593px * var(--k, var(--s)));   /* au-dessus du « I » d'Adrien */
  top: calc(-57px * var(--k, var(--s)));
  pointer-events: none;
  animation: scintille 4.5s ease-in-out infinite;
}
@keyframes scintille {
  0%, 100% { transform: scale(.85) rotate(0deg); opacity: .75; }
  45%      { transform: scale(1.15) rotate(20deg); opacity: 1; }
  55%      { transform: scale(1.05) rotate(25deg); opacity: .95; }
}

/* ---------- Niveau interface ---------- */
.layer--ui { pointer-events: none; }
.layer--ui ul { list-style: none; display: flex; align-items: center; justify-content: center; transform: translateX(-50%); pointer-events: auto; }
.layer--ui a { display: flex; align-items: center; justify-content: center; color: var(--blanc); text-decoration: none; }
.layer--ui a:focus-visible { outline: 2px solid var(--blanc); outline-offset: 4px; border-radius: 4px; }

.icones { gap: calc(26px * var(--u)); }
.icones a {
  width: calc(101px * var(--u));
  height: calc(101px * var(--u));
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 calc(3px * var(--u)) rgba(0, 0, 0, .12);
  transition: background .25s, transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.icones a:hover, .icones a:focus-visible { background: var(--rose-hover); transform: scale(1.12); }
.icones svg { width: 62%; height: 62%; fill: currentColor; }
.icones svg[fill="none"] { fill: none; }
.icones .be { font-weight: 800; font-size: calc(52px * var(--u)); letter-spacing: -.02em; transform: translateY(4%); }

.liens { gap: calc(50px * var(--u)); }
.liens a { padding: calc(14px * var(--u)) 0; opacity: .88; transition: opacity .2s, transform .2s; }
.liens a:hover, .liens a:focus-visible { opacity: 1; transform: translateY(-2px); }
.liens img { display: block; width: auto; height: calc(var(--h) * 1px * var(--u)); }
.liens .logo-x { width: calc(30px * var(--u)); height: calc(30px * var(--u)); fill: currentColor; }
/* Mobile portrait : les logos passent sur deux lignes */
.is-portrait .liens {
  width: max-content;
  max-width: 88vw;
  flex-wrap: wrap;
  column-gap: calc(46px * var(--u));
  row-gap: 0;
}

/* Bouton d'autorisation du gyroscope (iOS uniquement) */
.motion-btn {
  position: absolute;
  left: 50%;
  top: max(14px, env(safe-area-inset-top));
  transform: translateX(-50%);
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 99px;
  background: rgba(27, 31, 54, .55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--blanc);
  font: 200 13px/1 "Gilroy", sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  z-index: 10;
  cursor: pointer;
  transition: opacity .4s;
}
.motion-btn.is-hidden { opacity: 0; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .lueur, .etincelle, .lumieres { animation: none; }
  .layer { transition: none; }
}
