/* =========================================================================
   CISOSE 2027 — V6.6.5 Glass Welcome intro (Congress homepage only)
   Enabled per page in congress/site.config.json ("intro": true); tools/build-site-chrome.mjs writes the
   @site-chrome:intro <head> region (bootstrap + this file + welcome-intro.js) into that page only.
   Accepted look: demos/welcome-intro-v6.6.5.html (which loads these same files).
   A translucent ice-blue / white glass layer over the real page (the page stays visible, softly blurred), the
   title in the centre with one slow, very faint cyan glow behind it. No particles, no loops, no rotation.
   Pieces: (1) an inline <head> bootstrap (rendered by the build) that adds html.wi-pending when the intro should play,
   (2) this stylesheet, (3) welcome-intro.js (deferred) which builds the overlay.

   Timeline (≈ 2.5s): 0–0.6s glass + text fade / rise in · 0.2–1.8s the glow spreads once ·
   1.7–2.1s the text fades out first (so no half-transparent title ever ghosts over the sharpening page) ·
   1.9–2.5s the glass dissolves · then the script removes it.

   Safety: nothing here can cover the page for good.
   • html.wi-pending::after is the same glass, painted from the first frame (no flash before the intro). It never
     takes pointer events and fades out by itself at 2.5s — even if the script never runs.
   • .wi (the real overlay) also fades itself out with a CSS animation (then visibility: hidden); the script removes
     it at the end, on Skip / Esc, or from a failsafe timer.
   ========================================================================= */

:root {
  --wi-z: 2147483000;
  --wi-glass: rgb(238 247 252 / 0.58);          /* ice-blue white, translucent */
  --wi-blur: blur(14px) saturate(1.08);
  --wi-navy: #0b2545;                            /* title (navy-900) */
  --wi-teal: #0b6f82;                            /* soft teal-blue supporting text (≥ 4.5:1 on the glass) */
  --wi-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* (1) Placeholder glass until the overlay mounts. */
html.wi-pending::after {
  content: "";
  position: fixed; inset: 0; z-index: var(--wi-z);
  background: var(--wi-glass);
  -webkit-backdrop-filter: var(--wi-blur); backdrop-filter: var(--wi-blur);
  pointer-events: none;
  animation: wi-out 0.6s ease 1.9s 1 forwards;
}

/* (2) Overlay */
.wi {
  position: fixed; inset: 0; z-index: calc(var(--wi-z) + 1);
  display: grid; place-items: center;
  overflow: hidden;
  background: var(--wi-glass);
  -webkit-backdrop-filter: var(--wi-blur); backdrop-filter: var(--wi-blur);
  color: var(--wi-navy);
  font-family: var(--font-sans, "Segoe UI", system-ui, sans-serif);
  -webkit-font-smoothing: antialiased;
  animation: wi-in 0.45s ease-out both, wi-out 0.6s var(--wi-ease) 1.9s 1 forwards;
}
.wi[data-from-cover] { animation: wi-out 0.6s var(--wi-ease) 1.9s 1 forwards; }   /* the glass is already on screen */
@keyframes wi-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes wi-out { from { opacity: 1; visibility: visible; } to { opacity: 0; visibility: hidden; } }
/* Without backdrop-filter support the glass is simply a little more opaque, so the title stays legible. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html.wi-pending::after, .wi { background: rgb(238 247 252 / 0.9); }
}

/* Soft light behind the title: a white bloom for legibility + one slow, very faint cyan glow that spreads once. */
.wi__glow {
  position: absolute; left: 50%; top: 50%;
  width: min(1100px, 150vw); aspect-ratio: 1.6;
  transform: translate(-50%, -50%) scale(0.55);
  border-radius: 50%;
  background:
    radial-gradient(closest-side, rgb(255 255 255 / 0.62), rgb(255 255 255 / 0.28) 45%, transparent 75%),
    radial-gradient(closest-side, rgb(95 210 224 / 0.20), rgb(95 210 224 / 0.07) 55%, transparent 100%);
  opacity: 0;
  pointer-events: none;
  animation: wi-glow 1.6s var(--wi-ease) 0.2s 1 forwards, wi-fade 0.4s ease-in 1.7s 1 forwards;
}
@keyframes wi-fade { to { opacity: 0; } }   /* opacity only: keeps the glow's centring transform */
@keyframes wi-glow {
  0%   { opacity: 0;   transform: translate(-50%, -50%) scale(0.55); }
  45%  { opacity: 1; }
  100% { opacity: 0.85; transform: translate(-50%, -50%) scale(1); }
}

.wi__content {
  position: relative; z-index: 1;
  display: grid; justify-items: center; gap: clamp(0.5rem, 0.3rem + 0.7vw, 0.9rem);
  padding-inline: 1.25rem;
  text-align: center;
  max-width: 100%;
  animation: wi-text-out 0.4s ease-in 1.7s 1 forwards;
}
@keyframes wi-text-out { to { opacity: 0; transform: translateY(-4px); } }
.wi__eyebrow, .wi__title, .wi__sub { margin: 0; opacity: 0; animation: wi-rise 0.6s var(--wi-ease) both; }
.wi__eyebrow {
  font-size: clamp(0.8125rem, 0.65rem + 0.55vw, 1.0625rem);
  font-weight: 600; letter-spacing: 0.4em; text-transform: uppercase;
  color: var(--wi-teal);
  padding-left: 0.4em; /* balances the trailing letter-spacing so the line stays centred */
  animation-delay: 0.1s;
}
.wi__title {
  font-size: clamp(2.25rem, 1rem + 6vw, 6rem);
  font-weight: 800; line-height: 1.02; letter-spacing: -0.015em;
  color: var(--wi-navy);
  text-shadow: 0 1px 0 rgb(255 255 255 / 0.6);
  animation-delay: 0.2s;
}
.wi__line { display: inline-block; white-space: nowrap; }
.wi__sub {
  font-size: clamp(1rem, 0.78rem + 1vw, 1.625rem);
  font-weight: 500; letter-spacing: 0.06em;
  color: var(--wi-teal);
  animation-delay: 0.3s;
}
@keyframes wi-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Phones: the title breaks into two lines ("IEEE CISOSE" / "2027") and stays fully readable. */
@media (max-width: 30rem) {
  .wi__line { display: block; }
  .wi__title { font-size: clamp(2.5rem, 1.2rem + 9vw, 3.5rem); line-height: 1.05; }
  .wi__eyebrow { letter-spacing: 0.32em; padding-left: 0.32em; }
}

/* Skip Intro: top-right, always reachable, clear focus ring. */
.wi__skip {
  position: absolute; z-index: 2;
  top: max(1rem, env(safe-area-inset-top)); right: max(1rem, env(safe-area-inset-right));
  min-height: 2.75rem; padding: 0.5rem 1.1rem;
  border: 1px solid rgb(11 37 69 / 0.28); border-radius: 999px;
  background: rgb(255 255 255 / 0.72);
  color: var(--wi-navy); font: inherit; font-size: 0.9375rem; font-weight: 600; letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 14px -6px rgb(11 37 69 / 0.35);
  transition: background-color 150ms ease, border-color 150ms ease;
}
.wi__skip:hover { background: #ffffff; border-color: var(--wi-teal); }
.wi__skip:focus-visible { outline: 3px solid #0f5c99; outline-offset: 3px; }

/* The intro never plays with reduced motion (the bootstrap and the script both check); belt and braces: */
@media (prefers-reduced-motion: reduce) {
  html.wi-pending::after { display: none; }
  .wi { display: none; }
}
@media print { html.wi-pending::after, .wi { display: none !important; } }
