/* ==========================================================================
   Home — opening → pinned horizontal features → footer
   ========================================================================== */

/* --- 1. Opening ---------------------------------------------------------- */

.hero {
  position: relative;
  width: 100%;
  height: 100svh;
  /* Keep the full Spline frame visible — do not clip the canvas. */
  overflow: visible;
  opacity: 1;
  transition: opacity var(--motion-dur-media, 1.2s) var(--ease);
}

/* Quiet Fade on first load / leave — opacity only, no slide. */
body.home.is-loading .hero {
  opacity: 0;
  transition: none;
}

body.home.is-leaving .hero {
  opacity: 0;
}

.hero__scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  overflow: visible;
}

.hero__scene spline-viewer {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100svh;
}

.hero__scene.is-cursor-ready,
.hero__scene.is-cursor-ready spline-viewer,
.hero__scene.is-cursor-ready canvas {
  cursor: url("../assets/cursor.svg?v=9") 25 25, auto !important;
}

.hero__scene.is-cursor-ready.is-hot,
.hero__scene.is-cursor-ready.is-hot spline-viewer,
.hero__scene.is-cursor-ready.is-hot canvas {
  cursor: url("../assets/cursor-spline.svg?v=9") 25 25, pointer !important;
}

/* --- 2. Featured projects (sticky horizontal) ---------------------------- */

/*
  The section is tall: N viewports of scroll distance.
  Inside, a sticky pin holds the viewport while the track translates left.
*/
.feature {
  --feature-count: 3;
  position: relative;
  height: calc(var(--feature-count) * 100svh);
  background: var(--ink);
  color: #fff;
}

.feature__pin {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
}

.feature__track {
  display: flex;
  height: 100%;
  width: calc(var(--feature-count) * 100vw);
  will-change: transform;
}

.feature__panel {
  position: relative;
  flex: 0 0 100vw;
  width: 100vw;
  height: 100svh;
  overflow: hidden;
  color: #fff;
  cursor: url("../assets/cursor-project.svg?v=9") 19 12, pointer;
}

/* Explicitly repeat it on descendants; some browsers otherwise keep the
   global link cursor while hovering children inside the project card. */
.feature__panel * {
  cursor: url("../assets/cursor-project.svg?v=9") 19 12, pointer;
}

.feature__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.feature__media img,
.feature__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 1.4s var(--ease);
}

.feature__panel.is-active .feature__media img,
.feature__panel.is-active .feature__media video {
  transform: scale(1);
}

/* Nahum: crop into the left side of the artwork video. */
.feature__media--zoom-left video {
  object-position: left center;
  transform: scale(1.04);
  transform-origin: left center;
}

.feature__panel.is-active .feature__media--zoom-left video {
  transform: scale(1);
}

.feature__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.35) 0%,
      rgba(0, 0, 0, 0.05) 32%,
      rgba(0, 0, 0, 0.4) 58%,
      rgba(0, 0, 0, 0.82) 100%
    );
  pointer-events: none;
}

/* Nahum preview: clear light-pink glass tint (no blur / frost). */
.feature__glass {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      165deg,
      rgba(255, 164, 228, 0.28) 0%,
      rgba(255, 164, 228, 0.14) 45%,
      rgba(255, 164, 228, 0.22) 100%
    );
  box-shadow: inset 0 0 0 1px rgba(255, 164, 228, 0.35);
}

.feature__panel--nahum .feature__shade {
  background:
    linear-gradient(
      180deg,
      rgba(255, 164, 228, 0.18) 0%,
      rgba(0, 0, 0, 0.04) 34%,
      rgba(0, 0, 0, 0.28) 62%,
      rgba(0, 0, 0, 0.72) 100%
    );
}

.feature__panel--nahum .feature__body {
  z-index: 2;
}

.feature__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: clamp(1rem, 3vh, 1.75rem);
  height: 100%;
  /* Lift clear of the fixed corner labels (about / credits). */
  padding:
    calc(var(--bar) + 1rem)
    max(var(--edge), 7rem)
    calc(var(--nav-inset, 2rem) + clamp(6.5rem, 14vh, 9rem))
    var(--edge);
  color: #fff;
}

.feature__body > * {
  opacity: 0;
  transform: translateX(var(--motion-x, 1rem));
  transition:
    opacity var(--motion-dur, 0.7s) var(--ease),
    transform var(--motion-dur, 0.7s) var(--ease);
}

.feature__body > *:nth-child(1) { transition-delay: 0ms; }
.feature__body > *:nth-child(2) { transition-delay: 70ms; }
.feature__body > *:nth-child(3) { transition-delay: 140ms; }
.feature__body > *:nth-child(4) { transition-delay: 210ms; }

/* Hold copy until ~1s after the page settles. */
body.is-loading .feature__body > *,
body:not(.is-text-ready) .feature__body > * {
  opacity: 0;
  transform: translateX(var(--motion-x, 1rem));
  transition: none;
}

body.is-text-ready .feature__panel.is-active .feature__body > * {
  opacity: 1;
  transform: none;
}

.feature__meta {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  color: rgba(255, 255, 255, 0.8);
}

.feature__title {
  font-size: clamp(3rem, 10vw, 8.5rem);
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: -0.04em;
  max-width: 12ch;
}

.feature__summary {
  max-width: 38ch;
  font-size: clamp(1.05rem, 0.95rem + 0.55vw, 1.35rem);
  line-height: 1.4;
  color: #fff;
}

.feature__cta {
  font-family: var(--font-display);
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.25rem;
  width: fit-content;
  font-size: var(--step-0);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
}

.feature__cta::after {
  content: "";
  width: 2rem;
  height: 1px;
  background: currentColor;
  transition: width 0.5s var(--ease), transform 0.5s var(--ease);
}

.feature__panel:hover .feature__cta::after,
.feature__panel:focus-visible .feature__cta::after {
  width: 3rem;
}

/* Progress rail while pinned */
.feature__rail {
  position: absolute;
  inset: auto max(var(--edge), 7rem) calc(var(--nav-inset, 2rem) + 0.15rem) var(--edge);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 1rem;
  pointer-events: none;
  color: rgba(255, 255, 255, 0.9);
}

.feature__bar {
  position: relative;
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.35);
}

.feature__bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: #fff;
}

@media (max-width: 700px) {
  .feature__body {
    padding:
      calc(var(--bar) + 1rem)
      var(--edge)
      calc(var(--nav-inset, 2rem) + 4.75rem)
      var(--edge);
  }

  .feature__summary {
    display: none;
  }

  .feature__rail {
    inset: auto var(--edge) calc(var(--nav-inset, 2rem) + 0.1rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero {
    opacity: 1 !important;
    transition: none !important;
  }

  .feature {
    height: auto;
  }

  .feature__pin {
    position: relative;
    height: auto;
  }

  .feature__track {
    flex-direction: column;
    width: 100%;
    transform: none !important;
  }

  .feature__panel {
    width: 100%;
    flex-basis: auto;
    height: 100svh;
  }

  .feature__body > * {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .feature__rail {
    display: none;
  }
}
