/* Opening name reveal — Luminous Digital Hub (homepage)
   Shown only while <html> has .intro-active (set by the inline head script).
   Timeline: mark draws in yellow → fills cream → spark ignites → LUMINOUS writes
   → DIGITAL HUB + tagline rise → green curtain lifts, trailing yellow drips. */

.intro { display: none; }
html.intro-active .intro,
.intro.is-leaving {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  background: radial-gradient(120% 90% at 50% 45%, #17402B 0%, #0F2E1F 70%);
  color: #F0E6E3;
  cursor: pointer;
  transition: transform 1.05s cubic-bezier(.76, 0, .24, 1);
}
html.intro-active body { overflow: hidden; }

/* Warm yellow glow behind the logo */
.intro-glow {
  position: absolute; left: 50%; top: 50%; width: min(900px, 140vw); aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(.6); opacity: 0;
  background: radial-gradient(closest-side, rgba(247, 181, 0, .2), rgba(247, 181, 0, .05) 45%, transparent 72%);
  animation: i-glow 2.4s cubic-bezier(.16, 1, .3, 1) .9s forwards;
  pointer-events: none;
}
@keyframes i-glow { to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

.intro-stage {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 26px;
  transition: transform .7s cubic-bezier(.76, 0, .24, 1), opacity .5s ease;
}
.intro-mark { position: relative; width: min(78vw, 540px); }
.intro-logo { display: block; width: 100%; height: auto; overflow: visible; }

/* L + D: outline draws in yellow, then fills cream */
.intro .i-draw {
  fill: #F0E6E3; fill-opacity: 0;
  stroke: #F7B500; stroke-width: 4; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: i-draw 1s cubic-bezier(.65, 0, .35, 1) .25s forwards, i-fill .55s ease 1.05s forwards;
}
.intro .i-D { animation-delay: .45s, 1.2s; }
@keyframes i-draw { to { stroke-dashoffset: 0; } }
@keyframes i-fill { to { fill-opacity: 1; stroke-opacity: 0; } }

/* Spark ignites with a shock ring */
.intro .i-spark-in {
  transform-box: fill-box; transform-origin: center;
  opacity: 0; transform: scale(0) rotate(-120deg);
  animation: i-spark 1s cubic-bezier(.34, 1.56, .64, 1) 1.15s forwards;
}
@keyframes i-spark {
  55% { opacity: 1; transform: scale(1.6) rotate(20deg); }
  100% { opacity: 1; transform: none; }
}
.intro .i-ring {
  fill: none; stroke: #F7B500; stroke-width: .5;
  transform-box: fill-box; transform-origin: center;
  opacity: 0; animation: i-ring 1.1s cubic-bezier(.16, 1, .3, 1) 1.25s forwards;
}
@keyframes i-ring {
  0% { opacity: .9; transform: scale(.2); }
  100% { opacity: 0; transform: scale(7); }
}

/* LUMINOUS writes letter by letter */
.intro .i-letter {
  stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0;
  animation: i-letter .6s cubic-bezier(.65, 0, .35, 1) calc(1.3s + var(--i) * 75ms) forwards;
}
@keyframes i-letter {
  from { opacity: 1; stroke-dashoffset: 1; }
  to { opacity: 1; stroke-dashoffset: 0; }
}

/* DIGITAL HUB rises */
.intro .i-sub {
  opacity: 0; transform: translateY(3px);
  animation: i-up .7s cubic-bezier(.16, 1, .3, 1) 2s forwards;
}
@keyframes i-up { to { opacity: 1; transform: none; } }

/* Tagline as a yellow pill, like the homepage tags */
.intro-tagline {
  margin: 0; padding: 9px 18px 9px calc(18px + .32em); border-radius: 999px;
  background: #F7B500; color: #123022;
  font: 800 clamp(11px, 1.2vw, 13px)/1 var(--body, system-ui, sans-serif);
  letter-spacing: .32em; text-transform: uppercase;
  opacity: 0; transform: translateY(10px) scale(.96);
  animation: i-pill .8s cubic-bezier(.16, 1, .3, 1) 2.35s forwards;
}
@keyframes i-pill { to { opacity: 1; transform: none; } }

/* Progress bar */
.intro-progress {
  position: absolute; left: 50%; bottom: clamp(36px, 8vh, 72px);
  width: min(220px, 50vw); height: 3px; border-radius: 3px; transform: translateX(-50%);
  background: rgba(240, 230, 227, .12); overflow: hidden;
}
.intro-progress::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: #F7B500;
  transform: scaleX(0); transform-origin: left;
  animation: i-progress 3s cubic-bezier(.65, 0, .35, 1) .1s forwards;
}
@keyframes i-progress { to { transform: scaleX(1); } }

.intro-skip {
  position: absolute; right: clamp(16px, 3vw, 32px); bottom: clamp(24px, 6vh, 56px);
  font: 700 12px var(--body, system-ui, sans-serif); letter-spacing: .14em; text-transform: uppercase;
  color: rgba(240, 230, 227, .55); padding: 8px 14px; border-radius: 999px;
  border: 1px solid rgba(240, 230, 227, .18);
  transition: color .2s, background-color .2s, border-color .2s;
}
.intro-skip:hover { color: #123022; background: #F7B500; border-color: #F7B500; }

/* Yellow drips hang below the curtain and trail it as it lifts */
.intro::after {
  content: ""; position: absolute; left: 0; right: 0; top: calc(100% - 1px);
  height: clamp(60px, 9vw, 130px); pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 100' preserveAspectRatio='none'%3E%3Cpath fill='%23F7B500' d='M0 0H1440V6L1440 6C1414 6 1438 51 1400 51C1362 51 1386 6 1360 6L1320 6C1275 6 1317 92 1250 92C1184 92 1226 6 1180 6L1124 6C1095 6 1122 51 1080 51C1038 51 1065 6 1036 6L974 6C926 6 970 83 900 83C830 83 874 6 826 6L772 6C738 6 769 60 720 60C671 60 702 6 668 6L620 6C568 6 616 96 540 96C464 96 512 6 460 6L410 6C384 6 408 47 370 47C332 47 356 6 330 6L270 6C225 6 267 87 200 87C134 87 176 6 130 6L106 6C76 6 104 56 60 56C16 56 44 6 14 6L0 6Z'/%3E%3C/svg%3E") top / 100% 100% no-repeat;
}
/* Exit: curtain (with its drips) lifts clear of the viewport */
.intro.is-leaving { transform: translateY(calc(-100% - clamp(60px, 9vw, 130px))); pointer-events: none; }
.intro.is-leaving .intro-stage { transform: translateY(-60px) scale(.94); opacity: 0; }

/* Page chrome waits for the curtain */
html.intro-active .header { transform: translateY(-100%); opacity: 0; }
html.intro-active .wa-float { opacity: 0; }
.wa-float { transition: transform .3s cubic-bezier(.16, 1, .3, 1), opacity .6s ease .5s; }

@media (prefers-reduced-motion: reduce) {
  .intro { display: none !important; }
}
