/* ==========================================================================
   ILA — Intro / Loading overlay + page-transition loader
   Drop-in module. Pairs with ila-intro.js.
   Visual language matched to the ILA site: Bodoni Moda + Jost, gold #C8A86A.
   ========================================================================== */

#ila-intro{
  --ii-gold:#C8A86A;
  --ii-gold-2:#E6CF9B;
  --ii-fg:#F3F1EC;
  --ii-faint:rgba(243,241,236,0.52);
  --ii-ease:cubic-bezier(0.19,1,0.22,1);
  --ii-flight:cubic-bezier(0.65,0,0.20,1);

  position:fixed; inset:0; z-index:99999;
  display:grid; place-items:center; overflow:hidden;
  background:transparent;
  cursor:pointer;
  font-family:'Jost', system-ui, sans-serif;
  -webkit-font-smoothing:antialiased;
}

/* ---- background video (only when configured) — sits behind the backdrop and
   carries the same clip as the hero, so the intro and the first page are one
   continuous shot. Darkened so the crest never competes with it. ---- */
#ila-intro .ii-video{
  position:absolute; inset:0; z-index:0; pointer-events:none;
  width:100%; height:100%; object-fit:cover; object-position:center;
  filter:brightness(.66) saturate(.95) contrast(1.02);
}
/* ---- the dark stage backdrop (its own layer so it can fade out on reveal) ---- */
#ila-intro .ii-backdrop{
  position:absolute; inset:0; z-index:0; pointer-events:none;
  background:
    radial-gradient(125% 95% at 50% 40%, #131318 0%, #0a0a0c 46%, #050507 100%);
  transition:opacity .85s ease;
}
/* when a bg video is present the backdrop becomes a veil so the (opaque) video
   shows through it — the video itself covers the page, so nothing else bleeds */
#ila-intro.has-bgvideo .ii-backdrop{
  background:
    radial-gradient(125% 95% at 50% 40%, rgba(19,19,24,0.34) 0%, rgba(12,12,16,0.62) 46%, rgba(6,6,9,0.85) 100%);
}
/* ---- ambient spotlight bloom ---- */
#ila-intro .ii-bloom{
  position:absolute; left:50%; top:39%; width:165vmax; height:165vmax;
  transform:translate(-50%,-50%) scale(.55); transform-origin:center;
  pointer-events:none; opacity:0; z-index:1;
  background:radial-gradient(closest-side,
    rgba(200,168,106,0.18) 0%,
    rgba(200,168,106,0.06) 32%,
    transparent 60%);
}
#ila-intro .ii-vignette{
  position:absolute; inset:0; pointer-events:none; z-index:1;
  background:radial-gradient(130% 100% at 50% 42%, transparent 50%, rgba(0,0,0,0.6) 100%);
  transition:opacity .7s ease;
}

/* faint orbital halo — ambient, sits outside the crest's own engraved circle */
#ila-intro .ii-halo{
  position:absolute; top:42%; left:50%;
  width:min(78vh, 92vw); aspect-ratio:1/1;
  transform:translate(-50%,-50%) rotate(0deg);
  border-radius:50%;
  border:1px solid rgba(200,168,106,0.14);
  pointer-events:none; opacity:0; z-index:1;
}
#ila-intro .ii-halo::after{
  content:""; position:absolute; inset:7%;
  border-radius:50%; border:1px solid rgba(230,207,155,0.07);
}
#ila-intro .ii-halo::before{
  content:""; position:absolute; inset:-9%;
  border-radius:50%; border:1px solid rgba(200,168,106,0.06);
}

/* ---- stage: centered vertical stack (kicker · crest · meta) ---- */
#ila-intro .ii-stage{
  position:relative; z-index:3;
  display:flex; flex-direction:column; align-items:center;
  gap:clamp(18px, 3.2vh, 34px);
  padding:0 24px;
}

/* the flight wrapper — this is what travels to the hero-logo's resting spot.
   NOTE: will-change only during the actual flight — a permanently promoted
   compositor layer is half of what made iOS paint the crest as a white box. */
#ila-intro .ii-crestwrap{
  position:relative;
  width:clamp(210px, 30vmin, 320px);
  aspect-ratio:644 / 802;
  display:grid; place-items:center;
  transform:translate(0,0) scale(1);
  transform-origin:center center;
}
#ila-intro.is-flying .ii-crestwrap{
  transition:transform 1.15s var(--ii-flight);
  will-change:transform;
}

/* the crest itself (transparent silver PNG).
   visibility:hidden (not just opacity) until the PNG is DECODED — a hidden
   element is never rasterized, so WebKit cannot flush an empty white backing
   store for it. The drop-shadow lives in a fine-pointer query below: filters
   on this composited layer are the other half of the iOS white-box bug. */
#ila-intro .ii-crest{
  width:100%; height:100%; object-fit:contain;
  opacity:0; visibility:hidden;
  transition:opacity .4s ease;
}
#ila-intro.crest-ready .ii-crest{ visibility:visible; }
@media (pointer:fine){
  #ila-intro .ii-crest{ filter:drop-shadow(0 18px 50px rgba(0,0,0,0.6)); }
}

/* metallic sheen: a brightened copy of the crest revealed through a moving band */
#ila-intro .ii-sheen{
  position:absolute; inset:0; pointer-events:none; opacity:0;
  background:var(--ii-crest-src) center/contain no-repeat;
  filter:brightness(2.4) contrast(1.05);
  mix-blend-mode:screen;
  -webkit-mask-image:linear-gradient(105deg, transparent 42%, #000 49%, #000 51%, transparent 58%);
          mask-image:linear-gradient(105deg, transparent 42%, #000 49%, #000 51%, transparent 58%);
  -webkit-mask-size:260% 100%; mask-size:260% 100%;
  -webkit-mask-position:180% 0; mask-position:180% 0;
  -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat;
}

/* ---- transition spinner (only shown in page-transition mode) ---- */
#ila-intro .ii-spin{
  position:absolute; top:42%; left:50%;
  width:clamp(150px, 22vmin, 220px); aspect-ratio:1/1;
  transform:translate(-50%,-50%);
  pointer-events:none; opacity:0; z-index:2; display:none;
}
#ila-intro .ii-spin circle{ fill:none; stroke-linecap:round; transform-origin:center; }
#ila-intro .ii-spin .sp-track{ stroke:rgba(200,168,106,0.12); stroke-width:.6; }
#ila-intro .ii-spin .sp-arc{
  stroke:url(#ii-arc-grad); stroke-width:.9;
  stroke-dasharray:70 230; stroke-dashoffset:0;
}
#ila-intro.is-transition .ii-spin{ display:block; }

/* ---- kicker + meta ---- */
#ila-intro .ii-eyebrow{
  display:inline-flex; align-items:center; gap:1rem;
  font-size:clamp(10px,1.2vw,13px); font-weight:500;
  letter-spacing:.42em; text-transform:uppercase; text-indent:.42em;
  color:var(--ii-gold); opacity:0; white-space:nowrap;
}
/* (flanking dash lines removed — the kicker is text only) */

#ila-intro .ii-meta{
  font-size:clamp(10px,1.15vw,12.5px); font-weight:400;
  letter-spacing:.30em; text-transform:uppercase; text-indent:.30em;
  color:var(--ii-faint); opacity:0; white-space:nowrap; text-align:center;
}

/* in transition mode we keep it minimal: crest + spinner only */
#ila-intro.is-transition .ii-eyebrow,
#ila-intro.is-transition .ii-meta,
#ila-intro.is-transition .ii-hint{ display:none; }

/* ---- scroll hint ---- */
#ila-intro .ii-hint{
  position:absolute; left:0; right:0; bottom:clamp(22px,4.5vh,40px);
  margin-inline:auto; width:max-content;
  display:flex; flex-direction:column; align-items:center; gap:9px;
  opacity:0; z-index:3; pointer-events:none;
}
#ila-intro .ii-hint .ih-word{
  font-size:11px; letter-spacing:.34em; text-transform:uppercase; text-indent:.34em;
  white-space:nowrap; color:var(--ii-faint);
}
#ila-intro .ii-hint .ih-chev{ width:22px; height:22px; }
#ila-intro .ii-hint .ih-chev path{
  stroke:rgba(200,168,106,0.8); stroke-width:1.4; fill:none;
}

/* ---- skip control (discoverable exit) ---- */
#ila-intro .ii-skip{
  position:absolute; top:clamp(16px,3vh,26px); right:clamp(16px,3vw,30px);
  z-index:5; -webkit-appearance:none; appearance:none; background:transparent;
  border:0; padding:6px 4px; cursor:pointer;
  display:inline-flex; align-items:center; gap:.5em;
  font-family:'Jost', system-ui, sans-serif; font-size:11px; font-weight:500;
  letter-spacing:.26em; text-transform:uppercase; text-indent:.26em;
  color:var(--ii-faint); opacity:0; pointer-events:none;
  transition:opacity .6s ease .2s, color .3s ease;
}
#ila-intro .ii-skip svg{ width:13px; height:13px; opacity:.8; }
#ila-intro.is-playing .ii-skip{ opacity:1; pointer-events:auto; }
#ila-intro .ii-skip:hover,
#ila-intro .ii-skip:focus-visible{ color:var(--ii-gold); }
#ila-intro .ii-skip:focus-visible{ outline:1px solid rgba(200,168,106,.6); outline-offset:4px; border-radius:2px; }
/* not during the between-page curtain, and gone the moment we start revealing */
#ila-intro.is-transition .ii-skip,
#ila-intro.is-revealing .ii-skip,
#ila-intro.is-leaving .ii-skip{ opacity:0 !important; pointer-events:none; }

/* ---- thin top loader bar ---- */
#ila-intro .ii-bar{
  position:absolute; top:0; left:0; height:2px; width:0%;
  background:linear-gradient(90deg, var(--ii-gold), var(--ii-gold-2));
  box-shadow:0 0 12px rgba(200,168,106,0.6);
  z-index:4; opacity:.9;
  transition:width .4s var(--ii-ease);
}

/* ===================== ENTRANCE (gated on .is-playing) ==================== */
#ila-intro.is-playing .ii-bloom{ animation:ii-bloom 2.4s var(--ii-ease) .1s forwards; }
#ila-intro.is-playing .ii-halo{ animation:ii-fade 2.2s var(--ii-ease) .5s forwards, ii-spin 90s linear 2.6s infinite; }
/* crest + sheen only animate in once the PNG is fully DECODED (.crest-ready,
   set by JS) — prevents iOS/in-app browsers painting the undecoded image
   layer as a solid white box. On coarse pointers a filter-free variant of
   this animation is swapped in (see the touch-device block further down). */
#ila-intro.is-playing.crest-ready .ii-crest{ animation:ii-crest-in 1.5s var(--ii-ease) .3s forwards; }
#ila-intro.is-playing.crest-ready .ii-sheen{ animation:ii-sweep 1.5s var(--ii-ease) 1.55s, ii-sweep 1.5s var(--ii-ease) 5.4s; }
/* if the crest can't load at all, drop it rather than show a broken box */
#ila-intro.crest-missing .ii-crest,
#ila-intro.crest-missing .ii-sheen{ display:none !important; }
#ila-intro.is-playing .ii-eyebrow{ animation:ii-rise 1s var(--ii-ease) 1.0s forwards; }
#ila-intro.is-playing .ii-meta{ animation:ii-rise 1.1s var(--ii-ease) 1.5s forwards; }
#ila-intro.is-playing .ii-hint{ animation:ii-rise 1s var(--ii-ease) 2.0s forwards, ii-float 2.6s ease-in-out 3.1s infinite; }

/* Page-transition mode = a quick, minimal loader badge. The crest is COMPACT and
   STATIC (no cinematic blur-in) so the cover reads as one continuous curtain across
   the page swap — clearly different from the once-per-session cinematic intro and no
   longer "replaying the intro" on each navigation. */
#ila-intro.is-transition .ii-crestwrap{ width:clamp(92px, 13vmin, 144px); }
#ila-intro.is-transition .ii-crest{ animation:none !important;
  filter:drop-shadow(0 10px 26px rgba(0,0,0,.5)); transition:opacity .25s ease; }
#ila-intro.is-transition.crest-ready .ii-crest{ opacity:1; }
#ila-intro.is-transition.is-playing .ii-spin{ animation:ii-fade .3s ease forwards; }
#ila-intro.is-transition .ii-spin .sp-arc{ animation:ii-rotate 1.05s linear infinite; }
/* the between-page curtain lifts a touch quicker than the intro fallback */
#ila-intro.is-transition.is-leaving{ transition:transform .6s var(--ii-ease), filter .6s var(--ii-ease); }

/* curtain dropping over the current page before we navigate away */
#ila-intro.is-covering .ii-backdrop{ opacity:0; animation:ii-cover .42s ease forwards; }
#ila-intro.is-covering .ii-vignette{ opacity:0; animation:ii-cover .5s ease .05s forwards; }
@keyframes ii-cover{ from{ opacity:0; } to{ opacity:1; } }

@keyframes ii-bloom{
  0%{ opacity:0; transform:translate(-50%,-50%) scale(.5); }
  55%{ opacity:1; }
  100%{ opacity:.95; transform:translate(-50%,-50%) scale(1); }
}
@keyframes ii-crest-in{
  0%{ opacity:0; transform:scale(1.09); filter:blur(15px) drop-shadow(0 18px 50px rgba(0,0,0,.6)); }
  55%{ opacity:1; }
  100%{ opacity:1; transform:scale(1); filter:blur(0) drop-shadow(0 18px 50px rgba(0,0,0,.6)); }
}
@keyframes ii-spin{ to{ transform:translate(-50%,-50%) rotate(360deg); } }
@keyframes ii-rotate{ to{ transform:rotate(360deg); } }
@keyframes ii-sweep{
  0%{ opacity:0; -webkit-mask-position:180% 0; mask-position:180% 0; }
  12%{ opacity:1; }
  88%{ opacity:1; }
  100%{ opacity:0; -webkit-mask-position:-90% 0; mask-position:-90% 0; }
}
@keyframes ii-rise{ from{ opacity:0; transform:translateY(16px); } to{ opacity:1; transform:translateY(0); } }
@keyframes ii-fade{ to{ opacity:1; } }
@keyframes ii-float{ 0%,100%{ transform:translateY(0); } 50%{ transform:translateY(7px); } }

/* ===================== EXIT — flight reveal ============================== */
/* When flying, the crest travels (JS sets the transform) while everything
   else fades, exposing the page. The crest then cross-fades into the real
   site logo that lives at the landing spot. */
#ila-intro.is-revealing .ii-video,
#ila-intro.is-revealing .ii-backdrop,
#ila-intro.is-revealing .ii-bloom,
#ila-intro.is-revealing .ii-vignette,
#ila-intro.is-revealing .ii-halo,
#ila-intro.is-revealing .ii-bar,
#ila-intro.is-revealing .ii-eyebrow,
#ila-intro.is-revealing .ii-meta,
#ila-intro.is-revealing .ii-hint,
#ila-intro.is-revealing .ii-spin{
  opacity:0 !important;
  transition:opacity .6s ease;
}
#ila-intro.is-revealing{ pointer-events:none; }

/* ===================== EXIT — simple curtain (fallback, no landing) ====== */
#ila-intro.is-leaving{
  transform:translateY(-101%);
  filter:blur(4px);
  pointer-events:none;
  transition:transform 1.0s var(--ii-ease), filter 1.0s var(--ii-ease);
}

/* ===================== PAGE-LEVEL HOOKS ================================== */
/* lock scroll while the overlay is up */
html.ila-locked, html.ila-locked body{ overflow:hidden !important; }

/* hide the page (prevents a flash) until the overlay is ready to reveal it.
   The overlay is appended to <body>, so it is force-shown (rule below) to
   stay on top of the cloak. */
html.ila-cloak-page body{ visibility:hidden !important; }
/* the overlay must stay visible even while <body> is cloaked */
#ila-intro{ visibility:visible !important; }

/* hide the site's resting logo while the flying crest stands in for it,
   then let it cross-fade in as the crest lands */
html.ila-cloak-logo .ila-landing{ opacity:0 !important; }
.ila-landing{ transition:opacity .5s ease; }
/* gentle "planted" arrival once the flown crest hands off to the real logo */
.ila-landing.ila-settle{ animation:ila-settle .72s var(--ii-ease); }
@keyframes ila-settle{
  0%{ transform:scale(1.045); }
  55%{ transform:scale(.992); }
  100%{ transform:scale(1); }
}

/* reduced motion: show the resolved frame, skip the choreography */
@media (prefers-reduced-motion:reduce){
  #ila-intro *{ animation:none !important; }
  #ila-intro .ii-bloom{ opacity:.95; transform:translate(-50%,-50%) scale(1); }
  #ila-intro .ii-halo{ opacity:1; }
  #ila-intro.crest-ready .ii-crest{ opacity:1; transform:none; filter:drop-shadow(0 18px 50px rgba(0,0,0,.6)); }
  #ila-intro .ii-eyebrow,
  #ila-intro .ii-meta,
  #ila-intro .ii-hint{ opacity:1; transform:none; }
  #ila-intro.is-flying .ii-crestwrap{ transition:none; }
  #ila-intro.is-leaving{ transition:opacity .4s ease; transform:none; opacity:0; }
}

/* ===================== TOUCH DEVICES (phones / tablets) ================= */
/* iOS WebKit (Safari, Chrome-on-iOS, in-app browsers) can flush a composited
   image layer to screen as a SOLID WHITE RECTANGLE when that layer carries a
   `filter` — the opacity keyframe runs on the compositor even though the layer
   content was never rasterized. So on touch devices the crest renders with NO
   filter at all (the shadow is invisible on the dark stage anyway) and enters
   with a clean opacity/scale fade instead of the blur-in. Desktop keeps the
   full cinematic treatment. */
@media (pointer:coarse){
  #ila-intro .ii-crest{ filter:none !important; }
  #ila-intro.is-playing.crest-ready .ii-crest{
    animation:ii-crest-in-lite 1.3s var(--ii-ease) .3s forwards;
  }
  /* the metallic sheen is another filter+blend compositor layer over the same
     PNG — imperceptible on a phone, so drop the risk entirely */
  #ila-intro .ii-sheen{ display:none !important; }
}
@keyframes ii-crest-in-lite{
  0%{ opacity:0; transform:scale(1.055); }
  100%{ opacity:1; transform:scale(1); }
}

/* ===================== SMALL-SCREEN GUARDS ============================== */
/* Phones: the venue meta line is long (esp. RU). Let it wrap onto two centered
   lines instead of clipping off the overlay edge. white-space:normal only wraps
   when it must, so larger phones keep the single line. */
@media (max-width:480px){
  #ila-intro .ii-meta{ white-space:normal; line-height:1.5; max-width:86vw; }
}
/* Smallest phones: tighten the kicker + venue tracking so neither line
   reaches the viewport edge at ~320px. */
@media (max-width:380px){
  #ila-intro .ii-meta{ letter-spacing:.18em; text-indent:.18em; }
  #ila-intro .ii-eyebrow{ letter-spacing:.26em; text-indent:.26em; gap:.55rem; }
}
