/* ── EdgeUnivers — introduction 3D ─────────────────────────────────────────────────────────────────
   Une scène sobre : un cœur lumineux (EdgeLab), deux mondes en orbite (EdgeMetrics, vert ; REMEMBER, bleu) et un
   emplacement pour les suivants. Tout le texte est du HTML ; la 3D est décorative. */
:root { --ink: #05070d; --soft: rgba(255,255,255,.66); --faint: rgba(255,255,255,.6); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: #fff; overflow: hidden; }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block;
  background: radial-gradient(1100px 760px at 50% 40%, #0c1430 0%, #060a18 46%, #05070d 78%); }
.vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse 120% 100% at 50% 42%, transparent 55%, rgba(0,0,0,.62) 100%); }

/* Noms des mondes */
.labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.lbl { position: absolute; left: 0; top: 0; transform: translate(-999px, -999px); text-align: center; opacity: 0; will-change: transform, opacity; white-space: nowrap; }
.lbl b { display: block; font-family: Inter, system-ui, sans-serif; font-weight: 500; letter-spacing: -.01em; font-size: clamp(.95rem, 1.6vw, 1.2rem); letter-spacing: .01em; }
.lbl span { display: block; margin-top: 2px; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.lbl.ghost b { font-weight: 400; font-size: 1.3rem; color: var(--soft); }
.lbl.ghost span { color: rgba(255,255,255,.3); }

/* En-tête */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: max(22px, env(safe-area-inset-top)) clamp(18px, 4vw, 40px) 0; opacity: 0; animation: in 1.2s ease .3s forwards; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.1rem; letter-spacing: -.01em; }
.logo b { font-weight: 600; opacity: .6; }
.topnav { display: flex; gap: 18px; align-items: center; }
.skip { font-size: .86rem; color: var(--faint); padding: 8px 4px; transition: color .2s; }
.skip:hover, .skip:focus-visible { color: #fff; outline: none; }

/* Texte d'accueil */
.hero { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; text-align: center; padding: 0 22px max(34px, calc(env(safe-area-inset-bottom) + 22px)); display: flex; flex-direction: column; align-items: center; }
.eyebrow { margin: 0 0 18px; opacity: 0; animation: in 1.2s ease .7s forwards; }
.eyebrow span { display: inline-block; padding: 8px 16px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; background: rgba(255,255,255,.04); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: .74rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--soft); }
h1 { margin: 0; font-family: Inter, system-ui, -apple-system, sans-serif; font-weight: 300; font-size: clamp(2.7rem, 9.4vw, 6.2rem); line-height: 1.02; letter-spacing: -.05em; opacity: 0; filter: blur(14px); transform: translateY(14px);
  animation: title 1.5s cubic-bezier(.2,.7,.2,1) 1s forwards;
  background: linear-gradient(180deg, #fff 30%, rgba(255,255,255,.62) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.lead { margin: 16px 0 0; max-width: 460px; font-size: clamp(1rem, 2.4vw, 1.2rem); line-height: 1.55; color: var(--soft); opacity: 0; animation: in 1.2s ease 1.5s forwards; }
.enter { margin-top: 26px; display: inline-flex; align-items: center; gap: 12px; padding: 15px 28px; border-radius: 999px; background: #fff; color: var(--ink); font-weight: 600; font-size: 1rem;
  box-shadow: 0 0 0 0 rgba(255,255,255,.35), 0 18px 50px -14px rgba(120,150,255,.55); opacity: 0; animation: in 1.2s ease 1.9s forwards, pulse 3.4s ease-in-out 3.2s infinite; transition: transform .25s ease, gap .25s ease; }
.enter span { transition: transform .25s ease; }
.enter:hover, .enter:focus-visible { transform: translateY(-2px); outline: none; }
.enter:hover span, .enter:focus-visible span { transform: translateX(4px); }
.enter:focus-visible { box-shadow: 0 0 0 3px var(--ink), 0 0 0 6px #fff; }
.hint { margin: 16px 0 0; font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.3); opacity: 0; animation: in 1.2s ease 2.4s forwards; }

@keyframes in { to { opacity: 1; } }
@keyframes title { to { opacity: 1; filter: blur(0); transform: none; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 12px rgba(255,255,255,0), 0 18px 60px -12px rgba(120,150,255,.75); } }

/* ── Navigation : états de la page (posés par le script sur <html>) ───────────────────────────────── */
#scene { touch-action: none; cursor: default; }
#scene.pointer { cursor: pointer; }
#scene.grab { cursor: grabbing; }
.hero, .top, .lbl { transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
html.is-explore .hero { opacity: 0 !important; pointer-events: none; transform: translateY(24px); animation: none; }
html.is-explore .eyebrow, html.is-explore h1, html.is-explore .lead, html.is-explore .enter, html.is-explore .hint { animation: none; }
.flash { position: fixed; inset: 0; z-index: 20; background: #F5F2EC; opacity: 0; pointer-events: none; transition: opacity .55s cubic-bezier(.4,0,.2,1); }
html.flash-on .flash { opacity: 1; }
@media (prefers-color-scheme: dark) { .flash { background: #14171D; } }

/* Menu des mondes + conseil */
.dock { position: fixed; left: 50%; bottom: max(26px, calc(env(safe-area-inset-bottom) + 14px)); z-index: 6; display: flex; gap: 8px; padding: 7px; border-radius: 999px; transform: translate(-50%, 22px); opacity: 0; pointer-events: none;
  background: rgba(10,14,30,.55); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); transition: opacity .6s ease .25s, transform .6s cubic-bezier(.2,.7,.2,1) .25s; }
html.is-explore:not(.is-focus):not(.is-dive) .dock { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.dock button { font: 600 .92rem Inter, system-ui, sans-serif; color: #fff; background: transparent; border: 0; border-radius: 999px; padding: 11px 18px; display: inline-flex; align-items: center; gap: 9px; cursor: pointer; transition: background .2s; }
.dock button:hover, .dock button:focus-visible { background: rgba(255,255,255,.12); outline: none; }
.dock button:focus-visible { box-shadow: 0 0 0 2px rgba(255,255,255,.7); }
.dock button.ghost { color: var(--faint); font-weight: 500; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.em { background: #7EEAA0; box-shadow: 0 0 12px rgba(126,234,160,.9); } .dot.rm { background: #7C92FF; box-shadow: 0 0 12px rgba(124,146,255,.9); } .dot.fu { background: rgba(255,255,255,.35); }
.tip { position: fixed; left: 0; right: 0; bottom: max(90px, calc(env(safe-area-inset-bottom) + 78px)); z-index: 5; margin: 0; text-align: center; font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.55); opacity: 0; pointer-events: none; transition: opacity .8s ease .6s; padding: 0 20px; }
html.is-explore:not(.is-focus):not(.is-dive) .tip { opacity: 1; }
.tip .t-touch { display: none; } @media (hover: none) { .tip .t-mouse { display: none; } .tip .t-touch { display: inline; } }

/* Cartes de présentation */
.card { position: fixed; z-index: 7; right: clamp(22px, 5vw, 76px); top: 50%; width: min(400px, calc(100vw - 32px)); padding: 28px 28px 24px; border-radius: 26px; color: #fff;
  background: linear-gradient(160deg, rgba(14,20,40,.72), rgba(8,11,24,.64)); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(22px) saturate(1.2); -webkit-backdrop-filter: blur(22px) saturate(1.2);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.04) inset; visibility: hidden; opacity: 0; transform: translate(26px, -50%); pointer-events: none;
  transition: opacity .55s ease, transform .6s cubic-bezier(.2,.7,.2,1), visibility 0s linear .6s; }
.card.em { --a: 126,234,160; } .card.rm { --a: 124,146,255; } .card.fu { --a: 200,208,230; }
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: 0 0 60px -14px rgba(var(--a), .55); }
html.focus-em #card-em, html.focus-rm #card-rm, html.focus-fu #card-fu { visibility: visible; opacity: 1; transform: translate(0, -50%); pointer-events: auto; transition: opacity .6s ease .35s, transform .7s cubic-bezier(.2,.7,.2,1) .35s, visibility 0s; }
html.is-dive .card { opacity: 0 !important; transition: opacity .35s ease; }
.card .kind { margin: 0 0 8px; font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: rgba(var(--a), .95); }
.card h2 { margin: 0 0 12px; font-family: Inter, system-ui, sans-serif; font-weight: 500; letter-spacing: -.03em; font-size: clamp(1.7rem, 3.4vw, 2.2rem); line-height: 1.1; }
.card .txt { margin: 0 0 16px; font-size: .98rem; line-height: 1.6; color: rgba(255,255,255,.74); }
.card ul { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 9px; }
.card li { position: relative; padding-left: 22px; font-size: .92rem; line-height: 1.45; color: rgba(255,255,255,.88); }
.card li::before { content: ""; position: absolute; left: 0; top: .5em; width: 8px; height: 8px; border-radius: 50%; background: rgb(var(--a)); box-shadow: 0 0 10px rgba(var(--a), .8); }
.card .go { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 22px; border-radius: 999px; background: rgb(var(--a)); color: #05070d; font-weight: 700; font-size: 1rem; transition: transform .2s, gap .2s, box-shadow .2s; box-shadow: 0 16px 40px -14px rgba(var(--a), .9); }
.card .go:hover, .card .go:focus-visible { transform: translateY(-2px); gap: 14px; outline: none; }
.card .go:focus-visible { box-shadow: 0 0 0 3px #05070d, 0 0 0 6px #fff; }
.card .back { display: block; width: 100%; margin-top: 12px; padding: 10px; font: 500 .88rem Inter, system-ui, sans-serif; color: rgba(255,255,255,.6); background: transparent; border: 0; border-radius: 12px; cursor: pointer; transition: color .2s, background .2s; }
.card .back:hover, .card .back:focus-visible { color: #fff; background: rgba(255,255,255,.07); outline: none; }
.card.fu .back { margin-top: 4px; }
html.is-dive .top, html.is-dive .dock, html.is-dive .tip { opacity: 0 !important; }

/* Plongeon dans EdgeMetrics : un « bug » numérique */
.u-glitch{position:fixed;inset:0;z-index:200;pointer-events:none;overflow:hidden}
.u-glitch::before{content:"";position:absolute;inset:0;background:repeating-linear-gradient(0deg,rgba(0,0,0,.34) 0 2px,transparent 2px 4px);opacity:0;animation:ugScan .64s linear forwards}
.u-glitch::after{content:"";position:absolute;inset:0;background:#030b09;opacity:0;animation:ugBlack .64s steps(1) forwards}
.u-glitch i{position:absolute;left:-6%;width:112%;background:#fff;mix-blend-mode:difference;opacity:0;animation:ugBar .5s steps(1) forwards;animation-delay:var(--d,0s)}
.u-glitch em{position:absolute;left:0;right:0;top:0;height:2px;background:#7EEAA0;box-shadow:0 0 18px 5px rgba(126,234,160,.7);opacity:.9;animation:ugSweep .5s linear forwards}
@keyframes ugBar{0%{opacity:1;transform:translateX(var(--x1))}22%{opacity:1;transform:translateX(var(--x2))}44%{opacity:0}58%{opacity:1;transform:translateX(var(--x3))}82%{opacity:1;transform:translateX(0)}100%{opacity:0}}
@keyframes ugScan{0%{opacity:0}30%{opacity:1}100%{opacity:1}}
@keyframes ugBlack{0%,52%{opacity:0}58%{opacity:.7}66%{opacity:0}76%{opacity:.85}84%{opacity:0}90%,100%{opacity:1}}
@keyframes ugSweep{from{transform:translateY(0)}to{transform:translateY(100vh)}}
@keyframes ugJit{0%{transform:translate(0);filter:none}12%{transform:translate(-7px,0);filter:drop-shadow(5px 0 0 rgba(255,40,90,.75)) drop-shadow(-5px 0 0 rgba(0,255,225,.75))}24%{transform:translate(9px,1px);filter:drop-shadow(-6px 0 0 rgba(255,40,90,.75)) drop-shadow(6px 0 0 rgba(0,255,225,.75))}36%{transform:translate(0);filter:none}52%{transform:translate(-11px,-1px);filter:drop-shadow(7px 0 0 rgba(255,40,90,.8)) drop-shadow(-7px 0 0 rgba(0,255,225,.8)) hue-rotate(40deg)}64%{transform:translate(6px,0);filter:drop-shadow(-4px 0 0 rgba(255,40,90,.7)) drop-shadow(4px 0 0 rgba(0,255,225,.7))}76%{transform:translate(-3px,0);filter:none}100%{transform:translate(0);filter:none}}
html.u-glitching #scene{animation:ugJit .64s steps(1) forwards}

/* Mobile : la carte devient un volet en bas, la scène remonte */
@media (max-width: 760px) {
  .card { right: 12px; left: 12px; width: auto; top: auto; bottom: max(12px, env(safe-area-inset-bottom)); padding: 22px 22px 16px; border-radius: 24px; transform: translateY(30px); }
  html.focus-em #card-em, html.focus-rm #card-rm, html.focus-fu #card-fu { transform: none; }
  .card h2 { font-size: 1.55rem; margin-bottom: 8px; } .card .txt { font-size: .92rem; margin-bottom: 12px; } .card ul { margin-bottom: 16px; gap: 7px; } .card li { font-size: .86rem; }
  .card .go { padding: 13px 20px; } .card .back { margin-top: 6px; padding: 8px; }
  .dock button { padding: 10px 14px; font-size: .86rem; } .tip { font-size: .66rem; letter-spacing: .1em; }
}
@media (max-height: 620px) and (max-width: 760px) { .card .txt { display: none; } }
@media (max-width: 640px) { .skip.simple { display: none; } .hint { display: none; } .eyebrow span { font-size: .66rem; letter-spacing: .16em; } }
@media (max-height: 560px) { .lead, .hint { display: none; } h1 { font-size: 2.4rem; } }
@media (prefers-reduced-motion: reduce) {
  .dock, .tip, .card { display: none; }
  .top, .eyebrow, .lead, .enter, .hint, .legal-line { animation: none; opacity: 1; }
  h1 { animation: none; opacity: 1; filter: none; transform: none; }
}

/* Texte réservé aux lecteurs d'écran */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Retour depuis une application : le voile aux couleurs de l'application se dissipe pendant que la caméra recule */
html[data-back]::before { content: ""; position: fixed; inset: 0; z-index: 300; pointer-events: none; background: var(--vc, #030b09); animation: uvBack 1s cubic-bezier(.4,0,.2,1) .12s forwards; }
html[data-back="em"] { --vc: #030b09; } html[data-back="rm"] { --vc: #0A1033; }
@keyframes uvBack { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { html[data-back]::before { display: none; } }

/* Menu (burger) et ligne légale de l'accueil */
.top-l { display: flex; align-items: center; gap: 12px; }
.top .mn-btn { width: 40px; height: 40px; }
.legal-line { position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; display: flex; justify-content: center; gap: 18px; padding: 0 16px max(10px, env(safe-area-inset-bottom)); font-size: .72rem; color: rgba(255,255,255,.42); opacity: 0; animation: in 1.2s ease 2.6s forwards; }
.legal-line a { padding: 6px 2px; transition: color .2s; }
.legal-line a:hover, .legal-line a:focus-visible { color: #fff; outline: none; }
html.is-focus .legal-line, html.is-dive .legal-line, html.sheet-open .legal-line { opacity: 0 !important; pointer-events: none; }
html.sheet-open, html.sheet-open body { overflow: hidden; }
