:root {
  --bg: #DADDD8;        /* béton froid : fait ressortir le noir de la casquette */
  --ink: #16181B;
  --ink-2: #5C6168;
  --signal: #2F5BFF;    /* réservé à l'onde NFC */
  --gutter: clamp(16px, 3vw, 40px);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

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

html { background: var(--bg); color: var(--ink); }

body {
  margin: 0;
  background: var(--bg);
  font-family: "Archivo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* Lumière douce derrière la scène : donne de la profondeur sans dégradé décoratif */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(60% 55% at 50% 38%, #EEF0EC 0%, rgba(238, 240, 236, 0) 70%);
  pointer-events: none;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
  display: block;
  outline: none;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: max(var(--gutter), env(safe-area-inset-top)) var(--gutter) 0;
  pointer-events: none;
}

.brand {
  pointer-events: auto;
  display: inline-block;
  font-stretch: 72%;
  font-weight: 850;
  font-size: clamp(1.25rem, 1rem + 0.9vw, 1.6rem);
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  border-radius: 4px;
  transition: opacity 160ms var(--ease-out);
}
.brand img { display: block; height: clamp(16px, 0.9rem + 0.5vw, 22px); width: auto; }
@media (hover: hover) and (pointer: fine) { .brand:hover { opacity: 0.7; } }
.brand:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; }

/* Bouton de fin : entre par le bas quand l'iPhone s'est posé */
.cta {
  position: fixed;
  left: 50%;
  bottom: calc(clamp(20px, 4vh, 40px) + env(safe-area-inset-bottom, 0px));
  z-index: 10;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 26px;
  border-radius: 999px;
  background: var(--ink);
  color: #F4F5F2;
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 10px 30px rgba(22, 24, 27, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 16px) scale(0.97);
  transition: opacity 280ms var(--ease-out), transform 280ms var(--ease-out), visibility 0s linear 280ms;
}
.cta.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
  transition: opacity 360ms var(--ease-out), transform 360ms var(--ease-out), visibility 0s;
}
.cta.is-visible:active { transform: translate(-50%, 0) scale(0.97); transition-duration: 120ms; }
.cta:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
/* Écran large : l'iPhone finit à droite, le bouton se place sous la casquette */
@media (min-aspect-ratio: 4/5) {
  .cta { left: 40%; }
}
@media (prefers-reduced-motion: reduce) {
  .cta, .cta.is-visible { transform: translate(-50%, 0); }
}

.track { position: relative; z-index: 1; }
.beat { height: 120vh; }
.beat:first-child { height: 100vh; }
.beat:last-child { height: 160vh; }

/* Chargement : une seule ligne fine, pas de spinner */
.loader {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(180px, 40vw);
  height: 2px;
  translate: -50% -50%;
  background: rgba(22, 24, 27, 0.12);
  border-radius: 2px;
  overflow: hidden;
  z-index: 5;
  transition: opacity 400ms var(--ease-out);
}
.loader-bar {
  display: block;
  height: 100%;
  background: var(--ink);
  transform-origin: left;
  transform: scaleX(var(--progress, 0));
  transition: transform 200ms var(--ease-out);
}
.loader.is-done { opacity: 0; pointer-events: none; }

#debug {
  position: fixed;
  right: 8px;
  bottom: 8px;
  z-index: 20;
  margin: 0;
  padding: 8px 10px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.85);
  color: #000;
  white-space: pre;
}
