/* ==========================================================================
   The Try Company — Cinematic Luxury Brand Intro & Masking Transition
   ========================================================================== */

/* Fullscreen Splash Container */
.try-company-splash {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
}

/* Skip intro if returning visitor in session */
html.intro-skipped .try-company-splash,
html.intro-complete .try-company-splash {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Cream Canvas Backdrop (Receives the dynamic aperture mask) */
.splash-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: var(--colors-canvas, #faf6ef);
  z-index: 1;
  will-change: mask-image, -webkit-mask-image, opacity;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Ambient Radial Glow around Logo */
.splash-ambient-glow {
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.08) 0%, rgba(177, 89, 44, 0.06) 45%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  will-change: transform, opacity;
  transition: opacity 0.6s ease-out, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.try-company-splash.state-ready .splash-ambient-glow {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

/* Luminous Expanding Aperture Ring (Masking Ripple Effect) */
.splash-aperture-ring {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 1.5px solid rgba(177, 89, 44, 0.4);
  box-shadow: 0 0 25px rgba(13, 148, 136, 0.3), inset 0 0 15px rgba(177, 89, 44, 0.2);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  will-change: transform, opacity;
}

.try-company-splash.state-aperture-active .splash-aperture-ring {
  animation: splashApertureBloom 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes splashApertureBloom {
  0% {
    transform: translate(-50%, -50%) scale(0.6);
    opacity: 0.85;
    border-color: rgba(13, 148, 136, 0.6);
  }
  50% {
    opacity: 0.55;
    border-color: rgba(177, 89, 44, 0.45);
  }
  100% {
    transform: translate(-50%, -50%) scale(9.5);
    opacity: 0;
  }
}

/* Central Content Stack */
.splash-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

/* Central Logo Wrapper */
.splash-logo-wrap {
  width: 275px;
  max-width: 82vw;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.9);
  will-change: transform, opacity;
  transition: opacity 0.42s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.try-company-splash.state-ready .splash-logo-wrap {
  opacity: 1;
  transform: scale(1);
}

.splash-svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 16px rgba(42, 33, 24, 0.05));
}

/* Sheen sweep animation on the "T" mark */
.splash-sheen-rect {
  transform: translate(-900px, -900px);
  will-change: transform;
}

.try-company-splash.state-sheen .splash-sheen-rect {
  animation: splashSheenGlide 0.85s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes splashSheenGlide {
  0% {
    transform: translate(-900px, -900px);
  }
  100% {
    transform: translate(900px, 900px);
  }
}

/* Editorial Masked Typography */
.splash-logo-text,
.splash-logo-divider {
  opacity: 0;
  transform: translateY(18px);
  will-change: opacity, transform;
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.try-company-splash.state-text-reveal .splash-logo-text,
.try-company-splash.state-text-reveal .splash-logo-divider {
  opacity: 1;
  transform: translateY(0);
}

/* Tagline with Mask Box Container */
.splash-tagline-mask {
  overflow: hidden;
  margin-top: 16px;
  padding: 2px 0;
}

.splash-tagline {
  font-family: var(--font-body, 'Inter', -apple-system, sans-serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--colors-primary, #b1592c);
  opacity: 0;
  transform: translateY(100%);
  will-change: opacity, transform;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.try-company-splash.state-text-reveal .splash-tagline {
  opacity: 1;
  transform: translateY(0);
}

/* Dissolve Tagline as Flight Begins */
.try-company-splash.state-flight .splash-tagline-mask {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.try-company-splash.state-flight .splash-ambient-glow {
  opacity: 0;
  transition: opacity 0.35s ease;
}

/* Shop Page Cascading Reveal */
html.intro-active .shop-hero-content > *,
html.intro-active .shop-hero-highlights {
  opacity: 0;
  transform: translateY(14px);
  will-change: opacity, transform;
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

html.shop-reveal .shop-hero-content > .shop-kicker {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.05s;
}

html.shop-reveal .shop-hero-content > .shop-hero-title {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.12s;
}

html.shop-reveal .shop-hero-content > .shop-hero-sub {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.18s;
}

html.shop-reveal .shop-hero-content > .shop-hero-actions {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.24s;
}

html.shop-reveal .shop-hero-highlights {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.30s;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  .splash-logo-wrap {
    width: 220px;
    max-width: 78vw;
  }

  .splash-tagline {
    font-size: 9.5px;
    letter-spacing: 3px;
  }

  .splash-ambient-glow {
    width: 320px;
    height: 320px;
  }
}

/* Accessibility: prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .splash-logo-wrap,
  .splash-logo-text,
  .splash-tagline,
  .splash-backdrop {
    transition: opacity 0.25s ease !important;
    transform: none !important;
  }
  .splash-sheen-rect,
  .splash-aperture-ring {
    animation: none !important;
    display: none !important;
  }
  html.intro-active .shop-hero-content > *,
  html.intro-active .shop-hero-highlights {
    transition: opacity 0.25s ease !important;
    transform: none !important;
  }
}
