/* ============================================================
   HERO SCRUB — painterly bg + image-sequence foreground
   Scroll pins hero for ~1.5 viewports while the frame scrubs
   ============================================================ */

.hero-scrub {
  position: relative;
  height: 250vh;            /* extra scroll drives the scrub */
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  background: transparent !important;
  overflow: visible;
}

/* Sticky inner viewport — all layers absolutely positioned inside */
.hero-stage {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.hero-bg-layer,
.hero-fg-layer,
.hero-title-card,
.hero-scrub-hint,
.hero-dust {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ----- Parallax BG painterly landscape ----- */
.hero-bg-layer { z-index: 1; pointer-events: none; }
.hero-bg-img {
  position: absolute;
  inset: -8%;               /* overscan for parallax motion */
  background-image: url('hero-bg.png');
  background-size: cover;
  background-position: center 30%;
  transform: translate3d(0, 0, 0);
  transition: transform 0.05s linear;
  filter: saturate(0.92) contrast(0.98) brightness(0.95);
}
.hero-bg-webgl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hero-bg-img.three-ready {
  background-image: none;
}
.hero-bg-wash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 70%, rgba(244, 234, 213, 0.0) 30%, rgba(42, 26, 12, 0.35) 100%),
    linear-gradient(180deg, rgba(244, 234, 213, 0.15) 0%, transparent 20%, transparent 70%, rgba(42, 26, 12, 0.28) 100%);
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* ----- Foreground image-sequence canvas ----- */
.hero-fg-layer { z-index: 2; pointer-events: none; }
#heroScrubCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* Sequence frames are rendered over hero bg; lighten removes dark matte cheaply */
  mix-blend-mode: lighten;
  transform: translate3d(0, 0, 0);
  transition: transform 0.05s linear;
  filter: contrast(1.05) saturate(1.02);
}

/* ----- Dissolve particle overlay (triggers near end of hero scrub, only for image→image transitions) ----- */
#heroDissolveCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.1s linear;
  mix-blend-mode: screen;
}

/* ----- Dust motes floating between bg and fg ----- */
.hero-dust { z-index: 3; pointer-events: none; overflow: hidden; }
.hero-dust span {
  position: absolute;
  width: 3px; height: 3px;
  background: radial-gradient(circle, rgba(255, 240, 210, 0.9) 20%, transparent 70%);
  border-radius: 50%;
  animation: dust-drift 18s linear infinite;
  opacity: 0;
}
.hero-dust span:nth-child(1) { left: 8%;  top: 80%; animation-duration: 22s; animation-delay:  0s; }
.hero-dust span:nth-child(2) { left: 18%; top: 60%; animation-duration: 26s; animation-delay: -4s; }
.hero-dust span:nth-child(3) { left: 32%; top: 75%; animation-duration: 20s; animation-delay: -9s; }
.hero-dust span:nth-child(4) { left: 48%; top: 85%; animation-duration: 30s; animation-delay: -2s; }
.hero-dust span:nth-child(5) { left: 62%; top: 65%; animation-duration: 24s; animation-delay: -12s; }
.hero-dust span:nth-child(6) { left: 72%; top: 80%; animation-duration: 28s; animation-delay: -6s; }
.hero-dust span:nth-child(7) { left: 84%; top: 70%; animation-duration: 21s; animation-delay: -14s; }
.hero-dust span:nth-child(8) { left: 92%; top: 82%; animation-duration: 25s; animation-delay: -3s; }
.hero-dust span:nth-child(9) { left: 14%; top: 88%; animation-duration: 27s; animation-delay: -10s; }
.hero-dust span:nth-child(10){ left: 78%; top: 90%; animation-duration: 23s; animation-delay: -17s; }
@keyframes dust-drift {
  0%   { transform: translate(0, 0) scale(0.8);       opacity: 0; }
  15%  { opacity: 0.8; }
  80%  { opacity: 0.5; }
  100% { transform: translate(40px, -90vh) scale(1.2); opacity: 0; }
}

/* ----- Overlaid editorial card (title + CTAs) ----- */
.hero-title-card {
  --hero-frame-stroke: 1px;
  --hero-loader-stroke: 0.6px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
  padding: 60px 36px;
  pointer-events: none;     /* allow content through, buttons re-enable */
  color: #fff;
  transition: opacity 0.25s ease;
}
.hero-frame-bounds {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  width: min(70vw, 520px);
  max-width: 100%;
  margin-inline: auto;
  padding: 48px 32px 40px;
  border: var(--hero-frame-stroke) solid transparent;
  transition: border-color .2s ease;
  text-align: center;
}
.hero-frame-bounds > :not(.hero-frame-loader):not(.ornament):not(.hero-pitch):not(.meta-line) {
  width: 100%;
  max-width: 100%;
}
.hero-title-card .ornament {
  width: 120px;
  height: 10px;
  margin: 4px auto 18px;
  color: rgba(255, 255, 255, 0.9);
  opacity: 0.95;
}
.hero-scrub.is-ready .hero-frame-bounds {
  border-color: rgba(255, 255, 255, 0.85);
}
.hero-frame-loader {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
}
.hero-frame-loader svg {
  width: 100%;
  height: 100%;
  display: block;
}
.hero-frame-loader path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.98);
  stroke-width: var(--hero-loader-stroke);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset .45s cubic-bezier(.22,.61,.36,1);
}
.hero-scrub.is-loading .hero-frame-loader {
  opacity: 1;
}
.hero-scrub.is-loading .hero-frame-loader path {
  animation: hero-frame-draw 1s linear 1 forwards;
}
@keyframes hero-frame-draw {
  0% { stroke-dashoffset: 100; }
  85% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 0; }
}
.hero-title-card .hero-frame-bounds > * { pointer-events: auto; }
.hero-title-card .kicker {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 14px;
  opacity: 0.85;
  text-align: center;
  padding-right: 0.24em;
}
.hero-big {
  font-family: var(--ff-display);
  font-weight: 300;
  font-size: clamp(44px, 6vw, 90px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  max-width: 100%;
  color: #fff;
  text-shadow:
    0 2px 10px rgba(0, 0, 0, 0.45),
    0 0 24px rgba(0, 0, 0, 0.35);
}
.hero-big em {
  font-style: italic;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.96);
  font-variant: small-caps;
  letter-spacing: 0.02em;
}
.hero-sub {
  font-family: var(--ff-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(14px, 1.15vw, 17px);
  line-height: 1.55;
  max-width: 400px;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 22px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}
.hero-sub em { color: rgba(255, 255, 255, 1); font-style: italic; font-weight: 500; }
.hero-title-card .hero-pitch {
  font-family: var(--ff-body);
  font-size: clamp(15px, 1.65vw, 18px);
  line-height: 1.55;
  width: min(100%, 36ch);
  max-width: 100%;
  align-self: center;
  margin: 0 0 20px;
  color: rgba(255, 255, 255, 0.94);
  text-align: center;
  text-wrap: pretty;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
}
.hero-title-card .hero-pitch strong {
  font-weight: 600;
  color: #fff;
}
.hero-title-card .hero-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: center;
  margin-top: 16px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.hero-title-card .hero-jumps a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  padding-bottom: 2px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}
.hero-title-card .hero-jumps a:hover {
  color: #fff;
  border-color: #fff;
}
.hero-title-card .meta-line {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.86);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: baseline;
  width: auto;
  max-width: 100%;
  align-self: center;
  margin: 0 auto 28px;
  padding-right: 0.13em;
  text-align: center;
}
.hero-title-card .meta-line span {
  display: inline-block;
}
.hero-title-card .meta-line em {
  font-family: var(--ff-display);
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.95);
}
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.hero-ctas .btn-edition {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px;
  font-family: var(--ff-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .06em;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}
.hero-ctas .btn-edition.primary {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.95);
}
.hero-ctas .btn-edition:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.95);
}
.hero-title-card .hero-ctas .btn-edition {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.12);
}
.hero-title-card .hero-ctas .btn-edition.primary {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.95);
}
.hero-title-card .hero-ctas .btn-edition:hover,
.hero-title-card .hero-ctas .btn-edition.primary:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.95);
}

/* Scrub hint bar at bottom */
.hero-scrub-hint {
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 0 36px;
  pointer-events: none;
  transition: opacity 0.3s;
}
.hero-scrub-hint .hint-label {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: rgba(244, 234, 213, 0.85);
  margin-bottom: 10px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
.hero-scrub-hint .hint-bar {
  width: 180px;
  height: 2px;
  background: rgba(244, 234, 213, 0.28);
  border-radius: 2px;
  overflow: hidden;
}
.hero-scrub-hint .hint-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--rust-2), var(--rust));
  transition: width 0.1s linear;
}

/* Desktop: center hero in the viewport area beside the edition rail */
@media (min-width: 901px) {
  body.has-rail .hero-title-card,
  body.has-rail .hero-scrub-hint {
    left: 220px;
    width: calc(100% - 220px);
    padding-left: 0;
  }
}
@media (min-width: 901px) and (max-width: 1100px) {
  body.has-rail .hero-title-card,
  body.has-rail .hero-scrub-hint {
    left: 180px;
    width: calc(100% - 180px);
  }
}
@media (max-width: 900px) {
  body.has-rail .hero-title-card,
  body.has-rail .hero-scrub-hint {
    left: 0;
    width: 100%;
  }
  body.has-rail .hero-title-card {
    padding: 36px 20px 36px 24px;
  }
}
@media (max-width: 720px) {
  .hero-scrub { height: 200vh; }
  .hero-fg-layer {
    top: 6%;
    bottom: 10%;
    height: auto;
  }
  .hero-title-card { padding: 28px 18px 28px 22px; }
  .hero-frame-bounds {
    width: 100%;
    max-width: 100%;
    padding: 28px 18px 24px;
  }
  .hero-title-card .kicker {
    font-size: 9px;
    letter-spacing: .18em;
    line-height: 1.5;
    padding-right: 0.18em;
  }
  .hero-title-card .hero-pitch {
    font-size: 15px;
    width: 100%;
    max-width: 100%;
    padding-inline: 0;
    margin-bottom: 14px;
    overflow-wrap: break-word;
    hyphens: auto;
  }
  .hero-title-card .meta-line {
    width: 100%;
    margin: 0 0 18px;
    gap: 8px 10px;
    letter-spacing: .08em;
    padding-right: 0.08em;
    justify-content: center;
  }
  .hero-title-card .hero-ctas {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 10px;
  }
  .hero-title-card .hero-ctas .btn-edition {
    justify-content: center;
    width: 100%;
    padding: 12px 16px;
    font-size: 12px;
  }
  .hero-title-card .hero-occasions {
    justify-content: center;
    width: 100%;
  }
  .hero-big { font-size: clamp(34px, 9vw, 56px); margin-bottom: 14px; }
  .hero-sub { font-size: 14px; max-width: 80vw; }
  .hero-title-card .hero-occasions { margin-top: 14px; }
  .hero-title-card .hero-jumps { margin-top: 12px; }
}
