/* ============================================================
   TTP — ANIMATIONS
   The Travel Place | animations.css
   ============================================================ */

/* ── GSAP / Scroll Reveal Base States ────────────────────── */
/* Elements start invisible and are animated by GSAP */

[data-anim] {
  opacity: 0;
}

/* When JS is disabled or fails, show content */
.no-js [data-anim] {
  opacity: 1;
}

/* ── Hero Section ────────────────────────────────────────── */
.hero-section {
  position: relative;
  min-height: 100svh;
  background: #0a0a0c;
  display: flex;
  flex-direction: column;
}

/* Hero inner — the actual image/slides area, not the full viewport */
.hero-section-inner {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  /* Give slides area enough room for content + bottom padding for CTA */
  min-height: calc(100svh - 240px);  /* 240px ≈ search panel height */
  overflow: hidden;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.hero-section-inner {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.hero-slides {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-slide-bg {
  position: absolute;
  inset: -5%;
  z-index: 0;
  transition: opacity 0.1s;
}

.hero-slide-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0,0,0,0.72) 0%,
    rgba(0,0,0,0.35) 60%,
    rgba(0,0,0,0.1) 100%
  );
  z-index: 1;
}

.hero-slide-content {
  position: relative;
  z-index: 3;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  width: 100%;
}

.hero-slide-inner {
  max-width: 680px;
}

.hero-slide-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-bottom: var(--space-3);
  background: rgba(255,255,255,0.1);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
}

.hero-slide-eyebrow .material-symbols-outlined {
  font-size: 16px;
  color: var(--ttp-red-soft);
}

.hero-slide-headline {
  font-size: var(--text-hero);
  font-weight: var(--weight-extra);
  letter-spacing: var(--tracking-tight);
  line-height: 1.1;
  color: #fff;
  margin-bottom: var(--space-3);
}

.hero-slide-headline em {
  font-style: normal;
  color: var(--ttp-red-soft);
  display: block;
}

.hero-slide-sub {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.7);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
  max-width: 460px;
}

.hero-slide-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* ── Search panel inside hero ────────────────────────────── */
/* Sits at the bottom of .hero-section — overlaps hero background */
.hero-search-embed {
  position: relative;
  z-index: 30;
  background: transparent;
  padding: 0 0 var(--space-8);
}

/* The panel itself has no negative margin — it just sits below
   the slides area with the hero bg showing behind it */
.hero-search-embed .search-panel {
  margin-top: 0;
}

@media (max-width: 1024px) {
  .hero-section-inner {
    min-height: calc(100svh - 280px);
  }
}

@media (max-width: 768px) {
  .hero-section-inner {
    min-height: calc(100svh - 380px);
  }
  .hero-search-embed {
    padding-bottom: var(--space-5);
  }
}

/* Hero nav: scroll indicator */
.hero-scroll-hint {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  z-index: 5;
  opacity: 0.6;
}

.hero-scroll-hint span {
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}

.hero-scroll-mouse {
  width: 24px;
  height: 38px;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: var(--radius-full);
  display: flex;
  justify-content: center;
  padding-top: 5px;
}

.hero-scroll-wheel {
  width: 3px;
  height: 8px;
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius-full);
  animation: scrollWheel 2s var(--ease-in-out) infinite;
}

@keyframes scrollWheel {
  0%   { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(12px); opacity: 0; }
}

/* Hero slide counter */
.hero-counter {
  position: absolute;
  right: var(--container-pad);
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.hero-counter-line {
  width: 1px;
  height: 60px;
  background: rgba(255,255,255,0.2);
  position: relative;
  overflow: hidden;
}

.hero-counter-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: #fff;
  transition: height 0.4s var(--ease-out-expo);
}

.hero-counter-nums {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.5);
}

.hero-counter-current {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: #fff;
}

/* ── Parallax ────────────────────────────────────────────── */
.parallax-container {
  overflow: hidden;
}

.parallax-img {
  will-change: transform;
}

/* ── Reveal Animations (managed by GSAP) ─────────────────── */
.reveal-up    { opacity: 0; transform: translateY(40px); }
.reveal-down  { opacity: 0; transform: translateY(-40px); }
.reveal-left  { opacity: 0; transform: translateX(-40px); }
.reveal-right { opacity: 0; transform: translateX(40px); }
.reveal-scale { opacity: 0; transform: scale(0.92); }
.reveal-fade  { opacity: 0; }

/* Clip-path text reveal */
.text-reveal {
  overflow: hidden;
}

.text-reveal-inner {
  display: block;
  transform: translateY(100%);
}

/* ── Image Reveal ────────────────────────────────────────── */
.img-reveal {
  overflow: hidden;
}

.img-reveal img {
  transform-origin: center center;
}

/* ── Card Tilt ───────────────────────────────────────────── */
.tilt-card {
  transform-style: preserve-3d;
  transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
  transition: transform var(--duration-slow) var(--ease-out-expo),
              box-shadow var(--duration-slow) var(--ease-out-expo);
}

/* ── Number Counter ──────────────────────────────────────── */
.count-up {
  font-variant-numeric: tabular-nums;
}

/* ── Line Draw ───────────────────────────────────────────── */
.line-draw {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
}

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

@keyframes floatSlow {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50%       { transform: translateY(-8px) rotate(2deg); }
}

.float-anim {
  animation: float 4s var(--ease-in-out) infinite;
}

.float-slow {
  animation: floatSlow 6s var(--ease-in-out) infinite;
}

/* ── Pulse ───────────────────────────────────────────────── */
@keyframes pulse-ring {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2); opacity: 0; }
}

.pulse-ring::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full);
  background: var(--ttp-red);
  animation: pulse-ring 2s ease-out infinite;
}

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

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-surface-2) 25%,
    var(--color-border) 50%,
    var(--color-surface-2) 75%
  );
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite;
}

/* ── Stagger helper classes ──────────────────────────────── */
.stagger-children > * {
  opacity: 0;
  transform: translateY(24px);
}

/* ── Horizontal scroll section ───────────────────────────── */
.pinned-section {
  overflow: hidden;
}

/* ── Page Transition ─────────────────────────────────────── */
.page-transition {
  position: fixed;
  inset: 0;
  background: var(--ttp-red);
  z-index: 9998;
  transform: scaleX(0);
  transform-origin: left;
}

/* ── Reduced Motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  [data-anim],
  .reveal-up,
  .reveal-down,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .reveal-fade,
  .stagger-children > *,
  .text-reveal-inner {
    opacity: 1 !important;
    transform: none !important;
  }

  .hero-slide {
    position: relative;
  }

  .tilt-card {
    transform: none !important;
  }

  .parallax-img {
    transform: none !important;
  }

  .float-anim,
  .float-slow {
    animation: none;
  }

  .cursor-dot,
  .cursor-ring {
    display: none;
  }
}
