/* Calderne, la page d'attente.
   Le titre est un vrai texte : sans JavaScript, ou pour qui refuse les animations, il reste
   en or et fixe. Quand l'effet tourne, le canevas (blob.js) le redessine par-dessus et le
   texte devient transparent, sans quitter la page (les moteurs de recherche et les lecteurs
   d'écran le lisent toujours). */

/* La police des titres du jeu, IM Fell English (Igino Marini, licence SIL OFL :
   polices/OFL_IMFellEnglish.txt). Livrée avec la page : rien n'est chargé d'ailleurs. */
@font-face {
  font-family: "IM Fell English";
  src: url("polices/IMFeENrm28P.ttf") format("truetype");
  font-style: normal;
  font-weight: normal;
  font-display: block;
}
@font-face {
  font-family: "IM Fell English";
  src: url("polices/IMFeENit28P.ttf") format("truetype");
  font-style: italic;
  font-weight: normal;
  font-display: block;
}

:root {
  --nuit: #0a0e15;          /* la nuit du jeu (#1f2b3d), assombrie presque jusqu'au noir */
  --or: #e8c95a;            /* l'or du jeu (Theme.OR) */
  --or-pale: rgba(232, 201, 90, 0.58);
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--nuit);
}

body {
  color: var(--or);
  font-family: "IM Fell English", Georgia, "Times New Roman", serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.scene {
  position: relative;
  z-index: 1;               /* le titre, au-dessus du fond */
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8vh 16px 10vh;
  text-align: center;
  overflow: hidden;         /* le canevas déborde du titre : jamais de défilement de côté */
}

/* La taille de « Calderne » ; tout le reste du titre s'y mesure (em). */
.titre {
  position: relative;
  font-size: clamp(3.6rem, 21vw, 10.5rem);
  line-height: 1;
}

.ligne {
  margin: 0;
  font-weight: normal;
  white-space: nowrap;
}

.ligne-nom {
  font-size: 1em;
  line-height: 1.08;
}

.ligne-bientot {
  font-size: 0.5em;
  line-height: 1.15;
}

/* Le canevas couvre le titre et ses abords : le blob arrive de loin à gauche et repart loin à
   droite, les tranches du glitch se décalent, les gouttes tombent sous la dernière ligne. */
.blob {
  position: absolute;
  left: -2em;
  top: -0.3em;
  width: calc(100% + 4em);
  height: calc(100% + 0.9em);
  pointer-events: none;
}

.anime .ligne {
  color: transparent;
}

/* ——— Le fond (fond.js), fixe derrière le titre ——— */

.fond {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.fond > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* La carte à l'encre : le papier (un canevas), l'encre (un dessin vectoriel), la bougie. */
.fond > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.encre {
  fill: none;
  stroke: #dccaa2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Un trait tracé à la plume : il se dessine de son début à sa fin. */
.trace {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: trace var(--duree, 2s) cubic-bezier(0.45, 0.1, 0.35, 1) var(--attente, 0s) forwards;
}

/* Ce qui apparaît sans se tracer : les hachures, les sondes, la ligne des hauts-fonds. */
.parait {
  opacity: 0;
  animation: parait var(--duree, 1.2s) ease-out var(--attente, 0s) forwards;
}

@keyframes trace {
  to { stroke-dashoffset: 0; }
}

@keyframes parait {
  to { opacity: 1; }
}

.sondes {
  fill: #dccaa2;
  font-family: "IM Fell English", Georgia, serif;
  font-style: italic;
}

/* La lueur de la bougie : elle vacille doucement (deux battements mêlés, jamais le même). */
.bougie,
.bougie::after {
  position: absolute;
  inset: 0;
}

.bougie {
  background: radial-gradient(ellipse 70% 60% at 14% 88%, rgba(255, 186, 112, 0.10), transparent 70%);
  animation: vacille 2.3s ease-in-out infinite alternate;
}

.bougie::after {
  content: "";
  background: radial-gradient(ellipse 45% 40% at 10% 92%, rgba(255, 170, 90, 0.07), transparent 70%);
  animation: vacille 3.7s ease-in-out -1.1s infinite alternate;
}

@keyframes vacille {
  0% { opacity: 0.75; }
  23% { opacity: 1; }
  41% { opacity: 0.82; }
  58% { opacity: 0.95; }
  77% { opacity: 0.7; }
  100% { opacity: 0.9; }
}

/* L'ombre derrière le titre et les bords assombris : l'or et le bleu restent lisibles. */
.ombre {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse var(--ombre-l, 40%) var(--ombre-h, 22%) at var(--ombre-x, 50%) var(--ombre-y, 45%),
      rgba(6, 5, 4, 0.62), transparent 100%),
    radial-gradient(ellipse 85% 80% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* Pour qui refuse les animations : la carte entière d'emblée, la bougie immobile. */
.immobile .trace,
.immobile .parait,
.immobile .bougie,
.immobile .bougie::after {
  animation: none;
  stroke-dashoffset: 0;
  opacity: 1;
}

/* La ligne discrète, sans glitch : en italique, comme sur l'écran-titre du jeu. */
.lieu {
  margin: 1.7em 0 0;
  font-style: italic;
  font-size: clamp(1rem, 0.7rem + 1.5vw, 1.55rem);
  letter-spacing: 0.04em;
  color: var(--or-pale);
}

/* ——— Les mentions légales, que la loi demande ——— */

/* Le lien, en bas de la page d'attente : tout petit, presque effacé, sans effet. */
.mentions {
  position: absolute;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: rgba(232, 201, 90, 0.34);
  text-decoration: none;
  white-space: nowrap;
}

.mentions:hover,
.mentions:focus-visible {
  color: var(--or-pale);
  text-decoration: underline;
}

/* La page elle-même (mentions-legales.html) : du texte sobre, sur la nuit. */
.page-texte {
  box-sizing: border-box;
  max-width: 40rem;
  margin: 0 auto;
  padding: 10vh 16px 8vh;
  font-size: 1.1rem;
  line-height: 1.55;
  color: rgba(232, 201, 90, 0.8);
}

.page-texte h1 {
  margin: 0 0 1em;
  font-weight: normal;
  font-size: clamp(2.2rem, 8vw, 3.2rem);
  text-align: center;
  color: var(--or);
}

.page-texte h2 {
  margin: 1.8em 0 0.4em;
  font-weight: normal;
  font-style: italic;
  font-size: 1.3rem;
  color: var(--or);
}

.page-texte p {
  margin: 0 0 0.8em;
}

.page-texte a {
  color: var(--or);
}

.page-texte .retour {
  display: block;
  margin-top: 3em;
  text-align: center;
}
