/* VOILE — « Levons le voile sur 2027 » : 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: #171719; overflow: hidden; overscroll-behavior: none; }
body { font-family: Lexend, system-ui, sans-serif; color: #fff; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.vo { position: fixed; inset: 0; overflow: hidden; --ease: cubic-bezier(.22, .7, .2, 1); --gold: #e9d3a8; --vo-bg: #171719; --vo-vig: .42; --fg: #f6efe2; --shade: rgba(0, 0, 0, .6); -webkit-user-select: none; user-select: none; }
.vo-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 2.4s ease .1s; touch-action: none; cursor: grab; -webkit-tap-highlight-color: transparent; }
.is-ready .vo-canvas { opacity: 1; }
.is-grab .vo-canvas { cursor: grabbing; }
.vo[data-state="wishes"] .vo-canvas { cursor: default; }
.vo-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 46%, transparent 42%, rgba(0, 0, 0, var(--vo-vig)) 100%); }
.vo-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* attente : le drap se pose */
.vo-loader { pointer-events: none; position: absolute; left: 50%; top: 50%; width: 120px; height: 1px; margin-left: -60px; background: rgba(255, 255, 255, .12); overflow: hidden; transition: opacity .6s; }
.vo-loader i { position: absolute; inset: 0; background: var(--gold); transform: translateX(-100%); animation: voLoad 1.6s var(--ease) infinite; }
.is-ready .vo-loader, .vo--nogl .vo-loader { opacity: 0; }
@keyframes voLoad { to { transform: translateX(100%); } }

/* ─── textes des scènes ─── */
.vo-say { position: absolute; left: 50%; z-index: 3; top: max(9vh, 40px); width: min(92vw, 1040px); margin: 0; transform: translateX(-50%);
  text-align: center; pointer-events: none; font: 400 clamp(28px, 4.2vw, 62px)/1.12 'Instrument Serif', Georgia, serif; letter-spacing: .005em;
  color: var(--fg); text-shadow: 0 2px 30px var(--shade); text-wrap: balance; }
.vo-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 + 400ms); }
.vo-say.is-in .vo-w, .is-final .vo-final__wish .vo-w { opacity: 1; filter: blur(0); transform: none; }
.vo-say:not(.is-in) .vo-w { transition-duration: .9s; transition-delay: calc(var(--i) * 35ms); }

/* ─── invitation ─── */
.vo-hint { position: absolute; z-index: 4; left: 50%; bottom: max(5.5vh, 24px); transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 24px 0 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(233, 211, 168, .38); background: rgba(12, 12, 14, .42); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: 12.5px; font-weight: 400; letter-spacing: .22em; text-transform: uppercase; color: rgba(246, 239, 226, .92); white-space: nowrap;
  opacity: 0; transition: opacity 1.4s var(--ease), background .35s, border-color .35s; }
.is-ready .vo-hint { opacity: 1; transition-delay: 2.2s, 0s, 0s; }
.vo-hint.is-off, .is-final .vo-hint { opacity: 0 !important; pointer-events: none; transition-delay: 0s; }
.vo-hint:hover, .vo-hint:focus-visible { background: rgba(233, 211, 168, .16); border-color: rgba(233, 211, 168, .9); }
.vo-hint:focus-visible, .vo-icon:focus-visible, .vo-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.vo-hint svg { width: 20px; height: 20px; fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; animation: voSwipe 2.6s var(--ease) infinite; }
@keyframes voSwipe { 0%, 100% { transform: translateX(-4px); } 50% { transform: translateX(5px); } }

/* aide gestuelle : une main fantôme saisit le drap et le tire */
.vo-help { position: absolute; z-index: 2; left: 50%; top: 52%; width: 0; height: 0; pointer-events: none; opacity: 0; transition: opacity .8s; }
.is-help .vo-help { opacity: 1; }
.vo-help i { position: absolute; left: -17px; top: -17px; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .85);
  background: rgba(255, 255, 255, .16); box-shadow: 0 0 22px rgba(255, 244, 220, .4); }
.is-help .vo-help i { animation: voHelp 3.2s var(--ease) infinite; }
@keyframes voHelp {
  0% { transform: translate(-6vw, -4vh) scale(1.5); opacity: 0; }
  14% { transform: translate(-6vw, -4vh) scale(1); opacity: 1; }
  70% { transform: translate(12vw, 16vh) scale(1); opacity: 1; }
  100% { transform: translate(15vw, 19vh) scale(1.3); opacity: 0; }
}

/* ─── commandes discrètes ─── */
.vo-icon { position: absolute; top: 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, .28); background: rgba(12, 12, 14, .35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background .3s, border-color .3s; }
.vo-icon:hover, .vo-icon:focus-visible { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .7); }
.vo-icon svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.vo-icon svg path:first-child { fill: #fff; stroke: none; }
.vo-sound[aria-pressed="true"] .off, .vo-sound[aria-pressed="false"] .on { display: none; }

/* ─── écran final ─── */
.vo-final { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: max(8vh, 40px) 24px max(5vh, 22px); pointer-events: none;
  background: linear-gradient(180deg, color-mix(in srgb, var(--vo-bg) 55%, transparent), color-mix(in srgb, var(--vo-bg) 12%, transparent) 30%, transparent 46%, transparent 74%, color-mix(in srgb, var(--vo-bg) 55%, transparent)); }
.vo-final > * { pointer-events: auto; }
.vo-final__wish { margin: 0; max-width: min(92vw, 1040px); font: 400 clamp(30px, 4.6vw, 68px)/1.1 'Instrument Serif', Georgia, serif; letter-spacing: .005em; text-wrap: balance;
  color: var(--fg); text-shadow: 0 2px 34px var(--shade); }
.vo-final__wish .vo-w { transition-duration: 1.5s, 1.7s, 1.8s; transition-delay: calc(var(--i) * 150ms + 900ms); }
.vo-final__wishes { margin: 2.2vh 0 0; font-size: clamp(11.5px, 1.05vw, 14px); letter-spacing: .42em; text-indent: .42em; text-transform: uppercase; color: var(--gold); }
.vo-final__logo { margin-top: auto; }
.vo-final__actions { margin-top: 2.4vh; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.vo-credit { margin: 1.8vh 0 0; font-size: 11.5px; letter-spacing: .05em; color: rgba(255, 255, 255, .6); }
.vo-credit a { color: inherit; text-decoration: none; }
.vo-credit a:hover { text-decoration: underline; }
.vo-final__wishes, .vo-final__logo, .vo-final__actions, .vo-credit { opacity: 0; transform: translateY(14px); transition: opacity 1.6s var(--ease), transform 1.8s var(--ease); }
.is-final .vo-final__wishes, .is-final .vo-final__logo, .is-final .vo-final__actions, .is-final .vo-credit { opacity: 1; transform: none; }
.is-final .vo-final__wishes { transition-delay: 2.6s; } .is-final .vo-final__logo { transition-delay: 3.4s; }
.is-final .vo-final__actions { transition-delay: 4.2s; } .is-final .vo-credit { transition-delay: 4.6s; }

.vo-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(233, 211, 168, .5); background: rgba(12, 12, 14, .45); color: #f6efe2; font-size: 14px; font-weight: 400; 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); }
.vo-btn svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vo-btn:hover, .vo-btn:focus-visible { background: rgba(233, 211, 168, .18); border-color: var(--gold); transform: translateY(-1px); }

.vo-logo { --logo-h: 46px; color: #fff; }
.vo-logo svg, .vo-logo img { height: var(--logo-h); width: auto; display: block; }
.vo-logo a { display: block; }
.vo-logo__ph { display: inline-block; padding: 12px 26px; border: 1px dashed rgba(233, 211, 168, .45); border-radius: 6px; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: rgba(246, 239, 226, .75); }
@media (min-width: 1000px) and (min-height: 700px) { .vo-logo svg, .vo-logo img { height: calc(var(--logo-h) * 1.3); } }
.vo-noscript { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; font: 400 32px/1.2 'Instrument Serif', serif; }

/* fond clair (réglage « couleur de fond ») : textes et commandes passent en sombre */
.vo--light { --fg: #1c1a1e; --shade: rgba(255, 255, 255, .7); --gold: #7a5a1e; }
.vo--light .vo-hint, .vo--light .vo-btn { color: #1c1a1e; background: rgba(255, 255, 255, .55); border-color: rgba(40, 30, 20, .35); }
.vo--light .vo-hint:hover, .vo--light .vo-hint:focus-visible, .vo--light .vo-btn:hover, .vo--light .vo-btn:focus-visible { background: rgba(255, 255, 255, .85); border-color: rgba(40, 30, 20, .7); }
.vo--light .vo-icon { background: rgba(255, 255, 255, .5); border-color: rgba(40, 30, 20, .35); }
.vo--light .vo-icon svg { stroke: #1c1a1e; } .vo--light .vo-icon svg path:first-child { fill: #1c1a1e; }
.vo--light .vo-credit { color: rgba(28, 26, 30, .65); }
.vo--light .vo-logo__ph { color: rgba(28, 26, 30, .7); border-color: rgba(40, 30, 20, .4); }
.vo--light .vo-help i { border-color: rgba(28, 26, 30, .7); background: rgba(28, 26, 30, .12); box-shadow: none; }

/* ─── panneau de réglages (?reglages) ─── */
.vo-set { position: absolute; z-index: 9; left: 12px; top: 12px; width: min(318px, calc(100vw - 24px)); max-height: calc(100% - 24px); display: flex; flex-direction: column;
  border-radius: 12px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(18, 18, 21, .9); color: #ece8e1; font: 400 12.5px/1.35 Lexend, system-ui, sans-serif;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); -webkit-user-select: none; user-select: none; box-shadow: 0 12px 40px rgba(0, 0, 0, .45); }
.vo-set__head { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 11px 14px; border: 0; background: none; cursor: pointer;
  font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: #e9d3a8; }
.vo-set__head::after { content: '–'; font-size: 16px; letter-spacing: 0; } .vo-set__head[aria-expanded="false"]::after { content: '+'; }
.vo-set__head:focus-visible, .vo-set__btn:focus-visible, .vo-set input:focus-visible { outline: 2px solid #e9d3a8; outline-offset: 2px; }
.vo-set__body { overflow-y: auto; padding: 0 14px 14px; overscroll-behavior: contain; }
.vo-set fieldset { margin: 0 0 10px; padding: 8px 0 0; border: 0; border-top: 1px solid rgba(255, 255, 255, .1); min-width: 0; }
.vo-set legend { padding: 0; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: rgba(236, 232, 225, .62); }
.vo-set__row { display: grid; grid-template-columns: 1fr 96px 46px; align-items: center; gap: 8px; min-height: 30px; cursor: pointer; }
.vo-set__name { min-width: 0; }
.vo-set__row--wide { grid-template-columns: 96px 1fr; }
.vo-set__row select { width: 100%; min-width: 0; height: 26px; padding: 0 6px; border-radius: 5px; border: 1px solid rgba(255, 255, 255, .25); background: #1d1d21; color: #ece8e1; font: inherit; cursor: pointer; }
.vo-set__row input[type="checkbox"] { justify-self: start; width: 17px; height: 17px; margin: 0; accent-color: #e9d3a8; cursor: pointer; }
.vo-set__row--wide:has(input[type="checkbox"]) { grid-template-columns: 1fr 24px; }
/* aperçu du 2027 sans le drap : ni texte de scène ni invitation */
.is-peek .vo-say, .is-peek .vo-hint, .is-peek .vo-help { opacity: 0 !important; pointer-events: none; }
.vo-set__row output { text-align: right; font-variant-numeric: tabular-nums; font-size: 11.5px; color: rgba(236, 232, 225, .75); }
.vo-set__row input[type="range"] { width: 100%; margin: 0; accent-color: #e9d3a8; }
.vo-set__row input[type="color"] { width: 100%; height: 24px; padding: 0; border: 1px solid rgba(255, 255, 255, .25); border-radius: 5px; background: none; cursor: pointer; }
.vo-set__hint { display: block; margin: -3px 0 4px; font-size: 10.5px; color: rgba(236, 232, 225, .48); }
.vo-set__bar { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; }
.vo-set__btn { min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(233, 211, 168, .5); background: rgba(233, 211, 168, .08); color: #f6efe2; font-size: 12px; cursor: pointer; }
.vo-set__btn:hover { background: rgba(233, 211, 168, .22); }
.vo-set__note { margin: 10px 0 6px; font-size: 11px; color: rgba(236, 232, 225, .6); }
.vo-set__out { display: block; width: 100%; resize: vertical; padding: 8px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(0, 0, 0, .35); color: #d8e6d0;
  font: 11px/1.45 ui-monospace, Consolas, monospace; white-space: pre; -webkit-user-select: text; user-select: text; }
@media (max-width: 640px) { .vo-set { top: auto; bottom: 12px; max-height: 58%; } }

/* secours sans WebGL2 : les vœux, sans le drap */
.vo--nogl .vo-canvas, .vo--nogl .vo-say { display: none; }
.vo--nogl { background: radial-gradient(ellipse at 50% 60%, #2a2318, #050506 70%); }

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