/* home.css — Scroll-Driven Canvas Hero */

/* ─── Scroll Canvas Wrapper ─────────────────────────────────────────────────
   This wrapper is TALL (300vh) so scrolling within it drives frame playback.
   The inner .hero-section is sticky so it stays visible while you scroll.
──────────────────────────────────────────────────────────────────────────── */
#scroll-canvas-wrapper {
  position: relative;
  height: 300vh;                  /* 3× viewport = scroll travel space */
}

/* ─── Hero Section (sticky) ────────────────────────────────────────────────── */
.hero-section {
  height: 100svh;
  display: grid;
  place-items: center;
  position: sticky;
  top: 0;
  overflow: hidden;
  padding-top: 115px;
  box-sizing: border-box;
  background: var(--obsidian);   /* fallback when canvas hasn't loaded */
}

/* ─── Canvas (fills hero behind everything) ──────────────────────────────── */
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  z-index: 0;
  transform-origin: center center;
  transition: transform 0.04s linear, filter 0.04s linear;

  /*
   * 4K source (3840×2160) — use 'auto' so the browser's GPU scaler
   * applies its best-quality bicubic/lanczos downscale to the viewport.
   * 'crisp-edges' would apply nearest-neighbour which is wrong for photos.
   */
  image-rendering: auto;

  /* GPU compositing layer — prevents layout repaints during scroll */
  will-change: transform, filter;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;

  /* Very wide vignette — 4K detail visible fully in the center */
  -webkit-mask-image: radial-gradient(ellipse 98% 98% at 50% 50%, black 72%, rgba(0,0,0,0.3) 90%, transparent 100%);
          mask-image: radial-gradient(ellipse 98% 98% at 50% 50%, black 72%, rgba(0,0,0,0.3) 90%, transparent 100%);
}

/* ─── Dark overlay on canvas for text legibility ─────────────────────────── */
.hero-canvas-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 70% 60% at 50% 40%, rgba(3,10,22,0.55) 0%, rgba(3,10,22,0.2) 60%, transparent 100%),
    linear-gradient(to bottom, rgba(3,10,22,0.15) 0%, transparent 50%, rgba(3,10,22,0.6) 100%);
  pointer-events: none;
}

/* Subtle grid lines overlay — luxury tech aesthetic */
.hero-canvas-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  opacity: 0.6;
}

/* ─── Hero Story Overlay Cards (Scroll-driven reveal) ──────────────────── */
.hero-story-card {
  position: absolute;
  z-index: 10;
  text-align: center;
  max-width: 900px;
  padding: 2.5rem 2rem;
  will-change: transform, opacity;
  pointer-events: none;
  opacity: 0;
  transform: translateY(30px);
}

.hero-story-card.active-card {
  pointer-events: auto;
}

.story-heading {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.8rem, 3.2vw + 0.4rem, 3.4rem);
  letter-spacing: 0.04em;
  font-weight: 400;
  line-height: 1.2;
  margin: 0.75rem 0 1.25rem;
}

.story-stats-row {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  align-items: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.story-stat-badge {
  background: rgba(7, 21, 43, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0.65rem 1.4rem;
  border-radius: 30px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--silver);
  letter-spacing: 0.06em;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: border-color 0.3s ease;
}

.story-stat-badge:hover {
  border-color: rgba(211, 47, 47, 0.4);
}

.story-stat-badge span {
  color: var(--platinum);
  font-weight: 600;
  margin-right: 0.3rem;
}

.hero-headline {
  margin-bottom: 1.5rem;
}
.hero-headline span {
  display: block;
}

.hero-ctas {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-top: 2.5rem;
}

/* ─── Preloader Overlay ──────────────────────────────────────────────────── */
#canvas-preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--obsidian);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.preloader-logo {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  letter-spacing: 0.25em;
  color: var(--crystal-mid);
  text-transform: uppercase;
}

.preloader-bar-track {
  width: min(320px, 80vw);
  height: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

#canvas-load-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ruby-primary), #FF6B6B);
  border-radius: 2px;
  transition: width 0.15s ease;
}

.preloader-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--silver);
  text-transform: uppercase;
  opacity: 0.6;
}

/* ─── Scroll Indicator ───────────────────────────────────────────────────── */
.scroll-indicator {
  will-change: opacity;
}

/* ─── Metrics Section ────────────────────────────────────────────────────── */
.metrics-section {
  background: var(--velvet-navy);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}
@media (max-width: 992px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 576px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Collections Section ───────────────────────────────────────────────── */
.collections-section {
  position: relative;
}
.carousel-wrap {
  position: relative;
  width: 100%;
}

/* ─── Why Section ───────────────────────────────────────────────────────── */
.why-section {
  position: relative;
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  margin-top: 4rem;
}
@media (max-width: 768px) {
  .why-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Mobile: reduce scroll canvas height ───────────────────────────────── */
@media (max-width: 768px) {
  #scroll-canvas-wrapper {
    height: 250vh;
  }
}


