/* ============================================================
   PARIAH — Luxury Sensory Layer
   ============================================================
   Film grain, custom cursor, magnetic interactions,
   cinematic text reveals, momentum scroll feel.
   This is the layer that makes it feel alive.
   ============================================================ */

/* ── Film Grain Overlay ────────────────────────────────────── */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.028;
  mix-blend-mode: overlay;
}

.grain::before {
  content: '';
  position: absolute;
  inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  animation: grain-shift 0.5s steps(1) infinite;
}

@keyframes grain-shift {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-2%, -2%); }
  40%  { transform: translate(1%, -3%); }
  60%  { transform: translate(-3%, 1%); }
  80%  { transform: translate(2%, 2%); }
  100% { transform: translate(0, 0); }
}

/* ── Custom Cursor ─────────────────────────────────────────── */
@media (pointer: fine) {
  html.has-custom-cursor,
  html.has-custom-cursor *,
  html.has-custom-cursor *::before,
  html.has-custom-cursor *::after {
    cursor: none !important;
  }

  .cursor {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 99999;
  }

  .cursor__dot {
    width: 6px;
    height: 6px;
    background: var(--color-gold, #c9a84c);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s var(--ease-out),
                height 0.3s var(--ease-out),
                background 0.3s var(--ease-out),
                opacity 0.3s var(--ease-out);
  }

  .cursor__ring {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(var(--color-gold-rgb), 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s var(--ease-out),
                height 0.4s var(--ease-out),
                border-color 0.4s var(--ease-out),
                opacity 0.4s var(--ease-out);
  }

  /* Hover state — expand ring */
  .cursor--hovering .cursor__dot {
    width: 8px;
    height: 8px;
  }

  .cursor--hovering .cursor__ring {
    width: 56px;
    height: 56px;
    border-color: rgba(var(--color-gold-rgb), 0.6);
  }

  /* Link/button hover — fill */
  .cursor--active .cursor__dot {
    width: 48px;
    height: 48px;
    background: rgba(var(--color-gold-rgb), 0.15);
  }

  .cursor--active .cursor__ring {
    width: 48px;
    height: 48px;
    border-color: var(--color-gold);
    opacity: 0.6;
  }

  /* Text hover */
  .cursor--text .cursor__dot {
    width: 2px;
    height: 20px;
    border-radius: 1px;
    background: var(--color-gold);
  }

  .cursor--text .cursor__ring {
    opacity: 0;
  }

  /* Hidden state (over nav, inputs) */
  .cursor--hidden .cursor__dot,
  .cursor--hidden .cursor__ring {
    opacity: 0;
  }
}


/* ── Cinematic Text Reveal — Word by Word ──────────────────── */
.text-reveal {
  overflow: hidden;
}

.text-reveal__word {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  transition: transform 0.8s var(--ease-out),
              opacity 0.6s var(--ease-out);
}

.text-reveal--visible .text-reveal__word {
  transform: translateY(0);
  opacity: 1;
}

/* Staggered delays generated by JS via inline style */

/* ── Mask Reveal for Images ────────────────────────────────── */
.img-reveal {
  position: relative;
  overflow: hidden;
}

.img-reveal::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-black);
  transform-origin: right;
  transform: scaleX(1);
  transition: transform 1.2s var(--ease-out);
  z-index: 2;
}

.img-reveal--visible::after {
  transform: scaleX(0);
}

/* ── Horizontal Line Reveal ────────────────────────────────── */
.line-reveal {
  height: 1px;
  background: linear-gradient(90deg, var(--color-gold), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.5s var(--ease-out);
}

.line-reveal--visible {
  transform: scaleX(1);
}

/* ── Smooth Momentum Scroll ────────────────────────────────── */
html {
  scroll-behavior: smooth;
}


/* ── Sticky Mobile CTA ─────────────────────────────────────── */
.mobile-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  padding: var(--space-4) var(--space-6);
  background: linear-gradient(to top, var(--color-black) 60%, transparent);
  padding-top: var(--space-10);
  transform: translateY(100%);
  transition: transform 0.5s var(--ease-out);
}

.mobile-cta--visible {
  transform: translateY(0);
}

.mobile-cta .btn {
  width: 100%;
}

@media (max-width: 768px) {
  .mobile-cta {
    display: block;
    padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  }

  body.has-mobile-cta {
    padding-bottom: 5.5rem;
  }
}

/* ── Enhanced Link Underline ───────────────────────────────── */
.link-elegant {
  position: relative;
  display: inline;
  background-image: linear-gradient(var(--color-gold), var(--color-gold));
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: left bottom;
  transition: background-size 0.5s var(--ease-out);
  padding-bottom: 2px;
}

.link-elegant:hover {
  background-size: 100% 1px;
}

/* ── Intro / Page Load Sequence ────────────────────────────── */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: var(--color-black);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.intro-overlay__text {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: var(--weight-normal);
  color: var(--color-off-white);
  letter-spacing: var(--tracking-wide);
  opacity: 0;
  transform: translateY(10px);
}

.intro-overlay__logo {
  max-width: min(280px, 60vw);
  height: auto;
  opacity: 0;
  transform: translateY(10px);
}

.intro-overlay--active .intro-overlay__text {
  animation: intro-text 0.8s var(--ease-out) 0.1s forwards;
}

.intro-overlay--active .intro-overlay__logo {
  animation: intro-text 0.8s var(--ease-out) 0.1s forwards;
}

.intro-overlay--exiting {
  animation: intro-exit 0.8s var(--ease-out) forwards;
}

@keyframes intro-text {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes intro-exit {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* ── Horizontal Scroll Section ─────────────────────────────── */
.hscroll {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: var(--space-4);
}

.hscroll::-webkit-scrollbar {
  display: none;
}

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

/* ── Subtle Gradient Noise ─────────────────────────────────── */
.gradient-noise {
  position: relative;
}

.gradient-noise::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 100% 70% at 50% 30%,
    rgba(var(--color-gold-rgb), 0.03) 0%,
    transparent 70%
  );
  pointer-events: none;
}

/* ── Pull Quote Enhancement ────────────────────────────────── */
.pullquote {
  font-family: var(--font-accent);
  font-size: var(--text-3xl);
  font-style: italic;
  font-weight: var(--weight-light);
  color: var(--color-off-white);
  line-height: var(--leading-snug);
  text-align: center;
  max-width: 28ch;
  margin-inline: auto;
  position: relative;
}

.pullquote::before {
  content: '\201C';
  position: absolute;
  top: -0.4em;
  left: -0.15em;
  font-size: 4em;
  color: rgba(var(--color-gold-rgb), 0.08);
  font-family: var(--font-heading);
  line-height: 1;
  pointer-events: none;
}

/* ── Number Ornament ───────────────────────────────────────── */
.ornament-num {
  font-family: var(--font-accent);
  font-size: clamp(4rem, 3rem + 4vw, 8rem);
  font-weight: var(--weight-light);
  color: rgba(var(--color-gold-rgb), 0.05);
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

/* ── Image Placeholder Enhancement ─────────────────────────── */
.placeholder-art {
  position: relative;
  background: var(--color-charcoal);
  overflow: hidden;
}

.placeholder-art::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 50% 50%, rgba(var(--color-gold-rgb), 0.06) 0%, transparent 70%),
    linear-gradient(135deg, rgba(255,255,255,0.02) 0%, transparent 50%);
}

.placeholder-art::after {
  content: '';
  position: absolute;
  inset: 20%;
  border: 1px solid rgba(var(--color-gold-rgb), 0.06);
  border-radius: 50%;
}

/* ── Elegant Marquee / Scrolling Text ──────────────────────── */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

.marquee__inner {
  display: inline-flex;
  gap: var(--space-16);
  animation: marquee-scroll 30s linear infinite;
}

.marquee__inner span {
  font-family: var(--font-heading);
  font-size: var(--text-display);
  font-weight: var(--weight-light);
  color: rgba(255, 255, 255, 0.03);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  user-select: none;
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Card Tilt / 3D Hover ──────────────────────────────────── */
.card-3d {
  perspective: 800px;
}

.card-3d__inner {
  transition: transform 0.4s var(--ease-out);
  transform-style: preserve-3d;
}

/* ── Gold Glow Pulse (for CTA sections) ────────────────────── */
@keyframes gold-glow-pulse {
  0%, 100% { opacity: 0.03; }
  50% { opacity: 0.08; }
}

.gold-glow {
  position: relative;
}

.gold-glow::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(var(--color-gold-rgb), 0.15) 0%, transparent 70%);
  pointer-events: none;
  animation: gold-glow-pulse 4s var(--ease-in-out) infinite;
  z-index: 0;
}

/* ── Nav Logo Subtle Float ─────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .nav__logo-img {
    animation: float 8s var(--ease-in-out) infinite;
    animation-delay: 2s;
  }
}

/* ── Gold Card Border Trace ────────────────────────────────── */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  transition: border-color 0.6s var(--ease-out);
  pointer-events: none;
}

.card:hover::before {
  border-color: rgba(var(--color-gold-rgb), 0.2);
}

/* ── Hero Gold Particles ───────────────────────────────────── */
@keyframes gold-particle-float {
  0%   { opacity: 0; transform: translateY(0) scale(0); }
  15%  { opacity: 0.6; transform: translateY(-15px) scale(1); }
  85%  { opacity: 0.1; transform: translateY(-90px) scale(0.6); }
  100% { opacity: 0; transform: translateY(-110px) scale(0); }
}

.gold-particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--color-gold, #c9a84c);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  animation: gold-particle-float var(--dur, 8s) var(--delay, 0s) ease-in-out infinite;
}

/* ── Footer Gem Watermark ──────────────────────────────────── */
.footer {
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  top: 50%;
  right: -5%;
  width: 400px;
  height: 400px;
  transform: translateY(-50%);
  background-image: url('../images/logo-mark-watermark.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.03;
  pointer-events: none;
}

/* Scroll hint — never reclaim first-screen height on collection/explore */
.jewellery-hero__scroll-hint {
  display: none !important;
}

/* Phone first screen — compact heroes, kill particle fields, pull product/tray up */
@media (max-width: 768px) {
  section.jewellery-hero {
    min-height: 0 !important;
    justify-content: flex-start;
    padding: calc(4.25rem + var(--space-3)) 0 var(--space-5);
  }

  section.jewellery-hero .jewellery-hero__particles,
  section.jewellery-hero .jewellery-hero__particle {
    display: none;
  }

  section.jewellery-hero .jewellery-hero__eyebrow {
    margin-bottom: var(--space-3);
    opacity: 1;
    animation: none;
  }

  section.jewellery-hero .jewellery-hero__title {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-3);
    opacity: 1;
    animation: none;
  }

  section.jewellery-hero .jewellery-hero__title em {
    font-family: var(--font-accent);
    font-style: italic;
  }

  section.jewellery-hero .jewellery-hero__subtitle {
    font-size: var(--text-base);
    margin-bottom: var(--space-5);
    opacity: 1;
    animation: none;
    line-height: var(--leading-normal);
  }

  section.jewellery-hero .jewellery-hero__explore-link {
    display: none;
  }

  section.jewellery-hero .jewellery-hero__actions {
    gap: var(--space-2);
    opacity: 1 !important;
    animation: none !important;
  }

  section.jewellery-hero .btn {
    min-height: 44px;
    padding: var(--space-3) var(--space-6);
  }

  /* Instant, not 1.1s delayed — bounce risk */
  section.jewellery-hero [style*="opacity: 0"] {
    opacity: 1 !important;
    animation: none !important;
  }

  section.shop {
    padding-block: var(--space-6) var(--space-12);
  }

  section.shop > .container > .section-header {
    margin-bottom: var(--space-5);
  }

  section.shop > .container > .section-header .section-header__subtitle,
  .shop--available > .section-header {
    display: none;
  }

  section.shop .section-header__title {
    font-size: var(--text-2xl);
  }

  /* First cards must paint even if IntersectionObserver hasn't fired */
  section.shop .section-header.reveal,
  section.shop .cat-filters.reveal,
  section.shop .stagger > *:nth-child(-n+4) {
    opacity: 1;
    transform: none;
  }

  section.explore-guide {
    padding: var(--space-8) 0;
  }

  .cat-filters {
    margin: var(--space-4) 0 var(--space-6);
    position: static;
  }
}

@media (max-width: 900px) {
  .fit-layout {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
  }

  .fit-layout .fit-panel {
    order: -1;
  }

  .fit-stage {
    max-width: 280px;
  }

  .fit-hero {
    padding: calc(4.25rem + var(--space-3)) 0 var(--space-4);
  }

  .fit-hero__title {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-3);
  }

  .fit-hero__title em {
    font-family: var(--font-accent);
    font-style: italic;
  }

  .fit-hero__subtitle {
    font-size: var(--text-base);
    line-height: var(--leading-normal);
  }

  .fit-section {
    padding: var(--space-4) 0 var(--space-10);
  }

  .fit-hint {
    min-height: 0;
    padding: var(--space-4);
    margin-bottom: var(--space-4);
  }

  .fit-tray {
    max-height: min(38vh, 280px);
    margin-bottom: var(--space-4);
  }

  .fit-panel .reveal {
    opacity: 1;
    transform: none;
  }
}

@media (pointer: coarse) {
  .intro-overlay {
    display: none !important;
  }

  .page-transition {
    opacity: 1;
    animation: none;
  }
}
