/* EuroMed Climate Education Atlas — opening sequence of the home (assets/intro.js).
   Loaded by index.html only. Every rule applies while <html> carries the class «intro», which the inline script
   in the head adds on a visit of the home and which intro.js always removes at the end: without the class, nothing here
   has any effect and the page is the usual one. The animations start only with the class «intro-go», which intro.js
   adds at the first painted frame once the fonts are in: a CSS animation would otherwise run from the moment the
   stylesheet is read, invisibly, while the first paint waits for the fonts. */

#intro{display:none}
html.intro #intro{position:fixed;inset:0;z-index:70;display:flex;flex-direction:column;align-items:center;padding:clamp(40px,9vh,110px) var(--gutter) 0;background:var(--bg);color:var(--ink);text-align:center;overflow:hidden}   /* the curtain takes every click: nothing of the page underneath can be hit by accident; a click only skips */
html.intro.intro-globe #intro{background:transparent}

/* soft light where the globe will rise */
#intro::before{content:"";position:absolute;left:50%;top:64%;width:min(120vw,1100px);aspect-ratio:1;transform:translate(-50%,-50%);border-radius:50%;background:radial-gradient(closest-side,color-mix(in srgb,var(--focus) 16%,transparent),transparent 72%);opacity:0;pointer-events:none}

#intro .in-head{position:relative;display:flex;flex-direction:column;align-items:center;will-change:transform}
#intro .in-logo{display:block;height:clamp(64px,10vh,92px);width:auto;opacity:0;transform:perspective(900px) rotateX(34deg) translateY(30px) scale(.82);transform-origin:50% 100%;filter:drop-shadow(0 16px 34px rgba(0,0,0,.38));animation-delay:.1s}
#intro .in-kicker{margin:24px 0 0;font-size:clamp(12px,1.05vw,14px);letter-spacing:.01em;color:var(--ink-2);opacity:0;animation-delay:.75s}
#intro .in-title{margin:8px 0 0;font-family:var(--font-display);font-weight:600;font-variation-settings:"wdth" 92;letter-spacing:-.03em;line-height:1.02;font-size:clamp(34px,5.4vw,68px);text-wrap:balance;max-width:14em}
#intro .in-title span{display:inline-block;opacity:0;transform:translateY(.5em)}
#intro .in-title span:nth-child(1){animation-delay:.95s}
#intro .in-title span:nth-child(2){animation-delay:1.03s}
#intro .in-title span:nth-child(3){animation-delay:1.11s}
#intro .in-title span:nth-child(4){animation-delay:1.19s}
#intro .in-rule{display:block;margin-top:22px;width:min(220px,40vw);height:1px;background:var(--ink-3);transform:scaleX(0);animation-delay:1.45s}
#intro .in-skip{position:absolute;right:clamp(16px,3vw,32px);bottom:clamp(16px,3vh,28px);appearance:none;border:1px solid var(--line-2);background:color-mix(in srgb,var(--bg) 70%,transparent);color:var(--ink-2);font:inherit;font-size:13px;padding:8px 14px;border-radius:999px;cursor:pointer;opacity:0;animation-delay:1.6s}
#intro .in-skip:hover,#intro .in-skip:focus-visible{color:var(--ink);border-color:var(--ink-3);outline:none}

/* the animations, switched on at the first painted frame */
html.intro-go #intro::before{animation:intro-glow 1.8s .5s ease-out forwards}
html.intro-go #intro .in-logo{animation-name:intro-logo;animation-duration:1s;animation-timing-function:cubic-bezier(.2,.75,.2,1);animation-fill-mode:forwards}
html.intro-go #intro .in-kicker,html.intro-go #intro .in-skip{animation-name:intro-up;animation-duration:.7s;animation-timing-function:cubic-bezier(.2,.75,.2,1);animation-fill-mode:forwards}
html.intro-go #intro .in-title span{animation-name:intro-word;animation-duration:.75s;animation-timing-function:cubic-bezier(.2,.75,.2,1);animation-fill-mode:forwards}
html.intro-go #intro .in-rule{animation-name:intro-rule;animation-duration:.8s;animation-timing-function:cubic-bezier(.2,.75,.2,1);animation-fill-mode:forwards}

/* the page waits behind the curtain and comes in with a short stagger */
html.intro{overflow:hidden;scrollbar-gutter:stable}
html.intro .hero{background:var(--bg)}
html.intro .hero-map{opacity:0;will-change:transform,opacity}
html.intro header.topbar,html.intro .hero-shade,html.intro .hero-copy,html.intro .hero-ctl,html.intro .numstrip,html.intro main>.section,html.intro footer.footer{opacity:0;transition:opacity .65s ease,transform .65s cubic-bezier(.2,.75,.2,1)}
html.intro .hero-copy{transform:translateY(16px)}
html.intro.intro-reveal header.topbar,html.intro.intro-reveal .hero-shade,html.intro.intro-reveal .hero-copy,html.intro.intro-reveal .hero-ctl,html.intro.intro-reveal .numstrip,html.intro.intro-reveal main>.section,html.intro.intro-reveal footer.footer{opacity:1}
html.intro.intro-reveal .hero-map{opacity:1;transition:opacity .8s ease}
html.intro.intro-reveal .hero-copy{transform:none;transition-delay:.12s}
html.intro.intro-reveal .hero-ctl{transition-delay:.25s}
html.intro.intro-reveal .numstrip{transition-delay:.3s}
html.intro.intro-reveal main>.section,html.intro.intro-reveal footer.footer{transition-delay:.4s}

@keyframes intro-logo{to{opacity:1;transform:perspective(900px) rotateX(0) translateY(0) scale(1)}}
@keyframes intro-up{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes intro-word{to{opacity:1;transform:none}}
@keyframes intro-rule{to{transform:scaleX(1)}}
@keyframes intro-glow{to{opacity:1}}

@media (max-width:760px){
  html.intro #intro{padding-top:clamp(36px,8vh,80px)}
  #intro .in-logo{height:clamp(56px,9vh,72px)}
  #intro .in-title{font-size:clamp(30px,9vw,44px)}
  #intro .in-kicker{margin-top:18px}
}
@media (prefers-reduced-motion:reduce){#intro{display:none!important}}
