/* scene finale — « la machine à rimes » → façade → lockup → end card.
 * Stage px: 1920×1080 landscape, 1080×1920 portrait (html.is-portrait). Elements driven by render() carry
 * no CSS transform (P.set owns them); centring is done with offsets/margins. */

.s-finale { color: var(--ink); }
.s-finale .fin-all { position: absolute; inset: 0; }

/* ------------------------------------------------------------------ lamplight glow */
.s-finale .fin-glow { position: absolute; left: 960px; top: 400px; width: 1800px; height: 1150px; margin: -575px 0 0 -900px; pointer-events: none; }
.s-finale .fin-glow__breath { position: absolute; inset: 0;
  background: radial-gradient(closest-side, rgba(243, 217, 168, 0.26), rgba(227, 160, 98, 0.13) 38%, rgba(217, 115, 127, 0.05) 66%, transparent 100%); }
html[data-mode="ended"] .s-finale .fin-glow__breath { animation: fin-breathe 0.952s ease-in-out infinite alternate; }
html[data-mode="ended"] .s-finale.fin-reduced .fin-glow__breath { animation: none; }
@keyframes fin-breathe { from { opacity: 0.85; transform: none; } to { opacity: 1; transform: scale(1.045); } }
@media (prefers-reduced-motion: reduce) { html[data-mode="ended"] .s-finale .fin-glow__breath { animation: none; } }

/* ------------------------------------------------------------------ camera (push-in) */
.s-finale .fin-cam { position: absolute; inset: 0; transform-origin: 960px 540px; }

/* ------------------------------------------------------------------ façade
 * Position (540, 106) is mirrored in search.js (FACADE: its four accent dots land on these window centres on 24.4).
 * Façade + line + word + chips sit as one group with equal top / bottom margins once the push-in has run. */
.s-finale .fin-facade { position: absolute; left: 540px; top: 106px; width: 840px; height: 430px; --k: 1; perspective: 1600px; }
.s-finale .fin-win { position: absolute; top: calc(var(--k) * 230px); width: calc(var(--k) * 184px); height: calc(var(--k) * 184px); transform-origin: 50% 50.5%; }
.s-finale .fin-win__off, .s-finale .fin-win__on { position: absolute; inset: 0; }
.s-finale .fin-win__off svg, .s-finale .fin-win__on svg { width: 100%; height: 100%; display: block; overflow: visible; }
.s-finale .fin-win__on { filter: drop-shadow(0 0 calc(var(--k) * 18px) var(--c2)); }
.s-finale .fin-win__halo { position: absolute; left: -110%; top: -110%; width: 320%; height: 320%; pointer-events: none;
  background: radial-gradient(closest-side, var(--c), transparent 72%); opacity: 0; }
.s-finale .fin-win__spill { position: absolute; left: -45%; top: 86%; width: 190%; height: 34%; pointer-events: none;
  background: radial-gradient(closest-side, var(--c), transparent); opacity: 0; }
.s-finale .fin-floor { position: absolute; left: calc(var(--k) * 40px); top: calc(var(--k) * 407px); width: calc(var(--k) * 760px); height: 2px; transform-origin: 50% 50%;
  background: linear-gradient(90deg, transparent, rgba(243, 235, 221, 0.3) 14%, rgba(243, 235, 221, 0.3) 86%, transparent); }
.s-finale .fin-roof { position: absolute; inset: 0; }
.s-finale .fin-roof svg { width: 100%; height: 100%; display: block; overflow: visible; }
/* pilot dots: the four accent dots handed over by search, held on the window centres until each window lights
 * (same size, colour and glow as .s-search__fdot; inline left/top/background/box-shadow set in finale.js) */
.s-finale .fin-pilot { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; opacity: 0; pointer-events: none; }
.s-finale .fin-lamp { position: absolute; left: calc(var(--k) * 408px); top: calc(var(--k) * 174px); width: calc(var(--k) * 24px); height: calc(var(--k) * 24px); }
.s-finale .fin-lamp__dot { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 50% 45%, #FFF3E0, #F3D9A8 60%, #E3A062); }
.s-finale .fin-lamp__glow { position: absolute; left: -260%; top: -260%; width: 620%; height: 620%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 231, 191, 0.75), rgba(243, 217, 168, 0.28) 40%, rgba(227, 160, 98, 0) 100%); }

/* ------------------------------------------------------------------ kinetic type */
.s-finale .fin-mask { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.04em 0.1em 0.16em; margin: -0.04em -0.1em -0.16em; }
.s-finale .fin-mask__in { display: inline-block; }
.s-finale .fin-line { position: absolute; left: 0; right: 0; top: 570px; text-align: center; white-space: nowrap;
  font: 400 76px/1.2 var(--font-display); letter-spacing: -0.02em; color: var(--ink); }
.s-finale .fin-lw { display: inline-block; }

/* the rhyme machine: [reel][oire][.] — the row is centred on « Parloire », the period hangs outside */
.s-finale .fin-word { position: absolute; left: 0; right: 0; top: 670px; text-align: center; white-space: nowrap;
  font: 400 184px/1.15 var(--font-display); letter-spacing: -0.02em; color: var(--ink); }
.s-finale .fin-word__row { position: relative; display: inline-flex; transform-origin: 50% 50%; }
/* reel window with soft top/bottom edges (static mask): prefixes rise through it like a slot machine */
.s-finale .fin-reel, .s-finale .fin-oclip { position: relative; display: inline-block;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 17%, #000 75%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 17%, #000 75%, transparent 100%); }
.s-finale .fin-reel { padding: 0.35em 0 0.35em 1.6em; margin: -0.35em 0 -0.35em -1.6em; }
.s-finale .fin-oclip { padding: 0.35em 0.4em; margin: -0.35em -0.4em; }
.s-finale .fin-oin { position: relative; display: inline-block; }
.s-finale .fin-reel__sizer { display: inline-block; visibility: hidden; }
.s-finale .fin-pre { position: absolute; right: 0; top: 0.35em; display: inline-block; white-space: nowrap; opacity: 0; }
.s-finale .fin-oire, .s-finale .fin-lo .oire { display: inline-block; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.s-finale .fin-oire { padding-right: 0.03em; }
.s-finale .fin-sheen { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: hidden; opacity: 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(100deg, transparent 34%, #000 50%, transparent 66%); mask-image: linear-gradient(100deg, transparent 34%, #000 50%, transparent 66%); }
.s-finale .fin-sheen__copy { position: absolute; left: 0; top: 0; display: inline-block; white-space: nowrap; padding-right: 0.03em;
  background: linear-gradient(100deg, #FFFBF3, #FFE9C9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.s-finale .fin-sheen--lock .fin-sheen__copy { padding-right: 0.04em; }
.s-finale .fin-dotclip { position: absolute; left: 100%; top: 0; display: inline-block; overflow: hidden; }
.s-finale .fin-dot { display: inline-block; background: var(--brand-grad); background-size: 900% 100%; background-position: 100% 0; -webkit-background-clip: text; background-clip: text; color: transparent; }

/* promise chips — ivory hairline pills */
.s-finale .fin-chips { position: absolute; left: 0; right: 0; top: 904px; display: flex; justify-content: center; gap: 16px; }
.s-finale .fin-chip { display: inline-flex; align-items: center; gap: 13px; height: 54px; padding: 0 26px 0 22px; border-radius: 999px;
  border: 1px solid rgba(243, 235, 221, 0.24); background: rgba(24, 19, 15, 0.42); color: var(--ink); white-space: nowrap;
  font: 600 17px/1 var(--font-ui); letter-spacing: 0.14em; text-transform: uppercase; opacity: 0; }
.s-finale .fin-chip__dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--lamp); box-shadow: 0 0 12px rgba(243, 217, 168, 0.85); }

/* ------------------------------------------------------------------ end card */
.s-finale .fin-end > * { position: absolute; left: 0; right: 0; margin: 0; text-align: center; }
.s-finale .fin-lockup { top: 112px; }
.s-finale .fin-logo { font-size: 128px; gap: 0.07em; }
.s-finale .fin-mark { display: block; line-height: 0; opacity: 0; }
.s-finale .fin-lword { display: block; line-height: 1; opacity: 0; }
.s-finale .fin-lo { position: relative; display: inline-block; }
.s-finale .fin-tag { top: 404px; font-size: 52px; line-height: 1.2; color: var(--ink); white-space: nowrap; }
.s-finale .fin-launch { top: 490px; display: flex; justify-content: center; align-items: center; gap: 20px; }
.s-finale .fin-launch__txt { display: inline-block; font: 600 20px/1 var(--font-ui); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); opacity: 0; }
.s-finale .fin-launch__rule { display: block; width: 56px; height: 1px; background: rgba(243, 235, 221, 0.32); opacity: 0; }
.s-finale .fin-launch__rule--l { transform-origin: 100% 50%; }
.s-finale .fin-launch__rule--r { transform-origin: 0 50%; }

.s-finale .fin-form { top: 568px; display: flex; flex-direction: column; align-items: center; }
.s-finale .fin-form__label { display: block; font: 400 40px/1.2 var(--font-display); letter-spacing: -0.02em; color: var(--ink); margin-bottom: 22px; cursor: default; }
.s-finale .fin-field { position: relative; display: flex; align-items: center; gap: 6px; width: 780px; height: 84px; padding: 6px; border-radius: 999px;
  background: rgba(24, 19, 15, 0.78); border: 1px solid rgba(243, 235, 221, 0.2);
  box-shadow: 0 24px 70px -30px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(243, 235, 221, 0.05); opacity: 0;
  transition: border-color 0.25s ease, box-shadow 0.25s ease; }
.s-finale .fin-field:focus-within { border-color: rgba(243, 217, 168, 0.6); box-shadow: 0 0 0 4px rgba(243, 217, 168, 0.14), 0 24px 70px -30px rgba(0, 0, 0, 0.9); }
.s-finale .fin-input { flex: 1; min-width: 0; height: 100%; margin: 0; padding: 0 20px 0 26px; border: 0; border-radius: 999px; outline: none; background: transparent;
  font: 400 26px/1 var(--font-ui); color: var(--ink); caret-color: var(--lamp); }
.s-finale .fin-input::placeholder { color: #94877A; opacity: 1; } /* 5.4 : 1 on the field (≈ #16110E); --ink-3 was 3.8 : 1 */
.s-finale .fin-cta { flex: none; display: inline-flex; align-items: center; gap: 10px; height: 100%; padding: 0 26px 0 30px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--brand-grad); color: #1C120C; font: 600 23px/1 var(--font-ui); letter-spacing: -0.005em; white-space: nowrap;
  box-shadow: 0 12px 34px -12px rgba(227, 160, 98, 0.6), inset 0 1px 0 rgba(255, 250, 240, 0.45); opacity: 0; }
.s-finale .fin-cta__arrow { display: inline-flex; }
.s-finale .fin-cta__arrow svg { width: 22px; height: 22px; }
.s-finale .fin-cta:hover { box-shadow: 0 16px 40px -12px rgba(227, 160, 98, 0.8), inset 0 1px 0 rgba(255, 250, 240, 0.55); }
.s-finale .fin-cta:focus-visible { outline: 3px solid var(--lamp); outline-offset: 3px; }
/* not open yet: grey on hover / focus, tooltip « Bientôt » (also shown for 1.8 s on click / tap / Enter) */
.s-finale .fin-cta-wrap { position: relative; flex: none; display: flex; height: 100%; }
.s-finale .fin-cta { transition: filter 0.22s ease, box-shadow 0.22s ease; }
.s-finale .fin-cta:hover, .s-finale .fin-cta:focus-visible, .s-finale .fin-cta-wrap.is-soon .fin-cta {
  filter: grayscale(1) brightness(0.58); box-shadow: none; cursor: not-allowed; }
.s-finale .fin-soon { position: absolute; left: calc(100% + 22px); top: 50%; z-index: 2; padding: 11px 18px; border-radius: 12px; white-space: nowrap;
  background: rgba(24, 19, 15, 0.94); border: 1px solid rgba(243, 235, 221, 0.22); color: var(--ink); font: 600 22px/1 var(--font-ui);
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.9); opacity: 0; transform: translate(-6px, -50%); pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease; }
.s-finale .fin-soon::after { content: ""; position: absolute; left: 0; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  background: rgba(24, 19, 15, 0.94); border-left: 1px solid rgba(243, 235, 221, 0.22); border-bottom: 1px solid rgba(243, 235, 221, 0.22); transform: rotate(45deg); }
.s-finale .fin-cta:hover + .fin-soon, .s-finale .fin-cta:focus-visible + .fin-soon, .s-finale .fin-cta-wrap.is-soon .fin-soon { opacity: 1; transform: translate(0, -50%); }
.s-finale .fin-pulse { position: absolute; inset: -1px; border-radius: 999px; border: 1.5px solid rgba(243, 217, 168, 0.75); pointer-events: none; opacity: 0; }
.s-finale .fin-msg { margin: 16px 0 0; min-height: 34px; font: 400 24px/1.4 var(--font-ui); color: var(--ink-2); opacity: 0; }
.s-finale .fin-end.is-error .fin-msg { color: #F2A890; }
.s-finale .fin-end.is-error .fin-field { border-color: rgba(242, 168, 144, 0.65); }

.s-finale .fin-confirm { top: 568px; height: 170px; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px; outline: none; }
.s-finale .fin-end.is-done .fin-confirm { display: flex; }
.s-finale .fin-end.is-done .fin-form__label, .s-finale .fin-end.is-done .fin-field { visibility: hidden !important; }
.s-finale .fin-confirm__check { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: #1C120C; background: var(--brand-grad);
  box-shadow: 0 0 40px rgba(243, 217, 168, 0.35); }
.s-finale .fin-confirm__check svg { width: 26px; height: 26px; }
.s-finale .fin-confirm__txt { font-size: 42px; line-height: 1.2; color: var(--ink); }
.s-finale .fin-end.is-done .fin-confirm__txt, .s-finale .fin-end.is-done .fin-confirm__check { animation: fin-confirm 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }
.s-finale .fin-end.is-done .fin-confirm__txt { animation-delay: 0.08s; }
@keyframes fin-confirm { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .s-finale .fin-end.is-done .fin-confirm__txt, .s-finale .fin-end.is-done .fin-confirm__check { animation: none; } }
.s-finale.fin-reduced .fin-end.is-done .fin-confirm__txt, .s-finale.fin-reduced .fin-end.is-done .fin-confirm__check { animation: none; }

.s-finale .fin-names { top: 808px; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 30px; opacity: 0; }
.s-finale .fin-names__n { display: inline-flex; align-items: center; gap: 10px; font-size: 23px; line-height: 1.2; color: var(--ink-2); }
.s-finale .fin-names__dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

.s-finale .fin-links { top: 858px; display: flex; justify-content: center; gap: 14px; opacity: 0; }
.s-finale .fin-link { display: inline-flex; align-items: center; gap: 12px; height: 58px; padding: 0 26px 0 20px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(243, 235, 221, 0.14); background: rgba(243, 235, 221, 0.035); color: var(--ink-2);
  font: 500 22px/1 var(--font-ui); transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease; }
.s-finale .fin-link:hover { color: var(--ink); border-color: rgba(243, 235, 221, 0.3); background: rgba(243, 235, 221, 0.06); }
.s-finale .fin-link:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; }
.s-finale .fin-link__ic { display: inline-flex; }
.s-finale .fin-link__ic svg { width: 22px; height: 22px; }
.s-finale .fin-snd-off, html.is-muted .s-finale .fin-snd-on, html.is-muted .s-finale .fin-snd-wave, .s-finale .fin-snd-x { display: none; }
html.is-muted .s-finale .fin-snd-off, html.is-muted .s-finale .fin-snd-x { display: inline; }

/* ------------------------------------------------------------------ portrait (1080 × 1920)
 * The façade position (90, 400) / --k is mirrored in search.js (accent dots land on the window centres). */
.is-portrait .s-finale .fin-glow { left: 540px; top: 730px; width: 1500px; height: 1300px; margin: -650px 0 0 -750px; }
.is-portrait .s-finale .fin-cam { transform-origin: 540px 930px; }
.is-portrait .s-finale .fin-facade { left: 90px; top: 400px; width: 900px; height: 460.7px; --k: 1.0714; }
.is-portrait .s-finale .fin-line { top: 906px; font-size: 88px; }
.is-portrait .s-finale .fin-word { top: 1014px; font-size: 200px; }
.is-portrait .s-finale .fin-chips { top: 1306px; left: 70px; right: 70px; flex-wrap: wrap; gap: 22px 18px; }
.is-portrait .s-finale .fin-chip { height: 86px; padding: 0 38px 0 32px; gap: 18px; font-size: 30px; }
.is-portrait .s-finale .fin-chip__dot { width: 11px; height: 11px; }

.is-portrait .s-finale .fin-lockup { top: 236px; }
.is-portrait .s-finale .fin-logo { font-size: 172px; }
.is-portrait .s-finale .fin-tag { top: 632px; font-size: 66px; }
.is-portrait .s-finale .fin-launch { top: 748px; gap: 26px; }
.is-portrait .s-finale .fin-launch__txt { font-size: 30px; }
.is-portrait .s-finale .fin-launch__rule { width: 80px; height: 2px; }
.is-portrait .s-finale .fin-form { top: 878px; }
.is-portrait .s-finale .fin-form__label { font-size: 60px; margin-bottom: 36px; }
.is-portrait .s-finale .fin-field { flex-direction: column; width: 900px; height: auto; padding: 0; gap: 22px; background: none; border: 0; box-shadow: none; border-radius: 0; }
.is-portrait .s-finale .fin-field:focus-within { box-shadow: none; }
.is-portrait .s-finale .fin-input { flex: none; width: 100%; height: 118px; padding: 0 44px; font-size: 40px; text-align: center;
  background: rgba(24, 19, 15, 0.78); border: 1.5px solid rgba(243, 235, 221, 0.22); box-shadow: 0 24px 70px -30px rgba(0, 0, 0, 0.9); }
.is-portrait .s-finale .fin-input:focus { border-color: rgba(243, 217, 168, 0.65); box-shadow: 0 0 0 6px rgba(243, 217, 168, 0.16); }
.is-portrait .s-finale .fin-end.is-error .fin-input { border-color: rgba(242, 168, 144, 0.7); }
.is-portrait .s-finale .fin-cta-wrap { width: 100%; height: auto; }
/* portrait: the button is full width, so the tooltip sits under it, arrow up */
.is-portrait .s-finale .fin-soon { left: 50%; top: calc(100% + 18px); font-size: 34px; padding: 16px 26px; border-radius: 16px; transform: translate(-50%, -6px); }
.is-portrait .s-finale .fin-soon::after { left: 50%; top: 0; border: 0; border-left: 1px solid rgba(243, 235, 221, 0.22); border-top: 1px solid rgba(243, 235, 221, 0.22); }
.is-portrait .s-finale .fin-cta:hover + .fin-soon, .is-portrait .s-finale .fin-cta:focus-visible + .fin-soon,
.is-portrait .s-finale .fin-cta-wrap.is-soon .fin-soon { transform: translate(-50%, 0); }
.is-portrait .s-finale .fin-cta { width: 100%; height: 118px; justify-content: center; font-size: 38px; gap: 16px; padding: 0 40px; }
.is-portrait .s-finale .fin-cta__arrow svg { width: 36px; height: 36px; }
.is-portrait .s-finale .fin-pulse { bottom: auto; height: 120px; border-width: 2.5px; }
.is-portrait .s-finale .fin-msg { margin-top: 30px; max-width: 900px; font-size: 32px; line-height: 1.35; }
.is-portrait .s-finale .fin-confirm { top: 878px; height: 394px; gap: 28px; }
.is-portrait .s-finale .fin-confirm__check { width: 96px; height: 96px; }
.is-portrait .s-finale .fin-confirm__check svg { width: 46px; height: 46px; }
.is-portrait .s-finale .fin-confirm__txt { font-size: 64px; max-width: 900px; white-space: normal; }
.is-portrait .s-finale .fin-names { top: 1436px; left: 80px; right: 80px; gap: 18px 36px; }
.is-portrait .s-finale .fin-names__n { font-size: 38px; gap: 14px; }
.is-portrait .s-finale .fin-names__dot { width: 11px; height: 11px; }
.is-portrait .s-finale .fin-links { top: 1590px; gap: 22px; }
.is-portrait .s-finale .fin-link { height: 86px; padding: 0 36px 0 30px; gap: 16px; font-size: 32px; }
.is-portrait .s-finale .fin-link__ic svg { width: 34px; height: 34px; }

/* ------------------------------------------------------------------ short landscape viewports (phones on their side)
 * In ended mode the shared transport bar (base.css, fixed, z 15) shows over the stage; under ≈ 520 px of height it
 * covers the end card's own « Revoir le teaser » / « Son » buttons, which already do what it offers. Hide it there
 * (visibility too, so its buttons leave the tab order). */
@media (max-height: 520px) {
  html[data-mode="ended"] #controls { opacity: 0; visibility: hidden; pointer-events: none; }
}
