/* OCÉAN — habillage de la carte (voeux-interactifs.fr, modèle 08) */
@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: #020a16; 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; }

.ab { position: fixed; inset: 0; overflow: hidden; --ease: cubic-bezier(.22, .7, .2, 1); }
.ab-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ab-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* secours sans WebGL : dégradé qui s'éclaircit avec la remontée */
.ab-fallback { display: none; position: absolute; inset: 0; --k: var(--ab-k, 0);
  background: radial-gradient(120% 70% at 55% -10%, rgba(190, 240, 250, calc(var(--k) * .9)), transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, #08305a calc(100% - var(--k) * 100%), #9fe6f2), color-mix(in srgb, #000207 calc(100% - var(--k) * 100%), #0a5470)); }
.ab--nogl .ab-fallback { display: block; }
.ab--nogl .ab-canvas { display: none; }

/* ─── accueil ─── */
.ab-intro { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px;
  background: radial-gradient(80% 70% at 50% 45%, rgba(2, 10, 24, .25), rgba(1, 5, 14, .78)); z-index: 4; }
.ab-intro__in { display: flex; flex-direction: column; align-items: center; gap: 18px; animation: abRise 1.6s var(--ease) both .2s; }
.ab-intro__logo { opacity: .92; margin-bottom: 6px; }
.ab-intro__title { margin: 0; font: 400 clamp(54px, 9vw, 112px)/.95 'Instrument Serif', Georgia, serif; letter-spacing: .005em;
  text-shadow: 0 0 40px rgba(120, 190, 255, .35); }
.ab-intro__tag { margin: -4px 0 14px; font-size: clamp(12px, 1.4vw, 14px); font-weight: 400; letter-spacing: .32em; text-transform: uppercase; color: rgba(205, 230, 255, .78); }
.ab-intro__note { margin: 2px 0 0; font-size: 12.5px; color: rgba(205, 230, 255, .55); letter-spacing: .04em; }
@keyframes abRise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

.ab-btn { display: inline-flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 28px 0 24px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(200, 235, 255, .45); background: rgba(150, 210, 255, .1); color: #fff; font-size: 15px; font-weight: 500; letter-spacing: .03em;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); text-decoration: none;
  box-shadow: 0 0 0 0 rgba(140, 210, 255, .35), inset 0 0 18px rgba(160, 220, 255, .08);
  transition: background .35s, border-color .35s, transform .35s var(--ease), box-shadow .6s; }
.ab-btn svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.ab-btn:hover, .ab-btn:focus-visible { background: rgba(170, 225, 255, .2); border-color: rgba(220, 245, 255, .8); transform: translateY(-1px); box-shadow: 0 0 34px 2px rgba(140, 210, 255, .3), inset 0 0 18px rgba(160, 220, 255, .12); }
.ab-btn:focus-visible { outline: 2px solid #bfe9ff; outline-offset: 4px; }
.ab-btn--start { animation: abBreath 3.6s ease-in-out infinite 1.8s; }
@keyframes abBreath { 50% { box-shadow: 0 0 40px 4px rgba(140, 210, 255, .28), inset 0 0 18px rgba(160, 220, 255, .12); } }
.ab-btn--ghost { min-height: 46px; padding: 0 22px 0 18px; font-size: 14px; background: rgba(4, 40, 64, .22); border-color: rgba(255, 255, 255, .55); }
.ab-btn--ghost svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ─── commandes discrètes ─── */
.ab-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(2, 16, 30, .25); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background .3s, border-color .3s, opacity .6s; }
.ab-icon:hover, .ab-icon:focus-visible { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .6); }
.ab-icon:focus-visible, .ab-skip:focus-visible { outline: 2px solid #bfe9ff; outline-offset: 3px; }
.ab-icon svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ab-icon svg path:first-child { fill: #fff; stroke: none; }
.ab-sound[aria-pressed="true"] .off, .ab-sound[aria-pressed="false"] .on { display: none; }
.ab-skip { position: absolute; z-index: 5; right: max(18px, env(safe-area-inset-right)); bottom: 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, .2); background: rgba(2, 16, 30, .18); color: rgba(255, 255, 255, .75); font-size: 13px; letter-spacing: .06em;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: color .3s, border-color .3s, background .3s; animation: abFade 1s 3s both; }
.ab-skip svg { width: 14px; height: 14px; fill: currentColor; }
.ab-skip:hover, .ab-skip:focus-visible { color: #fff; border-color: rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .1); }
@keyframes abFade { from { opacity: 0; } }

/* ─── textes du voyage ─── */
.ab-say { position: absolute; left: 50%; top: 50%; z-index: 3; width: min(92vw, 980px); margin: 0; transform: translate(-50%, -50%);
  text-align: center; pointer-events: none; font: 400 clamp(30px, 4.6vw, 64px)/1.12 'Instrument Serif', Georgia, serif; letter-spacing: .005em;
  text-shadow: 0 2px 28px rgba(0, 20, 45, .55), 0 0 2px rgba(0, 20, 40, .3); text-wrap: balance; }
.ab-say[data-place="low"] { top: auto; bottom: 14vh; transform: translateX(-50%); }
.ab-say[data-place="high"] { top: 16vh; transform: translateX(-50%); }
.ab-say[data-size="s"] { font-size: clamp(22px, 2.6vw, 34px); font-style: italic; color: rgba(220, 235, 255, .9); }
.ab-say[data-size="l"] { font-size: clamp(34px, 5.4vw, 76px); }
.ab-w { display: inline-block; opacity: 0; filter: blur(10px); transform: translateY(.35em);
  transition: opacity 1.1s var(--ease), filter 1.3s var(--ease), transform 1.4s var(--ease); transition-delay: calc(var(--i) * 110ms + 150ms); }
.ab-say.is-in .ab-w { opacity: 1; filter: blur(0); transform: none; }
.ab-say:not(.is-in) .ab-w { transition-duration: .9s; transition-delay: calc(var(--i) * 40ms); }

/* ─── écran final ─── */
.ab-final { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 6vh 24px 9vh; pointer-events: none;
  background: radial-gradient(62% 50% at 50% 42%, rgba(0, 40, 70, .34), transparent 72%); }
.ab-final > * { pointer-events: auto; }
.ab-final__year { margin: 0; font: 400 clamp(110px, 21vw, 280px)/.86 'Instrument Serif', Georgia, serif; letter-spacing: -.01em;
  background: linear-gradient(180deg, #ffffff 30%, #d2f4ff 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 40px rgba(0, 40, 70, .45)); }
.ab-final__lines { margin-top: 1.2vh; max-width: 760px; }
.ab-final__lines p { margin: 0 0 .25em; font: 400 clamp(22px, 2.9vw, 38px)/1.2 'Instrument Serif', Georgia, serif; text-wrap: balance;
  text-shadow: 0 2px 26px rgba(0, 32, 60, .6); }
.ab-final__logo { margin-top: 4.2vh; }
.ab-final__actions { margin-top: 3.4vh; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.ab-credit { position: absolute; bottom: max(14px, env(safe-area-inset-bottom)); left: 0; right: 0; margin: 0; font-size: 11.5px; letter-spacing: .05em; color: rgba(255, 255, 255, .7); text-shadow: 0 1px 8px rgba(0, 30, 50, .6); }
.ab-credit a { color: inherit; text-decoration: none; }
.ab-credit a:hover { text-decoration: underline; }

.ab-final > * { opacity: 0; transform: translateY(16px); filter: blur(8px); transition: opacity 1.6s var(--ease), transform 1.8s var(--ease), filter 1.6s var(--ease); }
.ab-final__year { transform: scale(.94); transition-duration: 2.4s; }
.is-final .ab-final > * { opacity: 1; transform: none; filter: none; }
.is-final .ab-final__lines { transition-delay: .9s; }
.is-final .ab-final__logo { transition-delay: 1.6s; }
.is-final .ab-final__actions { transition-delay: 2.1s; }
.is-final .ab-credit { transition-delay: 2.6s; }
.is-final .ab-final__year { filter: drop-shadow(0 4px 40px rgba(0, 40, 70, .45)); }

.ab-logo { --logo-h: 46px; color: #fff; }
.ab-logo svg, .ab-logo img { height: var(--logo-h); width: auto; display: block; }
.ab-logo a { display: block; }

.ab-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) {
  .ab-final { padding-bottom: 12vh; }
  .ab-final__actions { flex-direction: column; align-items: center; }
  .ab-say[data-place="low"] { bottom: 18vh; }
}
@media (prefers-reduced-motion: reduce) {
  .ab-w, .ab-final > * { transition-duration: .01s !important; transition-delay: 0s !important; filter: none !important; transform: none !important; }
  .ab-intro__in, .ab-btn--start { animation: none; }
}
