/* ==========================================================
   INTRO — Nessie sort de l'eau (charte Rétro)
   Les étapes sont des classes ajoutées par js/intro.js :
   is-in → is-surgit → is-parle → is-plonge → is-ile → is-fin
   ========================================================== */
#intro {
  position: fixed; inset: 0; z-index: 700; overflow: hidden; cursor: pointer;
  background: #efe7dd; color: #064c72;
  transition: opacity .6s ease, transform .7s cubic-bezier(.7, 0, .3, 1);
}
#intro.is-fin { opacity: 0; transform: scale(1.06); pointer-events: none; }
#intro.is-rapide { transition-duration: .35s; }

/* ciel : soleil couchant à anneaux + signature */
.in-ciel { position: absolute; inset: 0 0 46%; }
.in-soleil, .in-soleil i { position: absolute; border-radius: 50%; }
.in-soleil {
  left: 50%; bottom: -24vmin; width: 64vmin; height: 64vmin; margin-left: -32vmin; background: #ecae7d;
  transform: translateY(18vmin); transition: transform 1.6s cubic-bezier(.16, 1, .3, 1);
}
.in-soleil i:nth-child(1) { inset: 8vmin; background: #ed6335; }
.in-soleil i:nth-child(2) { inset: 16vmin; background: #e9311a; }
#intro.is-in .in-soleil { transform: none; }
.in-signature {
  position: absolute; left: 0; right: 0; top: 9vh; text-align: center;
  font: 700 clamp(12px, 1.4vw, 15px) 'Space Mono', monospace; letter-spacing: .22em; text-transform: uppercase;
  opacity: 0; transform: translateY(-10px); transition: opacity .6s, transform .6s cubic-bezier(.16, 1, .3, 1);
}
#intro.is-in .in-signature { opacity: .8; transform: none; }

/* mer : bandes rétro ondulées, chacune avec sa crête qui défile */
.in-mer { position: absolute; left: 0; right: 0; bottom: 0; height: 52%; } /* pas d'overflow : l'île doit pouvoir monter dans le ciel */
.in-vague { position: absolute; left: 0; right: 0; bottom: 0; top: var(--t); background: var(--c); }
.in-vague svg { position: absolute; left: 0; bottom: calc(100% - 1px); width: 200%; height: clamp(14px, 3vh, 26px); animation: inVague 6s linear infinite; }
.in-v1 { --t: 5%; } .in-v1 svg { animation-duration: 9s; }
.in-v2 { --t: 24%; } .in-v2 svg { animation-duration: 7s; animation-direction: reverse; }
.in-v4 { --t: 52%; z-index: 3; } .in-v4 svg { animation-duration: 5s; animation-direction: reverse; }
@keyframes inVague { to { transform: translateX(-50%); } }

/* Nessie : cachée sous les vagues de devant, elle surgit puis replonge */
.in-nessie {
  position: absolute; left: 50%; bottom: 46%; z-index: 2; width: clamp(170px, 30vmin, 330px); margin-left: calc(clamp(170px, 30vmin, 330px) / -2);
  transform: translateY(115%); transform-origin: 50% 100%;
}
.in-nessie img { width: 100%; }
#intro.is-surgit .in-nessie { transform: translateY(12%); transition: transform .75s cubic-bezier(.34, 1.56, .64, 1); }
#intro.is-surgit .in-nessie img { animation: inFlotte 1.6s ease-in-out infinite .75s; }
#intro.is-plonge .in-nessie { transform: translateY(125%) rotate(14deg); transition: transform .45s cubic-bezier(.55, 0, .9, .4); }
@keyframes inFlotte { 50% { transform: translateY(-5px) rotate(-2deg); } }

.in-bulle {
  position: absolute; left: 62%; bottom: 92%; width: max-content; max-width: min(60vw, 300px);
  padding: 12px 18px; background: #fff; border: 3px solid #064c72; border-radius: 22px; box-shadow: 4px 4px 0 #064c72;
  font: 700 clamp(16px, 2vw, 22px)/1.2 'Souvenir', serif; color: #064c72;
  transform: scale(0); transform-origin: 0 100%; transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
}
.in-bulle::after {
  content: ''; position: absolute; left: 16px; bottom: -13px; width: 18px; height: 18px; background: #fff;
  border-right: 3px solid #064c72; border-bottom: 3px solid #064c72; transform: skewX(20deg) rotate(45deg);
}
#intro.is-parle .in-bulle { transform: scale(1); }
.in-bulle.is-pop { animation: inBullePop .35s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes inBullePop { 0% { transform: scale(.82) rotate(-3deg); } }
@media (max-width: 640px) {
  .in-bulle { left: 50%; bottom: 100%; translate: -50% 0; transform-origin: 50% 100%; text-align: center; }
  .in-bulle::after { left: calc(50% - 9px); }
}
#intro.is-plonge .in-bulle { transform: scale(0); transition-duration: .2s; }

/* éclaboussures quand Nessie sort et quand elle replonge */
.in-gouttes { position: absolute; left: 50%; bottom: 46%; z-index: 4; }
.in-gouttes i {
  position: absolute; left: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50% 50% 50% 0;
  background: #fff; border: 2px solid #064c72; opacity: 0;
  --a: calc(var(--k) * 26deg - 92deg);
}
.in-gouttes i:nth-child(1) { --k: 0; } .in-gouttes i:nth-child(2) { --k: 1; } .in-gouttes i:nth-child(3) { --k: 2; } .in-gouttes i:nth-child(4) { --k: 3; }
.in-gouttes i:nth-child(5) { --k: 4; } .in-gouttes i:nth-child(6) { --k: 5; } .in-gouttes i:nth-child(7) { --k: 6; } .in-gouttes i:nth-child(8) { --k: 7; }
#intro.is-surgit .in-gouttes i { animation: inGoutte .8s cubic-bezier(.16, 1, .3, 1) both; }
#intro.is-plonge .in-gouttes i { animation: inGoutte2 .7s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes inGoutte { 0% { opacity: 1; transform: rotate(var(--a)) translateX(0) scale(.4); } 100% { opacity: 0; transform: rotate(var(--a)) translateX(18vmin) scale(1); } }
@keyframes inGoutte2 { 0% { opacity: 1; transform: rotate(var(--a)) translateX(0) scale(.4); } 100% { opacity: 0; transform: rotate(var(--a)) translateX(14vmin) scale(1); } }

/* l'île remonte à la surface */
.in-ile {
  position: absolute; left: 50%; bottom: 30%; z-index: 1; width: min(60vw, 62vmin, 640px); max-width: none;
  transform: translate(-50%, 70%) scale(.7); opacity: 0;
}
#intro.is-ile .in-ile { transform: translate(-50%, 0) scale(1); opacity: 1; transition: transform 1s cubic-bezier(.16, 1, .3, 1), opacity .4s; }
#intro.is-fin .in-ile { transform: translate(-50%, -4%) scale(1.12); transition: transform .7s ease-in; }

.in-sauter {
  position: absolute; right: 18px; top: 16px; z-index: 6; padding: 7px 14px; border-radius: 99px;
  background: #efe7dd; border: 2px solid #064c72; box-shadow: 3px 3px 0 #064c72; color: #064c72;
  font: 700 12px 'Space Mono', monospace; letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
.in-sauter:hover { transform: translate(-1px, -2px) rotate(-2deg); }
.in-passer {
  position: absolute; right: 18px; bottom: 14px; z-index: 5;
  font: 700 12px 'Space Mono', monospace; letter-spacing: .08em; text-transform: uppercase; color: #efe7dd; opacity: .75;
}
