/* ============================================
   monpoeme.fr — Global Styles
   De Saint Paris — Pierre Dos Santos
   ============================================ */

@import url('/css/fonts-site.css'); /* polices locales, plus d'appel Google */

/* ---- Variables ---- */
:root {
  --bg: #0a0908;
  --bg-subtle: #0f0e0c;
  --text: #e8e0d4;
  --text-dim: #a09888;
  --text-muted: #6b6054;
  --gold: #c9a84c;
  --gold-dim: #8a7535;
  --bordeaux: #8b2635;
  --bordeaux-dim: #5e1a24;
  --serif: 'Cormorant Garamond', 'Georgia', serif;
  --ui: 'Crimson Pro', 'Georgia', serif;
  --ease-material: cubic-bezier(0.4, 0, 0.2, 1);
  --verse-delay: 250ms;
  --strophe-delay: 400ms;
}

/* ---- Reset ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-overflow-scrolling: touch;
}

body {
  font-family: var(--ui);
  font-weight: 200;
  color: var(--text);
  background: var(--bg);
  height: 100vh;
  line-height: 1.6;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* ---- Grain Overlay ---- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ---- Radial depth ---- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 30%, rgba(201,168,76,0.03) 0%, transparent 60%);
}

/* ---- Typography ---- */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.3;
}

a {
  color: var(--gold-dim);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--gold);
}

/* ---- Layout ---- */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: 680px;
}

/* ---- Hero (index) ---- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  position: relative;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background: url('/assets/backgrounds/morning.webp') center center / cover no-repeat;
  opacity: 0;
  animation: fadeIn 1.5s var(--ease-material) 0.1s forwards;
}

.hero--day .hero__bg { background-image: url('/assets/backgrounds/day.webp'); }
.hero--evening-early .hero__bg { background-image: url('/assets/backgrounds/evening-early.webp'); }
.hero--evening-late .hero__bg { background-image: url('/assets/backgrounds/evening-late.webp'); }
.hero--night-early .hero__bg { background-image: url('/assets/backgrounds/night-early.webp'); }
.hero--night-mid .hero__bg { background-image: url('/assets/backgrounds/night-mid.webp'); }
.hero--night-late .hero__bg { background-image: url('/assets/backgrounds/night-late.webp'); }

.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100vw;
  padding: 10px 24px;
}

.hero__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.8rem, 9vw, 5.5rem);
  letter-spacing: 0.12em;
  margin-bottom: 2px;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-material) 0.5s forwards;
}

.hero__brand {
  font-family: var(--ui);
  font-weight: 200;
  font-size: clamp(1rem, 3.5vw, 1.5rem);
  letter-spacing: 0.55em;
  text-transform: uppercase;
  margin-bottom: 0;
  opacity: 0;
  animation: fadeUp 0.6s var(--ease-material) 1s forwards;
}

.hero__subtitle {
  font-family: var(--ui);
  font-weight: 200;
  font-size: clamp(0.7rem, 2.5vw, 1rem);
  letter-spacing: 0.45em;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeUp 0.55s var(--ease-material) 1.4s forwards;
}

.hero__separator {
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
  margin: 4px auto 6px;
  opacity: 0;
  animation: fadeIn 0.5s var(--ease-material) 0.9s forwards;
}

/* -- Cinematic letterbox bars -- */
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 5vh;
  z-index: 2;
  background: #fff;
  opacity: 0;
  animation: fadeIn 1.2s var(--ease-material) 0.3s forwards;
}

.hero::before { top: 0; }
.hero::after { bottom: 0; }

.hero--evening-early::before, .hero--evening-early::after,
.hero--evening-late::before, .hero--evening-late::after,
.hero--night-early::before, .hero--night-early::after,
.hero--night-mid::before, .hero--night-mid::after,
.hero--night-late::before, .hero--night-late::after {
  background: #000;
}

/* -- Hero morning (default, 8h-10h) & day (10h-18h) -- light modes -- */
.hero__content {
  background: rgba(255,255,255,0.7);
}

.hero__title {
  color: #3a2f1e;
  text-shadow: 0 1px 8px rgba(255,255,255,0.4);
}

.hero__brand,
.hero__subtitle {
  color: #6b5d4a;
  text-shadow: 0 1px 6px rgba(255,255,255,0.3);
}

/* -- Hero evening (18h-22h) -- warm dark mode -- */
.hero--evening-early .hero__content,
.hero--evening-late .hero__content {
  background: rgba(0,0,0,0.65);
}

.hero--evening-early .hero__title,
.hero--evening-late .hero__title {
  color: var(--gold);
  text-shadow: 0 2px 16px rgba(180,120,40,0.3);
}

.hero--evening-early .hero__brand,
.hero--evening-early .hero__subtitle,
.hero--evening-late .hero__brand,
.hero--evening-late .hero__subtitle {
  color: #d4b896;
  text-shadow: 0 1px 10px rgba(0,0,0,0.5);
}

.hero--evening-early .hero__separator,
.hero--evening-late .hero__separator {
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* -- Hero night (22h-8h) -- dark mode -- */
.hero--night-early .hero__content,
.hero--night-mid .hero__content,
.hero--night-late .hero__content {
  background: rgba(0,0,0,0.7);
}

.hero--night-early .hero__title,
.hero--night-mid .hero__title,
.hero--night-late .hero__title {
  color: var(--gold);
  text-shadow: 0 2px 20px rgba(0,0,0,0.6);
}

.hero--night-early .hero__brand,
.hero--night-early .hero__subtitle,
.hero--night-mid .hero__brand,
.hero--night-mid .hero__subtitle,
.hero--night-late .hero__brand,
.hero--night-late .hero__subtitle {
  color: var(--text-dim);
  text-shadow: 0 1px 10px rgba(0,0,0,0.5);
}

.hero--night-early .hero__separator,
.hero--night-mid .hero__separator,
.hero--night-late .hero__separator {
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

/* Code doré de l'accueil (Pierre 12/10/2026 : TikTok ne prend pas de lien → « code CIEL »). Pastille sombre à elle,
   pour que l'or se lise aussi sur les fonds clairs du matin et du jour. */
.code-or {
  position: absolute;
  left: 0;
  right: 0;
  width: max-content;
  margin: 0 auto;
  bottom: calc(5vh + 28px);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 14px;
  border-radius: 14px;
  background: rgba(10,9,8,0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  animation: fadeUp 0.6s var(--ease-material) 1.8s forwards;
}
.code-or__lab {
  font-family: var(--ui);
  font-weight: 300;
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-dim);
  white-space: nowrap;
}
.code-or__ligne { display: flex; align-items: center; gap: 8px; }
.code-or__champ {
  width: 170px;
  height: 44px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid var(--gold-dim);
  border-radius: 22px;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  text-align: center;
  text-transform: uppercase;
  outline: none;
  box-shadow: 0 0 0 0 rgba(201,168,76,0);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.code-or__champ::placeholder { color: rgba(201,168,76,0.35); letter-spacing: 0.35em; }
.code-or__champ:focus { border-color: var(--gold); box-shadow: 0 0 14px rgba(201,168,76,0.28); }
.code-or__ok {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
  border: 1px solid var(--gold-dim);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.code-or__ok svg { display: block; width: 18px; height: 18px; margin: 0 auto; }
.code-or__ok:hover { border-color: var(--gold); box-shadow: 0 0 12px rgba(201,168,76,0.3); }
.code-or--attente .code-or__ok { opacity: 0.5; }
.code-or--juste .code-or__champ,
.code-or--juste .code-or__ok { border-color: var(--gold); box-shadow: 0 0 22px rgba(201,168,76,0.55); }
.code-or--faux .code-or__ligne { animation: codeOrNon 0.42s ease; }
.code-or--faux .code-or__champ { border-color: var(--bordeaux); }
@keyframes codeOrNon {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}

/* ---- Poems List (index) ---- */
.poems-section {
  padding: 80px 24px 120px;
}

.poems-section__title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 1.1rem;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 48px;
}

.poems-list {
  list-style: none;
  max-width: 540px;
  margin: 0 auto;
}

.poems-list__item {
  border-bottom: 1px solid rgba(201,168,76,0.08);
}

.poems-list__link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 20px 8px;
  color: var(--text);
  transition: transform 0.3s ease, color 0.3s ease;
}

.poems-list__link:hover {
  transform: translateX(6px);
  color: var(--gold);
}

.poems-list__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.15rem;
}

.poems-list__date {
  font-family: var(--ui);
  font-weight: 200;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: 16px;
}

.poems-list__empty {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 40px 0;
}

/* ---- Poem Reading ---- */
.poem-page {
  position: relative;
  height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  /* `pan-x pan-y` exclut le pincement : le navigateur ne zoome pas ici, et le geste
     reste captable par le script, qui ouvre le lecteur à la place (Pierre 04/08). */
  touch-action: pan-x pan-y;
}

/* Retour (série, coffre, galerie) : bulle ronde à flèche seule, même taille et même colonne que l'œil, juste
   au-dessus de lui — en haut à gauche elle passait sous le cadenas (Pierre 11/10/2026). 12/10 : à sa place dès
   l'ouverture, à la hauteur de la bulle → (« elle ne doit pas changer de place pour remonter quand l'œil arrive »). */
.poem-back {
  position: fixed;
  bottom: 74px;
  left: 24px;
  width: 40px;
  height: 40px;
  box-sizing: border-box;
  background: rgba(10,9,8,0.9);
  border: 1px solid var(--gold-dim);
  border-radius: 50%;
  color: var(--gold-dim);
  transition: color 0.3s ease, border-color 0.3s ease;
  z-index: 50;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.poem-back svg {
  display: block;
  width: 16px;
  height: 16px;
  margin: 11px auto 0;
}

.poem-back:hover {
  color: var(--gold);
  border-color: var(--gold);
}

/* Poème suivant d'un corpus : même bulle, colonne de droite, juste au-dessus de la bulle de lecture (11/10/2026). */
.poem-next {
  position: fixed;
  bottom: 74px;
  right: 24px;
  width: 40px;
  height: 40px;
  box-sizing: border-box;
  background: rgba(10,9,8,0.9);
  border: 1px solid var(--gold-dim);
  border-radius: 50%;
  color: var(--gold-dim);
  transition: color 0.3s ease, border-color 0.3s ease;
  z-index: 50;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.poem-next svg { display: block; width: 16px; height: 16px; margin: 11px auto 0; }
.poem-next:hover { color: var(--gold); border-color: var(--gold); }

/* Fin de lecture dans un corpus (Pierre 12/10/2026 : « un effet lumineux une fois la lecture terminée, un liseré doré à
   droite de l'écran ») : filet d'or sur toute la hauteur, halo qui respire ; la bulle → s'allume avec lui. */
.serie-lisere {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 46px;
  z-index: 40;
  pointer-events: none;
  background: linear-gradient(270deg, rgba(201,168,76,0.16), rgba(201,168,76,0) 100%);
  opacity: 0;
  animation: lisereEntre 1.4s var(--ease-material) 0.3s forwards, lisereRespire 3.2s ease-in-out 1.7s infinite;
}
.serie-lisere::after {
  content: '';
  position: absolute;
  top: 6%;
  bottom: 6%;
  right: 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(201,168,76,0), #e2c46a 30%, #f3dc8e 50%, #e2c46a 70%, rgba(201,168,76,0));
  box-shadow: 0 0 10px rgba(226,196,106,0.75), 0 0 26px rgba(201,168,76,0.45);
}
@keyframes lisereEntre { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@keyframes lisereRespire { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.poem-next--appel {
  color: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(201,168,76,0.4);
}

/* Glissement d'un poème à l'autre d'un corpus (12/10/2026) : le volet du voisin entre par le bord, filet doré en tête,
   titre au centre ; la page d'arrivée le garde à l'écran (écran d'attente) jusqu'à ce que le poème soit là. */
.glisse-volet {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  background: var(--bg);
  border-left: 2px solid #e2c46a;
  box-shadow: -6px 0 24px rgba(201,168,76,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate3d(100%,0,0);
  will-change: transform;
}
.glisse-volet--gauche {
  border-left: 0;
  border-right: 2px solid #e2c46a;
  box-shadow: 6px 0 24px rgba(201,168,76,0.35);
  transform: translate3d(-100%,0,0);
}
.glisse-volet__titre,
.loading__titre {
  max-width: 80vw;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 5.5vw, 2.2rem);
  font-weight: 500;
  line-height: 1.25;
  color: var(--gold);
  text-align: center;
  text-wrap: balance;
}
.loading__titre { display: none; }
.arrivee-glisse .loading { transition: opacity 0.45s ease; }
.arrivee-glisse .loading__padlock,
.arrivee-glisse .loading__text { display: none; }
.arrivee-glisse .loading__titre { display: block; }

/* Alignement des vers choisi poème par poème (options de publication). */
body.poem-align--center .poem-body,
body.poem-align--center .poem-header,
body.poem-align--center .poem-popup--zoom .poem-popup__body { text-align: center; }
body.poem-align--right .poem-body,
body.poem-align--right .poem-header,
body.poem-align--right .poem-popup--zoom .poem-popup__body { text-align: right; }

/* ---- Split Layout ---- */
.poem-layout {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
}

.poem-layout__image {
  flex: 0 0 35%;
  max-width: 35%;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0 0 0 40px;
  overflow: hidden;
}

.poem-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 2px;
  filter: grayscale(0.2) contrast(1.05);
  opacity: 0;
}

.poem-image--visible {
  animation: imageReveal 1.6s var(--ease-material) forwards;
}

.poem-layout__separator {
  flex-shrink: 0;
  width: 1px;
  margin: 40px 20px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    var(--gold-dim) 15%,
    var(--gold) 50%,
    var(--gold-dim) 85%,
    transparent 100%
  );
}

.poem-layout__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 40px;
  cursor: default;
}

.poem-header {
  text-align: left;
  margin-bottom: clamp(8px, 1.5vh, 20px);
  flex-shrink: 0;
}

.poem-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 3.5vh, 2.8rem);
  color: var(--gold);
  margin-bottom: 4px;
  opacity: 0;
}

.poem-title--visible {
  animation: fadeUp 0.8s var(--ease-material) forwards;
}

.poem-title-line {
  width: 90px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--gold-dim) 50%, transparent 100%);
  border: 0;
  margin: 10px 0 8px;
  opacity: 0.8;
}

.poem-meta {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(0.75rem, 1.3vh, 0.9rem);
  color: var(--text-dim);
  margin-top: 6px;
  opacity: 0;
  letter-spacing: 0.02em;
}

.poem-meta--visible {
  animation: fadeUp 0.55s var(--ease-material) forwards;
}

/* ---- Signature ---- */
.poem-signature {
  text-align: center;
  visibility: hidden;
  opacity: 0;
}

.poem-signature--visible {
  visibility: visible;
  animation: fadeIn 1s var(--ease-material) forwards;
}

.poem-signature__line {
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
  margin: 0 auto clamp(4px, 0.8vh, 10px);
}

.poem-signature__name {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(0.75rem, 1.2vh, 0.9rem);
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

/* ---- Footer (signature + reactions, pinned to bottom) ---- */
.poem-footer {
  flex-shrink: 0;
  text-align: center;
  margin-top: auto;
}

/* ---- Compact reactions ---- */
.poem-reactions {
  margin-top: clamp(4px, 0.8vh, 10px);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.6s ease;
  min-height: 48px;
}

.poem-reactions--visible {
  visibility: visible;
  opacity: 1;
}

.poem-reactions__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.poem-reactions__grid {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.poem-reactions__divider {
  width: 1px;
  height: 22px;
  background: rgba(201,168,76,0.25);
  display: inline-block;
}

.poem-reactions__links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.poem-reactions__link-btn {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid rgba(201,168,76,0.18);
  border-radius: 2px;
  color: var(--text-muted);
  font-family: var(--ui);
  font-weight: 300;
  font-size: clamp(0.6rem, 0.95vh, 0.75rem);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

.poem-reactions__link-btn:hover {
  color: var(--gold);
  border-color: var(--gold-dim);
  transform: scale(1.04);
}

.poem-reactions__btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(201,168,76,0.12);
  border-radius: 2px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.3s ease;
  padding: 0;
}

.poem-reactions__btn svg {
  width: 14px;
  height: 14px;
  fill: var(--text-muted);
  transition: fill 0.3s ease;
}

.poem-reactions__btn:hover {
  transform: scale(1.15);
  border-color: var(--gold-dim);
}

.poem-reactions__btn:hover svg {
  fill: var(--gold);
}

.poem-reactions__btn--active {
  border-color: var(--gold);
}

.poem-reactions__btn--active svg {
  fill: var(--gold);
}

.poem-reactions__msg-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--ui);
  font-weight: 200;
  font-size: clamp(0.65rem, 1vh, 0.8rem);
  cursor: pointer;
  transition: color 0.3s ease;
}

.poem-reactions__msg-btn:hover {
  color: var(--gold-dim);
}

/* ---- Zoom button ---- */
.poem-zoom {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10,9,8,0.9);
  border: 1px solid var(--gold-dim);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.3s ease;
  z-index: 50;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.poem-zoom svg {
  width: 18px;
  height: 18px;
  color: var(--gold-dim);
  transition: color 0.3s ease;
}

.poem-zoom--visible {
  opacity: 1;
  transform: scale(1);
}

.poem-zoom:hover {
  border-color: var(--gold);
}

.poem-zoom:hover svg {
  color: var(--gold);
}

/* ---- Image eye button (mobile only, hidden on desktop) ---- */
.poem-eye {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 40px;
  height: 40px;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10,9,8,0.9);
  border: 1px solid var(--gold-dim);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.3s ease;
  z-index: 50;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.poem-eye svg {
  width: 16px;
  height: 16px;
  color: var(--gold-dim);
  transition: color 0.3s ease;
}

.poem-eye--visible {
  opacity: 1;
  transform: scale(1);
}

.poem-eye:hover {
  border-color: var(--gold);
}

.poem-eye:hover svg {
  color: var(--gold);
}

/* ---- Security Padlock (private poems) ---- */
.poem-padlock {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10,9,8,0.9);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.3s ease;
  z-index: 50;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.poem-padlock svg {
  width: 16px;
  height: 16px;
  color: var(--gold-dim);
  transition: color 0.3s ease;
}

.poem-padlock--visible {
  opacity: 1;
  transform: scale(1);
}

.poem-padlock:hover {
  border-color: var(--gold);
}

.poem-padlock:hover svg {
  color: var(--gold);
}

/* ---- Security Overlay ---- */
.security-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.security-overlay--visible {
  opacity: 1;
  visibility: visible;
}

.security-overlay__content {
  text-align: center;
  max-width: 400px;
}

.security-overlay__icon {
  width: 36px;
  height: 36px;
  color: var(--gold);
  margin-bottom: 24px;
}

.security-overlay__text {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
  letter-spacing: 0.02em;
}

/* ---- Popup ---- */
.poem-popup {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease, height 0.3s ease, top 0.3s ease;
}

.poem-popup--visible {
  opacity: 1;
  visibility: visible;
}

.poem-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.poem-popup__panel {
  position: relative;
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 2px;
  padding: 0;
  z-index: 1;
}

.poem-popup__close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--gold-dim);
  font-size: 1.8rem;
  font-weight: 200;
  cursor: pointer;
  transition: color 0.3s ease;
  z-index: 2;
  line-height: 1;
}

.poem-popup__close:hover {
  color: var(--gold);
}

.poem-popup__scroll {
  overflow-y: auto;
  padding: 40px 48px 32px;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
}

.poem-popup__scroll::-webkit-scrollbar { width: 4px; }
.poem-popup__scroll::-webkit-scrollbar-track { background: transparent; }
.poem-popup__scroll::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 2px; }

.poem-popup__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.6rem;
  color: var(--gold);
  text-align: center;
  margin-bottom: 32px;
}

.poem-popup__strophe {
  margin-bottom: 24px;
  text-align: center;
}

.poem-popup__verse {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text);
}

.poem-popup__verse::first-letter {
  text-transform: uppercase;
}

.poem-popup__sep {
  display: block;
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
  margin: 16px auto;
}

.poem-popup__author {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 0.95rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 24px;
}

.poem-popup__msg {
  padding: 20px 48px 32px;
  border-top: 1px solid rgba(201,168,76,0.08);
}

.poem-popup__msg-intro {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 1.1rem;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 24px;
}

/* Message-only popup (introspection mode) */
.poem-popup--message .poem-popup__scroll {
  display: none;
}

.poem-popup--message .poem-popup__panel {
  max-width: 520px;
  max-height: 60vh;
}

.poem-popup--message .poem-popup__msg {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-top: none;
  padding: 48px;
}

.poem-popup--message .message-form {
  width: 100%;
}

/* ---- Popup Zoom Mode (full viewport, auto-fit text) ---- */
.poem-popup--zoom .poem-popup__panel {
  width: 92vw;
  height: 88vh;
  max-width: none;
  max-height: none;
}

.poem-popup--zoom .poem-popup__scroll {
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.poem-popup--zoom .poem-popup__title {
  flex-shrink: 0;
  text-align: center;
  font-size: clamp(1.8rem, 4vh, 3.2rem);
}

.poem-popup--zoom .poem-popup__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  text-align: left;
  gap: var(--popup-strophe-gap, 16px);
  min-height: 0;
  overflow: hidden;
}

.poem-popup--zoom .poem-popup__strophe {
  margin-bottom: 0;
}

.poem-popup--zoom .poem-popup__verse {
  white-space: nowrap;
}

.poem-popup--zoom .poem-popup__sep {
  margin: 0 auto;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

.poem-popup--zoom .poem-popup__author {
  flex-shrink: 0;
  text-align: right;
}

/* ---- Strophes & Verses ---- */
.poem-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* `safe` : si le poeme deborde, l'alignement retombe sur le haut. Centre, le debordement se
     partage en haut ET en bas, et la part du haut est inatteignable au defilement. */
  justify-content: safe center;
  text-align: left;
  min-height: 0;
  overflow: hidden;
  gap: var(--strophe-gap, 6px);
}

.strophe {
  margin-bottom: 0;
  opacity: 0;
}

.strophe--visible {
  opacity: 1;
}

.verse {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.5s var(--ease-material);
}

.verse::first-letter {
  text-transform: uppercase;
}

.verse--visible {
  opacity: 1;
}

/* Typewriter cursor — elegant gold pulse */
.verse--typing::after {
  content: '';
  display: inline-block;
  width: 1.5px;
  height: 0.9em;
  background: var(--gold-dim);
  margin-left: 2px;
  vertical-align: baseline;
  animation: cursor-pulse 0.9s ease-in-out infinite;
}

@keyframes cursor-pulse {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.15; }
}

.poem-body--static .strophe { opacity: 1; }
.poem-body--static .verse { opacity: 1; transform: none; }
.poem-body--static .verse--typing::after { display: none; }

.strophe-separator {
  display: block;
  width: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
  margin: 0 auto;
  opacity: 0;
  transition: opacity 0.55s var(--ease-material);
}

.strophe-separator--visible {
  opacity: 1;
}

/* ---- Scenography Arrow ---- */
.sceno-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  position: fixed;
  bottom: 32px;
  left: 50%;
  margin-left: -24px;
  background: rgba(10,9,8,0.85);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s var(--ease-material), transform 0.4s var(--ease-material), border-color 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  z-index: 50;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.sceno-arrow--visible {
  opacity: 1;
  transform: translateY(0);
}

.sceno-arrow svg {
  width: 20px;
  height: 20px;
  color: var(--gold-dim);
  transition: color 0.3s ease;
}

.sceno-arrow:hover {
  border-color: var(--gold);
}

.sceno-arrow:hover svg {
  color: var(--gold);
}

.sceno-arrow:active {
  transform: scale(0.92);
}

@media (max-width: 640px) {
  .sceno-arrow {
    width: 44px;
    height: 44px;
    bottom: 24px;
    margin-left: -22px;
  }

  .sceno-arrow svg {
    width: 18px;
    height: 18px;
  }
}

/* ---- Cadenas (Lock) ---- */
.cadenas {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 32px 24px;
  background: linear-gradient(0deg, var(--bg) 60%, transparent);
  opacity: 0;
  transition: opacity 0.8s ease;
  z-index: 40;
}

.cadenas--visible {
  opacity: 1;
}

.cadenas--unlocked {
  opacity: 0;
  height: 0;
  overflow: hidden;
  padding: 0;
  transition: opacity 0.6s ease, height 0.4s ease 0.6s, padding 0.4s ease 0.6s;
}

.cadenas__icon {
  width: 32px;
  height: 32px;
  margin: 0 auto 20px;
  color: var(--gold-dim);
  animation: pulse 3s ease-in-out infinite;
}

.cadenas__text {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 1rem;
  color: var(--text-dim);
  margin-bottom: 28px;
}

.cadenas__input-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cadenas__input {
  background: transparent;
  border: 1px solid var(--gold-dim);
  border-radius: 1px;
  color: var(--gold);
  font-family: var(--ui);
  font-weight: 300;
  font-size: 1.1rem;
  letter-spacing: 0.4em;
  text-align: center;
  text-transform: uppercase;
  padding: 10px 16px;
  width: 180px;
  outline: none;
  transition: border-color 0.3s ease;
}

.cadenas__input:focus {
  border-color: var(--gold);
}

.cadenas__input::placeholder {
  color: var(--text-muted);
  letter-spacing: 0.2em;
  font-size: 0.85rem;
}

.cadenas__btn {
  background: transparent;
  border: 1px solid var(--gold-dim);
  border-radius: 1px;
  color: var(--gold-dim);
  font-family: var(--ui);
  font-weight: 300;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  padding: 10px 24px;
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.cadenas__btn:hover {
  color: var(--gold);
  border-color: var(--gold);
}

.cadenas__error {
  color: var(--bordeaux);
  font-family: var(--ui);
  font-weight: 300;
  font-size: 0.85rem;
  margin-top: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cadenas__error--visible {
  opacity: 1;
}

/* ---- Emotions & Messages ---- */
.reactions {
  max-width: 680px;
  margin: 80px auto 0;
  text-align: center;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.reactions--visible {
  opacity: 1;
}

.reactions__label {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 1rem;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.reactions__grid {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.reactions__btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 2px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.3s ease;
  padding: 0;
}

.reactions__btn svg {
  width: 24px;
  height: 24px;
  fill: var(--text-dim);
  transition: fill 0.3s ease;
}

.reactions__btn:hover {
  transform: scale(1.1);
  border-color: var(--gold-dim);
}

.reactions__btn:hover svg {
  fill: var(--gold);
}

.reactions__btn--active {
  border-color: var(--gold);
  transform: scale(1.1);
}

.reactions__btn--active svg {
  fill: var(--gold);
}

.reactions__separator {
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
  margin: 0 auto 40px;
}

.message-section {
  max-width: 400px;
  margin: 0 auto;
}

.message-toggle {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--ui);
  font-weight: 200;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.3s ease;
  display: block;
  margin: 0 auto;
}

.message-toggle:hover {
  color: var(--gold-dim);
}

.message-form {
  margin-top: 20px;
  display: none;
}

.message-form--visible {
  display: block;
}

.message-form__textarea {
  width: 100%;
  min-height: 100px;
  background: transparent;
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 1px;
  color: var(--text);
  font-family: var(--ui);
  font-weight: 200;
  font-size: 0.95rem;
  line-height: 1.6;
  padding: 14px;
  resize: vertical;
  outline: none;
  transition: border-color 0.3s ease;
  -webkit-user-select: text;
  user-select: text;
}

.message-form__textarea:focus {
  border-color: var(--gold-dim);
}

.message-form__textarea::placeholder {
  color: var(--text-muted);
}

.message-form__submit {
  background: transparent;
  border: 1px solid var(--gold-dim);
  border-radius: 1px;
  color: var(--gold-dim);
  font-family: var(--ui);
  font-weight: 300;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  padding: 8px 24px;
  cursor: pointer;
  margin-top: 12px;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.message-form__submit:hover {
  color: var(--gold);
  border-color: var(--gold);
}

.message-confirm {
  color: var(--gold-dim);
  font-family: var(--ui);
  font-weight: 300;
  font-size: 0.85rem;
  margin-top: 12px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.message-confirm--visible {
  opacity: 1;
}

/* ---- Loading Screen ---- */
.loading {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 1.2s ease;
}

.loading--hidden {
  opacity: 0;
  pointer-events: none;
}

.loading__padlock {
  width: 48px;
  height: 56px;
  color: var(--gold);
  animation: heartbeat 1.6s ease-in-out infinite;
}

.loading__text {
  margin-top: 16px;
  font-family: var(--serif);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  opacity: 0;
  animation: fadeIn 1s ease 0.4s forwards;
}

/* ---- Anti-screenshot Overlay ---- */
.screenshot-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.screenshot-overlay--active {
  opacity: 1;
  pointer-events: all;
}

.screenshot-overlay__text {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 1.2rem;
  color: var(--text-dim);
}

/* ---- Error States ---- */
.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
}

.error-page__icon {
  width: 32px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.error-page__text {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-bottom: 32px;
}

.error-page__link {
  font-family: var(--ui);
  font-weight: 200;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

/* ---- Footer ---- */
.footer {
  text-align: center;
  padding: 40px 24px;
  font-family: var(--ui);
  font-weight: 200;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ---- Print Protection ---- */
@media print {
  body * {
    visibility: hidden !important;
  }
  body::before {
    visibility: visible !important;
    content: 'Ce contenu est protege.';
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--serif);
    font-size: 1.2rem;
    color: var(--text-dim);
    background: var(--bg);
    opacity: 1;
    z-index: 999999;
  }
}

/* ---- Animations ---- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes imageReveal {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  15% { transform: scale(1.12); opacity: 1; }
  30% { transform: scale(1); opacity: 0.8; }
  45% { transform: scale(1.08); opacity: 0.95; }
  60% { transform: scale(1); opacity: 0.8; }
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .container {
    padding: 0 12px;
  }

  .hero {
    padding: 40px 16px;
  }

  .poem-page {
    height: 100vh;
    height: 100dvh;
    height: 100svh;
    justify-content: flex-start;
    align-items: stretch;
    overflow: hidden;
  }

  .poem-layout {
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    height: 100svh;
    position: relative;
  }

  /* Mobile: image as faded background */
  .poem-layout__image {
    position: absolute;
    inset: 0;
    max-width: none;
    max-height: none;
    padding: 0;
    z-index: 0;
    overflow: hidden;
  }

  .poem-layout__image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
      180deg,
      rgba(10,9,8,0.35) 0%,
      rgba(10,9,8,0.55) 40%,
      rgba(10,9,8,0.78) 70%,
      var(--bg) 100%
    );
    z-index: 1;
    transition: opacity 0.8s ease;
  }

  .poem-image {
    object-fit: cover;
    object-position: center top;
    border-radius: 0;
    filter: grayscale(0.15) contrast(1.15);
    opacity: 0;
  }

  .poem-image--visible {
    animation: none;
    opacity: 0.6;
    transform: none;
    transition: opacity 2s ease;
  }

  /* Hide separator on mobile (image is background now) */
  .poem-layout__separator {
    display: none !important;
    margin: 0 !important;
  }

  .poem-layout__text {
    position: relative;
    z-index: 2;
    padding: 20px 24px 24px;
    height: 100vh;
    height: 100dvh;
    height: 100svh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: opacity 0.6s ease;
  }

  /* Le corps prend la place restante entre l'en-tête et le pied : c'est cette hauteur que
     l'ajustement JS (ajusterMobile) remplit au plus juste — un poème long n'est plus coupé.
     Trop long même à 9 px : `.poem-body--defile` le laisse défiler, voile en bas comme repère. */
  .poem-body {
    flex: 1 1 auto;
    min-height: 0;
    justify-content: flex-start;
  }
  .poem-body--defile {
    overflow-y: auto;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 14px;
    -webkit-mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 26px), transparent 100%);
    mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 26px), transparent 100%);
  }

  .verse {
    white-space: normal;
    font-size: 12.5px;
    line-height: 1.55;
  }

  /* Mobile: titre a droite du cadenas (left:20 + 36 + 8 = 64px reserves) */
  .poem-header {
    margin-bottom: 8px;
    padding-left: 64px;
    min-height: 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .poem-title {
    font-size: clamp(1.2rem, 2.4vh, 1.7rem);
    margin: 0;
    line-height: 1.2;
  }

  /* Meta deplacee dans la signature (footer) sur mobile */
  .poem-meta {
    display: none !important;
  }

  /* Plus de ligne doree au-dessus de la signature, gain de place */
  .poem-signature__line {
    display: none !important;
  }

  .poem-back {
    bottom: 66px;
    left: 20px;
    width: 36px;
    height: 36px;
  }

  .poem-back svg {
    margin-top: 9px;
  }

  .poem-next {
    bottom: 66px;
    right: 20px;
    width: 36px;
    height: 36px;
  }

  .poem-next svg {
    margin-top: 9px;
  }

  /* Titre centré : la réserve du cadenas à gauche a sa jumelle à droite, sinon le titre décale. */
  body.poem-align--center .poem-header {
    padding-right: 64px;
  }

  .poem-zoom {
    bottom: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
  }

  .poem-zoom svg {
    width: 16px;
    height: 16px;
  }

  /* Image admire button (mobile only) */
  .poem-eye {
    bottom: 20px;
    left: 20px;
    width: 36px;
    height: 36px;
  }

  .poem-eye svg {
    width: 16px;
    height: 16px;
  }

  .poem-eye--visible {
    opacity: 1;
    transform: scale(1);
  }

  /* Security padlock: top left on mobile */
  .poem-padlock {
    top: 20px;
    right: auto;
    left: 20px;
    width: 36px;
    height: 36px;
  }

  .poem-padlock svg {
    width: 14px;
    height: 14px;
  }

  /* Mobile: tout en flow, viewport-fit (autoFit JS shrink le body).
     Footer pousse en bas du viewport. Reactions en grille:
     ligne1 = row icones, ligne2 = msg-btn (gauche) + share-btn (droite) */
  .poem-footer {
    margin-top: auto;
  }

  .poem-reactions {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "row row"
      "msg share";
    gap: 10px 8px;
    align-items: center;
    justify-items: center;
    min-height: 100px;
  }

  .poem-reactions__row {
    grid-area: row;
    margin-bottom: 0;
    max-width: calc(100vw - 120px);
  }

  .poem-reactions__msg-btn {
    grid-area: msg;
    justify-self: end;
    margin-top: 0;
    font-size: 0.78rem;
    margin-right: 4px;
  }

  .poem-reactions__share-btn {
    grid-area: share;
    justify-self: start;
    margin-top: 0;
    padding: 5px 14px;
    font-size: 0.78rem;
    margin-left: 4px;
  }

  /* Image admire mode — full image, text hidden */
  .poem-layout--image-mode .poem-layout__text {
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
  }

  .poem-layout--image-mode .poem-layout__image::after {
    opacity: 0.2;
    transition: opacity 0.8s ease;
  }

  .poem-layout--image-mode .poem-image--visible {
    opacity: 1 !important;
    filter: grayscale(0) contrast(1);
    transition: opacity 0.8s ease, filter 0.8s ease;
  }

  .poem-layout--image-mode .poem-zoom,
  .poem-layout--image-mode .sceno-arrow {
    opacity: 0;
    pointer-events: none;
  }

  .poem-popup__panel {
    width: 95%;
    max-height: 90vh;
  }

  /* Zoom: full-screen reader mode
     scroll container keeps flex:1 (fills panel) but display:block inside
     so title/body/author flow naturally and scroll when content exceeds */
  .poem-popup--zoom .poem-popup__panel {
    width: 100vw;
    height: 100vh;
    height: 100svh;
    border: none;
    border-radius: 0;
  }

  .poem-popup--zoom .poem-popup__scroll {
    display: block;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* `pinch-zoom` en plus du défilement : quelqu'un qui a écarté les doigts pour
       arriver ici doit pouvoir continuer à agrandir (Pierre 04/08). */
    touch-action: pan-y pinch-zoom;
    padding: 48px 24px 40px;
  }

  .poem-popup--zoom .poem-popup__title {
    font-size: clamp(1.4rem, 5vw, 2rem);
    text-align: center;
    margin-bottom: 24px;
  }

  .poem-popup--zoom .poem-popup__body {
    overflow: visible;
    justify-content: flex-start;
    text-align: center;
    gap: 24px;
    min-height: auto;
  }

  .poem-popup--zoom .poem-popup__verse {
    white-space: normal;
    font-size: clamp(1rem, 4.2vw, 1.25rem);
    line-height: 1.9;
  }

  .poem-popup--zoom .poem-popup__strophe {
    text-align: center;
  }

  .poem-popup--zoom .poem-popup__sep {
    margin: 4px auto;
  }

  .poem-popup--zoom .poem-popup__author {
    text-align: center;
    margin-top: 28px;
  }

  .poem-popup__scroll {
    padding: 32px 24px 24px;
  }

  .poem-popup__msg {
    padding: 16px 24px 24px;
  }

  /* Message popup: full-width on mobile, scrollable for keyboard */
  .poem-popup--message .poem-popup__panel {
    max-height: 100%;
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    border: none;
  }

  .poem-popup--message .poem-popup__msg {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .poem-reactions__btn {
    width: 32px;
    height: 32px;
  }

  .poem-reactions__btn svg {
    width: 16px;
    height: 16px;
  }

  .poems-section {
    padding: 60px 16px 80px;
  }

  .reactions__grid {
    gap: 12px;
  }

  .reactions__btn {
    width: 44px;
    height: 44px;
  }

  .cadenas__input-wrap {
    flex-direction: column;
    gap: 10px;
  }

  .cadenas__input {
    width: 160px;
  }
}

/* ---- Landscape phone: keep desktop layout, body scrolls between pinned header/footer ---- */
@media (orientation: landscape) and (max-height: 500px) {
  .poem-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
  }

  .poem-popup--zoom .poem-popup__body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
  }
}

/* ---- Selection prevention (private pages) ---- */
.no-select {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.no-select .poem-image {
  pointer-events: none;
  -webkit-touch-callout: none;
}

/* ============================================
   BURN EFFECTS
   ============================================ */

/* SVG filter for realistic flame distortion (injected by JS) */

/* Verse burning: glow → flame → fade in place (NO movement) */
.verse--burning {
  animation: verse-burn 2s ease-in forwards;
  filter: url(#flame-distort);
}

@keyframes verse-burn {
  0% {
    opacity: 1;
    color: var(--text);
    text-shadow: none;
  }
  15% {
    color: #f0c050;
    text-shadow:
      0 -2px 4px rgba(255,180,50,0.7),
      0 -4px 10px rgba(255,100,20,0.5),
      0 -6px 16px rgba(200,40,10,0.3);
  }
  40% {
    color: #e06020;
    text-shadow:
      0 -3px 6px rgba(255,120,30,0.6),
      0 -8px 20px rgba(200,40,0,0.4);
    opacity: 0.8;
  }
  70% {
    color: #801008;
    text-shadow: 0 -2px 8px rgba(180,30,0,0.3);
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    color: #200404;
    text-shadow: none;
  }
}

/* Strophe separator burning — fade in place */
.strophe-separator--burning {
  animation: sep-burn 0.6s ease-in forwards;
}

@keyframes sep-burn {
  0% { opacity: 1; }
  40% { opacity: 0.4; background: #c04010; }
  100% { opacity: 0; }
}

/* Full page burn overlay (timer-based burn after reading) */
.burn-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 100%, rgba(200,80,20,0.6) 0%, rgba(40,10,5,0.9) 50%, rgba(10,9,8,1) 100%);
  transition: opacity 2s ease-in;
}

.burn-overlay--active {
  pointer-events: all;
  opacity: 1;
}

/* Image survives the burn — stays visible */
.poem-layout--burned .poem-layout__text {
  opacity: 0;
  transition: opacity 1.5s ease-in;
}

.poem-layout--burned .poem-layout__separator {
  opacity: 0;
  transition: opacity 1s ease-in;
}

/* Burn timer indicator (subtle ember glow at bottom) */
.burn-timer {
  position: fixed;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #c04010, #e8a040);
  z-index: 9997;
  width: 0%;
  transition: width linear;
}

/* ---- Accessibility: Focus visible ---- */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---- Accessibility: Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Contrast fix: text-muted on small text ---- */
.poem-back,
.poem-back a {
  color: var(--text-dim);
}

/* ---- Reading progress ---- */
.reading-progress {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 100;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  opacity: 0.6;
  transition: opacity 0.3s;
  pointer-events: none;
}

/* ---- Share button ---- */
.poem-reactions__share-btn {
  background: none;
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 6px 16px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.85rem;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: background 0.2s, color 0.2s;
  margin-top: 8px;
}
.poem-reactions__share-btn:hover {
  background: var(--gold);
  color: var(--bg);
}

/* ---- Bas de page sur ORDINATEUR ---------------------------------------------
   Ne s'applique qu'au-delà de 640 px : sur téléphone le bas de page est une grille
   à zones nommées qui fonctionne, et Pierre a demandé de ne pas y toucher (04/08).

   Deux défauts corrigés ici :
   1. « Lui écrire un mot » et « Partager » étaient deux boutons en ligne libres dans
      un bloc simplement centré par le texte — collés l'un à l'autre, sans espace, et
      décalés verticalement par un `margin-top: 8px` posé sur le seul « Partager ».
   2. « Lui écrire un mot » n'avait ni bordure ni fond : à côté d'un vrai bouton
      cerclé d'or, il se lisait comme une légende, pas comme une action.

   Ce bloc DOIT rester après `.poem-reactions__share-btn` : à spécificité égale c'est
   la dernière règle qui gagne, et le `margin-top: 8px` y est redéclaré. Placé avant,
   la remise à zéro ne servait à rien. */
@media (min-width: 641px) {
  .poem-reactions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px 14px;
  }

  /* la rangée d'icônes occupe sa propre ligne, les deux actions se centrent dessous */
  .poem-reactions__row {
    flex-basis: 100%;
    margin-bottom: 0;
  }

  .poem-reactions__msg-btn,
  .poem-reactions__share-btn {
    margin-top: 0;
  }

  /* même famille visuelle que « Partager », un ton en dessous : l'action principale
     reste le partage, mais écrire à l'auteur se voit enfin comme un bouton. */
  .poem-reactions__msg-btn {
    border: 1px solid rgba(201, 168, 76, 0.35);
    padding: 6px 16px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    transition: border-color 0.2s, color 0.2s;
  }

  .poem-reactions__msg-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
  }
}


/* ---- Gallery empty state ---- */
.gal-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}
