/* FutureAITechX — cinematic 3D intro overlay (css/intro.css)
 *
 * Styles the overlay built by js/intro.js (lazy-loaded by js/motion.js on the
 * homepage only, once per session, desktop + WebGL + motion allowed). The
 * overlay is pure presentation: the homepage beneath stays server-rendered,
 * and every control here is a real, keyboard-reachable <button>.
 */

html.fsh-intro-lock { overflow: hidden; }

/* pre-paint cloak: the inline head script adds this only when the intro will
   play, so the homepage never flashes before the dark canvas is up. The
   failsafe timer (and intro.js itself) always removes it. */
html.fsh-intro-cloak body > *:not(.fsh-intro) { visibility: hidden; }

.fsh-intro {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: #02040c;
  color: #e8f4ff;
  overflow: hidden;
  opacity: 1;
  transition: opacity 1s ease;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.fsh-intro.done { opacity: 0; pointer-events: none; }
.fsh-intro.done-fast { opacity: 0; pointer-events: none; transition: opacity .45s ease; }

.fsh-intro-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* cinematic dressing ---------------------------------------------------- */

.fsh-intro-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 118% 88% at 50% 46%, rgba(0, 0, 0, 0) 52%, rgba(1, 3, 10, .62) 100%),
    linear-gradient(180deg, rgba(2, 6, 18, .35), rgba(0, 0, 0, 0) 22% 78%, rgba(1, 3, 10, .5));
}

.fsh-intro-grain {
  position: absolute;
  inset: -40px;
  pointer-events: none;
  opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

.fsh-intro-bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  background: #000;
  pointer-events: none;
  transition: height 1.1s cubic-bezier(.6, 0, .3, 1);
}
.fsh-intro-bar-top { top: 0; }
.fsh-intro-bar-bot { bottom: 0; }
.fsh-intro.ready .fsh-intro-bar { height: 6.5vh; }
.fsh-intro.done .fsh-intro-bar,
.fsh-intro.done-fast .fsh-intro-bar { height: 0; }

/* finale pulse ----------------------------------------------------------- */

.fsh-intro-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse 70% 55% at 50% 58%, rgba(120, 190, 255, .5), rgba(64, 110, 255, .18) 45%, rgba(0, 0, 0, 0) 75%);
}
.fsh-intro.pulse .fsh-intro-flash { animation: fsh-intro-flash 1.1s ease-out; }
@keyframes fsh-intro-flash {
  0% { opacity: 0; }
  14% { opacity: .8; }
  100% { opacity: 0; }
}

/* finale copy (the brand name itself stays in the 3D scene above it) ------ */

.fsh-intro-copy {
  position: absolute;
  left: 50%;
  top: 61%;
  transform: translateX(-50%);
  width: min(92vw, 900px);
  text-align: center;
  pointer-events: none;
}
.fsh-intro .sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.fsh-intro-tag,
.fsh-intro-sub {
  margin: 0;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1);
}
.fsh-intro-tag {
  font-size: clamp(13px, 1.35vw, 17px);
  font-weight: 600;
  letter-spacing: .42em;
  text-indent: .42em;   /* recenters tracked uppercase */
  text-transform: uppercase;
  color: #e8f2ff;
  text-shadow: 0 0 24px rgba(83, 216, 255, .45);
  white-space: nowrap;
}
.fsh-intro-tag .d { color: #53d8ff; }
.fsh-intro-sub {
  margin-top: 14px;
  font-size: clamp(12px, 1.1vw, 14.5px);
  font-weight: 500;
  letter-spacing: .12em;
  color: rgba(180, 205, 245, .78);
}
.fsh-intro-copy.show-tag .fsh-intro-tag { opacity: 1; transform: translateY(0); }
.fsh-intro-copy.show-sub .fsh-intro-sub { opacity: 1; transform: translateY(0); }
.fsh-intro-copy.show-brand .fsh-intro-tag { transition-delay: .45s; }

/* controls ----------------------------------------------------------------- */

.fsh-intro-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s ease .8s;
}
.fsh-intro.ready .fsh-intro-ui { opacity: 1; }

.fsh-intro-skip,
.fsh-intro-sound {
  pointer-events: auto;
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid rgba(141, 176, 255, .32);
  border-radius: 999px;
  background: rgba(6, 12, 28, .55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #cfe0ff;
  font: 600 12px/1 Inter, system-ui, sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color .25s ease, color .25s ease, background .25s ease, box-shadow .25s ease;
}
.fsh-intro-skip { top: max(18px, calc(6.5vh + 12px)); right: 22px; }
.fsh-intro-sound { bottom: max(18px, calc(6.5vh + 12px)); left: 22px; }
/* quiet affordance: the whole surface answers a scroll or tap, so say so */
.fsh-intro-hint {
  pointer-events: none;
  position: absolute;
  bottom: max(24px, calc(6.5vh + 18px));
  left: 50%;
  transform: translateX(-50%);
  font: 500 11px/1 Inter, system-ui, sans-serif;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(180, 205, 245, .55);
  animation: fsh-intro-hint-breath 2.6s ease-in-out infinite;
}
@keyframes fsh-intro-hint-breath {
  0%, 100% { opacity: .45; }
  50% { opacity: .95; }
}
.fsh-intro.done .fsh-intro-hint,
.fsh-intro.done-fast .fsh-intro-hint { opacity: 0; }
.fsh-intro-skip:hover,
.fsh-intro-skip:focus-visible,
.fsh-intro-sound:hover,
.fsh-intro-sound:focus-visible {
  border-color: rgba(83, 216, 255, .8);
  color: #fff;
  background: rgba(10, 22, 48, .75);
  box-shadow: 0 0 24px rgba(83, 216, 255, .22);
  outline: none;
}
.fsh-intro-skip:focus-visible,
.fsh-intro-sound:focus-visible { outline: 2px solid rgba(83, 216, 255, .85); outline-offset: 3px; }
.fsh-intro-sound svg { opacity: .75; }
.fsh-intro-sound.on { color: #9fe8ff; border-color: rgba(83, 216, 255, .55); }

/* progress hairline --------------------------------------------------------- */

.fsh-intro-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(141, 176, 255, .12);
  pointer-events: none;
}
.fsh-intro-progress i {
  display: block;
  height: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, #406eff, #53d8ff);
  box-shadow: 0 0 12px rgba(83, 216, 255, .8);
}

/* guards --------------------------------------------------------------------- */

@media (max-width: 899px) {
  .fsh-intro { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .fsh-intro { display: none; }
}
