/* ==========================================================================
   Hero — full-bleed storefront, gold monogram drawn on load, scroll cue.
   The entrance is pure CSS (no JS needed); hero.js only adds parallax + particles.
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  justify-items: center;
  /* Content sits low so the storefront's own "Bellissimo" sign stays readable above it */
  align-content: end;
  padding-block: calc(var(--header-h) + var(--space-6)) calc(var(--space-9) + var(--space-5));
  color: var(--on-photo);
  overflow: hidden;
  isolation: isolate;
  text-align: center;
}

/* ---------- Photo + grading ---------- */
.hero__media {
  position: absolute;
  /* extends above the hero so the storefront sign tucks under the header on tall phones */
  inset: -14% 0 0 0;
  z-index: -2;
  /* top: keeps the header readable · middle: vignette · bottom: melts into the page */
  --photo-shade:
    linear-gradient(180deg, rgb(18 11 8 / 0.85) 0%, rgb(18 11 8 / 0.35) 24%, rgb(18 11 8 / 0) 42%),
    radial-gradient(ellipse 80% 70% at 50% 45%, rgb(18 11 8 / 0.15) 0%, rgb(18 11 8 / 0.7) 100%),
    linear-gradient(180deg, rgb(18 11 8 / 0) 60%, var(--bg) 100%);
  will-change: transform;
}

/* The photo file is pre-graded into a warm "golden hour" mood (tools/grade-images.mjs) */
.hero__media img {
  object-position: 50% 58%;
  animation: hero-settle 3.2s var(--ease-out) both;
}

/* Warm sunset glow from the top corner */
.hero__media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: var(--z-base);
  pointer-events: none;
  background: radial-gradient(circle at 78% 8%, rgb(232 150 80 / 0.16) 0%, rgb(198 110 60 / 0.06) 30%, transparent 60%);
}

.hero__particles {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------- Content ---------- */
.hero__content {
  display: grid;
  justify-items: center;
  gap: var(--space-5);
  will-change: transform, opacity;
}

.hero__content::before,
.hero__monogram {
  grid-area: 1 / 1;
  width: clamp(5rem, 3.6rem + 5vw, min(8.5rem, 14svh)); /* a confident disc, capped by height on short screens */
  aspect-ratio: 1;
}

.hero__content::before {
  content: "";
  background: radial-gradient(circle, rgb(198 160 122 / 0.16), rgb(198 160 122 / 0.05) 40%, transparent 72%);
  scale: 1.5;
  pointer-events: none;
}

.hero__monogram {
  height: auto;
  overflow: visible;
  fill: var(--kraft);
  fill-opacity: 0;
  stroke: var(--kraft);
  stroke-width: 6; /* in path units (512 wide) ≈ 1.5px on screen at the largest size */
  stroke-dasharray: 1; /* the path has pathLength="1", so 1 = its full length */
  stroke-dashoffset: 1;
  animation:
    monogram-draw 2.6s var(--ease-in-out) 0.2s forwards,
    monogram-fill 1.2s var(--ease-out) 2.2s forwards;
}

.hero__eyebrow {
  color: var(--kraft-light);
  white-space: nowrap;
}

.hero__title {
  font-size: min(var(--fs-hero), 12.5svh); /* also capped by height so short laptops fit */
  max-width: 14ch;
  text-shadow: 0 4px 40px rgb(0 0 0 / 0.35);
}

.hero__lead {
  max-width: 46ch;
  font-size: var(--fs-md);
  color: var(--on-photo-muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin-block-start: var(--space-3);
}

/* Staggered entrance after the monogram starts drawing */
.hero__eyebrow,
.hero__title,
.hero__lead,
.hero__actions,
.scroll-cue {
  animation: hero-rise 1.3s var(--ease-out) both;
}

.hero__eyebrow {
  animation-delay: 0.6s;
}
.hero__title {
  animation-delay: 0.8s;
}
.hero__lead {
  animation-delay: 1.05s;
}
.hero__actions {
  animation-delay: 1.25s;
}
.scroll-cue {
  animation-delay: 1.8s;
}

/* ---------- Scroll cue ---------- */
/* hero.js adds .is-scrolled; the entrance animation's fill would otherwise pin the opacity */
.hero.is-scrolled .scroll-cue {
  animation: none;
  opacity: 0;
  transition: opacity var(--dur-fast);
}

.scroll-cue {
  position: absolute;
  inset-block-end: var(--space-6);
  inset-inline: 0;
  margin-inline: auto;
  width: max-content;
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  color: var(--on-photo-muted);
}

:lang(en) .scroll-cue {
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

.scroll-cue__line {
  position: relative;
  width: 1px;
  height: 3rem;
  overflow: hidden;
  background: rgb(244 238 230 / 0.2);
}

.scroll-cue__line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--kraft);
  animation: cue-drop 2.2s var(--ease-in-out) infinite;
}

/* ---------- Keyframes ---------- */
@keyframes hero-settle {
  from {
    transform: scale(1.14);
  }
  to {
    transform: scale(1.02);
  }
}

@keyframes monogram-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes monogram-fill {
  to {
    fill-opacity: 1;
    stroke-opacity: 0;
  }
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes cue-drop {
  0% {
    transform: translateY(-100%);
  }
  60%,
  100% {
    transform: translateY(100%);
  }
}

/* ---------- Reduced motion: show the final state straight away ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero__media img,
  .hero__eyebrow,
  .hero__title,
  .hero__lead,
  .hero__actions,
  .scroll-cue,
  .scroll-cue__line::after {
    animation: none;
  }

  .hero__monogram {
    animation: none;
    fill-opacity: 1;
    stroke-dashoffset: 0;
    stroke-opacity: 0;
  }
}
