/* toutpointe.fr — une salle de projection : un écran éteint, un point de lumière. */

@font-face {
  font-family: "Jost";
  src: url("fonts/jost-latin-wght-normal.woff2") format("woff2-variations"),
       url("fonts/jost-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --nuit: #111626;         /* la salle */
  --toile: #171d30;        /* l'écran éteint, les champs */
  --trait: #283049;        /* filets */
  --craie: #ece7de;        /* texte */
  --brume: #969cb1;        /* texte secondaire */
  --lumiere: #ffc64a;      /* le point de lumière, l'action principale */
  --lumiere-vive: #ffd579;
  --alerte: #ff9d8c;
  --rayon: 4px;
  --gouttiere: 16px;
  color-scheme: dark;
}

@media (min-width: 720px) {
  :root { --gouttiere: 40px; }
}

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

[hidden] { display: none !important; }

html {
  background: var(--nuit);
  color: var(--craie);
  font-family: "Jost", "Futura", "Century Gothic", "Avenir Next", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--nuit);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-weight: 420;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--lumiere); color: var(--nuit); }

:focus-visible {
  outline: 2px solid var(--lumiere);
  outline-offset: 3px;
}

.vh {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Mise en page : une colonne centrée, contenu aligné à gauche ---------- */

.page {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gouttiere);
  padding-left: max(var(--gouttiere), env(safe-area-inset-left));
  padding-right: max(var(--gouttiere), env(safe-area-inset-right));
}

/* L'écran est aussi grand que possible tout en laissant la place au reste de la page. */
.scene {
  --ratio: 1.7778;
  --reserve: 330px;
  width: min(100%, 1120px, max(300px, (100vh - var(--reserve)) * var(--ratio)));
  width: min(100%, 1120px, max(300px, (100svh - var(--reserve)) * var(--ratio)));
}

.scene.est-ouvert { --reserve: 190px; }

@media (max-height: 560px) {
  .scene { --reserve: 250px; }
  .scene.est-ouvert { --reserve: 110px; }
}

/* ---------- En-tête ---------- */

.entete {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.marque {
  color: var(--craie);
  text-decoration: none;
  font-size: 1.625rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  border-radius: 2px;
}

/* Le point du « i » : le même point de lumière que sur l'écran. */
.marque-point {
  display: inline-block;
  width: 0.15em;
  height: 0.15em;
  margin: 0 0.049em 0 -0.199em;
  vertical-align: 0.568em;
  border-radius: 50%;
  background: var(--lumiere);
}

.verrou { margin: 0; }

.bouton-texte {
  padding: 4px 0;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--brume);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
}

.bouton-texte:hover {
  color: var(--craie);
  text-decoration-color: currentColor;
}

/* ---------- L'écran ---------- */

.ecran {
  position: relative;
  aspect-ratio: var(--ratio);
  overflow: hidden;
  background: var(--toile);
  border-radius: var(--rayon);
  box-shadow: inset 0 0 0 1px var(--trait);
}

/* Écran éteint : la lueur du point se diffuse sur la toile, à l'échelle de l'écran. */
.scene:not(.est-ouvert) .ecran {
  background:
    radial-gradient(closest-side circle at 50% 50%,
      rgba(255, 198, 74, 0.15) 0%,
      rgba(255, 198, 74, 0.055) 38%,
      rgba(255, 198, 74, 0.015) 70%,
      rgba(255, 198, 74, 0) 100%),
    var(--toile);
}

.est-ouvert .ecran {
  background: #000;
  box-shadow: none;
}

.ecran-point {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--lumiere);
  box-shadow: 0 0 14px 3px rgba(255, 198, 74, 0.55), 0 0 40px 8px rgba(255, 198, 74, 0.18);
}

.ecran video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.ecran-message {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 24px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--brume);
  background: var(--toile);
}

/* Juste après le mot de passe : le point s'ouvre en écran, la lumière laisse place à l'image. */
.allumage .est-ouvert .ecran {
  animation: allumage 900ms cubic-bezier(0.22, 0.8, 0.25, 1) both;
}

.allumage .est-ouvert .ecran::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, #fff4d6 0%, var(--lumiere) 55%, #eea52a 100%);
  animation: lumiere 1300ms ease-out both;
}

@keyframes allumage {
  from { clip-path: circle(7px at 50% 50%); }
  to { clip-path: circle(75% at 50% 50%); }
}

@keyframes lumiere {
  0%, 35% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------- Sous l'écran ---------- */

.sous-ecran { margin-top: 16px; }

.titre {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.005em;
}

.lecture-erreur {
  margin: 8px 0 0;
  color: var(--alerte);
}

/* ---------- Mot de passe ---------- */

.acces {
  margin-top: 28px;
  display: grid;
  gap: 22px;
}

.acces h1 {
  margin: 0 0 6px;
  font-size: 1.875rem;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.012em;
}

.acces-texte p {
  margin: 0;
  max-width: 34ch;
  color: var(--brume);
}

.acces-form { margin: 0; }

.acces-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9375rem;
  color: var(--brume);
}

.acces-ligne {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.acces-champ {
  flex: 1;
  min-width: 0;
}

.champ { position: relative; }

.champ input {
  width: 100%;
  height: 50px;
  padding: 0 92px 0 15px;
  font: inherit;
  font-size: 1.0625rem;
  letter-spacing: 0.02em;
  color: var(--craie);
  background: var(--toile);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
}

/* Focus : un seul anneau net, jaune (ou corail si le mot de passe vient d'être refusé). */
.champ input:focus,
.champ input:focus-visible {
  outline: none;
  border-color: var(--lumiere);
  box-shadow: 0 0 0 1px var(--lumiere);
}

.champ input[aria-invalid="true"] { border-color: var(--alerte); }

.champ input[aria-invalid="true"]:focus,
.champ input[aria-invalid="true"]:focus-visible {
  border-color: var(--alerte);
  box-shadow: 0 0 0 1px var(--alerte);
}

.voir {
  position: absolute;
  top: 7px;
  right: 7px;
  bottom: 7px;
  padding: 0 10px;
  font: inherit;
  font-size: 0.875rem;
  color: var(--brume);
  background: transparent;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
}

.voir:hover {
  color: var(--craie);
  background: rgba(236, 231, 222, 0.06);
}

.regarder {
  height: 50px;
  padding: 0 26px;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 560;
  color: var(--nuit);
  background: var(--lumiere);
  border: 0;
  border-radius: var(--rayon);
  cursor: pointer;
  white-space: nowrap;
}

.regarder:hover { background: var(--lumiere-vive); }
.regarder:active { transform: translateY(1px); }
.regarder:disabled { opacity: 0.75; cursor: progress; }

.erreur {
  margin: 9px 0 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--alerte);
}

@media (min-width: 760px) {
  .acces {
    grid-template-columns: minmax(0, 1fr) minmax(0, 27rem);
    align-items: start;
    gap: 40px;
  }
}

@media (max-width: 759px) {
  .acces-ligne {
    flex-direction: column;
    align-items: stretch;
  }
  .regarder { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
