/* ============================================================
   TERRAVAULT OUTDOORS — animations.css
   Vault intro, keyframes, micro-interactions
   ============================================================ */

/* ─── Vault Intro Overlay ───────────────────────────────────── */
#vault-intro {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
  /* Force visibility — never let it flash/hide before JS runs */
  opacity: 1;
  visibility: visible;
}

#vault-intro.exit {
  animation: vault-exit .9s ease-in forwards;
  pointer-events: none;
}

@keyframes vault-exit {
  0%   { opacity: 1; }
  100% { opacity: 0; pointer-events: none; }
}

/* Ambient glow behind door */
.vault-intro-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(176,141,87,.18) 0%, transparent 70%);
  pointer-events: none;
  animation: glow-pulse 3s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { transform: scale(1); opacity: .6; }
  50%       { transform: scale(1.15); opacity: 1; }
}

/* SVG Vault Door */
#vault-door-svg {
  position: relative;
  z-index: 2;
  width: min(380px, 80vw);
  opacity: 0;
  transform: scale(.85);
  animation: vault-door-appear 1.4s .5s cubic-bezier(.34,1.56,.64,1) forwards;
}

@keyframes vault-door-appear {
  to { opacity: 1; transform: scale(1); }
}

/* Door Spin Group - rotates around the left edge. Slower, heavier, more deliberate. */
#vault-door-panel {
  transform-origin: 12% 50%;
  animation: vault-spin 3s 2.2s cubic-bezier(.65,0,.35,1) forwards;
}

@keyframes vault-spin {
  0%   { transform: rotateY(0deg); }
  100% { transform: rotateY(-80deg); }
}

/* Inner light that reveals when door opens */
.vault-intro-light {
  position: absolute;
  width: min(260px, 60vw);
  height: min(320px, 70vw);
  background: radial-gradient(ellipse at center, rgba(176,141,87,.55) 0%, rgba(176,141,87,.1) 50%, transparent 80%);
  z-index: 1;
  opacity: 0;
  animation: light-reveal 1s 4.6s ease-out forwards;
}

@keyframes light-reveal {
  to { opacity: 1; }
}

/* Brand text */
.vault-intro-text {
  position: relative;
  z-index: 3;
  text-align: center;
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
}

.vault-intro-text .brand-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(2.5rem, 10vw, 5.5rem);
  font-weight: 900;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0;
  transform: translateY(18px);
  animation: text-rise .9s 5.3s cubic-bezier(.34,1.2,.64,1) forwards;
  line-height: 1;
}

.vault-intro-text .brand-sub {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(0.7rem, 2.5vw, 1.1rem);
  font-weight: 600;
  letter-spacing: .5em;
  text-transform: uppercase;
  color: #B08D57;
  opacity: 0;
  transform: translateY(12px);
  animation: text-rise .7s 6.0s ease-out forwards;
}

@keyframes text-rise {
  to { opacity: 1; transform: translateY(0); }
}

.vault-intro-divider {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #B08D57, transparent);
  opacity: 0;
  animation: text-rise .5s 5.1s ease-out forwards;
}

/* Skip button */
.vault-skip {
  position: absolute;
  bottom: 2.5rem;
  right: 2.5rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  background: none;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 4px;
  padding: .45rem 1rem;
  cursor: pointer;
  transition: all .3s ease;
  opacity: 0;
  animation: fade-in .4s 1.2s ease-out forwards;
  z-index: 5;
}

.vault-skip:hover {
  color: #B08D57;
  border-color: #B08D57;
}

@keyframes fade-in {
  to { opacity: 1; }
}

/* Progress line at bottom of intro */
.vault-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: #B08D57;
  animation: progress-fill 8.2s linear forwards;
}

@keyframes progress-fill {
  from { width: 0; }
  to   { width: 100%; }
}

/* ─── Page Transitions ──────────────────────────────────────── */
.page-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: var(--black);
  transform: scaleX(0);
  transform-origin: right;
  pointer-events: none;
}

.page-transition-overlay.enter {
  animation: curtain-enter .45s cubic-bezier(.77,0,.18,1) forwards;
}

.page-transition-overlay.leave {
  animation: curtain-leave .45s .25s cubic-bezier(.77,0,.18,1) forwards;
}

@keyframes curtain-enter {
  from { transform: scaleX(0); transform-origin: left; }
  to   { transform: scaleX(1); transform-origin: left; }
}

@keyframes curtain-leave {
  from { transform: scaleX(1); transform-origin: right; }
  to   { transform: scaleX(0); transform-origin: right; }
}

/* ─── Spin / Rotate Keyframes ───────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes spin-slow {
  to { transform: rotate(360deg); }
}

.animate-spin      { animation: spin 1s linear infinite; }
.animate-spin-slow { animation: spin-slow 8s linear infinite; }

/* ─── Float Animation ───────────────────────────────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

.animate-float { animation: float 4s ease-in-out infinite; }

/* ─── Shimmer / Loading Skeleton ────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,.04) 0%,
    rgba(255,255,255,.09) 50%,
    rgba(255,255,255,.04) 100%
  );
  background-size: 400px 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}

/* ─── Pulse Glow ────────────────────────────────────────────── */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(176,141,87,.4); }
  50%       { box-shadow: 0 0 0 16px rgba(176,141,87,0); }
}

.animate-pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }

/* ─── Counter Roll-up ───────────────────────────────────────── */
.count-up {
  display: inline-block;
  /* JS controls the actual number content */
}

/* ─── Staggered Fade-in Grid ────────────────────────────────── */
.stagger-grid > * {
  opacity: 0;
  transform: translateY(24px);
}

.stagger-grid.visible > *:nth-child(1)  { animation: stagger-in .5s  .05s ease-out forwards; }
.stagger-grid.visible > *:nth-child(2)  { animation: stagger-in .5s  .12s ease-out forwards; }
.stagger-grid.visible > *:nth-child(3)  { animation: stagger-in .5s  .19s ease-out forwards; }
.stagger-grid.visible > *:nth-child(4)  { animation: stagger-in .5s  .26s ease-out forwards; }
.stagger-grid.visible > *:nth-child(5)  { animation: stagger-in .5s  .33s ease-out forwards; }
.stagger-grid.visible > *:nth-child(6)  { animation: stagger-in .5s  .40s ease-out forwards; }
.stagger-grid.visible > *:nth-child(7)  { animation: stagger-in .5s  .47s ease-out forwards; }
.stagger-grid.visible > *:nth-child(8)  { animation: stagger-in .5s  .54s ease-out forwards; }
.stagger-grid.visible > *:nth-child(9)  { animation: stagger-in .5s  .61s ease-out forwards; }
.stagger-grid.visible > *:nth-child(10) { animation: stagger-in .5s  .68s ease-out forwards; }
.stagger-grid.visible > *:nth-child(11) { animation: stagger-in .5s  .75s ease-out forwards; }
.stagger-grid.visible > *:nth-child(12) { animation: stagger-in .5s  .82s ease-out forwards; }

@keyframes stagger-in {
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Vault Door In-Page Animation ─────────────────────────── */
.vault-door-inpage {
  transform-style: preserve-3d;
  perspective: 800px;
}

.vault-door-panel-inpage {
  transform-origin: left center;
  transition: transform 1.2s cubic-bezier(.77,0,.18,1);
  will-change: transform;
}

.vault-door-panel-inpage.open {
  transform: perspective(800px) rotateY(-75deg);
}

.vault-categories.hidden-state > * {
  opacity: 0;
  transform: translateY(20px) scale(.96);
}

.vault-categories > * {
  transition: opacity .5s ease, transform .5s ease;
}

.vault-categories.revealed > *:nth-child(1) { opacity:1; transform:none; transition-delay:.05s; }
.vault-categories.revealed > *:nth-child(2) { opacity:1; transform:none; transition-delay:.13s; }
.vault-categories.revealed > *:nth-child(3) { opacity:1; transform:none; transition-delay:.21s; }
.vault-categories.revealed > *:nth-child(4) { opacity:1; transform:none; transition-delay:.29s; }
.vault-categories.revealed > *:nth-child(5) { opacity:1; transform:none; transition-delay:.37s; }

/* ─── Navbar Logo Intro ──────────────────────────────────────── */
@keyframes logo-intro {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

.nav-logo {
  animation: logo-intro .6s .1s ease-out both;
}

/* ─── Bronze border animation on hover ──────────────────────── */
@keyframes border-spin {
  to { transform: rotate(360deg); }
}

.btn-primary::after {
  display: none; /* reserved for future use */
}

/* ─── Text gradient shimmer ─────────────────────────────────── */
@keyframes text-shimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.text-shimmer {
  background: linear-gradient(
    90deg,
    #B08D57 0%,
    #E8D5A3 40%,
    #B08D57 60%,
    #8A6D3F 100%
  );
  background-size: 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: text-shimmer 4s ease-in-out infinite;
}

/* ─── Horizontal scroll snap (product reel) ─────────────────── */
.scroll-snap-x {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: 1.5rem;
  padding-bottom: 1rem;
  scrollbar-width: none;
}

.scroll-snap-x::-webkit-scrollbar { display: none; }

.scroll-snap-x > * {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* ─── Hover Image Zoom ──────────────────────────────────────── */
.img-zoom-wrap {
  overflow: hidden;
  border-radius: var(--radius-md);
}

.img-zoom-wrap img {
  transition: transform .7s cubic-bezier(.4,0,.2,1);
}

.img-zoom-wrap:hover img {
  transform: scale(1.07);
}

/* ─── Cursor line ───────────────────────────────────────────── */
.cursor-line {
  position: fixed;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(176,141,87,.7);
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform .1s linear, opacity .3s;
  opacity: 0;
}

body:not(.touch) .cursor-line { opacity: 1; }

/* ─── Tape lines decorative ─────────────────────────────────── */
.deco-tape {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(176,141,87,.3) 50%, transparent 100%);
  pointer-events: none;
}

/* ─── Reduced motion overrides ──────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .tagline-track { animation: none; }
  .vault-door-panel { animation: none; transform: rotateY(-80deg); }
  #vault-door-svg   { animation: none; opacity: 1; transform: none; }
  .vault-intro-text .brand-name { animation: none; opacity: 1; transform: none; }
  .vault-intro-text .brand-sub  { animation: none; opacity: 1; transform: none; }
  .vault-progress { animation: none; width: 100%; }
}
