/* ==========================================================================
   Nena Bullion — cinematic parallax / 3D theme layer
   Procedural gold & silver "mine" backdrops (no external imagery), plus
   positioning rules for the ambient particle field and Three.js hero canvas.
   ========================================================================== */

/* ---- Lenis smooth-scroll integration --------------------------------------
   Lenis drives scroll itself; native CSS smooth-scrolling must be disabled
   or the two fight each other and scrolling stutters/jumps. */
html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.lenis.lenis-stopped {
  overflow: hidden;
}

/* ---- Reveal-on-scroll base state -----------------------------------------
   Elements are visible by default (no-JS / slow-JS visitors still get full
   content). scroll-reveal.js adds .reveal-armed once GSAP is registered,
   which is what actually hides elements right before animating them in. */
[data-reveal],
[data-reveal-item] {
  opacity: 1;
}
.reveal-armed [data-reveal],
.reveal-armed [data-reveal-item] {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .reveal-armed [data-reveal],
  .reveal-armed [data-reveal-item] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---- Split-text word spans ------------------------------------------------ */
.split-word {
  display: inline-block;
  will-change: transform, opacity;
}

/* ---- Parallax layers ------------------------------------------------------
   Generic wrapper for any section that should never sit fully still while
   scrolling. Layers are transformed via inline style (translate3d) by
   scroll-reveal.js; keep transitions out of CSS so JS stays in full control. */
.parallax-host {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.parallax-layer {
  position: absolute;
  inset: -10% -10%;
  pointer-events: none;
  will-change: transform;
}

/* ---- Procedural backdrops ---------------------------------------------------
   Smooth directional gradients (no repeating stripes — those read as muddy
   banding at section scale) plus a couple of crisp diagonal "glint" streaks
   standing in for gold/silver ore veins. No external photography. */
.mine-strata {
  background-image:
    radial-gradient(140% 100% at 15% -20%, rgba(203, 160, 82, 0.09), transparent 55%),
    linear-gradient(150deg, #18242f 0%, #131e29 50%, #0a1119 100%);
}

.mine-strata--light {
  background-image:
    radial-gradient(140% 100% at 85% -20%, rgba(203, 160, 82, 0.12), transparent 55%),
    linear-gradient(150deg, #fdfaf3 0%, #f7ecd4 55%, #fbf6ea 100%);
}

/* Soft vignette — frames content and grounds the flat corners of a dark
   backdrop (hero / page banners) without adding visual noise. */
.mine-vignette {
  background: radial-gradient(120% 95% at 50% 15%, transparent 45%, rgba(4, 8, 11, 0.6) 100%);
}

/* Fine grain / noise, screened on top of any strata layer for texture */
.mine-grain {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/></svg>");
  background-size: 180px 180px;
  mix-blend-mode: overlay;
  opacity: 0.15;
}

/* ---- Gold / silver veins ---------------------------------------------------
   Crisp diagonal light-shaft streaks in brand metal tones, screened over the
   dark strata so they read as a deliberate glint rather than a hazy blob. */
.mine-vein-gold {
  background-image:
    linear-gradient(112deg, transparent 36%, rgba(210, 172, 95, 0.16) 45%, rgba(226, 184, 74, 0.3) 49%, rgba(210, 172, 95, 0.14) 53%, transparent 62%),
    linear-gradient(112deg, transparent 70%, rgba(245, 225, 164, 0.14) 79%, transparent 88%);
  mix-blend-mode: screen;
  opacity: 0.7;
}

.mine-vein-silver {
  background-image:
    linear-gradient(112deg, transparent 14%, rgba(199, 205, 209, 0.16) 23%, rgba(147, 164, 177, 0.26) 27%, rgba(199, 205, 209, 0.12) 31%, transparent 40%),
    linear-gradient(112deg, transparent 56%, rgba(224, 230, 234, 0.12) 65%, transparent 74%);
  mix-blend-mode: screen;
  opacity: 0.6;
}

/* Softer vein variants for light (white / gray-50) sections — a single
   faint diagonal streak, no blend mode (screen would wash out on white). */
.mine-vein-gold--muted {
  background-image: linear-gradient(112deg, transparent 38%, rgba(172, 135, 64, 0.09) 50%, transparent 64%);
}

.mine-vein-silver--muted {
  background-image: linear-gradient(112deg, transparent 30%, rgba(98, 119, 138, 0.08) 44%, transparent 58%);
}

/* Keeps a decorative layer fully invisible near the very top of its section
   so a flat-colour wave divider above (see .section-divider) always lands
   on pure, untextured background — no seam where photo/vein opacity would
   otherwise show through slightly differently than the wave's flat fill. */
.parallax-layer--fade-in-top {
  /* .parallax-layer is inset -10% -10% relative to the section, so the
     section's real visible top sits 8.4% into this layer's own (120%-tall)
     box — start the mask there (in %, so it tracks any section height)
     rather than at the layer's own top edge, which sits above the fold. */
  mask-image: linear-gradient(to bottom, transparent 8.4%, black calc(8.4% + 90px));
  -webkit-mask-image: linear-gradient(to bottom, transparent 8.4%, black calc(8.4% + 90px));
}

/* ---- Ambient mouse-reactive particle field -------------------------------- */
#particle-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
  mix-blend-mode: screen;
}

@media (prefers-reduced-motion: reduce) {
  #particle-field {
    display: none;
  }
}

/* ---- Three.js hero mount ---------------------------------------------------
   Interactive: visitors can drag to spin the bars, so pointer-events are
   enabled here (unlike every other decorative layer). touch-action: pan-y
   keeps vertical swipes free for the browser to scroll the page — only
   horizontal drag is captured for rotation — so mobile visitors are never
   stuck unable to scroll past the hero. */
#hero-3d {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  cursor: grab;
  touch-action: pan-y;
}
#hero-3d.is-dragging {
  cursor: grabbing;
}
#hero-3d canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ---- Header: glass panel that compacts + solidifies on scroll ------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(180deg, rgba(19, 30, 41, 0.97), rgba(19, 30, 41, 0.94));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: box-shadow 0.35s ease;
}

/* Curved gold hairline standing in for a straight border-bottom — sits
   astride the header's own edge (half in its padding, half over the page
   below) so it never crosses live nav/logo content. */
.header-hairline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -11px;
  height: 22px;
  pointer-events: none;
  z-index: 1;
}
.header-hairline svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Same curved gold hairline, mirrored onto the footer's top edge, so the
   footer always opens on a curve no matter what section (dark or light)
   precedes it on a given page. */
.footer-hairline {
  position: absolute;
  left: 0;
  right: 0;
  top: -11px;
  height: 22px;
  pointer-events: none;
  z-index: 1;
}
.footer-hairline svg {
  display: block;
  width: 100%;
  height: 100%;
}
.site-header.is-scrolled {
  box-shadow: 0 12px 30px -14px rgba(0, 0, 0, 0.6);
}
.site-header__utility {
  overflow: hidden;
  max-height: 44px;
  opacity: 1;
  transition: max-height 0.35s ease, opacity 0.25s ease;
}
.site-header.is-scrolled .site-header__utility {
  max-height: 0;
  opacity: 0;
}
.site-header__main {
  transition: padding 0.3s ease;
}
.site-header.is-scrolled .site-header__main {
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}
.site-header__logo-img {
  height: 2.5rem;
  filter: drop-shadow(0 0 14px rgba(203, 160, 82, 0.35));
  transition: height 0.3s ease;
}
.site-header.is-scrolled .site-header__logo-img {
  height: 2.05rem;
}

/* Nav pills — soft gold-tinted fill on hover instead of a plain underline */
.nav-pill {
  position: relative;
  border-radius: 9999px;
  transition: background-color 0.25s ease, color 0.25s ease;
}
.nav-pill:hover,
.nav-pill:focus-visible {
  background: linear-gradient(135deg, rgba(210, 172, 95, 0.2), rgba(203, 160, 82, 0.08));
  color: #fff;
}

/* CTA shimmer sweep */
.cta-shimmer {
  position: relative;
  overflow: hidden;
}
.cta-shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.55) 48%, transparent 66%);
  transform: translateX(-130%);
  transition: transform 0.7s ease;
}
.cta-shimmer:hover::after {
  transform: translateX(130%);
}

/* ---- Mobile slide-in menu panel -------------------------------------------- */
.mobile-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 11, 0.6);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 59;
}
.mobile-panel-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}
.mobile-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(88vw, 380px);
  background: linear-gradient(160deg, #18242f 0%, #0a1119 100%);
  border-left: 1px solid rgba(203, 160, 82, 0.25);
  z-index: 60;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.mobile-panel.is-open {
  transform: translateX(0);
}
.mobile-panel__link {
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.mobile-panel.is-open .mobile-panel__link {
  opacity: 1;
  transform: translateX(0);
}
.mobile-panel__link:nth-child(1) { transition-delay: 0.04s; }
.mobile-panel__link:nth-child(2) { transition-delay: 0.08s; }
.mobile-panel__link:nth-child(3) { transition-delay: 0.12s; }
.mobile-panel__link:nth-child(4) { transition-delay: 0.16s; }
.mobile-panel__link:nth-child(5) { transition-delay: 0.2s; }
.mobile-panel__link:nth-child(6) { transition-delay: 0.24s; }
.mobile-panel__link:nth-child(7) { transition-delay: 0.28s; }
.mobile-panel__link:nth-child(8) { transition-delay: 0.32s; }

html.menu-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .site-header__utility,
  .site-header__main,
  .site-header__logo-img,
  .mobile-panel,
  .mobile-panel-backdrop,
  .mobile-panel__link {
    transition: none !important;
  }
}

/* ---- Section transitions: curved dividers + tonal fades ------------------
   Every section boundary gets a soft oval wave or a colour fade instead of
   a hard horizontal line. The divider sits at the bottom of the section it
   closes out, filled with the *next* section's colour via currentColor —
   one SVG markup, recoloured per instance with a text-{color} class. */
.section-divider {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  line-height: 0;
  pointer-events: none;
  z-index: 1;
}
.section-divider svg {
  display: block;
  width: 100%;
  height: 48px;
}
@media (min-width: 768px) {
  .section-divider svg {
    height: 88px;
  }
}
.section-divider--flip svg {
  transform: scaleX(-1);
}

.section-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 130px;
  pointer-events: none;
  z-index: 1;
}
.section-fade--to-gray-50 {
  background: linear-gradient(to bottom, rgba(249, 250, 251, 0), #f9fafb);
}
.section-fade--to-white {
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #ffffff);
}

/* ---- Gold-tone ornamental separator ---------------------------------------
   Marks a tonal section-fade boundary (white <-> gray-50, too close in
   value for a wave/hairline to read) with a small brand-gold line-diamond
   motif, so the seam still has a deliberate marker instead of just blur. */
.tone-separator {
  position: absolute;
  bottom: 28px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 16px;
  pointer-events: none;
  z-index: 1;
}
.tone-separator__line {
  height: 1px;
  width: 90px;
  background: linear-gradient(90deg, transparent, rgba(203, 160, 82, 0.75));
}
.tone-separator__line--flip {
  background: linear-gradient(270deg, transparent, rgba(203, 160, 82, 0.75));
}
.tone-separator__mark {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  transform: rotate(45deg);
  background: rgba(203, 160, 82, 0.85);
}
@media (min-width: 768px) {
  .tone-separator__line {
    width: 160px;
  }
}

/* ---- Scroll-to-top button --------------------------------------------- */
.scroll-top-btn {
  position: fixed;
  right: 24px;
  bottom: 96px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 9999px;
  background: linear-gradient(135deg, #d2ac5f, #cba052);
  color: #131e29;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 8px 20px -6px rgba(203, 160, 82, 0.6);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease, filter 0.2s ease;
  z-index: 45;
}
.scroll-top-btn.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.scroll-top-btn:hover {
  filter: brightness(1.08);
}

@media (prefers-reduced-motion: reduce) {
  .scroll-top-btn {
    transition: opacity 0.15s linear, visibility 0.15s linear;
    transform: none;
  }
}

/* ---- Cursor-proximity tilt + spotlight glow (see tilt-cards.js) ----------
   Kept on its own element, never combined with [data-reveal-item] — GSAP
   writes its entrance animation to that element's inline `transform`,
   which would otherwise permanently win over this CSS-driven tilt. */
[data-tilt] {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --glow-x: 50%;
  --glow-y: 50%;
  --glow-opacity: 0;
  transform: perspective(800px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-tilt]::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(320px circle at var(--glow-x) var(--glow-y), rgba(210, 172, 95, 0.16), transparent 65%);
  opacity: var(--glow-opacity);
  transition: opacity 0.3s ease;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  [data-tilt] {
    transform: none !important;
  }
}

/* Keep decorative layers from ever intercepting clicks/keyboard focus */
.mine-strata,
.mine-strata--light,
.mine-vein-gold,
.mine-vein-silver,
.mine-vein-gold--muted,
.mine-vein-silver--muted,
.mine-grain {
  pointer-events: none;
}
