/* Mode immersif : on entre dans la ville (écran d'entrée), on s'y promène (panneaux de l'accueil),
   chaque univers s'ouvre en plein écran puis reste visible derrière le contenu (verre dépoli),
   et chaque page mène à la suivante. Sans animation si l'appareil le demande (prefers-reduced-motion). */

:root { --glass: rgb(246 240 231 / 80%); --veil: rgb(16 20 34); }

/* ---------- écran d'entrée ---------- */
.splash { position: fixed; inset: 0; z-index: 100; display: grid; align-items: end; overflow: hidden; background: var(--veil); color: var(--white); }
.splash__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 74% 55%; }
.splash::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(16 20 34 / 10%) 0%, rgb(16 20 34 / 25%) 40%, rgb(16 20 34 / 88%) 100%); }
.splash__body {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  max-width: 640px; width: 100%; margin: 0 auto; padding: 0 24px calc(40px + env(safe-area-inset-bottom));
}
.splash__logo { width: 76px; height: 76px; border-radius: 50%; border: 3px solid var(--white); }
.splash__kicker { color: var(--sand); font-size: 14px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.splash__title { font-family: var(--font-display); font-size: clamp(3.2rem, 18vw, 5.6rem); font-weight: 900; line-height: 0.88; text-transform: uppercase; letter-spacing: -0.02em; }
.splash__text { max-width: 30ch; font-size: 17px; line-height: 1.45; opacity: 0.92; text-wrap: pretty; }
.splash__enter {
  margin-top: 10px; min-height: 56px; padding: 0 28px; border: 0; border-radius: 999px;
  background: var(--white); color: var(--navy); font: inherit; font-size: 17px; font-weight: 800; cursor: pointer;
  box-shadow: 0 10px 30px rgb(0 0 0 / 35%);
}
.splash__by { font-size: 13px; opacity: 0.8; }
.splash--out { pointer-events: none; opacity: 0; transition: opacity 0.6s ease 0.25s; }

/* ---------- entrée d'un univers : la photo plein écran ---------- */
.page-head--immersive .banner { height: calc(100svh - 60px - var(--tabbar-h) - env(safe-area-inset-bottom)); min-height: 440px; max-height: 760px; }
.page-head--immersive .banner__img { view-transition-name: universe; }
.page-head--immersive .banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(16 20 34 / 18%) 0%, rgb(16 20 34 / 0%) 30%, rgb(16 20 34 / 20%) 55%, rgb(16 20 34 / 82%) 100%); }
.banner__where {
  position: absolute; z-index: 1; top: 16px; inset-inline-end: var(--gutter); display: inline-flex; align-items: center; gap: 6px;
  max-width: calc(100% - 90px); padding: 6px 12px; border-radius: 999px; background: rgb(16 20 34 / 45%); color: var(--white);
  font-size: 13px; font-weight: 700; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.banner__titles { position: absolute; z-index: 1; inset-inline: var(--gutter); bottom: 96px; display: flex; flex-direction: column; gap: 8px; }
.page-head--immersive .banner__title { position: static; inset: auto; display: block; font-size: clamp(2.3rem, 12vw, 3.6rem); }
.banner__sub { color: var(--sand); font-size: 15px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; text-shadow: 0 1px 8px rgb(0 0 0 / 45%); }
.banner__enter {
  position: absolute; z-index: 1; inset-inline-start: var(--gutter); bottom: 26px;
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border: 1.5px solid rgb(255 255 255 / 70%); border-radius: 999px; background: rgb(255 255 255 / 14%); color: var(--white);
  font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.banner__enter .icon { transform: rotate(-90deg); }
.page-head--immersive .back { background: rgb(255 255 255 / 88%); }

/* ---------- l'univers reste visible derrière le contenu : verre dépoli ---------- */
.view--universe::before {
  background:
    linear-gradient(180deg, rgb(236 227 214 / 30%) 0%, rgb(236 227 214 / 55%) 60%, rgb(236 227 214 / 78%) 100%),
    var(--universe) center / cover no-repeat;
}
.view--universe > .intro, .view--universe > .toolbar, .view--universe > .stage-nav, .view--universe > .notice,
.view--universe > .footer, .view--universe .stage__head, .view--universe > .count, .view--universe > .lead,
.view--universe > .block, .view--universe > .block__text {
  padding: 12px 14px; border-radius: 18px; background: var(--glass);
  backdrop-filter: blur(14px) saturate(1.1); -webkit-backdrop-filter: blur(14px) saturate(1.1);
}
.view--universe > .footer { border-top: 0; }
.view--universe .stage + .stage { border-top-color: rgb(255 255 255 / 55%); }

/* ---------- promenade de l'accueil : un grand panneau par univers ---------- */
.walk { display: flex; flex-direction: column; gap: 14px; }
.walk__panel {
  position: relative; isolation: isolate; display: flex; align-items: flex-end; min-height: min(62vh, 480px); overflow: hidden;
  border-radius: 26px; background: var(--navy); color: var(--white); text-decoration: none; box-shadow: var(--shadow-lift);
}
.walk__img { position: absolute; inset: -8% 0; z-index: -2; width: 100%; height: 116%; object-fit: cover; }
.walk__panel::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgb(16 20 34 / 0%) 35%, rgb(16 20 34 / 80%) 100%); }
.walk__num { position: absolute; top: 14px; inset-inline-start: 16px; font-family: var(--font-display); font-size: 2.4rem; font-weight: 900; line-height: 1; color: rgb(255 255 255 / 85%); text-shadow: 0 2px 12px rgb(0 0 0 / 35%); }
.walk__panel .tile__stamp { top: 18px; }
.walk__body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 20px 18px; }
.walk__icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: rgb(255 255 255 / 92%); color: var(--cat); }
.walk__title { font-family: var(--font-display); font-size: clamp(1.7rem, 8vw, 2.3rem); font-weight: 900; line-height: 1; text-transform: uppercase; text-shadow: 0 2px 14px rgb(0 0 0 / 40%); text-wrap: balance; }
.walk__sub { font-size: 15px; opacity: 0.9; }
.walk__go { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 8px 16px; border-radius: 999px; background: var(--white); color: var(--navy); font-size: 14px; font-weight: 800; }
.walk__go .icon, .next-universe__go .icon { transform: rotate(180deg); }
[dir="rtl"] .walk__go .icon, [dir="rtl"] .next-universe__go .icon { transform: none; }

/* ---------- la porte suivante, en bas de chaque univers ---------- */
.next-universe {
  position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
  min-height: 210px; padding: 18px; overflow: hidden; border-radius: 24px; background: var(--navy); color: var(--white);
  text-decoration: none; box-shadow: var(--shadow-lift);
}
.next-universe__img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.next-universe::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgb(16 20 34 / 10%) 20%, rgb(16 20 34 / 78%) 100%); }
.next-universe__kicker { color: var(--sand); font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.next-universe__title { font-family: var(--font-display); font-size: 1.7rem; font-weight: 900; line-height: 1.05; text-transform: uppercase; }
.next-universe__go { position: absolute; top: 16px; inset-inline-end: 16px; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--white); color: var(--navy); }

@media (prefers-reduced-motion: no-preference) {
  .splash__img { animation: splash-drift 18s ease-out both; }
  @keyframes splash-drift { from { transform: scale(1.18); } to { transform: scale(1.02); } }
  .splash__body > * { animation: rise 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .splash__body > :nth-child(2) { animation-delay: 150ms; }
  .splash__body > :nth-child(3) { animation-delay: 260ms; }
  .splash__body > :nth-child(4) { animation-delay: 380ms; }
  .splash__body > :nth-child(5) { animation-delay: 520ms; }
  .splash__body > :nth-child(6) { animation-delay: 640ms; }
  .splash--out .splash__img { animation: none; transform: scale(1.6); transition: transform 0.9s cubic-bezier(0.6, 0, 0.3, 1); }
  .splash--out .splash__body { opacity: 0; transform: translateY(30px); transition: opacity 0.35s ease, transform 0.35s ease; }

  .banner__enter { animation: nudge 2.4s ease-in-out 1.2s infinite; }
  @keyframes nudge { 0%, 100% { translate: 0 0; } 50% { translate: 0 6px; } }
  .banner__titles { animation: rise 800ms 150ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }

  /* parallaxe des panneaux : la photo glisse moins vite que la page */
  @supports (animation-timeline: view()) {
    .walk__img { animation: parallax linear both; animation-timeline: view(); }
    @keyframes parallax { from { transform: translateY(-6%); } to { transform: translateY(6%); } }
  }
  .walk__panel { transition: transform 200ms cubic-bezier(0.2, 0.7, 0.2, 1); }
  .walk__panel:active { transform: scale(0.97); }

  /* la porte touchée s'agrandit jusqu'à devenir la page */
  ::view-transition-group(universe) { animation-duration: 520ms; animation-timing-function: cubic-bezier(0.6, 0, 0.2, 1); }
  ::view-transition-old(universe), ::view-transition-new(universe) { animation-duration: 520ms; height: 100%; object-fit: cover; }
}
@media (prefers-reduced-motion: reduce) {
  .splash--out { transition: opacity 0.2s; }
}
