/* ============================================================
   Homepage sticky hero: cover image → 3×3 mosaic → article.
   Loaded only on pages/home.html — no external CDNs / GSAP.
   Progress variables are written by static/js/hero-shrink.js.
   ============================================================ */

.page-home.has-hero-shrink {
  --hero-progress: 0;
  --hero-zoom: 3.08;
  --hero-gap: 0px;
  --hero-spread: 0px;
  --hero-inset: 0px;
  --hero-nav-clear: 0px;
  --hero-radius: 0px;
  --hero-copy: 1;
  --hero-veil: 1;
  --hero-hint: 1;
  padding-top: 0; /* full-bleed behind the fixed navbar */
}

.hero-shrink {
  position: relative;
  z-index: 2;
  background-color: #070707;
}

/* Tall track = scroll distance while the sticky viewport stays pinned. */
.hero-shrink__track {
  position: relative;
  height: 320vh;
}

.hero-shrink__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background-color: #070707;
}

.hero-shrink__stage {
  position: absolute;
  top: calc(var(--hero-inset) + var(--hero-nav-clear));
  right: var(--hero-inset);
  bottom: var(--hero-inset);
  left: var(--hero-inset);
  overflow: hidden;
  border-radius: var(--hero-radius);
  background-color: #070707;
  box-shadow:
    0 calc(var(--hero-progress) * 18px) calc(var(--hero-progress) * 48px) rgba(0, 0, 0, 0.42);
  will-change: top, right, bottom, left, border-radius;
}

/* Zoom the whole 3×3 from ~3 (center fills the screen) down to 1 (grid visible). */
.hero-shrink__scaler {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(var(--hero-zoom));
  transform-origin: center center;
  will-change: transform;
}

.hero-shrink__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  width: 100%;
  height: 100%;
  gap: var(--hero-gap);
}

.hero-shrink__cell {
  position: relative;
  margin: 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background-color: #111;
  will-change: transform;
}

.hero-shrink__cell img,
.hero-shrink__video,
.hero-shrink__video iframe {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.hero-shrink__video iframe {
  border: 0;
}

/* Surrounding tiles ease slightly away from center while the grid opens. */
.hero-shrink__cell[data-pos="tl"] { transform: translate(calc(var(--hero-spread) * -1), calc(var(--hero-spread) * -1)); }
.hero-shrink__cell[data-pos="tc"] { transform: translate(0, calc(var(--hero-spread) * -1)); }
.hero-shrink__cell[data-pos="tr"] { transform: translate(var(--hero-spread), calc(var(--hero-spread) * -1)); }
.hero-shrink__cell[data-pos="ml"] { transform: translate(calc(var(--hero-spread) * -1), 0); }
.hero-shrink__cell[data-pos="mr"] { transform: translate(var(--hero-spread), 0); }
.hero-shrink__cell[data-pos="bl"] { transform: translate(calc(var(--hero-spread) * -1), var(--hero-spread)); }
.hero-shrink__cell[data-pos="bc"] { transform: translate(0, var(--hero-spread)); }
.hero-shrink__cell[data-pos="br"] { transform: translate(var(--hero-spread), var(--hero-spread)); }

.hero-shrink__cell--hero {
  z-index: 1;
  transform: none;
}

.hero-shrink__cell--card {
  background:
    radial-gradient(circle at 20% 20%, rgba(233, 185, 26, 0.28), transparent 55%),
    linear-gradient(160deg, #1a2740 0%, #0d1524 70%);
}

.hero-shrink__card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  padding: clamp(0.7rem, 1.6vw, 1.35rem);
  color: #f5ebc4;
}

.hero-shrink__card-kicker {
  margin: 0 0 0.25rem;
  font-family: var(--font-nav);
  font-size: clamp(0.58rem, 1.1vw, 0.78rem);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245, 235, 196, 0.72);
}

.hero-shrink__card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.4vw, 1.85rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-transform: none;
}

.hero-shrink__card-title span {
  text-transform: none;
  color: #e9b91a;
}

.hero-shrink__card-text {
  margin: 0.4rem 0 0;
  max-width: 16rem;
  font-family: var(--font-body);
  font-size: clamp(0.68rem, 1.15vw, 0.88rem);
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.78);
}

.hero-shrink__veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.34) 0%,
      rgba(0, 0, 0, 0.08) 42%,
      rgba(0, 0, 0, 0.58) 100%
    );
  opacity: var(--hero-veil);
}

.hero-shrink__content {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  /* Leave the lower-left clear for the travelling logo (Volt composition). */
  padding: 0 5vw 7vh max(1.25rem, calc(var(--logo-start-h) + 2.5rem));
  pointer-events: none;
}

.hero-shrink__brand {
  width: min(920px, 100%);
  text-align: right;
  color: #f5ebc4;
  opacity: var(--hero-copy);
  transform: translate3d(0, calc((1 - var(--hero-copy)) * 1.6rem), 0);
  transform-origin: center bottom;
  will-change: transform, opacity;
  pointer-events: auto;
}

.hero-shrink__eyebrow {
  margin: 0 0 0.55rem;
  font-family: var(--font-nav);
  font-size: clamp(0.75rem, 1.5vw, 0.9rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245, 235, 196, 0.85);
}

.hero-shrink__title {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 10vw, 6.5rem);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #f5ebc4 !important;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.28);
}

.hero-shrink__title .nail-accent {
  letter-spacing: 0.04em;
  text-transform: none;
  color: #e9b91a;
}

.hero-shrink__lead {
  margin: 0 0 1.2rem auto;
  max-width: 28rem;
  font-family: var(--font-body);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 500;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
}

.hero-shrink__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.2rem;
  border: 2px solid rgba(245, 235, 196, 0.55);
  border-radius: 999px;
  background-color: rgba(245, 235, 196, 0.12);
  color: #f5ebc4 !important;
  font-family: var(--font-nav);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.hero-shrink__cta:hover,
.hero-shrink__cta:focus {
  background-color: rgba(245, 235, 196, 0.24);
  border-color: #f5ebc4;
  color: #ffffff !important;
  transform: translateY(-1px);
}

.hero-shrink__hint {
  position: absolute;
  left: 50%;
  bottom: 1.35rem;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  transform: translateX(-50%);
  opacity: var(--hero-hint);
  pointer-events: none;
  color: rgba(245, 235, 196, 0.78);
}

.hero-shrink__hint-label {
  font-family: var(--font-nav);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hero-shrink__hint-chevron {
  width: 0.7rem;
  height: 0.7rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  animation: hero-hint-bounce 1.6s ease-in-out infinite;
}

@keyframes hero-hint-bounce {
  0%,
  100% { translate: 0 0; }
  50% { translate: 0 6px; }
}

.page-home.has-hero-shrink .bio-canvas {
  position: relative;
  z-index: 1;
}

.page-home.has-hero-shrink #home-content {
  scroll-margin-top: 5.5rem;
}

@media (max-width: 991.98px) {
  .hero-shrink__track {
    height: 280vh;
  }

  .hero-shrink__content {
    justify-content: center;
    padding: 0 1.25rem 9.5vh;
  }

  .hero-shrink__brand {
    text-align: center;
  }

  .hero-shrink__lead {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-shrink__title {
    font-size: clamp(2.4rem, 12vw, 4rem);
  }
}

@media (max-width: 575.98px) {
  .hero-shrink__track {
    height: 240vh;
  }

  .hero-shrink__card-text {
    display: none;
  }

  .hero-shrink__hint {
    bottom: 0.85rem;
  }
}

/* Short viewports: keep the pin, but spend less scroll on the settle. */
@media (max-height: 560px) {
  .hero-shrink__track {
    height: 220vh;
  }

  .hero-shrink__title {
    font-size: clamp(2rem, 10vh, 3.4rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-shrink__track {
    height: auto;
  }

  .hero-shrink__sticky {
    position: relative;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .hero-shrink__stage {
    position: relative;
    inset: auto;
    min-height: 100vh;
    min-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }

  .hero-shrink__scaler {
    position: relative;
    transform: none !important;
  }

  .hero-shrink__grid {
    display: block;
    height: 100vh;
    height: 100dvh;
    gap: 0;
  }

  .hero-shrink__cell {
    display: none;
    transform: none !important;
  }

  .hero-shrink__cell--hero {
    display: block;
    width: 100%;
    height: 100%;
  }

  .hero-shrink__brand,
  .hero-shrink__veil,
  .hero-shrink__hint {
    opacity: 1 !important;
    transform: none !important;
  }

  .hero-shrink__hint-chevron {
    animation: none;
  }
}
