/* ===========================================================================
   intro.css — logo intro splash + hero logo treatment.
   On load: a full-screen splash shows the Trio logo big with a 3D flip-in, a
   light sweep masked to the logo shape, and a gentle float/wobble, then lifts.
   The same logo (with the sweep) sits in the hero. Gated on .js so without JS
   the splash never blocks the page; a CSS backstop hides it if JS never runs.
   =========================================================================== */

/* ---------- splash overlay ---------- */
#intro { display: none; }
html.js #intro {
  display: grid;
  place-items: center;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(239, 232, 216, 0.5);          /* warm frost over the page */
  -webkit-backdrop-filter: blur(30px) saturate(116%);
  backdrop-filter: blur(30px) saturate(116%);
  animation: introFail 0.1s linear 5s forwards; /* backstop: hide even if JS never dismisses */
}
#intro.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}
@keyframes introFail { to { opacity: 0; visibility: hidden; pointer-events: none; } }

/* ---------- shared 3D logo rig (nested so transforms never collide) ---------- */
.intro-logo-stage { perspective: 1300px; }
.intro-float  { animation: logoFloat 6s ease-in-out infinite; }
.intro-rotate { transform-style: preserve-3d; animation: introIn 0.65s cubic-bezier(.2,.75,.25,1) both; }
.intro-wobble { transform-style: preserve-3d; animation: logoWobble 7s ease-in-out 0.65s infinite; }

.logo-wrap { position: relative; display: inline-block; }
.intro-logo {
  height: clamp(380px, 78vh, 880px);
  width: auto;
  display: block;
  filter: drop-shadow(0 24px 56px rgba(10, 60, 111, .35));
}

/* ---------- light sweep (masked to the logo shape) ---------- */
.logo-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .85) 50%, transparent 60%);
  background-repeat: no-repeat;
  background-size: 240% 100%;
  background-position: 160% 0;
  -webkit-mask: url(../assets/trio-logo.png) center / contain no-repeat;
  mask: url(../assets/trio-logo.png) center / contain no-repeat;
  mix-blend-mode: screen;
  animation: logoSheen 1.5s ease-in-out 0.35s infinite;
}
@keyframes logoSheen {
  0%   { background-position: 160% 0; }
  45%  { background-position: -60% 0; }
  100% { background-position: -60% 0; }
}

@keyframes introIn {
  0%   { opacity: 0; transform: rotateY(-85deg) rotateX(12deg) scale(.78); }
  55%  { opacity: 1; }
  100% { opacity: 1; transform: rotateY(0) rotateX(0) scale(1); }
}
@keyframes logoFloat  { 0%, 100% { transform: translateY(0); }   50% { transform: translateY(-14px); } }
@keyframes logoWobble { 0%, 100% { transform: rotateY(-8deg); }  50% { transform: rotateY(8deg); } }

/* ---------- hero logo ---------- */
.brand-logo-wrap {
  position: relative;
  display: inline-block;
  animation: logoFloat 6s ease-in-out infinite;
}
.brand-logo { height: clamp(120px, 20vh, 210px); width: auto; display: block; }
.logo-sheen--hero { animation: logoSheen 5s ease-in-out 1s infinite; }

/* ---------- hero logo watermark (big + faint; fills the first view) ---------- */
.hero-watermark-stage {
  position: absolute; inset: 0; z-index: 0;
  display: grid; place-items: center;
  pointer-events: none; overflow: hidden;
}
.hero-watermark-box {
  position: relative;
  height: min(98vh, 920px);
  aspect-ratio: 1024 / 1536;
}
.hero-watermark { width: 100%; height: 100%; object-fit: contain; opacity: 0.085; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  #intro { display: none !important; }
  .intro-float, .intro-rotate, .intro-wobble,
  .brand-logo-wrap, .logo-sheen { animation: none !important; }
}
