/* ============================================================
   PORTAIL DIMENSIONNEL — pré-accueil de « / » (branche preview)
   Fresque Renaissance → œil officiel (assets/hero.png) → accueil.

   Activation : <html data-portal="on">. Le script inline du <head>
   pose .portal-on (animation pilotée par le scroll natif) ou
   .portal-static (prefers-reduced-motion). Sans JS : aucune de ces
   classes, la scène reste display:none et l'accueil s'affiche tel
   qu'avant.

   Principe : l'accueil (<main class="hub">) est sticky en haut d'un
   conteneur prolongé par .portal-run. Pendant ce scroll, la scène
   fixe .portal-stage le recouvre ; elle s'ouvre en iris et le logo
   de transit se pose exactement sur .eye-wrap, puis s'efface au
   profit de l'œil réel du DOM. Aucun listener wheel/touch, aucun
   preventDefault : le scroll reste celui du navigateur.
   ============================================================ */

/* Police « romaine » du système vidéo Roman V2 (cartouches, boutons du hook) :
   EB Garamond 400, capitales, approche large. OFL, voir assets/fonts/. */
@font-face {
  font-family: 'EB Garamond Agentic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(assets/fonts/eb-garamond-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  --font-roman: 'EB Garamond Agentic', Garamond, 'Times New Roman', serif;
  --portal-gold: #e9b44c;
  --portal-gold-soft: rgba(233, 180, 76, 0.55);
  --portal-ivory: #FAF5EB;
  --portal-cyan: #67e8f9;
  --portal-night: #06070c;
  --portal-run: 150svh;
}
@supports not (height: 1svh) { :root { --portal-run: 150vh; } }
@media (max-width: 760px) { :root { --portal-run: 130svh; } }
@media (max-width: 760px) { @supports not (height: 1svh) { :root { --portal-run: 130vh; } } }

/* ---------- état par défaut : rien (sans JS = accueil inchangé) ---------- */
.portal-stage, .portal-skip, .portal-run { display: none; }

/* ---------- mode animé ---------- */
.portal-on .portal-run { display: block; height: var(--portal-run); }
/* min-height : sans elle, un accueil plus court que l'écran empêche le
   scroll d'atteindre la fin du parcours (p resterait < 1). */
/* lvh (plus grand viewport) : quand la barre d'adresse mobile se replie,
   le document doit encore pouvoir défiler sur toute la course. */
.portal-on .hub { position: sticky; top: 0; min-height: 100vh; min-height: 100lvh; }
/* Le halo bleu du body est placé à « 50% -10% » de la hauteur du body ; le
   parcours allonge le body et l'éloignerait. On le reporte sur l'accueil,
   qui a la hauteur d'un écran comme le body d'origine. */
.portal-on body, .portal-static body { background: var(--bg); }
.portal-on .hub, .portal-static .hub {
  background: radial-gradient(1100px 700px at 50% -10%, rgba(37, 99, 235, 0.12), transparent 60%);
}
/* .hub-lines déborde de 4 % (existant) : à 768 px cela crée 13 px de scroll
   horizontal et un dézoom mobile. clip (et non hidden) garde le sticky. */
.portal-scene { overflow-x: clip; }

.portal-on .portal-stage,
.portal-static .portal-stage {
  display: block;
  overflow: hidden;
  background: var(--portal-night);
  color: var(--ink);
}
.portal-on .portal-stage {
  position: fixed;
  inset: 0;
  z-index: 50;
  contain: strict;
  /* transparent : c'est .portal-world (masqué en iris) qui porte l'opacité,
     sinon l'accueil resterait caché jusqu'à la toute fin */
  background: transparent;
}
.portal-on .portal-world { background: var(--portal-night); }
.portal-stage.is-done { visibility: hidden; }
.portal-stage.is-passive { pointer-events: none; }

.portal-world {
  position: absolute;
  inset: 0;
}
.portal-backdrop {
  position: absolute;
  inset: -4%;
  background:
    radial-gradient(120% 70% at 50% 46%, rgba(6, 7, 12, 0.25), rgba(6, 7, 12, 0.82)),
    url(assets/portal/fresque-blur.webp) center / cover no-repeat,
    var(--lqip, none) center / cover no-repeat;
}
.portal-fresco {
  position: absolute;
  left: 0;
  top: 0;
  width: 1672px;
  height: 941px;
  transform-origin: 0 0;
  will-change: transform;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.55);
}
.portal-fresco img {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-drag: none;
}
/* voile radial : taille fixée par JS (3 × le plus grand côté), déplacé par
   translation pour suivre le logo, donc jamais repeint */
/* coordonnées en px source de la fresque (le conteneur est mis à l'échelle) :
   centre (836,5 ; 343), rayon 272 = CFG.LOGO_R */
.portal-void {
  position: absolute;
  left: 564.5px;
  top: 71px;
  width: 544px;
  height: 544px;
  border-radius: 50%;
  background: radial-gradient(circle closest-side, #02040b 0%, #050b1d 55%, #0a1d47 86%, #12357a 97%, #1d4ed8 100%);
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.55), 0 0 40px 6px rgba(59, 130, 246, 0.45);
  pointer-events: none;
}
.portal-tint {
  position: absolute;
  left: 0;
  top: 0;
  width: 300vmax;
  height: 300vmax;
  background: radial-gradient(circle closest-side, rgba(6, 7, 12, 0.15), rgba(6, 7, 12, 0.92) 50%);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

/* halos : or (fresque) → cyan (technologie), jamais une forme nouvelle */
.portal-halo {
  position: absolute;
  left: 0;
  top: 0;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  transform-origin: 50% 50%;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
/* liseré bleu autour du logo (remplace l'ancien halo or) : le contour du portail */
.portal-halo--rim { background: radial-gradient(circle closest-side, rgba(59, 130, 246, 0) 0%, rgba(59, 130, 246, 0) 60%, rgba(147, 197, 253, 0.95) 64.5%, rgba(96, 165, 250, 0.7) 67.5%, rgba(59, 130, 246, 0.32) 76%, rgba(37, 99, 235, 0.12) 88%, rgba(37, 99, 235, 0) 100%); }
.portal-halo--cyan { background: radial-gradient(circle, rgba(103, 232, 249, 0.55) 0%, rgba(59, 130, 246, 0.32) 36%, rgba(59, 130, 246, 0) 70%); }

/* rayons d'or + orbites cyan, centrés sur le logo */
.portal-orbits {
  position: absolute;
  left: 0;
  top: 0;
  width: 300px;
  height: 300px;
  overflow: visible;
  pointer-events: none;
  will-change: transform;
}
.portal-orbits * { vector-effect: non-scaling-stroke; }
.portal-rays line { stroke: var(--blue-light); stroke-width: 1; stroke-linecap: round; }
.portal-circuit { fill: none; stroke: var(--portal-cyan); stroke-width: 1; }
.portal-circuit .dash { stroke-dasharray: 2 6; }
.portal-circuit .node { fill: var(--portal-cyan); stroke: none; }

/* logo de transit : MÊME fichier, MÊME classe .eye-img que l'accueil */
.portal-logo {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.portal-logo .eye-img { display: block; width: 100%; height: 100%; animation: none; }

/* tant que portal.js n'a pas cadré la scène : seul l'aperçu flou est visible
   (pas de fresque posée en haut à gauche, pas de logo hors du médaillon) */
.portal-on:not(.portal-ready) .portal-fresco,
.portal-on:not(.portal-ready) .portal-logo,
.portal-on:not(.portal-ready) .portal-halo,
.portal-on:not(.portal-ready) .portal-orbits,
.portal-static:not(.portal-ready) .portal-fresco,
.portal-static:not(.portal-ready) .portal-logo,
.portal-static:not(.portal-ready) .portal-halo { visibility: hidden; }

.portal-ascii {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
}
.portal-ascii-src { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* indication de geste */
.portal-hint {
  position: absolute;
  left: 50%;
  bottom: max(22px, calc(env(safe-area-inset-bottom) + 14px));
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 18px;
  border-radius: 999px;
  background: rgba(6, 7, 12, 0.55);
  border: 1px solid rgba(233, 180, 76, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: var(--font-roman);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--portal-ivory);
  white-space: nowrap;
  pointer-events: none;
}
.portal-hint__touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .portal-hint__touch { display: inline; }
  .portal-hint__mouse { display: none; }
}
.portal-hint svg { width: 10px; height: 16px; color: var(--portal-gold); animation: portal-nudge 2.4s ease-in-out infinite; }
@keyframes portal-nudge { 0%, 100% { transform: translateY(-2px); opacity: 0.6; } 50% { transform: translateY(2px); opacity: 1; } }
@media (max-width: 380px) { .portal-hint { letter-spacing: 0.12em; font-size: 12px; } }
/* tactile : la flèche suit le doigt (vers le haut) */
@media (hover: none) and (pointer: coarse) { .portal-hint svg { transform: rotate(180deg); animation: none; } }

/* lien « Passer l'introduction » : discret, toujours atteignable */
.portal-on .portal-skip {
  display: block;
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  z-index: 60;
  padding: 8px 13px;
  border-radius: 999px;
  font-family: var(--font-roman);
  font-size: 12.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--portal-ivory);
  background: rgba(6, 7, 12, 0.42);
  border: 1px solid rgba(250, 245, 235, 0.22);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 200ms ease, border-color 160ms ease, color 160ms ease;
}
.portal-on .portal-skip:hover { border-color: var(--portal-gold-soft); color: #fff; }
.portal-on .portal-skip:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(96, 165, 250, 0.7); }
.portal-on .portal-skip.is-gone { opacity: 0; pointer-events: none; visibility: hidden; transition: opacity 200ms ease, visibility 0s 200ms; }

/* pendant l'intro, l'accueil sticky attend sous la scène */
.portal-on .hub-lines path { animation-play-state: paused; }
.portal-on.portal-home .hub-lines path { animation-play-state: running; }

/* ---------- mode statique (prefers-reduced-motion) ---------- */
.portal-static .portal-stage {
  position: relative;
  height: 100vh;
  height: 100svh;
}
/* « Entrer » doit pouvoir amener l'accueil en haut de l'écran */
.portal-static .hub { min-height: 100vh; min-height: 100lvh; }
.portal-static .portal-ascii,
.portal-static .portal-orbits,
.portal-static .portal-halo--cyan,
.portal-static .portal-hint { display: none; }
.portal-enter { display: none; }
.portal-static .portal-enter {
  display: inline-flex;
  position: absolute;
  left: 50%;
  bottom: max(28px, calc(env(safe-area-inset-bottom) + 18px));
  transform: translateX(-50%);
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 14px;
  font-family: var(--font-roman);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
  background: rgba(6, 7, 12, 0.72);
  border: 1px solid var(--portal-gold-soft);
  cursor: pointer;
}
.portal-static .portal-enter:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 5px rgba(96, 165, 250, 0.6); }

/* ============================================================
   CTA : deux cartes, sceau romain discret (laurier + numéral)
   ============================================================ */
/* titre AGENTIC masqué à l'écran mais conservé pour le SEO et l'accessibilité */
.brandline--hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
/* .route-card impose display:grid : sans cette règle, `hidden` ne masquerait rien */
.route-card[hidden] { display: none; }
/* Accueil = univers bleu : sceau, filet et patine aux couleurs AGENTIC
   (les ::before/::after bleus de .route-card__index sont repris tels quels). */
.route-card__seal { color: var(--blue-light); }
.route-card__seal svg {
  position: absolute;
  inset: 7px;
  width: calc(100% - 14px);
  height: calc(100% - 14px);
  fill: currentColor;
  opacity: 0.9;
  transition: color 180ms ease, filter 180ms ease;
}
.route-card__seal .seal-num {
  position: relative;
  font-family: var(--font-roman);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #dbeafe;
  line-height: 1;
}
/* titres des deux CTA : la police romaine des reels, en capitales espacées ;
   plus de phrase descriptive sous le titre */
.route-card--roman .route-card__content strong {
  font-family: var(--font-roman);
  font-weight: 400;
  font-size: clamp(1.05rem, 1rem + 0.2vw, 1.2rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.2;
}
.route-card--roman { align-items: center; }
@media (min-width: 861px) {
  .route-card--roman { grid-template-columns: auto 1fr auto; padding: 16px 18px; }
  .route-card--roman .route-card__index { grid-row: 1; grid-column: 1; margin-top: 0; }
  .route-card--roman .route-card__content { grid-row: 1; grid-column: 2; }
  .route-card--roman .route-card__action { grid-row: 1; grid-column: 3; }
}

/* fine ligne bleue qui s'allume au survol / focus */
.route-card::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue-light), transparent);
  transform: scaleX(0.15);
  opacity: 0;
  transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 160ms ease;
  pointer-events: none;
}
.route-card:hover::before,
.route-card:focus-visible::before { transform: scaleX(1); opacity: 1; }
.route-card:hover .route-card__seal,
.route-card:focus-visible .route-card__seal { color: #93c5fd; }
.route-card:hover .route-card__seal .seal-num,
.route-card:focus-visible .route-card__seal .seal-num { color: #fff; }
.route-card:hover .route-card__seal svg,
.route-card:focus-visible .route-card__seal svg { filter: drop-shadow(0 0 4px rgba(96, 165, 250, 0.85)); }
.route-card:active .route-card__seal { transform: scale(0.94); transition-duration: 90ms; }

/* carte principale « Je me lance » : patine bleue très légère */
.route-card--primary {
  border-color: rgba(96, 165, 250, 0.34);
  background:
    linear-gradient(180deg, rgba(59, 130, 246, 0.07), transparent 55%),
    var(--surface);
}
.route-card--primary:hover { border-color: rgba(96, 165, 250, 0.6); }

@media (prefers-reduced-motion: reduce) {
  .portal-hint svg { animation: none; }
  .route-card::before, .route-card__seal svg { transition: none; }
}
