/* Playstill, playstill.app : feuille des pages Privacy, Legal et Confirmed (l'ancienne page d'accueil).
   Un seul écran, centré. Le rendu passe derrière, fondu en haut et en bas.
   Même habit que l'app : noirs chauds, ivoire, cuivre, feutre ; Cinzel pour le
   logotype et les titres, Space Grotesk pour le reste ; angles droits partout.
   Polices servies depuis ce dépôt : aucune requête vers un tiers. */

@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;

  /* Repris tels quels de l'app (src/style.css). */
  --coal: #100e0c;
  --ebony: #17130f;
  --ebony-raised: #1d1813;
  --ivory: #f0e9dc;
  --ivory-bright: #fff9ee;
  --text: #f2ece2;
  --muted: #b9ad9d;
  --copper: #c88958;
  --copper-bright: #eba66c;
  --copper-soft: rgba(200, 137, 88, 0.28);
  --felt: #8e342d;
  --error: #ffad9e;
  --line: rgba(240, 233, 220, 0.12);
  --reflect: inset 0 1px 0 rgba(255, 249, 238, 0.1);
  --shadow-short: 0 1px 3px rgba(0, 0, 0, 0.4);

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

  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --gutter: max(24px, env(safe-area-inset-left, 0px));
  --gutter-r: max(24px, env(safe-area-inset-right, 0px));

  scrollbar-color: var(--copper) var(--coal);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  /* La lueur du feutre au pied de l'écran, comme l'accueil de l'app. */
  background:
    radial-gradient(70% 86% at 50% 115%, rgba(125, 47, 34, 0.22), transparent 66%) fixed,
    var(--coal);
  color: var(--text);
  font-family: var(--body);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
  caret-color: var(--copper-bright);
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; height: auto; }
h1 { margin: 0; }
p { margin: 0; }

/* ---------- la page ---------- */

.page {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: clamp(2rem, 6vh, 4rem) var(--gutter-r) clamp(1.5rem, 4vh, 2.5rem) var(--gutter);
  text-align: center;
}

/* Le rendu reste à sa forme : plein cadre sur téléphone, bande centrée au-delà. */
.film {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: min(100%, 540px);
  height: 100%;
  margin-inline: auto;
  object-fit: cover;
  /* On vise le haut du rendu : les notes restent en vue, le clavier descend
     sous le texte, dans le fondu du bas. */
  object-position: 50% 22%;
}

/* Fondus dans le noir chaud de la page, pour que la bande s'y fonde. */
.fade {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.fade.veil { inset: 0; background: rgba(16, 14, 12, 0.5); }
.fade.top { top: 0; left: 0; right: 0; height: 30svh; background: linear-gradient(to bottom, var(--coal) 12%, transparent); }
.fade.bottom {
  bottom: 0; left: 0; right: 0; height: 58svh;
  background:
    radial-gradient(70% 70% at 50% 120%, rgba(125, 47, 34, 0.24), transparent 70%),
    linear-gradient(
      to top,
      var(--coal) 30%,
      rgba(16, 14, 12, 0.95) 55%,
      rgba(16, 14, 12, 0.5) 76%,
      transparent
    );
}
.fade.sides { display: none; }

.content {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1.4rem;
  width: 100%;
  max-width: 46rem;
  margin-inline: auto;
}

/* Le logotype de l'app : Cinzel, « Forge » en cuivre. */
.wordmark {
  font-family: var(--mark);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: 1px;
  line-height: 1;
  color: var(--text);
}

.wordmark b { font-weight: 600; color: var(--copper-bright); }

h1 {
  font-family: var(--mark);
  font-weight: 600;
  font-size: clamp(1.9rem, 7.4vw, 4rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: var(--ivory-bright);
  max-width: 18ch;
  text-wrap: balance;
}

.lead {
  color: var(--muted);
  font-size: 1rem;
  max-width: 36ch;
}

/* ---------- inscription ---------- */

.signup { display: grid; justify-items: center; width: 100%; margin-top: 0.4rem; }

/* Le seul bouton visible au départ : l'encadrement cuivré des boutons de l'app. */
button.open {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  padding: 0.85rem 1.6rem;
  border: 1px solid var(--copper-soft);
  border-radius: 0;
  color: var(--text);
  background:
    linear-gradient(rgba(255, 249, 238, 0.06), rgba(255, 249, 238, 0) 45%),
    rgba(29, 24, 19, 0.82);
  box-shadow: var(--reflect), var(--shadow-short);
  cursor: pointer;
  transition: border-color 180ms var(--ease), transform 140ms var(--ease);
}

button.open svg { width: 15px; height: 15px; color: var(--copper-bright); transition: transform 320ms var(--ease); }
button.open:hover, button.open[aria-expanded="true"] { border-color: var(--copper); }
button.open:active { transform: translateY(1px); }
button.open[aria-expanded="true"] svg { transform: rotate(180deg); }

/* Le tiroir : sa hauteur passe de 0 à son contenu, sans chiffre magique. */
.drawer {
  display: grid;
  grid-template-rows: 0fr;
  width: 100%;
  opacity: 0;
  transition: grid-template-rows 360ms var(--ease), opacity 260ms var(--ease);
}

.open[aria-expanded="true"] + .drawer { grid-template-rows: 1fr; opacity: 1; }

/* Le rembourrage laisse la place au contour de focus, que overflow rognerait. */
.drawer-inner {
  min-height: 0;
  overflow: hidden;
  display: grid;
  gap: 1rem;
  justify-items: center;
  padding: 1rem 6px 6px;
}

.field {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: min(30rem, 100%);
}

/* La surface des boutons « chrome » de l'app : ébène, reflet en haut, bord cuivré. */
.box {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--copper-soft);
  background:
    linear-gradient(rgba(255, 249, 238, 0.06), rgba(255, 249, 238, 0) 45%),
    rgba(29, 24, 19, 0.82);
  box-shadow: var(--reflect), var(--shadow-short);
  transition: border-color 180ms var(--ease);
}

.box:hover { border-color: var(--copper); }
.box:focus-within { border-color: var(--copper-bright); }

.field input {
  width: 100%;
  height: 100%;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.8rem 1rem;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 0;
}

.field input:focus { outline: none; }
.field input::placeholder { color: var(--muted); opacity: 0.7; }

/* Piège à robots : hors écran, hors clavier. `.field .pot` doit l'emporter sur
   `.field input` ci-dessus, qui remettrait le champ dans le flux et rognerait
   la moitié du champ. */
.pot, .field .pot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
}

/* Le bouton principal de l'app (« Exporter ») : ivoire plein, texte brun. */
button.go {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font: inherit;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.8rem 1.15rem;
  border: 1px solid #fffaf1;
  border-radius: 0;
  color: #1b1510;
  background: var(--ivory);
  box-shadow: var(--shadow-short);
  cursor: pointer;
  transition: background-color 180ms var(--ease), transform 140ms var(--ease);
}

button.go svg { width: 15px; height: 15px; }
button.go:hover { background: var(--ivory-bright); }
button.go:active { transform: translateY(1px); }
button.go[disabled] { background: var(--muted); border-color: var(--muted); cursor: progress; }

.fine {
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 38ch;
}

.fine.error { color: var(--error); }

.done {
  display: grid;
  gap: 0.4rem;
  padding: 1.1rem 1.4rem;
  width: min(30rem, 100%);
}

.done strong { font-family: var(--mark); font-weight: 600; font-size: 1.15rem; color: var(--ivory-bright); }
.done span { font-size: 0.85rem; color: var(--muted); }

/* ---------- barre de pied ---------- */

.bar {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 64rem;
  margin-inline: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.bar nav { display: flex; gap: 1.5rem; }
.bar a { color: var(--muted); text-decoration: none; transition: color 180ms var(--ease); }
.bar a:hover { color: var(--copper-bright); }

/* ---------- grands écrans ---------- */

@media (min-width: 768px) {
  .bar { flex-direction: row; justify-content: space-between; }

  /* Bande plus large : le cadrage coupe dans le rendu, le clavier descend sous
     le texte au lieu de passer derrière. */
  .film { width: min(100%, 720px); }

  /* Le noir mord 130 de chaque côté, sinon on voit le rectangle. */
  .fade.sides {
    display: block;
    inset: 0;
    background:
      linear-gradient(to right, var(--coal) 0%, transparent calc(50% - 230px)),
      linear-gradient(to left, var(--coal) 0%, transparent calc(50% - 230px));
  }

  .fade.top { height: 26vh; }
  .fade.bottom { height: 48vh; }
}

/* Assez large pour que « Drag and drop a song. » tienne sur une ligne. */
@media (min-width: 1024px) {
  .content { max-width: 54rem; }
  .page h1 { max-width: none; }
}

/* ---------- pages de texte ---------- */

.prose {
  max-width: 40rem;
  margin-inline: auto;
  padding: 4rem var(--gutter-r) 4rem var(--gutter);
  display: grid;
  gap: 1.1rem;
  text-align: left;
}

.prose h1 { font-size: clamp(1.7rem, 6vw, 2.4rem); max-width: none; }
.prose h2 { margin: 1.75rem 0 0; font-family: var(--body); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--copper-bright); }
.prose p, .prose li { color: var(--muted); font-size: 0.92rem; }
.prose ul { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.4rem; }
.prose a { color: var(--text); text-underline-offset: 4px; }
.prose a:hover { color: var(--copper-bright); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
