/* ==========================================================================
   KediHanem Scroll-Animated Hero
   ========================================================================== */

.kh-scroll-hero {
  position: relative;
  width: 100%;
  height: 230vh;
  margin: 0;
  padding: 0;
  background: #f7f2e9;
  isolation: isolate;
}

.scroll-hero-sticky {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  min-height: 580px;
  max-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 24px 24px;
  box-sizing: border-box;
}

/* Ambient Radial Glow */
.hero-glow-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 75% 40%, rgba(254, 243, 222, 0.7) 0%, rgba(247, 242, 233, 0) 65%);
  z-index: 0;
}

/* Main Hero Stage - Scales and transforms on scroll */
.hero-stage {
  position: relative;
  width: 100%;
  max-width: 1360px;
  height: 100%;
  border-radius: 24px;
  overflow: hidden;
  background: #f7f2e9;
  box-shadow: 0 10px 40px rgba(60, 45, 25, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  will-change: transform, border-radius, box-shadow;
  transform-origin: center center;
  transition: box-shadow 0.2s ease;
  z-index: 1;
}

/* Full Bleed Hero Photo with dynamic zoom */
.hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  will-change: transform;
  transform-origin: center center;
  transition: filter 0.3s ease;
}

/* Cinematic Left Gradient overlay to ensure text contrast */
.hero-overlay-gradient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(247, 242, 233, 0.96) 0%,
    rgba(247, 242, 233, 0.88) 32%,
    rgba(247, 242, 233, 0.55) 52%,
    rgba(247, 242, 233, 0.15) 75%,
    rgba(247, 242, 233, 0.02) 100%
  );
}

/* Narrative Panels (Text morphing across scroll phases) */
.hero-narrative-wrap {
  position: relative;
  z-index: 5;
  width: 52%;
  max-width: 580px;
  padding-left: 64px;
  padding-right: 20px;
}

.narrative-panel {
  position: absolute;
  top: 50%;
  left: 64px;
  transform: translateY(-50%);
  width: calc(100% - 64px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.narrative-panel.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%);
}

.narrative-panel.leaving-up {
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(-50% - 24px));
}

.narrative-panel.entering-down {
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(-50% + 24px));
}

.narrative-panel .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  letter-spacing: 2.2px;
  font-weight: 700;
  color: #747f5c;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral, #d97154);
  box-shadow: 0 0 10px rgba(217, 113, 84, 0.6);
  animation: dotPulse 2s infinite ease-in-out;
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
}

.narrative-panel h1,
.narrative-panel h2 {
  font-family: 'Manrope', sans-serif;
  font-size: clamp(38px, 4.2vw, 56px);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -2px;
  color: #2c2824;
  margin-bottom: 18px;
}

.narrative-panel h1 em,
.narrative-panel h2 em {
  font-style: italic;
  color: var(--coral, #d97154);
}

.narrative-panel p {
  font-size: 14px;
  line-height: 1.85;
  color: #5a544b;
  margin-bottom: 24px;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.kh-button-pulse {
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(217, 113, 84, 0.28);
  animation: btnFloat 3s infinite ease-in-out;
}

@keyframes btnFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* Feature Perks Row in Phase 2 */
.hero-perks-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.perk-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 600;
  color: #4b5443;
  box-shadow: 0 3px 12px rgba(60, 45, 25, 0.04);
}

.perk-pill span {
  color: var(--coral, #d97154);
}

/* ==========================================================================
   Parallax Floating Badges & Stickers
   ========================================================================== */
.floating-badge {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  will-change: transform;
}

.badge-owner {
  top: 48px;
  right: 64px;
}

.sticker-circle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: #f4e4b9;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  font-size: 13.5px;
  line-height: 1.45;
  box-shadow: 0 0 0 5px rgba(244, 228, 185, 0.45), 0 8px 24px rgba(60, 45, 25, 0.08);
  transform: rotate(9deg);
}

.sticker-circle span {
  font-size: 24px;
  color: var(--coral, #d97154);
  line-height: 1;
  margin-top: 2px;
}

.badge-love {
  bottom: 110px;
  right: 80px;
}

.badge-yarn {
  top: 45%;
  right: 28%;
}

.pill-card {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  padding: 12px 18px;
  background: rgba(255, 252, 242, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(60, 45, 25, 0.07);
}

.pill-card .badge-icon {
  font-size: 24px;
}

.pill-card b {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #2c2824;
}

.pill-card small {
  display: block;
  font-size: 10px;
  color: #7c7e74;
}

/* ==========================================================================
   Animated SVG Yarn Trail & Rolling Yarn Ball
   ========================================================================== */
.scroll-yarn-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}

.yarn-path {
  fill: none;
  stroke: #d97154;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  opacity: 0.75;
  will-change: stroke-dashoffset;
}

.yarn-ball-follower {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  font-size: 24px;
  line-height: 1;
  will-change: transform, left, top;
  filter: drop-shadow(0 4px 8px rgba(217, 113, 84, 0.3));
}

/* ==========================================================================
   Bottom Floating Scroll HUD / Cue Indicator
   ========================================================================== */
.scroll-hero-hud {
  position: absolute;
  bottom: 24px;
  left: 64px;
  right: 64px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  pointer-events: none;
}

.hud-cue {
  display: flex;
  align-items: center;
  gap: 12px;
}

.scroll-mouse-icon {
  display: block;
  width: 18px;
  height: 28px;
  border: 1.6px solid #949a85;
  border-radius: 10px;
  position: relative;
}

.scroll-mouse-icon::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 6.5px;
  width: 2.5px;
  height: 6px;
  border-radius: 2px;
  background: var(--coral, #d97154);
  animation: mouseWheelMove 1.8s infinite;
}

@keyframes mouseWheelMove {
  0% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(5px); opacity: 0.3; }
  100% { transform: translateY(0); opacity: 1; }
}

.hud-cue-text b {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #4b5443;
}

.hud-cue-text span {
  display: block;
  font-size: 9.5px;
  color: #8c907e;
  margin-top: 1px;
}

.hud-progress-bar {
  flex: 1;
  max-width: 240px;
  height: 4px;
  background: rgba(148, 154, 133, 0.25);
  border-radius: 4px;
  overflow: hidden;
}

.hud-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--coral, #d97154);
  border-radius: 4px;
  will-change: width;
  transition: width 0.08s linear;
}

.hud-skip-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: rgba(255, 250, 242, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  color: #555d4c;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 3px 10px rgba(60, 45, 25, 0.05);
  transition: all 0.2s ease;
}

.hud-skip-btn:hover {
  background: #ffffff;
  color: var(--coral, #d97154);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(60, 45, 25, 0.08);
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1100px) {
  .hero-narrative-wrap {
    width: 60%;
    padding-left: 40px;
  }
  .narrative-panel {
    left: 40px;
    width: calc(100% - 40px);
  }
  .badge-owner {
    right: 32px;
    top: 32px;
  }
  .badge-love {
    right: 32px;
    bottom: 90px;
  }
  .scroll-hero-hud {
    left: 40px;
    right: 40px;
  }
}

@media (max-width: 768px) {
  .kh-scroll-hero {
    height: 180vh;
  }
  .scroll-hero-sticky {
    padding: 10px;
  }
  .hero-stage {
    border-radius: 16px;
  }
  .hero-overlay-gradient {
    background: linear-gradient(
      180deg,
      rgba(247, 242, 233, 0.96) 0%,
      rgba(247, 242, 233, 0.88) 45%,
      rgba(247, 242, 233, 0.45) 80%,
      rgba(247, 242, 233, 0.1) 100%
    );
  }
  .hero-narrative-wrap {
    width: 100%;
    padding: 24px 20px;
    margin-top: -60px;
  }
  .narrative-panel {
    left: 20px;
    width: calc(100% - 40px);
  }
  .narrative-panel h1,
  .narrative-panel h2 {
    font-size: 32px;
    letter-spacing: -1px;
  }
  .badge-owner, .badge-yarn {
    display: none;
  }
  .badge-love {
    right: 20px;
    bottom: 70px;
  }
  .scroll-hero-hud {
    left: 20px;
    right: 20px;
    bottom: 16px;
  }
  .hud-progress-bar {
    display: none;
  }
}

