/* PASSAGE — habillage de la carte (voeux-interactifs.fr) */
@font-face { font-family: 'Instrument Serif'; src: url('fonts/instrument-serif-latin.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('fonts/instrument-serif-italique-latin.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Lexend'; src: url('fonts/lexend-latin-var.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0b1118; overflow: hidden; }
body { font-family: Lexend, system-ui, sans-serif; color: #fff; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.pa { position: fixed; inset: 0; overflow: hidden; --ease: cubic-bezier(.22, .7, .2, 1); --bar: 0px; }
.pa-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 2.2s ease .15s; }
.is-ready .pa-canvas { opacity: 1; }
.is-over .pa-canvas { cursor: pointer; }
.pa-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* secours sans WebGL : un ciel qui change avec les trois scènes */
.pa-fallback { display: none; position: absolute; inset: 0; transition: filter 3s; --k: var(--pa-k, 0);
  background: linear-gradient(180deg, #5a90c2 0%, #f3dcc2 58%, #6f8f3a 58.2%, #2c4a1a 100%); filter: hue-rotate(calc(var(--k) * -18deg)) brightness(calc(1 + var(--k) * .06)); }
.pa--nogl .pa-fallback { display: block; }
.pa--nogl .pa-canvas { display: none; }

/* ─── textes du voyage ─── */
.pa-say { position: absolute; left: 50%; z-index: 3; top: calc(var(--bar) + 11vh); width: min(92vw, 1040px); margin: 0; transform: translateX(-50%);
  text-align: center; pointer-events: none; font: 400 clamp(30px, 4.5vw, 66px)/1.12 'Instrument Serif', Georgia, serif; letter-spacing: .005em;
  text-shadow: 0 2px 30px rgba(10, 30, 60, .5), 0 1px 3px rgba(10, 30, 60, .35); text-wrap: balance; }
.pa-say[data-place="center"] { top: 50%; transform: translate(-50%, -50%); }
.pa-w { display: inline-block; opacity: 0; filter: blur(10px); transform: translateY(.35em);
  transition: opacity 1.2s var(--ease), filter 1.4s var(--ease), transform 1.5s var(--ease); transition-delay: calc(var(--i) * 120ms + 500ms); }
.pa-say.is-in .pa-w, .is-final .pa-final__wish .pa-w { opacity: 1; filter: blur(0); transform: none; }
.pa-say:not(.is-in) .pa-w { transition-duration: 1s; transition-delay: calc(var(--i) * 40ms); }

/* ─── invitation à cliquer la porte ─── */
.pa-hint { position: absolute; z-index: 4; left: 50%; bottom: calc(var(--bar) + max(5vh, 22px)); transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 22px 0 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .42); background: rgba(20, 34, 30, .26); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: 13px; font-weight: 400; letter-spacing: .2em; text-transform: uppercase; color: rgba(255, 255, 255, .94); white-space: nowrap;
  opacity: 0; animation: paIn 1.6s var(--ease) 2.4s forwards; transition: background .35s, border-color .35s; }
.pa-hint:hover, .pa-hint:focus-visible, .is-over .pa-hint { background: rgba(255, 236, 190, .22); border-color: rgba(255, 240, 205, .9); }
.pa-hint:focus-visible, .pa-icon:focus-visible, .pa-skip:focus-visible, .pa-btn:focus-visible { outline: 2px solid #ffe7b5; outline-offset: 3px; }
.pa-hint i { position: relative; width: 10px; height: 10px; border-radius: 50%; background: #ffe2a6; box-shadow: 0 0 12px 2px rgba(255, 220, 150, .8); }
.pa-hint i::after { content: ''; position: absolute; inset: -7px; border-radius: 50%; border: 1px solid rgba(255, 226, 166, .8); animation: paPing 2.4s ease-out infinite; }
@keyframes paPing { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.9); opacity: 0; } }
@keyframes paIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ─── commandes discrètes ─── */
.pa-icon { position: absolute; top: calc(var(--bar) + max(16px, env(safe-area-inset-top))); right: max(16px, env(safe-area-inset-right)); z-index: 5;
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .34); background: rgba(10, 24, 36, .22); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background .3s, border-color .3s; }
.pa-icon:hover, .pa-icon:focus-visible { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .7); }
.pa-icon svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pa-icon svg path:first-child { fill: #fff; stroke: none; }
.pa-sound[aria-pressed="true"] .off, .pa-sound[aria-pressed="false"] .on { display: none; }
.pa-skip { position: absolute; z-index: 5; right: max(18px, env(safe-area-inset-right)); bottom: calc(var(--bar) + max(18px, env(safe-area-inset-bottom)));
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .3); background: rgba(10, 24, 36, .2); color: rgba(255, 255, 255, .85); font-size: 13px; letter-spacing: .06em;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: color .3s, border-color .3s, background .3s; animation: paFade 1s 3s both; }
.pa-skip svg { width: 14px; height: 14px; fill: currentColor; }
.pa-skip:hover, .pa-skip:focus-visible { color: #fff; border-color: rgba(255, 255, 255, .7); background: rgba(255, 255, 255, .14); }
@keyframes paFade { from { opacity: 0; } }

/* ─── écran final ─── */
.pa-final { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: calc(var(--bar) + 10vh) 24px calc(var(--bar) + 8vh); pointer-events: none;
  background: linear-gradient(180deg, rgba(24, 30, 52, .42), rgba(24, 30, 52, .14) 34%, transparent 52%, transparent 70%, rgba(20, 16, 10, .34)); }
.pa-final > * { pointer-events: auto; }
.pa-final__wish { margin: 0; max-width: min(92vw, 1080px); font: 400 clamp(32px, 4.9vw, 72px)/1.1 'Instrument Serif', Georgia, serif; letter-spacing: .005em; text-wrap: balance;
  text-shadow: 0 2px 34px rgba(30, 24, 40, .55), 0 1px 3px rgba(30, 24, 40, .4); }
.pa-final__wish .pa-w { transition-duration: 1.5s, 1.7s, 1.8s; transition-delay: calc(var(--i) * 150ms + 300ms); }
.pa-final__logo { margin-top: auto; }
.pa-final__actions { margin-top: 2.6vh; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.pa-credit { margin: 2vh 0 0; font-size: 11.5px; letter-spacing: .05em; color: rgba(255, 255, 255, .82); text-shadow: 0 1px 8px rgba(30, 20, 10, .7); }
.pa-credit a { color: inherit; text-decoration: none; }
.pa-credit a:hover { text-decoration: underline; }
.pa-final__logo, .pa-final__actions, .pa-credit { opacity: 0; transform: translateY(14px); transition: opacity 1.6s var(--ease), transform 1.8s var(--ease); }
.is-final .pa-final__logo, .is-final .pa-final__actions, .is-final .pa-credit { opacity: 1; transform: none; }
.is-final .pa-final__logo { transition-delay: 2.6s; } .is-final .pa-final__actions { transition-delay: 3.1s; } .is-final .pa-credit { transition-delay: 3.5s; }

.pa-btn { display: inline-flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 22px 0 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .6); background: rgba(40, 30, 16, .26); color: #fff; font-size: 14px; font-weight: 500; letter-spacing: .03em; text-decoration: none;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: background .35s, border-color .35s, transform .35s var(--ease); }
.pa-btn svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pa-btn:hover, .pa-btn:focus-visible { background: rgba(255, 240, 210, .24); border-color: #fff; transform: translateY(-1px); }

.pa-logo { --logo-h: 46px; color: #fff; filter: drop-shadow(0 1px 10px rgba(30, 20, 10, .5)); }
.pa-logo svg, .pa-logo img { height: var(--logo-h); width: auto; display: block; }
.pa-logo a { display: block; }
@media (min-width: 1000px) and (min-height: 700px) { .pa-logo svg, .pa-logo img { height: calc(var(--logo-h) * 1.3); } }
.pa-noscript { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; font: 400 32px/1.2 'Instrument Serif', serif; }

@media (max-width: 640px) {
  .pa-say { top: 12vh; }
  .pa-final { padding-top: 11vh; }
  .pa-final__actions { flex-direction: column; align-items: center; }
  .pa-hint { letter-spacing: .14em; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .pa-w, .pa-final > * { transition-duration: .01s !important; transition-delay: 0s !important; filter: none !important; transform: none !important; }
  .pa-hint i::after { animation: none; }
}
