/* =========================================================
   LARHANTEC · Allauch v4 · Dispositif trois actes
   Hérite charte larhantec.fr (crème / noir chaud / or sourd).
   ========================================================= */

.dispositif-body {
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
}

.dispositif-stage {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  transition: transform 420ms var(--ease-out), opacity 280ms var(--ease-soft);
  will-change: transform, opacity;
}
.dispositif-stage.slide-out-left  { transform: translateX(-18%); opacity: 0; }
.dispositif-stage.slide-out-right { transform: translateX(18%);  opacity: 0; }
.dispositif-stage.slide-in-from-right {
  transform: translateX(18%); opacity: 0;
  transition: none;
}
.dispositif-stage.slide-in-from-left {
  transform: translateX(-18%); opacity: 0;
  transition: none;
}

/* Header minimal */
.dispositif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
  z-index: 50;
}
.dispositif-header .header-back {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--ink);
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dispositif-header .page-counter {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.16em;
  color: var(--gold);
  text-transform: lowercase;
}

/* Actes superposés */
.acte {
  position: absolute;
  inset: 64px 0 0 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  background: var(--bg);
  transition: opacity 800ms var(--ease-soft), visibility 0s linear 800ms;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.acte.is-visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition: opacity 800ms var(--ease-soft), visibility 0s linear 0s;
}

/* === ACTE 0 - Entrée tactile === */
.acte-0 {
  align-items: center;
  justify-content: center;
  padding: 24px 22px 32px;
  gap: 22px;
}
.acte0-visual {
  flex: 0 1 auto;
  max-width: 70vw;
  max-height: 44vh;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.04),
    0 20px 50px rgba(10,9,6,0.18),
    0 40px 90px rgba(10,9,6,0.08);
  background: #fff;
}
.acte0-visual img {
  max-width: 100%;
  max-height: 44vh;
  object-fit: contain;
  display: block;
}
.acte0-title {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: var(--ink);
  margin: 0;
  text-align: center;
}
.acte0-tagline {
  font-family: var(--font-expr);
  font-style: italic;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
  text-align: center;
  max-width: 320px;
}
.acte0-tagline .tag-rule {
  display: block;
  width: 28px; height: 1px;
  background: var(--gold);
  margin: 14px auto 14px;
}
.acte0-start {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.22em;
  text-transform: lowercase;
  color: var(--bg);
  background: var(--ink);
  border: 1px solid var(--ink);
  padding: 18px 32px;
  cursor: pointer;
  border-radius: 0;
  margin-top: 6px;
  position: relative;
}
.acte0-start::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 1px;
  background: var(--gold);
  opacity: 0;
  animation: pulseUnderline 2.6s ease-in-out infinite;
}
@keyframes pulseUnderline {
  0%, 100% { opacity: 0; width: 12px; }
  50% { opacity: 1; width: 28px; }
}

/* === ACTE II - Contemplation === */
.acte-2 {
  align-items: center;
  justify-content: flex-start;
  padding: 20px 22px 40px;
  gap: 14px;
  overflow-y: auto;
}
.acte2-title {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  color: var(--ink);
  margin: 4px 0 0;
  text-align: center;
}
.acte2-source {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  color: var(--gold);
  margin: 0;
  text-align: center;
  max-width: 90vw;
}
.acte2-collab {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 300;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--ink-soft, #3a3633);
  margin: 2px 0 4px;
  text-align: center;
  max-width: 90vw;
}
.acte2-visual {
  flex: 0 0 auto;
  width: 100%;
  max-width: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 6px 0;
}
.acte2-visual img {
  max-width: 100%;
  max-height: 38vh;
  object-fit: contain;
  display: block;
  background: #fff;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.04),
    0 16px 36px rgba(10,9,6,0.14);
}
.acte2-text {
  width: 100%;
  max-width: 560px;
  padding: 0 4px;
}
.acte2-text p {
  font-family: var(--font-expr);
  font-style: italic;
  font-weight: 400;
  font-size: 20px;
  line-height: 1.65;
  color: var(--ink);
  margin: 0 auto;
  text-align: center;
  text-wrap: balance;
  opacity: 0;
  animation: fadeInText 800ms var(--ease-soft) forwards 200ms;
}
@keyframes fadeInText {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Lecteur audio minimal - apparaît en acte 2 */
.acte2-player {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 420px;
  margin: 4px auto 0;
  padding: 12px 16px;
  border: 1px solid var(--rule-strong);
  background: rgba(255,255,255,0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0.6;
  transition: opacity 400ms var(--ease-soft);
  user-select: none;
}
.acte2-player.ready { opacity: 1; }
.acte2-player-btn {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 220ms var(--ease-soft), color 220ms var(--ease-soft);
  padding: 0;
}
.acte2-player-btn:hover,
.acte2-player.is-playing .acte2-player-btn {
  background: var(--ink);
  color: var(--bg);
}
.acte2-player-btn svg {
  width: 12px; height: 12px;
  fill: currentColor;
  display: block;
  margin-left: 2px;
}
.acte2-player-btn .icon-pause { display: none; margin-left: 0; }
.acte2-player.is-playing .icon-play { display: none; }
.acte2-player.is-playing .icon-pause { display: block; }
.acte2-player-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.acte2-player-label {
  /* Affiche le titre du morceau lu (champ music_source) - mai 2026 */
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 300;
  font-size: 15px;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
}
.acte2-player-progress {
  height: 2px;
  background: var(--rule);
  position: relative;
  overflow: hidden;
}
.acte2-player-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: var(--gold);
  transition: width 0.5s linear;
}

/* === ACTE III - Dépôt === */
.acte-3 {
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  gap: 18px;
}
.acte3-question {
  font-family: var(--font-expr);
  font-style: italic;
  font-size: 26px;
  font-weight: 400;
  color: var(--ink);
  text-align: center;
  margin: 0 0 12px 0;
  max-width: 420px;
}
.acte3-form {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.acte3-form textarea {
  width: 100%;
  background: rgba(255,255,255,0.5);
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  padding: 16px 18px;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  resize: none;
  outline: none;
  transition: border-color 200ms;
}
.acte3-form textarea::placeholder {
  color: var(--muted-faint);
  font-family: var(--font-expr);
  font-style: italic;
}
.acte3-form textarea:focus { border-color: var(--ink); }
.acte3-actions {
  display: flex;
  gap: 10px;
}
.acte3-actions .btn-secondary,
.acte3-actions .btn-primary {
  flex: 1;
  padding: 16px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 200ms, color 200ms;
}
.acte3-actions .btn-primary { background: var(--ink); color: var(--bg); }
.acte3-actions .btn-secondary:hover,
.acte3-actions .btn-secondary:active { background: var(--ink); color: var(--bg); }
.acte3-rgpd {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  margin: 4px 0 0 0;
  text-align: center;
}
.acte3-thanks {
  text-align: center;
  max-width: 380px;
  animation: fadeInText 600ms var(--ease-soft) forwards;
}
.thanks-headline {
  font-family: var(--font-expr);
  font-style: italic;
  font-size: 34px;
  color: var(--ink);
  margin: 0 0 14px 0;
}
.thanks-sub {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
}
.thanks-prelude {
  font-family: var(--font-expr);
  font-style: italic;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.55;
  color: var(--muted);
  margin: 32px 0 0 0;
  text-align: center;
}

/* Indicateur transition acte 2 → 3 (signal subtil avant fade) */
.acte-2.is-fading-out .acte2-text p,
.acte-2.is-fading-out .acte2-source {
  opacity: 0.35;
  transition: opacity 1200ms var(--ease-soft);
}

/* Navigation pied de page - toujours visible, sobre */
.dispositif-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
  background: rgba(241, 235, 224, 0.88);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-top: 1px solid var(--rule);
  z-index: 200;
  opacity: 1;
  pointer-events: auto;
}
.dispositif-nav .nav-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  transition: color 200ms var(--ease-soft), transform 200ms var(--ease-soft);
  min-width: 44px;
  min-height: 44px;
}
.dispositif-nav .nav-btn .nav-arrow {
  font-size: 18px;
  line-height: 1;
  display: inline-block;
}
.dispositif-nav .nav-btn .nav-label {
  max-width: 28vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dispositif-nav .nav-btn[data-nav="prev"]:active { transform: translateX(-3px); }
.dispositif-nav .nav-btn[data-nav="next"]:active { transform: translateX(3px); }
.dispositif-nav .nav-btn:hover { color: var(--gold); }
.dispositif-nav .nav-end {
  color: var(--gold);
  font-size: 16px;
  line-height: 1;
  padding: 8px 12px;
}
.dispositif-nav .nav-end:hover { color: var(--rust); }

/* Cacher labels sur très petits écrans */
@media (max-width: 360px) {
  .dispositif-nav .nav-btn .nav-label { display: none; }
}

/* YouTube hidden */
#yt-hidden {
  position: fixed;
  width: 200px; height: 200px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  left: -9999px;
  top: 0;
}
#yt-hidden iframe {
  width: 200px; height: 200px;
}

/* Tablette+ */
@media (min-width: 760px) {
  .acte2-text p { font-size: 21px; }
  .acte3-question { font-size: 28px; }
  .acte0-title { font-size: 20px; }
}

/* Kiosque : pas de sélection sauf inputs */
.dispositif-body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.dispositif-body textarea, .dispositif-body input { -webkit-user-select: text; user-select: text; }

/* === ARCHIVE / MENTIONS / SALLE === */
.archive-body, .mentions-body {
  overflow: auto;
  height: auto;
  min-height: 100vh;
  background: var(--bg);
}
.archive-wrap, .mentions-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px 60px;
}
.archive-main { padding: 40px 0; }
.archive-lead {
  font-family: var(--font-expr);
  font-style: italic;
  font-size: 22px;
  color: var(--ink);
  margin: 0 0 30px 0;
  text-align: center;
}
.archive-question {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: var(--gold);
  margin: 0 0 18px 0;
  text-align: center;
}
.archive-form input[type=email] {
  width: 100%;
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  color: var(--ink);
  outline: none;
  margin-bottom: 16px;
}
.archive-form input[type=email]:focus { border-color: var(--ink); }
.archive-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 20px;
}
.archive-consent input { margin-top: 3px; flex-shrink: 0; }
.archive-consent a { color: var(--ink); text-decoration: underline; }
.archive-actions {
  display: flex; gap: 10px;
}
.archive-actions .btn-secondary,
.archive-actions .btn-primary {
  flex: 1;
  padding: 13px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.archive-actions .btn-primary { background: var(--ink); color: var(--bg); }
.archive-thanks {
  text-align: center;
  padding: 40px 0;
}
.archive-error {
  background: rgba(139, 69, 19, 0.06);
  border: 1px solid rgba(139, 69, 19, 0.25);
  padding: 14px;
  margin-bottom: 16px;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 13px;
  color: var(--rust);
}
.archive-foot {
  border-top: 1px solid var(--rule);
  padding: 20px 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-align: center;
  text-transform: lowercase;
}
.archive-foot a { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Mentions */
.mentions-main h1 {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.20em;
  text-transform: lowercase;
  color: var(--ink);
  margin: 40px 0 24px;
}
.mentions-main h2 {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: var(--gold);
  margin: 28px 0 10px;
}
.mentions-main p, .mentions-main ul {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
}
.mentions-main ul { padding-left: 20px; }
.mentions-main li { margin-bottom: 6px; }
.mentions-back { margin-top: 40px; }
.mentions-back a { color: var(--ink); text-decoration: underline; }

/* Salle (écran public, contraste fort) */
.salle-body {
  background: #0a0906;
  color: #f5e6d3;
  overflow: hidden;
  height: 100vh;
}
.salle-stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8vh 10vw;
}
.salle-waiting, .salle-rotation {
  max-width: 70vw;
  text-align: center;
}
.salle-date {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 80px);
  letter-spacing: 0.22em;
  text-transform: lowercase;
  margin: 0 0 24px 0;
  color: #f5e6d3;
}
.salle-msg {
  font-family: var(--font-expr);
  font-style: italic;
  font-size: clamp(20px, 2.4vw, 32px);
  line-height: 1.5;
  color: rgba(245,230,211,0.7);
  margin: 0;
}
.salle-fragment {
  font-family: var(--font-expr);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(28px, 4vw, 56px);
  line-height: 1.5;
  color: #f5e6d3;
  margin: 0 0 40px 0;
  opacity: 0;
  transition: opacity 800ms var(--ease-soft);
}
.salle-source {
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.1vw, 14px);
  letter-spacing: 0.24em;
  text-transform: lowercase;
  color: var(--gold);
  margin: 0;
  opacity: 0;
  transition: opacity 800ms var(--ease-soft);
}

/* Lien edition discret sous le merci de l'acte 3 - ajoute le 29 mai 2026 */
.thanks-edition {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding: 15px 28px 16px;
  border: 1px solid rgba(10, 9, 6, 0.45);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: var(--ink);
  text-decoration: none;
  background: transparent;
  transition: background 280ms var(--ease-soft), border-color 280ms var(--ease-soft), color 280ms var(--ease-soft);
}
.thanks-edition:hover,
.thanks-edition:focus-visible {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.thanks-edition-arrow {
  font-family: var(--font-body);
  font-size: 18px;
  transform: translateY(-1px);
}
@media (max-width: 480px) {
  .thanks-edition {
    margin-top: 22px;
    font-size: 14px;
    padding: 16px 26px 17px;
  }
}
