/* Aarnika Silks — 3D front page layer (loaded after style.css, index.html only) */

:root { --ease-out: cubic-bezier(.16, 1, .3, 1); }

/* ---------- Header sits on top of the dark hero ---------- */
.site-header { position: sticky; top: 0; z-index: 50; }

/* ---------- Hero ---------- */
.hero3d {
  position: relative;
  min-height: min(88vh, 860px);
  background: radial-gradient(120% 90% at 70% 40%, #4a0e17 0%, #2a070d 55%, #170306 100%);
  color: var(--cream-100);
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: center;
}
.hero3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: -2; }
.hero3d::before { /* readable text zone + vignette */
  content: "";
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(23,3,6,.82) 0%, rgba(23,3,6,.55) 34%, rgba(23,3,6,0) 62%),
    radial-gradient(90% 80% at 50% 50%, transparent 55%, rgba(10,1,3,.65) 100%);
}
.hero3d::after { /* fade into cream page */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--cream-100));
}
.hero3d.no-webgl { background: linear-gradient(135deg, #5c1220, #2a070d 60%, #170306); }

.hero3d-inner {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: 40px;
  padding-top: 56px;
  padding-bottom: 96px;
}

.hero3d .eyebrow { color: var(--gold-400); }
.hero3d .eyebrow::before { background: var(--gold-400); }
.hero3d-copy { position: relative; min-height: 340px; perspective: 900px; }
.h3-slide-copy {
  position: absolute; inset: 0 auto auto 0; width: 100%;
  opacity: 0; transform: translate3d(0, 24px, -60px) rotateX(8deg); filter: blur(6px);
  transition: opacity .8s var(--ease-out), transform .9s var(--ease-out), filter .8s var(--ease-out);
  pointer-events: none;
}
.h3-slide-copy.is-active { opacity: 1; transform: none; filter: none; pointer-events: auto; position: relative; }
.h3-slide-copy h1, .h3-slide-copy .h1like {
  color: #fff;
  font-size: clamp(36px, 5.2vw, 68px);
  line-height: 1.04;
  margin: 18px 0 20px;
  text-shadow: 0 6px 40px rgba(0,0,0,.45);
}
.h3-slide-copy h1 i, .h3-slide-copy .h1like i, .h3-slide-copy .italic-accent {
  font-style: italic; font-weight: 500;
  background: linear-gradient(100deg, #f3d99b, #c19a4a 55%, #f0cf86);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.h3-slide-copy p { color: rgba(251,245,234,.82); max-width: 470px; font-size: 16.5px; }
.h3-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }
.hero3d .btn-gold { box-shadow: 0 10px 30px rgba(193,154,74,.35); }
.hero3d .btn-ghost { color: var(--cream-100); border-color: rgba(251,245,234,.45); background: rgba(255,255,255,.04); backdrop-filter: blur(6px); }
.hero3d .btn-ghost:hover { background: var(--cream-100); color: var(--maroon-950); }

/* 3D card stage */
.hero-stage {
  position: relative;
  height: min(62vh, 560px);
  perspective: 1400px;
  --rx: 0deg; --ry: 0deg;
}
.stage-rig {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .25s ease-out;
}
.stage-card {
  --o: 0;
  position: absolute; top: 50%; left: 50%;
  width: min(330px, 62%); aspect-ratio: 4 / 5;
  margin: calc(min(62vh, 560px) * -0.0) 0 0 0;
  transform:
    translate(-50%, -50%)
    translate3d(calc(var(--o) * 78px), calc(var(--o) * -26px), calc(var(--o) * -170px))
    rotateY(calc(-14deg + var(--o) * -6deg)) rotateZ(calc(var(--o) * 2deg));
  opacity: calc(1 - var(--o) * 0.28);
  filter: brightness(calc(1 - var(--o) * .22));
  transition: transform 1s var(--ease-out), opacity .8s var(--ease-out), filter .8s var(--ease-out);
  transform-style: preserve-3d;
  border-radius: 6px;
  cursor: pointer;
  z-index: calc(10 - var(--o));
}
.stage-card .face {
  position: absolute; inset: 0; overflow: hidden; border-radius: 6px;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,.65), 0 0 0 1px rgba(212,176,107,.35), inset 0 0 0 6px rgba(23,3,6,.0);
  background: #2a070d;
}
.stage-card .face img { width: 100%; height: 100%; object-fit: cover; object-position: 68% 50%; transform: scale(1.12); transition: transform 1.2s var(--ease-out); }
.stage-card.is-front .face img { transform: scale(1.02); }
.stage-card .face::after { /* glass sheen following pointer */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,235,190,.22) 48%, transparent 62%);
  transform: translateX(calc(var(--ry, 0deg) * 6)); mix-blend-mode: screen;
}
.stage-card .tag {
  position: absolute; left: -18px; bottom: 28px; transform: translateZ(70px);
  background: var(--cream-100); color: var(--maroon-900);
  font: 600 11px/1 var(--font-body); letter-spacing: .2em; text-transform: uppercase;
  padding: 11px 16px; box-shadow: 0 14px 30px rgba(0,0,0,.35);
  opacity: 0; transition: opacity .6s .3s;
}
.stage-card.is-front .tag { opacity: 1; }
.stage-card .frame { /* gold zari frame floating behind */
  position: absolute; inset: -14px; border: 1px solid rgba(212,176,107,.55); border-radius: 8px;
  transform: translateZ(-40px); pointer-events: none;
}

.hero-controls {
  position: absolute; left: 0; right: 0; bottom: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.hero-controls .container { display: flex; align-items: center; gap: 18px; width: 100%; }
.h3-dots { display: flex; gap: 8px; }
.h3-dots button { width: 28px; height: 3px; border: 0; padding: 0; background: rgba(251,245,234,.28); border-radius: 3px; transition: all .4s; }
.h3-dots button.is-active { background: var(--gold-400); width: 54px; }
.h3-arrows { display: flex; gap: 10px; margin-left: auto; }
.h3-arrows button {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(251,245,234,.4);
  background: rgba(255,255,255,.05); color: var(--cream-100); font-size: 22px; backdrop-filter: blur(6px);
  transition: all .25s;
}
.h3-arrows button:hover { background: var(--gold-500); color: var(--maroon-950); border-color: var(--gold-500); }
.h3-arrows button:focus-visible, .h3-dots button:focus-visible { outline: 2px solid var(--gold-400); outline-offset: 3px; }

.scroll-cue { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); font: 600 10.5px var(--font-body); letter-spacing: .3em; text-transform: uppercase; color: rgba(251,245,234,.6); text-align: center; z-index: 2; }
.scroll-cue span { display: block; width: 1px; height: 30px; margin: 8px auto 0; background: linear-gradient(var(--gold-400), transparent); animation: cue 2s infinite; }
@keyframes cue { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ---------- Marquee ---------- */
.marquee { background: var(--maroon-950); border-block: 1px solid rgba(212,176,107,.35); overflow: hidden; padding: 16px 0; }
.marquee-track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee-track span { font: italic 500 22px var(--font-display); color: var(--gold-400); padding: 0 28px; white-space: nowrap; display: inline-flex; align-items: center; gap: 56px; }
.marquee-track span::after { content: "◆"; font-size: 10px; color: var(--gold-600); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Scroll reveal (3D) ---------- */
.reveal { opacity: 0; transform: perspective(900px) translate3d(0, 46px, -80px) rotateX(10deg); transition: opacity .9s var(--ease-out), transform 1s var(--ease-out); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Collections: 3D tilt cards ---------- */
.collections { perspective: 1200px; }
.collection-card.tilt {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .35s var(--ease-out), box-shadow .35s;
  will-change: transform;
  box-shadow: 0 14px 34px rgba(74,14,23,.14);
}
.collection-card.tilt:hover { box-shadow: 0 38px 60px -18px rgba(74,14,23,.45); }
.collection-card.tilt::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: radial-gradient(240px circle at var(--mx) var(--my), rgba(255,236,190,.34), transparent 60%);
  opacity: 0; transition: opacity .3s;
}
.collection-card.tilt:hover::after { opacity: 1; }
.collection-card.tilt .label { padding-bottom: 66px; }
.collection-card .label { padding-bottom: 66px; }

/* ---------- Gallery rail: coverflow ---------- */
.rail-wrap { position: relative; perspective: 1400px; margin: 0 -32px; }
.rail {
  display: flex; gap: 22px; overflow-x: auto; padding: 30px 32px 50px; scroll-snap-type: x proximity;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; cursor: grab;
}
.rail::-webkit-scrollbar { display: none; }
.rail.dragging { cursor: grabbing; scroll-snap-type: none; }
.rail .product-card {
  flex: 0 0 min(280px, 70vw); scroll-snap-align: center; transform-style: preserve-3d;
  transition: transform .15s linear, opacity .15s linear; will-change: transform;
}
.rail .product-card img { pointer-events: none; -webkit-user-drag: none; }
.rail .product-thumb { box-shadow: 0 24px 44px -16px rgba(74,14,23,.4); }
#latestRow.product-row { display: flex; }

/* ---------- Story: layered parallax ---------- */
.story-media { position: relative; overflow: hidden; }
.story-media img { transform: scale(1.18) translate3d(0, var(--py, 0px), 0); will-change: transform; transition: transform .1s linear; }
.story-stat { transition: transform .4s var(--ease-out); }
.story-stat:hover { transform: translateY(-6px) rotateX(8deg); }

.visit-media { perspective: 1200px; }
.visit-media img { transform: rotateY(-8deg) rotateX(2deg); transition: transform .6s var(--ease-out); }
.visit-media:hover img { transform: rotateY(0) rotateX(0); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero3d { min-height: auto; align-items: flex-start; }
  .hero3d-inner { grid-template-columns: 1fr; padding-top: 36px; padding-bottom: 200px; gap: 8px; }
  .hero3d-copy { min-height: 330px; }
  .hero-stage { height: 380px; order: -1; }
  .stage-card { width: min(250px, 62%); }
  .hero-controls { bottom: 62px; }
  .h3-arrows button { width: 42px; height: 42px; }
  .rail-wrap { margin: 0 -20px; }
  .rail { padding-inline: 20px; }
}
@media (hover: none) { .collection-card.tilt::after { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .marquee-track, .scroll-cue span { animation: none; }
  .reveal, .h3-slide-copy, .stage-card, .stage-rig { transition: none; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Classic slider showcase ---------- */
.showcase { padding: 70px 0 80px; background: var(--cream-100); }
.sc-frame {
  position: relative; aspect-ratio: 2 / 0.86; border-radius: 6px; overflow: hidden;
  box-shadow: 0 40px 70px -28px rgba(74,14,23,.55), 0 0 0 1px rgba(193,154,74,.45);
  background: var(--maroon-950);
}
.sc-frame::after { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(212,176,107,.55); border-radius: 3px; pointer-events: none; z-index: 3; }
.sc-slide { position: absolute; inset: 0; margin: 0; opacity: 0; visibility: hidden; transition: opacity 1s var(--ease-out), visibility 0s 1s; }
.sc-slide.is-active { opacity: 1; visibility: visible; transition: opacity 1s var(--ease-out); }
.sc-slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.0); }
.sc-slide.is-active img { animation: kenburns 9s ease-out forwards; }
@keyframes kenburns { from { transform: scale(1.0); } to { transform: scale(1.09) translate(-1.2%, -.8%); } }
.sc-slide::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(23,3,6,.82) 0%, rgba(23,3,6,.45) 40%, transparent 70%); }
.sc-slide figcaption {
  position: absolute; z-index: 2; left: clamp(26px, 5vw, 70px); bottom: clamp(30px, 7vw, 80px); max-width: min(520px, 78%);
  transform: translateY(24px); opacity: 0; transition: transform .9s .25s var(--ease-out), opacity .9s .25s;
}
.sc-slide.is-active figcaption { transform: none; opacity: 1; }
.sc-slide h3 { color: #fff; font-size: clamp(24px, 3.6vw, 46px); line-height: 1.08; margin-bottom: 12px; }
.sc-slide h3 i { color: var(--gold-400); font-weight: 500; }
.sc-slide p { color: rgba(251,245,234,.85); font-size: clamp(13px, 1.3vw, 16px); margin-bottom: 20px; }
.sc-nav { position: absolute; top: 50%; z-index: 4; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(251,245,234,.5); background: rgba(23,3,6,.35); color: #fff; font-size: 24px; backdrop-filter: blur(6px); transition: all .25s; }
.sc-nav.prev { left: 22px; } .sc-nav.next { right: 22px; }
.sc-nav:hover { background: var(--gold-500); color: var(--maroon-950); border-color: var(--gold-500); }
.sc-nav:focus-visible, .sc-dots button:focus-visible { outline: 2px solid var(--gold-400); outline-offset: 3px; }
.sc-dots { position: absolute; z-index: 4; right: 30px; bottom: 26px; display: flex; gap: 8px; }
.sc-dots button { width: 26px; height: 3px; padding: 0; border: 0; border-radius: 3px; background: rgba(251,245,234,.4); transition: all .4s; }
.sc-dots button.is-active { width: 50px; background: var(--gold-400); }
@media (max-width: 760px) {
  .sc-frame { aspect-ratio: 4 / 5; }
  .sc-slide::before { background: linear-gradient(0deg, rgba(23,3,6,.88) 0%, rgba(23,3,6,.3) 55%, transparent 80%); }
  .sc-slide figcaption { max-width: 88%; left: 22px; bottom: 56px; }
  .sc-nav { display: none; }
  .sc-dots { left: 22px; right: auto; bottom: 22px; }
}
@media (prefers-reduced-motion: reduce) { .sc-slide.is-active img { animation: none; } }
