/* ──────────────────────────────────────────────────────────────────────────
   Thérémine virtuel — habillage repris de la DA du portfolio.

   Jetons, familles et courbes sont copiés de ../css/style.css. La page reste
   autonome (elle ne charge pas la feuille du site, comme les autres pages du
   Lab), mais elle en parle la langue : blanc cassé, quasi-noir, un seul rouge
   réservé à l'action, Playfair en titrage, Jakarta en labeur, rayon de 5 px.

   Le terrain de jeu est en quasi-noir sur la page claire — même inversion que
   la section témoignages du site : c'est la scène, le reste est le papier.
   ────────────────────────────────────────────────────────────────────────── */

:root {
  --accent:        #fb1010;
  --accent-dark-1: #dd0303;
  --light:         #f8f6f6;
  --light-3:       #c7c6c5;
  --mid-dark:      #6f6e6d;
  --dark:          #1d1d1b;
  --dark-3:        #4e4d4c;
  --dark-4:        #666564;

  --font-display: "Playfair Display", "Times New Roman", serif;
  --font-sans:    "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --ease-sortie: cubic-bezier(.22, .61, .36, 1);
  --ease-franc:  cubic-bezier(.3, 0, .2, 1);
  --dur-court:  140ms;
  --dur-moyen:  600ms;

  color-scheme: light;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--light);
  color: var(--dark);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 4vw, 56px) max(16px, env(safe-area-inset-left, 0px))
           clamp(24px, 4vw, 56px) max(16px, env(safe-area-inset-right, 0px));
}

.container {
  width: 100%;
  max-width: 1114px;          /* la colonne du site */
  margin-inline: auto;
}

/* ---- Retour au site : la page était un cul-de-sac ----------------------- */

.retour {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: clamp(20px, 3vw, 34px);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--dark-3);
  text-decoration: none;
  transition: color var(--dur-court) var(--ease-franc);
}
.retour:hover, .retour:focus-visible { color: var(--accent); }
.retour span { transition: transform 300ms var(--ease-sortie); }
.retour:hover span, .retour:focus-visible span { transform: translateX(-4px); }

/* ---- Titrage ------------------------------------------------------------ */

.sur {
  margin: 0 0 12px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 5.2vw, 58px);
  line-height: 1.04;
  letter-spacing: -.015em;
  color: #000;
  text-wrap: balance;
}

.instructions {
  max-width: 62ch;
  margin: 16px 0 clamp(26px, 4vw, 40px);
  font-size: 16px;
  color: var(--dark-3);
}
.instructions strong { font-weight: 700; color: var(--dark); }

/* ---- Le terrain de jeu -------------------------------------------------- */

.theremin-area {
  position: relative;
  width: 100%;
  height: clamp(320px, 52vh, 500px);
  background: var(--dark);
  border: 0;
  border-radius: 5px;
  cursor: crosshair;
  overflow: hidden;
  box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .55);
  transition: box-shadow var(--dur-moyen) var(--ease-sortie);
}
.theremin-area:hover { box-shadow: 0 14px 38px -14px rgba(0, 0, 0, .65); }
/* En jeu, le cadre s'allume d'un filet rouge : c'est l'état « ça sonne ». */
.theremin-area.active {
  box-shadow: 0 0 0 2px var(--accent), 0 14px 44px -14px rgba(251, 16, 16, .45);
}

.grid-lines { position: absolute; inset: 0; pointer-events: none; }
.grid-line-vertical   { position: absolute; width: 1px; height: 100%; background: rgba(248, 246, 246, .09); }
.grid-line-horizontal { position: absolute; width: 100%; height: 1px; background: rgba(248, 246, 246, .09); }

.axis-labels { position: absolute; inset: 0; pointer-events: none; }
.label {
  position: absolute;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(248, 246, 246, .42);
}
.label-left   { left: 16px;  top: 50%; transform: translateY(-50%); }
.label-right  { right: 16px; top: 50%; transform: translateY(-50%); }
.label-top    { top: 14px;    left: 50%; transform: translateX(-50%); }
.label-bottom { bottom: 14px; left: 50%; transform: translateX(-50%); }

/* Le curseur : un anneau rouge. js/script.js en fait varier l'intensité
   selon le volume — la teinte, elle, ne bouge pas. */
.cursor-indicator {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  display: none;
}
.cursor-indicator.active { display: block; }

/* ---- Commandes ---------------------------------------------------------- */

.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: clamp(22px, 3vw, 32px);
}

/* Le bouton du site : rayon de 5 px, rouge d'action, et le clic s'entend. */
.btn {
  padding: 13px 30px;
  border: 0;
  border-radius: 5px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.318;
  cursor: pointer;
  transition: background-color var(--dur-moyen) var(--ease-sortie),
              color var(--dur-moyen) var(--ease-sortie),
              box-shadow var(--dur-moyen) var(--ease-sortie),
              transform var(--dur-court) var(--ease-franc);
}
.btn-start { background: var(--accent); color: var(--light); }
.btn-start:hover { background: var(--accent-dark-1); box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.btn-start:active { box-shadow: none; transform: scale(.975); }
/* En cours de jeu le bouton dit « arrêter » : il passe au noir, le rouge est
   rendu au terrain. */
.btn-start.active { background: var(--dark); color: var(--light); }
.btn-start.active:hover { background: #000; }

select {
  padding: 12px 18px;
  border: 1px solid var(--light-3);
  border-radius: 5px;
  background: #fff;
  color: var(--dark);
  font-family: var(--font-sans);
  font-size: 14px;
  cursor: pointer;
  transition: border-color var(--dur-court) var(--ease-franc);
}
select:hover { border-color: var(--dark); }

.btn:focus-visible, select:focus-visible, .retour:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---- Lecture des valeurs ------------------------------------------------ */

.info-panel {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: clamp(22px, 3vw, 32px);
}

.info-item {
  flex: 1 1 200px;
  max-width: 280px;
  min-width: 0;
  padding: 18px 22px;
  border: 1px solid var(--light-3);
  border-radius: 5px;
  background: #fff;
  text-align: left;
}

.info-label {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dark-4);
}

/* Les chiffres en Playfair, comme les grands nombres du site. */
.info-value {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1.1;
  color: var(--dark);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {
  .controls { flex-direction: column; align-items: stretch; }
  .btn, select { width: 100%; }
  .info-item { flex-basis: 100%; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
