/* ============================================
   MOSS MOUNTAIN OUTFITTERS — PREMIUM LAYER
   Cinematic polish, texture, micro-interactions
   ============================================ */

/* ============ SMOOTH SCROLL ============ */
html {
  scroll-behavior: smooth;
}

html.lenis, html.lenis body {
  height: auto;
}

/* ============ PAGE LOAD REVEAL ============ */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--cream, #f7f5f0);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.6s;
}

.page-loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-logo { display: none; }

/* Moss Mountain Icon Loader */
.page-loader .loader-icon {
  width: 64px;
  height: 64px;
  animation: loaderPop 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards,
             loaderPulse 1.2s ease-in-out 0.5s infinite;
  opacity: 0;
  transform: scale(0.6);
}

@keyframes loaderPop {
  to { opacity: 1; transform: scale(1); }
}

@keyframes loaderPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.page-loader .loader-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted, #888);
  opacity: 0;
  animation: loaderTextFade 0.4s ease 0.3s forwards;
}

@keyframes loaderTextFade {
  to { opacity: 0.6; }
}

@keyframes loaderPulse {
  0%, 100% { opacity: 0.4; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* ============ GRAIN TEXTURE OVERLAY ============ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px;
}

/* Hero section replaced by scroll video */

/* ============ PREMIUM BUTTON EFFECTS ============ */
.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.2) 0%,
    transparent 50%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.4s;
}

.btn:hover::before {
  opacity: 1;
}

/* Magnetic-feel lift on primary buttons */
.btn-primary,
.btn-accent {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover,
.btn-accent:hover {
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
  transform: translateY(-3px);
}

.btn-primary:active,
.btn-accent:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transition-duration: 0.1s;
}

/* ============ PREMIUM CARD EFFECTS ============ */
/* Subtle border glow on hover */
.product-card-image {
  border: 1px solid rgba(0,0,0,0.04);
  transition: border-color 0.5s, box-shadow 0.5s;
}

.product-card:hover .product-card-image {
  border-color: rgba(43, 95, 43, 0.1);
  box-shadow: 0 20px 60px rgba(27, 42, 27, 0.12);
}

/* Category cards — cinematic overlay */
.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: inherit;
  pointer-events: none;
  transition: border-color 0.5s;
}

.category-card:hover::before {
  border-color: rgba(255,255,255,0.2);
}

/* Collection cards lift */
.collection-card {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.collection-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 64px rgba(27, 42, 27, 0.14);
}

/* ============ PREMIUM SECTION TRANSITIONS ============ */
/* Smoother, more dramatic fade-ups */
.fade-up {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
              transform 1s cubic-bezier(0.16, 1, 0.3, 1),
              filter 1s cubic-bezier(0.16, 1, 0.3, 1);
  filter: blur(2px);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* ============ STORY SECTION PREMIUM ============ */
.story-banner {
  transition: box-shadow 0.6s;
}

.story-banner:hover {
  box-shadow: 0 20px 80px rgba(27, 42, 27, 0.12);
}

.story-quote {
  position: relative;
  padding-left: 28px;
}

.story-quote::before {
  content: '\201C';
  position: absolute;
  left: 0;
  top: 16px;
  font-family: 'Playfair Display', serif;
  font-size: 4rem;
  color: var(--tan);
  line-height: 1;
  opacity: 0.3;
}

/* ============ FEATURES CARD PREMIUM ============ */
.features-card {
  transition: box-shadow 0.6s;
}

.features-card:hover {
  box-shadow: 0 20px 80px rgba(27, 42, 27, 0.14);
}

.feature-icon {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-item:hover .feature-icon {
  background: rgba(43, 95, 43, 0.08);
  transform: translateY(-2px);
}

/* ============ CTA PREMIUM ============ */
.cta-card {
  position: relative;
  overflow: hidden;
}

.cta-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at 30% 50%,
    rgba(200, 169, 110, 0.06) 0%,
    transparent 50%
  );
  pointer-events: none;
  z-index: 1;
}

/* ============ TESTIMONIAL CARDS ============ */
.testimonial-card {
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(27, 42, 27, 0.1);
  border-color: rgba(200, 169, 110, 0.15);
}

/* ============ BLOG CARDS PREMIUM ============ */
.blog-card {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.blog-card:hover {
  transform: translateY(-8px);
}

.blog-card-image {
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  transition: box-shadow 0.5s;
}

.blog-card:hover .blog-card-image {
  box-shadow: 0 16px 48px rgba(27, 42, 27, 0.12);
}

/* ============ FOOTER PREMIUM ============ */
.footer-card {
  position: relative;
  overflow: hidden;
}

.footer-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--tan) 50%,
    transparent 100%
  );
  opacity: 0.3;
}

/* ============ INSTAGRAM CARD PREMIUM ============ */
.insta-card {
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.insta-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 20px 60px rgba(0,0,0,0.1);
}

/* ============ PREMIUM PRICE BADGE ============ */
.product-price-badge {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.9);
  transition: all 0.3s;
}

.product-card:hover .product-price-badge {
  background: var(--forest);
  color: var(--cream);
  transform: scale(1.05);
}

/* ============ MEGA MENU PREMIUM ============ */
.mega-panel {
  border-top: 3px solid var(--forest);
}

.mega-featured {
  transition: box-shadow 0.5s;
}

.mega-featured:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

/* ============ SCROLL PROGRESS BAR ============ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--forest), var(--tan));
  z-index: 10000;
  transform-origin: left;
  transform: scaleX(0);
  transition: none;
}

/* ============ SCROLL-DRIVEN VIDEO HERO ============ */
.scroll-video-section {
  height: 400vh;
  position: relative;
  z-index: 1;
}

.scroll-video-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--deep-forest, #1a2e1a);
}

.scroll-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.5s ease-out;
}
.scroll-video.ready { opacity: 1; }

/* Hero text overlay — fades out on scroll */
.scroll-hero-text {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.15s linear, transform 0.15s linear, filter 0.15s linear;
  will-change: opacity, transform, filter;
}

.scroll-hero-headline {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(3.5rem, 9vw, 8rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  text-shadow:
    0 2px 40px rgba(0,0,0,0.3),
    0 0 100px rgba(0,0,0,0.1);
}

.scroll-hero-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 2px 20px rgba(0,0,0,0.35);
  margin-top: 0;
  line-height: 1.6;
}

/* Split subtitle line */
.scroll-hero-split-line {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 0;
  white-space: nowrap;
}

.split-left,
.split-right {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(0.85rem, 1.8vw, 1.35rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 2px 20px rgba(0,0,0,0.35);
  opacity: 0;
  transform: translateY(20px);
  filter: blur(4px);
  display: inline-block;
  transition: none;
}

.split-left {
  margin-right: 0.25em;
}

@media (max-width: 768px) {
  .scroll-hero-split-line { flex-direction: column; align-items: center; gap: 4px; }
  .split-left { margin-right: 0; }
  .split-left, .split-right { font-size: clamp(0.9rem, 4vw, 1.3rem); letter-spacing: 0.1em; }
}

/* "Start Your Journey" CTA */
.scroll-hero-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  opacity: 0;
  transform: translateY(16px);
  transition: none;
}

.scroll-hero-cta-text {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(0.8rem, 1.2vw, 0.95rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: rgba(255,255,255,0.6);
}

.scroll-hero-cta-arrow {
  width: 40px;
  height: 40px;
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ctaArrowBounce 2s ease-in-out infinite;
}

.scroll-hero-cta-arrow svg {
  width: 18px;
  height: 18px;
}

@keyframes ctaArrowBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* End text — hidden by default, fades in */
.scroll-hero-end {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(30px);
}

@media (max-width: 768px) {
  .scroll-hero-headline {
    font-size: clamp(2.5rem, 12vw, 4.5rem);
    letter-spacing: 0.05em;
  }
  .scroll-hero-sub {
    letter-spacing: 0.15em;
  }
}

/* Progress bar */
.scroll-video-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(247,245,240,0.1);
  z-index: 5;
}

.scroll-video-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--forest), var(--tan));
  width: 0%;
  transition: width 0.05s linear;
}

/* Scroll hint */
.scroll-video-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.7);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: opacity 0.6s;
  text-shadow: 0 1px 6px rgba(0,0,0,0.4);
}

.scroll-video-hint.hidden {
  opacity: 0;
  pointer-events: none;
}

.scroll-hint-icon {
  width: 40px;
  height: 40px;
  border: 1.5px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: scrollHintBounce 2s ease-in-out infinite;
  backdrop-filter: blur(4px);
  background: rgba(255,255,255,0.05);
}

.scroll-hint-icon svg {
  width: 16px;
  height: 16px;
}

@keyframes scrollHintBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

@media (max-width: 1024px) {
  .scroll-video-section {
    height: 350vh;
  }

  .svt-item .display-1 {
    font-size: clamp(1.6rem, 5vw, 2.2rem);
  }

  .scroll-video-hint {
    bottom: 24px;
  }
}

@media (max-width: 768px) {
  .scroll-video-section {
    height: 300vh;
  }
}

@media (max-width: 480px) {
  /* Mobile: 200dvh section gives the scroll-driven video enough scroll distance
     to animate. Use dvh (dynamic viewport height) so the math stays correct as
     iOS Safari shows/hides the URL bar — otherwise the pinned brand-ticker at
     viewport bottom overlaps the bottom of the hero. */
  .scroll-video-section {
    height: 200dvh;
  }

  .scroll-video-sticky {
    height: 78dvh;
  }

  .scroll-hero-text {
    padding: 0 24px;
  }

  .scroll-hero-headline {
    font-size: clamp(1.75rem, 8.4vw, 3rem);
    letter-spacing: 0.02em;
  }

  .scroll-video-hint {
    bottom: 16px;
    font-size: 0.7rem;
  }

  .scroll-hint-icon {
    width: 36px;
    height: 36px;
  }
}

/* ============ SELECTION COLOR ============ */
::selection {
  background: rgba(43, 95, 43, 0.15);
  color: var(--deep-forest);
}

/* ============ SMOOTH IMAGE LOADING ============ */
img {
  transition: opacity 0.3s ease;
  opacity: 1;
}
/* Only fade in lazy images that are still loading — use JS-added .loading class */
img[loading="lazy"].loading {
  opacity: 0;
}
img[loading="lazy"].loaded {
  opacity: 1;
}

/* ============ LINK HOVER UNDERLINE EFFECT ============ */
.footer-col a {
  position: relative;
}

.footer-col a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--cream);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.footer-col a:hover::after {
  width: 100%;
}

/* ============ BRAND MARQUEE GLOW ============ */
.marquee-dot {
  box-shadow: 0 0 8px rgba(200, 169, 110, 0.4);
}

/* ============ SECTION DIVIDER ACCENTS ============ */
.section {
  position: relative;
}

/* ============ PREMIUM HEADER TRANSITION ============ */
.header {
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.header.scrolled .logo-icon,
.header.mega-open .logo-icon {
  transition: height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============ CAT-PROMO CARD SHIMMER ============ */
.cat-promo {
  position: relative;
  overflow: hidden;
}

.cat-promo::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    ellipse at 20% 80%,
    rgba(200, 169, 110, 0.12) 0%,
    transparent 50%
  );
  pointer-events: none;
}

/* ============ SMOOTH FORM FOCUS ============ */
input:focus,
textarea:focus,
select:focus {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============ BRAND TICKER ============ */
.brand-ticker-section {
  padding: 48px 0;
  overflow: hidden;
}

.brand-ticker-label {
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 28px;
}

@media (max-width: 480px) {
  .brand-ticker-section { padding: 18px 0 28px; }
  .brand-ticker-label { margin-bottom: 16px; font-size: 0.72rem; }

  /* While the hero is still on screen, pin the brand-ticker to the bottom of
     the viewport so it's visible at scrollY=0. Same cream background as the
     natural state — no border, no blur — so it looks identical when it
     releases into normal flow after the hero. JS toggles `.bt-pinned`. */
  .brand-ticker-section.bt-pinned {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 9;
    background: var(--cream, #F7F5F0);
    padding: 18px 0 22px;
    margin: 0;
  }
  [data-theme="dark"] .brand-ticker-section.bt-pinned {
    background: var(--deep-forest, #0a1f0a);
  }
}

.brand-ticker {
  overflow: hidden;
}

.brand-ticker-track {
  display: flex;
  align-items: center;
  animation: marquee 45s linear infinite;
  width: max-content;
}

.brand-ticker-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-mid);
  white-space: nowrap;
  padding: 0 24px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.5;
  transition: opacity 0.3s;
}

.brand-ticker-name:hover {
  opacity: 1;
}

.brand-ticker-dot {
  width: 4px;
  height: 4px;
  background: var(--tan);
  border-radius: 50%;
  flex-shrink: 0;
  align-self: center;
}

[data-theme="dark"] .brand-ticker-name {
  color: rgba(224, 221, 214, 0.4);
}

[data-theme="dark"] .brand-ticker-name:hover {
  color: var(--tan);
  opacity: 1;
}

/* ============ VISIT US SECTION ============ */
.visit-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: var(--card-radius-lg);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  min-height: 500px;
}

.visit-map {
  position: relative;
}

.visit-map iframe {
  width: 100%;
  height: 100%;
  filter: saturate(0.8) contrast(1.05);
}

.visit-info {
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.visit-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 28px;
}

.visit-detail {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.visit-detail svg {
  width: 20px;
  height: 20px;
  stroke: var(--forest);
  flex-shrink: 0;
  margin-top: 2px;
}

.visit-detail-text {
  font-size: 0.95rem;
  color: var(--text-mid);
}

.visit-detail-text strong {
  display: block;
  color: var(--text-dark);
  font-weight: 700;
}

[data-theme="dark"] .visit-card {
  background: #0e1319;
  border: 1px solid rgba(200, 169, 110, 0.06);
}

[data-theme="dark"] .visit-map iframe {
  filter: invert(0.92) hue-rotate(180deg) saturate(0.6);
}

[data-theme="dark"] .visit-detail svg {
  stroke: var(--tan);
}

[data-theme="dark"] .visit-detail-text {
  color: rgba(224, 221, 214, 0.55);
}

[data-theme="dark"] .visit-detail-text strong {
  color: #e0ddd6;
}

@media (max-width: 1024px) {
  .visit-card {
    grid-template-columns: 1fr;
  }
  .visit-map {
    min-height: 300px;
  }
}

@media (max-width: 768px) {
  .visit-info {
    padding: 36px 24px;
  }
}

/* ============ PRODUCT QUICK VIEW OVERLAY ============ */
.product-card-image::after {
  content: 'Quick View';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px;
  background: rgba(43, 95, 43, 0.92);
  color: #fff;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
  backdrop-filter: blur(8px);
}

.product-card:hover .product-card-image::after {
  transform: translateY(0);
}

[data-theme="dark"] .product-card-image::after {
  background: rgba(200, 169, 110, 0.92);
  color: #080c12;
}

/* ============ RESPONSIVE PREMIUM ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero-bg img {
    animation: none;
  }

  .fade-up {
    filter: none;
  }
}
