/* =========================================================
   Thème : Les Trous du masque (Jean Lorrain)
   Un mardi gras à Paris : or du gaz, noir du satin, bleu de lune sur les quais,
   jaune de troquet, puis le vert blême du bal des cagoules.
   Au moment de l'horreur, les mots « rien », « vide », « néant » se vident :
   il ne reste que leur contour, comme un trou de masque.
   veillee → nuit → gaz → bal → reveil
   ========================================================= */

@property --bg     { syntax: "<color>"; inherits: true; initial-value: #120d0c; }
@property --accent { syntax: "<color>"; inherits: true; initial-value: #d9a24a; }

.theme-masque {
  --bg: #120d0c;
  --surface: #1b1412;
  --ink: #ece3d3;
  --ink-muted: #a89c88;
  --accent: #d9a24a;           /* flamme de gaz */
  --accent-2: #9fc2a8;         /* vert de la cagoule */
  --font-display: "Playfair Display", "Didot", Georgia, serif;
  --font-body: "Spectral", "Iowan Old Style", Georgia, serif;
  --measure: 34em;

  transition: --bg 2.4s ease, --accent 2.4s ease;
}
.theme-masque[data-mood="veillee"] { --bg: #120d0c; --accent: #d9a24a; }
.theme-masque[data-mood="nuit"]    { --bg: #0b1218; --accent: #9db4c9; }
.theme-masque[data-mood="gaz"]     { --bg: #15140a; --accent: #cfc65a; }
.theme-masque[data-mood="bal"]     { --bg: #0a110e; --accent: #9fc2a8; }
.theme-masque[data-mood="reveil"]  { --bg: #120d0c; --accent: #d9a24a; }

.theme-masque .chapter { font-size: calc(var(--step-0) * var(--reader-scale) * 1.04); }

/* ---------- Ouverture : trois tableaux, des gouttières noires, un halo de gaz ---------- */
.theme-masque .hero {
  position: relative; isolation: isolate;
  min-height: 100svh; display: grid; align-items: end;
  overflow: hidden; background: #070504;
}
.hero__bg { position: absolute; inset: 0; z-index: -1; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; filter: brightness(.78) saturate(1.05); }
.hero__gas {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(40% 40% at 16% 22%, rgb(255 190 90 / .26), transparent 70%),
              radial-gradient(40% 40% at 84% 22%, rgb(255 190 90 / .22), transparent 70%);
  animation: gas 6s infinite;
}
@keyframes gas {
  0%, 100% { opacity: .9; } 12% { opacity: .72; } 29% { opacity: 1; } 46% { opacity: .8; }
  64% { opacity: .98; } 82% { opacity: .76; }
}
.theme-masque .hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgb(7 5 4 / .96) 0%, rgb(7 5 4 / .6) 32%, transparent 62%);
}
.theme-masque .hero__content { position: relative; z-index: 1; width: min(100%, 76rem); margin: 0 auto; padding: 6rem var(--gutter) clamp(2.5rem, 8vh, 4.5rem); }
.theme-masque .hero__title {
  font-family: var(--font-display); font-weight: 700; font-style: italic;
  font-size: clamp(2.8rem, 1.4rem + 6.2vw, 6.4rem); line-height: .95;
  color: #f0e2bf; text-shadow: 0 2px 28px rgb(0 0 0 / .9);
}
.theme-masque .hero__subtitle { margin-top: .8rem; font-style: italic; font-size: var(--step-1); }
.theme-masque .hero__meta { margin-top: .8rem; font-family: var(--font-ui); font-size: var(--step--1); color: var(--ink-muted); }
.theme-masque .hero__start {
  display: inline-block; margin-top: 1.4rem; padding: .75rem 1.25rem; border-radius: 2px;
  font-family: var(--font-ui); font-size: .95rem; font-weight: 600; text-decoration: none;
  color: #1a1208; background: var(--accent);
}
.theme-masque .hero__start:hover { background: #efbb68; }

/* ---------- Sommaire, titres ---------- */
.theme-masque .toc { padding-top: clamp(3rem, 8vh, 5rem); }
.theme-masque .toc a { font-family: var(--font-display); font-weight: 700; font-style: italic; font-size: 1.15rem; }
.theme-masque .toc a::before { color: var(--accent); font-family: var(--font-ui); font-style: normal; font-size: .9rem; }
.theme-masque .chapter__title { font-family: var(--font-display); font-weight: 700; font-style: italic; font-size: clamp(1.9rem, 1.4rem + 2.2vw, 2.9rem); line-height: 1.05; }
.theme-masque .chapter__num { color: var(--accent); font-style: normal; }
.theme-masque .chapter__title::after {
  content: ""; display: block; width: 3rem; height: 2px; margin-top: .9rem;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.lead { font-size: var(--step-1); line-height: 1.55 !important; font-style: italic; }

/* ---------- Illustrations : de grands formats verticaux, en duo ou seuls ---------- */
.theme-masque .illu__frame { background: #0a0807; }
.theme-masque .illu--panel { max-width: 17rem; margin-inline: auto !important; }
.theme-masque .illu--panel .illu__frame img { max-height: none; }
.theme-masque .illu--duo { max-width: min(36rem, 100%); margin-inline: auto !important; }
.theme-masque .illu__frame--duo { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; background: transparent; border-radius: 0; overflow: visible; }
.theme-masque .illu__frame--duo img { max-height: none; border-radius: 4px; }
.theme-masque .illu figcaption { font-style: italic; }

/* ---------- Les mots qui se vident ---------- */
.hollow {
  color: transparent;
  -webkit-text-stroke: .9px color-mix(in srgb, var(--ink) 88%, transparent);
  font-weight: 600; letter-spacing: .01em;
}
/* Avec effets : le mot est d'abord plein, puis se vide quand on le lit */
.js-fx .hollow {
  color: var(--ink); -webkit-text-stroke-color: transparent;
  transition: color 2.4s ease .3s, -webkit-text-stroke-color 2.4s ease .3s;
}
.js-fx .is-empty .hollow { color: transparent; -webkit-text-stroke-color: color-mix(in srgb, var(--ink) 88%, transparent); }

/* ---------- La chute ---------- */
.sting {
  margin-top: 2.2em !important; text-align: center;
  font-family: var(--font-display); font-weight: 700; font-style: italic;
  font-size: var(--step-3); line-height: 1.1 !important; color: #f0e2bf;
}
.js-fx .sting { opacity: 0; transform: translateY(.3em); transition: opacity 3.2s ease, transform 3.2s ease; }
.js-fx .sting.is-seen { opacity: 1; transform: none; }

.fx-off .hero__gas { animation: none; opacity: .9; }
@media (prefers-reduced-motion: reduce) { .hero__gas { animation: none; opacity: .9; } }
@media (max-width: 40rem) { .theme-masque .illu--duo { max-width: 100%; } }
