/* Direction A, « La salle » : noirs chauds, ivoire, cuivre, angles droits ;
   Cinzel pour le logo et le titre, Space Grotesk pour le reste. */

@font-face { font-family: "Cinzel"; src: url("fonts/cinzel-latin.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("fonts/space-grotesk-latin.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }

:root {
  color-scheme: dark;
  --color-coal: oklch(16.5% 0.006 60);      /* #100e0c */
  --color-coal-75: oklch(16.5% 0.006 60 / 0.75);
  --color-coal-92: oklch(16.5% 0.006 60 / 0.92);
  --color-coal-0: oklch(16.5% 0.006 60 / 0);
  --color-ivory: oklch(93.5% 0.018 80);     /* #f0e9dc */
  --color-ivory-bright: oklch(98% 0.015 85);
  --color-muted: oklch(75% 0.025 75);       /* #b9ad9d */
  --color-copper: oklch(68% 0.1 60);        /* #c88958 */
  --color-copper-bright: oklch(77% 0.12 62);
  --color-copper-soft: oklch(68% 0.1 60 / 0.35);
  --color-ink: oklch(20% 0.02 55);          /* texte sur ivoire */
  --color-line: oklch(93.5% 0.018 80 / 0.14);
  --color-error: oklch(78% 0.1 40);

  --font-display: "Cinzel", Georgia, serif;
  --font-body: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;

  --space-xs: 8px; --space-sm: 12px; --space-md: 16px; --space-lg: 24px; --space-xl: 40px;
  --gutter: clamp(20px, 5vw, 72px);

  --text-xs: 0.8rem; --text-sm: 0.875rem; --text-md: 1rem;

  /* Lent et continu, sans rebond. */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 160ms; --dur-slow: 900ms; --dur-rise: 1400ms;
}

* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; background: var(--color-coal); color: var(--color-ivory); }
body { font-family: var(--font-body); font-size: var(--text-md); line-height: 1.5; -webkit-font-smoothing: antialiased; }
:focus-visible { outline: 2px solid var(--color-ivory); outline-offset: 3px; }
a { color: inherit; }

/* Un grain de pellicule sur tout l'écran : le noir respire au lieu d'être plat. */
body::after {
  content: ""; position: fixed; inset: -50%; z-index: 20; 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='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0% { transform: translate(0, 0); } 33% { transform: translate(-3%, 2%); } 66% { transform: translate(2%, -3%); } 100% { transform: translate(0, 0); } }

.mark { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; letter-spacing: 1px; text-transform: uppercase; color: var(--color-ivory); }
.mark b { color: var(--color-copper-bright); font-weight: 600; }
/* « MidiForge is now Playstill » : une note à côté du logo, dans le bandeau du haut, qui flotte
   au-dessus de la page ; elle ne pousse ni le titre ni le formulaire. */
.brand { display: flex; align-items: center; gap: var(--space-sm); min-width: 0; }
.renamed { margin: 0; padding-left: var(--space-sm); border-left: 1px solid var(--color-line); font-size: var(--text-xs); line-height: 1.3; color: var(--color-muted); text-wrap: balance; }
.tag { font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-muted); white-space: nowrap; }
.pot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- La salle ---- */
.hall { position: relative; min-height: 100svh; overflow: hidden; }
/* Le rendu se cale en bas : le clavier et les mains au pied de l'écran, le noir des notes en haut pour le texte. */
.stage { position: absolute; inset: 0; }
.film { position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; }
.shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, var(--color-coal-75) 0%, var(--color-coal-0) 10%), linear-gradient(to bottom, var(--color-coal) 0%, var(--color-coal-75) 30%, var(--color-coal-0) 58%); }
/* Derrière le texte, le noir tient jusqu'au-dessus du clavier : les notes de gauche sortent
   de l'ombre juste avant les touches, et la phrase sous le champ reste nette. */
.shade::before { content: ""; position: absolute; left: 0; top: 0; width: 46%; height: 69%; background: linear-gradient(to right, var(--color-coal-92) 75%, var(--color-coal-0)); -webkit-mask-image: linear-gradient(to bottom, #000 88%, transparent); mask-image: linear-gradient(to bottom, #000 88%, transparent); }

/* Le bandeau du haut passe au-dessus du texte : sur téléphone, le bloc du titre prend toute la
   largeur et recouvrait le haut-parleur, qu'on ne pouvait plus toucher. */
.top { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; padding: var(--space-lg) var(--gutter); }
/* Le son : une icône seule, sans texte. Barrée quand il est coupé, des ondes quand il joue. */
.sound { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-right: -10px; padding: 0; color: var(--color-muted); background: none; border: 0; cursor: pointer; transition: color var(--dur-fast) var(--ease-out); }
.sound:hover { color: var(--color-ivory); }
.sound svg { width: 22px; height: 22px; }
.sound .on { display: none; color: var(--color-copper-bright); }
.sound[aria-pressed="true"] { color: var(--color-ivory); }
.sound[aria-pressed="true"] .off { display: none; }
.sound[aria-pressed="true"] .on { display: inline; animation: waves 1.6s var(--ease-in-out) infinite alternate; }
@keyframes waves { from { opacity: 0.55; } to { opacity: 1; } }

.say { position: relative; z-index: 2; display: grid; gap: var(--space-md); justify-items: start; max-width: 46rem; padding: clamp(96px, 14vh, 140px) var(--gutter) 0; }
.say h1 { margin: 0; font-family: var(--font-display); font-weight: 600; font-style: normal; font-size: clamp(2rem, 4.4vw, 4rem); line-height: 1.04; color: var(--color-ivory-bright); overflow-wrap: anywhere; min-width: 0; }
.say h1 span { display: block; color: var(--color-copper-bright); }
.lead { margin: 0; max-width: 32ch; color: var(--color-muted); }
.fine { margin: 0; font-size: var(--text-xs); color: var(--color-muted); }
.fine.error { color: var(--color-error); }

/* Le champ : un trait cuivre, pas une boîte ; le bouton ivoire plein de l'app. */
.join { display: flex; align-items: stretch; width: min(100%, 30rem); min-width: 0; margin-top: var(--space-xs); border: 1px solid var(--color-copper-soft); background: var(--color-coal-75); transition: border-color var(--dur-fast) var(--ease-out); }
.join:focus-within { border-color: var(--color-copper-bright); }
.join input[type="email"] { flex: 1 1 auto; width: 100%; min-width: 0; padding: 15px 16px; font: inherit; color: var(--color-ivory); background: transparent; border: 0; border-radius: 0; }
.join input::placeholder { color: var(--color-muted); }
.join input:focus { outline: none; }
.go { flex: none; padding: 0 22px; font: inherit; font-weight: 600; font-size: var(--text-sm); white-space: nowrap; color: var(--color-ink); background: var(--color-ivory); border: 0; border-radius: 0; cursor: pointer; transition: background-color var(--dur-fast) var(--ease-out); }
.go:hover { background: var(--color-ivory-bright); }
.go:active { transform: translateY(1px); }
.go:disabled { cursor: progress; opacity: 0.7; }
.done { display: grid; gap: 4px; padding: 14px 16px; width: 100%; }
.done strong { font-weight: 600; color: var(--color-ivory-bright); }
.done span { font-size: var(--text-sm); color: var(--color-muted); }

/* Le morceau joué, en entier : jamais coupé, il passe à la ligne s'il le faut. */
.now { position: absolute; z-index: 2; right: var(--gutter); bottom: var(--space-lg); display: flex; gap: var(--space-sm); align-items: center; max-width: calc(100% - 2 * var(--gutter)); }
.now .tag { white-space: normal; text-transform: none; letter-spacing: 0.02em; }
.now .label { text-transform: uppercase; letter-spacing: 0.14em; }
.now .bar { flex: none; width: 120px; height: 2px; background: var(--color-line); }
.now .bar i { display: block; width: 0; height: 100%; background: var(--color-copper-bright); }
.foot { position: absolute; z-index: 2; left: var(--gutter); bottom: var(--space-lg); display: flex; gap: var(--space-lg); font-size: var(--text-xs); color: var(--color-muted); }
.foot a { text-decoration: none; white-space: nowrap; padding: 6px 0; transition: color var(--dur-fast) var(--ease-out); }
.foot a:hover { color: var(--color-ivory); }

/* L'entrée : le texte monte lentement, une ligne après l'autre, une fois le seuil passé. */
.rise { opacity: 0; transform: translateY(14px); transition: opacity var(--dur-rise) var(--ease-out), transform var(--dur-rise) var(--ease-out); }
.entered .rise { opacity: 1; transform: none; }
.entered .rise:nth-child(2) { transition-delay: 140ms; }
.entered .rise:nth-child(3) { transition-delay: 280ms; }
.entered .rise:nth-child(4) { transition-delay: 420ms; }
.entered .now { transition-delay: 600ms; }

/* Téléphone : on empile, sans rien poser sur les mains. Le texte dans le noir en haut,
   le rendu pleine largeur dessous, puis « Now playing » et les liens. */
@media (max-width: 767px) {
  .hall { display: flex; flex-direction: column; }
  .say { order: 1; padding-top: 84px; gap: var(--space-sm); }
  .stage { order: 2; position: relative; inset: auto; flex: none; margin-top: auto; aspect-ratio: 6 / 5; }
  .shade { background: linear-gradient(to bottom, var(--color-coal) 0%, var(--color-coal-0) 22%); }
  .shade::before { display: none; }
  .now, .foot { position: static; }
  .now { order: 3; justify-content: space-between; padding: var(--space-md) var(--gutter) 0; }
  .now { flex-wrap: wrap; row-gap: var(--space-xs); }
  .now .bar { width: 100%; }
  .foot { order: 4; padding: var(--space-xs) var(--gutter) var(--space-md); }
}
@media (max-width: 479px) {
  .join { flex-direction: column; }
  .go { padding: 15px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, body::after { animation: none !important; transition-duration: 1ms !important; transition-delay: 0ms !important; }
}
