/* =========================================================================
   Brand intro — official logo reveal before the AUTO / BUS gateway.
   Loaded by the gateway and by the /logo-intro-preview/ prototype route.

   Structure matters here: .lintro is a TRANSPARENT container; the Deep Indigo
   background lives on .lintro__veil so the veil can fade while the flying logo
   stays fully opaque. The logo never leaves .lintro__stage — it is animated
   with transforms only, never reparented into the header flex layout.
   ========================================================================= */

/* The gateway underneath starts hidden and inert, but only once JS has taken
   over (html.li-js, set synchronously in <head>). Without JS the gateway is
   simply visible and usable. */
html.li-js .portal,
html.li-js .gw__top { opacity: 0; visibility: hidden; }
html.li-js body { overflow: hidden; }
html.li-done .portal,
html.li-done .gw__top { opacity: 1; visibility: visible; }

.lintro {
  position: fixed; inset: 0; z-index: 400;
  background: transparent;                 /* the veil carries the background */
  /* hidden until the synchronous <head> decision opts in (html.li-js).
     Crucially this also covers JavaScript OFF: no class is ever added, the
     overlay never renders, and the portal is plainly usable. */
  display: none;
}
html.li-js .lintro { display: block; }
.lintro[hidden] { display: none !important; }
/* repeat visit: decided synchronously in <head>, so the overlay is
   never painted at all */
html.li-skip .lintro, html.li-skip .lintro-replay { display: none; }

.lintro__veil {
  position: absolute; inset: 0;
  background: var(--indigo-deep);
  /* a very subtle radial light behind the mark — no glow, no particles */
  background-image: radial-gradient(58% 46% at 50% 46%,
    rgba(174, 183, 189, 0.10) 0%, rgba(174, 183, 189, 0.04) 38%, transparent 72%);
  will-change: opacity;
}

/* full-viewport stage: the logo is centred here for the whole sequence and
   only ever moves by transform, so no layout can be recalculated mid-flight */
.lintro__stage {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  pointer-events: none;
}

/* The lockup keeps the manual's exact proportions: symbol and wordmark are
   placed at their true offsets inside one box the width of the real lockup. */
.lintro__lockup {
  position: relative;
  width: clamp(220px, 34vw, 380px);
  aspect-ratio: 760 / 218;
  will-change: transform;
}
.lintro__sym,
.lintro__word { position: absolute; top: 0; height: 100%; }
.lintro__sym { left: 0; width: 31.036%; }
.lintro__word { left: 31.036%; width: 68.964%; overflow: hidden; }
.lintro__sym img,
.lintro__word img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* pre-GSAP safe state: symbol hidden, wordmark clipped away */
html.li-js .lintro__sym { opacity: 0; }
html.li-js .lintro__word { clip-path: inset(0 100% 0 0); opacity: 0; }

/* one restrained highlight passes over the symbol; never a permanent recolour */
.lintro__shine {
  /* scoped to the symbol box so the mask lines up with the symbol artwork */
  position: absolute; top: 0; left: 0; width: 31.036%; height: 100%;
  overflow: hidden; pointer-events: none;
  mask-image: url("/assets/logo/intro-symbol.png");
  mask-size: contain; mask-repeat: no-repeat; mask-position: center;
  -webkit-mask-image: url("/assets/logo/intro-symbol.png");
  -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center;
}
.lintro__shine i {
  position: absolute; top: -20%; bottom: -20%; width: 38%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: translateX(-180%);
}

.lintro__skip {
  position: absolute; top: clamp(16px, 2.4vw, 28px); right: clamp(16px, 2.4vw, 28px);
  min-width: 44px; min-height: 44px; padding: 0 18px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(254, 246, 242, 0.10);
  border: 1px solid rgba(254, 246, 242, 0.42); border-radius: 8px;
  color: var(--ivory); font-family: var(--font-primary);
  font-size: 0.85rem; font-weight: 500; cursor: pointer;
}
.lintro__skip:hover { background: rgba(254, 246, 242, 0.18); border-color: var(--ivory); }
.lintro__skip:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* development-only, prototype route only, never rendered on / */
.lintro-replay {
  position: fixed; right: 16px; bottom: 16px; z-index: 401;
  min-height: 44px; padding: 0 16px;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(8, 18, 26, 0.86); color: rgba(254, 246, 242, 0.9);
  border: 1px dashed rgba(174, 183, 189, 0.5); border-radius: 8px;
  font-family: var(--font-primary); font-size: 0.76rem; font-weight: 500;
  letter-spacing: 0.04em; cursor: pointer;
}
.lintro-replay:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

@media (max-width: 560px) {
  .lintro__lockup { width: clamp(220px, 62vw, 270px); }
  .lintro__skip { font-size: 0.8rem; padding: 0 14px; }
}

/* Reduced motion: no cinematic sequence. The complete official logo is shown
   immediately and the gateway is available at once. */
@media (prefers-reduced-motion: reduce) {
  html.li-js .lintro__sym { opacity: 1; }
  html.li-js .lintro__word { clip-path: inset(0 0 0 0); opacity: 1; }
  .lintro__shine { display: none; }
}
