/* ============================================================================
   ADRIANO JEWELRY · home.css  (home page only)
   P2: the hero — full-viewport velvet, the diamond canvas center-right, a
   staggered serif headline, dual CTAs, a breathing scroll cue. Poster-first:
   fully readable with no JS / no WebGL / reduced motion.
   Sections 2–7 land in P3. Depends on tokens.css + base.css + components.css.
   ============================================================================ */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;                 /* mobile: text sits low, diamond above */
  overflow: hidden;
  isolation: isolate;               /* local stacking context for the layers */
  background: var(--bg);
}
@media (min-width: 860px) { .hero { align-items: center; } }

/* Layer 0 — warm atmosphere glow behind the stone */
.hero__atmosphere {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(58% 56% at 50% 40%, rgba(var(--accent-rgb), 0.16), transparent 70%),
    radial-gradient(90% 90% at 55% 45%, rgba(var(--mocha-rgb), 0.12), transparent 76%);
}
@media (min-width: 860px) {
  .hero__atmosphere {
    background:
      radial-gradient(46% 60% at 70% 45%, rgba(var(--accent-rgb), 0.18), transparent 70%),
      radial-gradient(70% 90% at 72% 50%, rgba(var(--mocha-rgb), 0.12), transparent 78%);
  }
}
/* The atmosphere breathes — a slow candle-light swell (opacity/transform only) */
@media (prefers-reduced-motion: no-preference) {
  .hero__atmosphere { animation: atmoBreathe 12s ease-in-out infinite alternate; }
}
@keyframes atmoBreathe {
  from { opacity: 0.82; transform: scale(1); }
  to   { opacity: 1;    transform: scale(1.05); }
}

/* Film grain over the hero only — dissolves radial-gradient banding on the
   velvet. Static SVG noise tile, 5% — under the copy (z3), over the scrim. */
.hero::after {
  content: "";
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  opacity: 0.05;
}

/* Layer 1 — the diamond stage (poster + canvas), decorative */
.hero__stage { position: absolute; inset: 0; z-index: 1; }
@media (min-width: 860px) { .hero__stage { left: 26%; } } /* push the stone right */

/* The poster — a real photograph, pre-graded dark so it blends into the velvet.
   It is the LCP element; the canvas fades in over it. Ken-Burns drift is
   decorative and stops once the canvas is live (the layer then leaves paint). */
.hero__poster {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 60% 42%;
}
@media (prefers-reduced-motion: no-preference) {
  .hero__poster { animation: posterDrift 30s ease-in-out infinite alternate; transform-origin: 55% 45%; }
  .hero.is-live .hero__poster { animation: none; }
}
@keyframes posterDrift { from { transform: scale(1); } to { transform: scale(1.055); } }
.hero.is-live .hero__poster {
  visibility: hidden;                                  /* canvas is opaque once live */
  transition: visibility 0s calc(var(--dur-hero) + 300ms); /* after the canvas fade */
}

/* Layer 1b — champagne dust motes rising through the dark (decorative only) */
.hero__motes { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; display: none; }
@media (prefers-reduced-motion: no-preference) {
  .hero__motes { display: block; }
  .hero__motes::before {
    content: "";
    position: absolute; left: 0; top: 0; width: 100%; height: 200%;
    background-image:
      radial-gradient(1.6px 1.6px at 22% 14%, rgba(var(--accent-rgb), 0.50), transparent 100%),
      radial-gradient(1px 1px at 68% 34%, rgba(var(--accent-rgb), 0.38), transparent 100%),
      radial-gradient(1.4px 1.4px at 84% 6%, rgba(var(--accent-rgb), 0.30), transparent 100%),
      radial-gradient(1px 1px at 42% 46%, rgba(var(--accent-rgb), 0.36), transparent 100%),
      radial-gradient(2px 2px at 8% 30%, rgba(var(--accent-rgb), 0.26), transparent 100%),
      radial-gradient(1.2px 1.2px at 55% 22%, rgba(var(--accent-rgb), 0.42), transparent 100%);
    background-size: 100% 50%;   /* two identical tiles → seamless -50% loop */
    animation: motesRise 64s linear infinite;
  }
}
@keyframes motesRise { to { transform: translateY(-50%); } }

.hero__canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0;                       /* poster is the LCP; canvas fades over it */
  transition: opacity var(--dur-hero) var(--ease-out);
}
.hero.is-live .hero__canvas { opacity: 1; }
/* Reduced motion / poster path: no canvas fade at all. */
@media (prefers-reduced-motion: reduce) { .hero__canvas { transition: none; } }

/* Layer 2 — scrim keeps the headline legible over the stone/atmosphere */
.hero__scrim {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(to top, var(--bg) 6%, rgba(var(--bg-rgb), 0.55) 34%, rgba(var(--bg-rgb), 0.28) 58%, transparent 80%);
}
@media (min-width: 860px) {
  .hero__scrim {
    background: linear-gradient(to right, var(--bg) 16%, rgba(var(--bg-rgb), 0.42) 44%, transparent 64%);
  }
}

/* Layer 3 — content */
.hero__inner {
  position: relative; z-index: 3;
  padding-top: calc(var(--header-h) + env(safe-area-inset-top) + var(--space-lg));
  padding-bottom: calc(var(--space-2xl) + env(safe-area-inset-bottom));
}
@media (min-width: 860px) {
  /* Keep the container full-width (centered gutters) so text stays LEFT and the
     stone breathes on the right — don't let a measure cap re-center the block. */
  .hero__inner { padding-bottom: var(--space-2xl); }
  .hero__title { max-width: 18ch; }        /* headline stays left, short */
  .hero__kicker { white-space: nowrap; }   /* one uppercase line, never wrapped */
}

.hero__kicker { margin-bottom: var(--space-md); }
.hero__title {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: var(--ls-display);
}
.hero__line { display: block; }
.hero__line em { font-style: italic; color: var(--accent); }
.hero__sub {
  margin-top: var(--space-md);
  max-width: 46ch;
  color: var(--text-dim);
  font-size: var(--fs-lede);
  line-height: 1.6;
}
.hero__cta {
  margin-top: var(--space-lg);
  display: flex; flex-wrap: wrap;
  align-items: center; gap: var(--space-sm) var(--space-lg);
}

/* Scroll cue — a 1px gold line that breathes */
.hero__cue {
  position: absolute; left: 50%; z-index: 3;
  bottom: calc(var(--space-md) + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: 44px; height: 56px;
  display: grid; place-items: end center;
}
.hero__cue-line {
  width: 1px; height: 40px;
  background: linear-gradient(var(--accent), transparent);
  transform-origin: top center;
}
@media (prefers-reduced-motion: no-preference) {
  .hero__cue-line { animation: heroCue 2.6s var(--ease-out) infinite; }
}
@keyframes heroCue {
  0%, 100% { transform: scaleY(0.45); opacity: 0.45; }
  50%      { transform: scaleY(1); opacity: 1; }
}
@media (max-height: 560px) { .hero__cue { display: none; } } /* landscape-phone */

/* ---- Entrance — visible by default; only .js hides then reveals ----------- */
.js .hero__kicker,
.js .hero__line,
.js .hero__sub,
.js .hero__cta,
.js .hero__cue {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-reveal) var(--ease-out),
              transform var(--dur-reveal) var(--ease-out);
}
.hero.is-ready .hero__kicker,
.hero.is-ready .hero__line,
.hero.is-ready .hero__sub,
.hero.is-ready .hero__cta,
.hero.is-ready .hero__cue { opacity: 1; transform: none; }

.hero.is-ready .hero__kicker { transition-delay: 40ms; }
.hero.is-ready .hero__line:nth-child(1) { transition-delay: 120ms; }
.hero.is-ready .hero__line:nth-child(2) { transition-delay: 200ms; }
.hero.is-ready .hero__line:nth-child(3) { transition-delay: 280ms; }
.hero.is-ready .hero__sub { transition-delay: 380ms; }
.hero.is-ready .hero__cta { transition-delay: 480ms; }
.hero.is-ready .hero__cue { transition-delay: 900ms; }

@media (prefers-reduced-motion: reduce) {
  .js .hero__kicker, .js .hero__line, .js .hero__sub, .js .hero__cta, .js .hero__cue {
    opacity: 1; transform: none; transition: none;
  }
}
/* Failsafe: if hero.js never runs (module 404 / parse error), reveal the copy
   anyway at ~1.2s so it is never left invisible. is-ready wins earlier and
   cancels this. Reduced-motion is already handled by the override above. */
@media (prefers-reduced-motion: no-preference) {
  .js .hero__kicker, .js .hero__line, .js .hero__sub, .js .hero__cta, .js .hero__cue {
    animation: heroFailsafe 0.01s linear 1.2s forwards;
  }
  .hero.is-ready .hero__kicker, .hero.is-ready .hero__line, .hero.is-ready .hero__sub,
  .hero.is-ready .hero__cta, .hero.is-ready .hero__cue { animation: none; }
}
@keyframes heroFailsafe { to { opacity: 1; transform: none; } }

/* Landscape-phone / short viewports: tighten so the hero never clips.
   Keyed on height alone (like the scroll-cue hide) so 900–930px-wide
   landscape phones are covered too. */
@media (max-height: 560px) {
  .hero { min-height: 100svh; align-items: center; }
  .hero__title { font-size: clamp(2.25rem, 7vw, 3.25rem); }
  .hero__inner { padding-top: calc(var(--header-h) + env(safe-area-inset-top) + var(--space-sm)); padding-bottom: var(--space-lg); }
}

/* ===========================================================================
   §2 · MANIFESTO — cream chapter, oversized serif, line-break rhythm
   =========================================================================== */
.manifesto { text-align: center; }
.manifesto__text {
  font-family: var(--font-display);
  font-size: var(--fs-manifesto);
  font-weight: 500;
  line-height: 1.35;
  max-width: 30ch;
  margin-inline: auto;
  color: var(--ink);
  text-wrap: balance;
}
.manifesto__text em { font-style: italic; color: var(--accent-ink); }
@media (max-width: 620px) {
  .manifesto__text br { display: none; }   /* wrap naturally on small screens */
}

/* ===========================================================================
   §3 · THE COLLECTION — dark editorial grid of bordered cards
   =========================================================================== */
.collection__head { max-width: 34ch; margin-bottom: var(--space-xl); }
.collection__head h2 { margin-top: var(--space-sm); }
.collection__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gutter);
  align-items: start;   /* natural card heights — ragged bottoms are the editorial asymmetry */
}
@media (min-width: 720px) { .collection__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.collection__item { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.collection__item .card__media { margin: var(--space-2xs); }
.collection__cap {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--space-md); padding: var(--space-md) var(--space-md) var(--space-lg);
}
.collection__cap h3 { font-size: var(--fs-h3); }
@media (hover: hover) { .collection__item:hover .ghost-link::after { transform: scaleX(1); } }
.collection__grid .reveal:nth-child(2) { --reveal-delay: 80ms; }
.collection__grid .reveal:nth-child(3) { --reveal-delay: 160ms; }
.collection__grid .reveal:nth-child(4) { --reveal-delay: 240ms; }

/* ===========================================================================
   §4 · GALLERY — full-width horizontal scroll-snap strip, edge-faded
   =========================================================================== */
.gallery__head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: var(--space-xs) var(--space-md); margin-bottom: var(--space-lg);
}
.gallery__head h2 { margin-top: var(--space-sm); }
.gallery__counter { color: var(--text-dim); font-size: var(--fs-small); letter-spacing: 0.12em; }
.gallery__strip {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  touch-action: pan-y;                 /* vertical page scroll never fights */
  padding-inline:
    max(var(--gutter), env(safe-area-inset-left))
    max(var(--gutter), env(safe-area-inset-right));
  padding-block: var(--space-2xs);
  scrollbar-width: none;
  cursor: grab;
  user-select: none;                   /* mouse drag scrolls — never selects labels */
  -webkit-user-select: none;
  /* Edge fade capped to the gutter so the end cells rest fully unfaded. */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent);
}
.gallery__strip::-webkit-scrollbar { display: none; }
.gallery__strip.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.gallery__strip.is-gliding { scroll-snap-type: none; } /* snap stays off until inertia dies */
.gallery__cell {
  flex: 0 0 auto;
  width: clamp(210px, 60vw, 300px);
  scroll-snap-align: center;
  border-radius: var(--radius);
}
.gallery__cell:focus-visible { outline-offset: 4px; }
.gallery__img {
  display: block;
  width: 100%; height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-user-drag: none;   /* native image drag must never fight the strip drag */
  user-select: none;
  -webkit-user-select: none;
}

/* ===========================================================================
   §5 · CRAFT TEASER — split, image overlaps the boundary above
   =========================================================================== */
.craft__grid {
  display: grid; grid-template-columns: 1fr; gap: var(--space-xl); align-items: center;
}
@media (min-width: 860px) { .craft__grid { grid-template-columns: 1fr 1fr; gap: var(--space-2xl); } }
.craft__copy { max-width: 44ch; }
.craft__copy h2 { margin-block: var(--space-sm) var(--space-md); }
.craft__copy p { color: var(--text-dim); margin-bottom: var(--space-lg); }
@media (min-width: 860px) {
  .craft__media { margin-top: -80px; align-self: start; } /* overlap by 80px */
}

/* ===========================================================================
   §6 · HERITAGE — cream chapter, three count-up stats
   =========================================================================== */
.heritage { text-align: center; }
.heritage__head { max-width: 22ch; margin-inline: auto; margin-top: var(--space-sm); }
.heritage__stats {
  display: grid; grid-template-columns: 1fr; gap: var(--space-xl);
  margin-block: var(--space-2xl) var(--space-lg);
}
@media (min-width: 640px) { .heritage__stats { grid-template-columns: repeat(3, 1fr); } }
.heritage__num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 600; line-height: 1;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
}
.heritage__label {
  margin-top: var(--space-xs);
  font-size: var(--fs-small); text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--ink-dim);
}
.heritage__stats .reveal:nth-child(2) { --reveal-delay: 100ms; }
.heritage__stats .reveal:nth-child(3) { --reveal-delay: 200ms; }

/* ===========================================================================
   §7 · CTA BAND — dark, centered, gold rule above
   =========================================================================== */
.cta-band { text-align: center; }
.cta-band .rule-gold { margin: 0 auto var(--space-xl); }
.cta-band h2 { max-width: 20ch; margin: 0 auto var(--space-lg); font-size: var(--fs-h1); }
