/*
 * brand-intro.css — Signature brand intro.
 * Concept: the "PIA Industries" wordmark is the GROUND / ROOTS. The white pine
 * tree grows up out of it, surges to full strength, the base anchors with a firm
 * thud, then the tree withstands a buffeting shake (rooted = indestructible).
 * Self-contained: all selectors prefixed .brand-intro-*. Never leaks into the host.
 * v20260618-grow
 */

/* ── Overlay backdrop ─────────────────────────────────────────────────────────── */
.brand-intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(125% 125% at 50% 66%, #0e1a2c 0%, #070d17 58%, #04070e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.brand-intro-overlay.brand-intro-fading {
  pointer-events: none;
  animation: brand-intro-overlay-out 560ms ease-in both;
}
@keyframes brand-intro-overlay-out { from { opacity: 1; } to { opacity: 0; } }

/* ── Stage: tree on top, wordmark (the base/roots) directly beneath it ─────────── */
.brand-intro-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  user-select: none;
  -webkit-user-select: none;
}

/* ── Pine-tree logo — grows UP out of the wordmark ────────────────────────────── */
.brand-intro-logo {
  position: relative;
  z-index: 2;
  transform-origin: bottom center;   /* sprouts from its base */
  transform: scale(0.04);            /* a seed at the base before it grows */
  opacity: 0;
  margin-bottom: -7px;               /* base roots slightly into the wordmark */
  will-change: transform, opacity;
  pointer-events: none;
}
.brand-intro-logo-inner {
  display: block;
  transform-origin: bottom center;   /* shake sways around the rooted base */
  will-change: transform;
}
.brand-intro-logo img {
  display: block;
  width: clamp(90px, 13vw, 158px);
  height: clamp(90px, 13vw, 158px);
  filter: drop-shadow(0 0 22px rgba(56, 189, 248, 0.50)) drop-shadow(0 0 6px rgba(125, 211, 252, 0.55));
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Grow: from a seed at the base, surge up to full with a confident overshoot. */
.brand-intro-logo.brand-intro-logo-grow {
  opacity: 1;
  animation: brand-intro-grow 1000ms cubic-bezier(0.20, 1.25, 0.32, 1) both;
}
@keyframes brand-intro-grow {
  0%   { opacity: 0; transform: scale(0.04); }
  16%  { opacity: 1; }
  66%  { transform: scale(1.11); }   /* surges up — vigor */
  83%  { transform: scale(0.97); }   /* settles back */
  100% { transform: scale(1); }      /* established, strong */
}

/* Established: the glow firms up and holds (kept on through the shake + hold). */
.brand-intro-logo.brand-intro-logo-strong img {
  filter: drop-shadow(0 0 32px rgba(56, 189, 248, 0.66)) drop-shadow(0 0 11px rgba(125, 211, 252, 0.72));
  transition: filter 260ms ease;
}

/* Shake (on the inner wrapper, pivoting on the rooted base): buffeted hard,
   holds firm, and settles dead upright — strong and indestructible. */
.brand-intro-logo-inner.brand-intro-shake {
  animation: brand-intro-shake 840ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes brand-intro-shake {
  0%   { transform: rotate(0deg)    translateX(0)    scale(1); }
  5%   { transform: rotate(-5.6deg) translateX(-3px) scale(1.025); }  /* takes a hard hit */
  12%  { transform: rotate(5deg)    translateX(3px)  scale(1.022); }  /* flexes, holds */
  20%  { transform: rotate(-3.9deg) translateX(-2px); }
  30%  { transform: rotate(3.3deg)  translateX(2px); }
  42%  { transform: rotate(-2.3deg); }
  55%  { transform: rotate(1.6deg); }
  68%  { transform: rotate(-0.9deg); }
  82%  { transform: rotate(0.45deg); }
  100% { transform: rotate(0deg)    translateX(0)    scale(1); }      /* dead upright */
}

/* ── Wordmark = the base / roots ──────────────────────────────────────────────── */
.brand-intro-wordmark {
  display: flex;
  align-items: baseline;
  justify-content: center;
  white-space: nowrap;
  position: relative;
  z-index: 3;                        /* sits in front of the tree's rooted base */
}
.brand-intro-word { display: inline-flex; align-items: baseline; }
.brand-intro-word-gap { display: inline-block; width: 0.32em; }

/* A firm "thud" the instant the tree establishes — the base presses down, immovable. */
.brand-intro-wordmark.brand-intro-wordmark-anchor {
  animation: brand-intro-anchor 440ms cubic-bezier(0.3, 0.85, 0.3, 1) both;
}
@keyframes brand-intro-anchor {
  0%   { transform: translateY(0); }
  38%  { transform: translateY(2.5px); }
  100% { transform: translateY(0); }
}

/* The foundation energizes once the tree is rooted. */
.brand-intro-wordmark.brand-intro-wordmark-lit .brand-intro-letter {
  text-shadow: 0 0 18px rgba(56, 189, 248, 0.32);
  transition: text-shadow 320ms ease;
}

/* ── Letters (the foundation): rise up from below and plant firmly ────────────── */
.brand-intro-letter {
  display: inline-block;
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(28px, 5.5vw, 52px);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #f1f5f9;
  line-height: 1;
  opacity: 0;
  transform: translateY(var(--bi-ty, 16px)) scale(0.92);
  transform-origin: center bottom;
  will-change: transform, opacity;
}
.brand-intro-letter.brand-intro-letter-animate {
  animation: brand-intro-letter-in var(--bi-dur, 520ms) var(--bi-ease, cubic-bezier(0.22, 1, 0.36, 1)) var(--bi-delay, 0ms) both;
}
@keyframes brand-intro-letter-in {
  0%   { opacity: 0; transform: translateY(var(--bi-ty, 16px)) scale(0.92); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Reduced-motion is intentionally NOT honored — it is a brief, deliberate
   signature splash that always plays the full grow-and-stand sequence. */
