.rh-hero-frame {
  --rh-mx: 0px;
  --rh-my: 0px;
  isolation: isolate;
  min-height: 520px;
}

.rh-hero-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 253, 246, 0.95), rgba(245, 240, 231, 0.56) 42%, rgba(245, 240, 231, 0) 74%),
    linear-gradient(180deg, rgba(251, 249, 245, 0.86), rgba(245, 240, 231, 0.72));
  opacity: 0;
  animation: rhCreamIn 1.15s ease-out 0.05s forwards;
}

.rh-hero-art {
  transform-origin: 50% 84%;
  filter: saturate(0.96) contrast(0.98);
  will-change: transform, filter, opacity;
  animation:
    rhTreeArrive 2.85s cubic-bezier(0.19, 0.78, 0.24, 1) both,
    rhTreeBreathe 7.5s ease-in-out 3.1s infinite;
}

.rh-hero-sun {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: soft-light;
  background:
    linear-gradient(108deg, rgba(255, 247, 211, 0) 8%, rgba(255, 247, 211, 0.34) 36%, rgba(255, 247, 211, 0.08) 52%, rgba(255, 247, 211, 0) 76%),
    radial-gradient(circle at 50% 68%, rgba(255, 225, 151, 0.22), rgba(255, 225, 151, 0) 18%);
  opacity: 0;
  transform: translate3d(calc(var(--rh-mx) * -0.25), calc(var(--rh-my) * -0.18), 0);
  animation:
    rhSunRise 2.8s ease-out 0.65s forwards,
    rhSunDrift 9s ease-in-out 3.2s infinite;
}

.rh-window-glow {
  position: absolute;
  z-index: 3;
  width: clamp(26px, 4.2cqw, 58px);
  aspect-ratio: 1 / 1.18;
  border-radius: 42%;
  background: radial-gradient(circle, rgba(255, 214, 132, 0.62), rgba(255, 207, 125, 0.2) 46%, rgba(255, 207, 125, 0) 72%);
  filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  animation: rhWindowWarmth 2.4s ease-out 1.35s forwards, rhLanternPulse 5.5s ease-in-out 4s infinite;
}

.rh-window-glow.left { left: 38.2%; top: 73.3%; }
.rh-window-glow.right { left: 56.4%; top: 73.2%; }

.rh-root-wash {
  position: absolute;
  left: 0;
  right: 0;
  top: 84%;
  z-index: -1;
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  opacity: 0.92;
  clip-path: inset(0 50% 62% 50%);
  filter: saturate(0.94) contrast(0.96);
  mix-blend-mode: multiply;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0) 0%, #000 8%, #000 66%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(180deg, rgba(0,0,0,0) 0%, #000 8%, #000 66%, rgba(0,0,0,0) 100%);
  animation: rhRootReveal 2.7s cubic-bezier(0.19, 0.78, 0.24, 1) 0.25s forwards;
}

[data-rootside] {
  opacity: 0.82;
  filter: saturate(0.82) contrast(0.9);
  mix-blend-mode: multiply;
}

[data-root] {
  transform-box: fill-box;
  transform-origin: center top;
  will-change: stroke-dashoffset, opacity, transform;
}

.rh-live-canopy {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  transform: translate3d(calc(var(--rh-mx) * 0.65), calc(var(--rh-my) * 0.45), 0);
  will-change: transform;
}

.rh-live-canopy svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.rh-live-sprig {
  transform-origin: center;
  opacity: 0;
  animation: rhLeafUnfold 1.8s cubic-bezier(0.22, 0.8, 0.25, 1) forwards, rhSprigSway 6.8s ease-in-out infinite;
}

.rh-drifting-leaf {
  position: absolute;
  z-index: 5;
  width: 14px;
  height: 7px;
  border-radius: 90% 8% 90% 8%;
  background: linear-gradient(110deg, rgba(139, 150, 120, 0.72), rgba(226, 223, 194, 0.66));
  box-shadow: inset -3px 0 4px rgba(74, 97, 54, 0.14);
  opacity: 0;
  pointer-events: none;
  transform-origin: 50% 50%;
  animation: rhLeafDrift var(--leaf-dur, 10s) linear var(--leaf-delay, 0s) infinite;
}

.rh-floating-nav {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
}

.rh-floating-nav a {
  position: absolute;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(117, 105, 94, 0.26);
  border-radius: 999px;
  background: rgba(251, 249, 245, 0.74);
  backdrop-filter: blur(8px);
  color: #55614C;
  font-size: clamp(10px, 1.05cqw, 13px);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 8px 22px -20px rgba(60, 50, 35, 0.55);
  opacity: 0;
  transform: translate3d(calc(var(--rh-mx) * 0.24), calc(9px + var(--rh-my) * 0.18), 0);
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
  animation: rhNavBloom 0.7s ease-out forwards;
  animation-delay: var(--nav-delay, 1.8s);
}

.rh-floating-nav a:hover,
.rh-floating-nav a:focus-visible {
  color: #2F4A34;
  border-color: rgba(85, 97, 76, 0.52);
  background: rgba(255, 253, 249, 0.9);
  box-shadow: 0 14px 28px -22px rgba(60, 50, 35, 0.7);
}

.rh-floating-nav a:nth-child(1) { left: 21%; top: 48%; --nav-delay: 1.7s; }
.rh-floating-nav a:nth-child(2) { right: 22%; top: 47%; --nav-delay: 1.83s; }
.rh-floating-nav a:nth-child(3) { left: 15%; top: 66%; --nav-delay: 1.96s; }
.rh-floating-nav a:nth-child(4) { right: 14%; top: 65%; --nav-delay: 2.09s; }
.rh-floating-nav a:nth-child(5) { left: 31%; top: 84%; --nav-delay: 2.22s; }
.rh-floating-nav a:nth-child(6) { right: 27%; top: 84%; --nav-delay: 2.35s; }

.rh-hero-frame [data-fade="brand"] {
  animation: rhBrandSettle 1.25s ease-out 1.25s both;
}

.rh-scroll-limbs {
  display: none;
  position: absolute;
  inset: -60px 0 0;
  z-index: 4;
  pointer-events: none;
  overflow: visible;
}

.rh-scroll-limbs svg {
  position: absolute;
  top: 0;
  bottom: 0;
  width: min(42vw, 560px);
  height: calc(100% + 80px);
  overflow: visible;
}

.rh-scroll-limbs svg:first-child {
  left: 0;
}

.rh-scroll-limbs svg:last-child {
  right: 0;
  transform: scaleX(-1);
}

.rh-limb-path {
  fill: none;
  stroke: rgba(169, 152, 130, 0.78);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(2px 3px 2px rgba(80, 64, 43, 0.08));
  stroke-dasharray: var(--path-len, 1);
  stroke-dashoffset: calc(var(--path-len, 1) * (1 - var(--limb-progress, 0)));
}

.rh-limb-path.fine {
  stroke: rgba(126, 111, 88, 0.52);
  stroke-width: 1.6;
}

.rh-limb-path.mid {
  stroke: rgba(185, 167, 143, 0.68);
  stroke-width: 3.2;
}

.rh-limb-highlight {
  fill: none;
  stroke: rgba(230, 220, 199, 0.72);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: var(--path-len, 1);
  stroke-dashoffset: calc(var(--path-len, 1) * (1 - var(--limb-progress, 0)));
}

.rh-limb-leaf {
  fill: rgba(139, 150, 120, 0.34);
  stroke: rgba(95, 116, 70, 0.28);
  stroke-width: 0.7;
  opacity: clamp(0, calc((var(--limb-progress, 0) - var(--leaf-start, 0.2)) * 5), 0.85);
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(clamp(0.72, calc(var(--limb-progress, 0) * 1.1), 1));
}

.rh-limb-bud {
  fill: rgba(139, 134, 98, 0.34);
  opacity: clamp(0, calc((var(--limb-progress, 0) - var(--leaf-start, 0.2)) * 5), 0.72);
}

@keyframes rhCreamIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rhTreeArrive {
  0% {
    opacity: 0;
    clip-path: inset(62% 0 0 0);
    transform: translate3d(0, 24px, 0) scale(0.988);
    filter: blur(3px) saturate(0.82) contrast(0.95);
  }
  42% {
    opacity: 1;
    clip-path: inset(20% 0 0 0);
  }
  100% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translate3d(calc(var(--rh-mx) * 0.35), calc(var(--rh-my) * 0.18), 0) scale(1);
    filter: blur(0) saturate(0.98) contrast(0.99);
  }
}

@keyframes rhTreeBreathe {
  0%, 100% { transform: translate3d(calc(var(--rh-mx) * 0.35), calc(var(--rh-my) * 0.18), 0) scale(1); }
  50% { transform: translate3d(calc(var(--rh-mx) * 0.35), calc(var(--rh-my) * 0.18 - 2px), 0) scale(1.003); }
}

@keyframes rhRootReveal {
  0% { opacity: 0; clip-path: inset(0 50% 74% 50%); transform: translateY(-10px); }
  34% { opacity: 0.92; }
  100% { opacity: 0.92; clip-path: inset(0 0 28% 0); transform: translateY(0); }
}

@keyframes rhSunRise {
  from { opacity: 0; transform: translate3d(-24px, 10px, 0); }
  to { opacity: 0.8; transform: translate3d(calc(var(--rh-mx) * -0.25), calc(var(--rh-my) * -0.18), 0); }
}

@keyframes rhSunDrift {
  0%, 100% { opacity: 0.58; }
  50% { opacity: 0.78; }
}

@keyframes rhWindowWarmth {
  0% { opacity: 0; transform: scale(0.72); }
  100% { opacity: 0.72; transform: scale(1); }
}

@keyframes rhLanternPulse {
  0%, 100% { opacity: 0.42; }
  45% { opacity: 0.74; }
}

@keyframes rhLeafUnfold {
  from { opacity: 0; transform: scale(0.65) rotate(-8deg); }
  to { opacity: 0.64; transform: scale(1) rotate(0); }
}

@keyframes rhSprigSway {
  0%, 100% { transform: rotate(-0.8deg); }
  50% { transform: rotate(1.2deg); }
}

@keyframes rhLeafDrift {
  0% { opacity: 0; transform: translate3d(var(--leaf-x, 0), -4%, 0) rotate(0deg); }
  8% { opacity: 0.55; }
  100% { opacity: 0; transform: translate3d(calc(var(--leaf-x, 0) + var(--leaf-dx, 50px)), 92%, 0) rotate(230deg); }
}

@keyframes rhNavBloom {
  from { opacity: 0; transform: translate3d(calc(var(--rh-mx) * 0.24), calc(15px + var(--rh-my) * 0.18), 0) scale(0.98); }
  to { opacity: 1; transform: translate3d(calc(var(--rh-mx) * 0.24), calc(var(--rh-my) * 0.18), 0) scale(1); }
}

@keyframes rhBrandSettle {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 700px) {
  .rh-hero-frame {
    min-height: 0;
  }

  .rh-floating-nav {
    display: none;
  }

  .rh-window-glow {
    width: 6.2cqw;
  }

  .rh-window-glow.left { left: 38.4%; top: 73.4%; }
  .rh-window-glow.right { left: 56.2%; top: 73.4%; }

  .rh-root-wash {
    top: 83%;
  }

  .rh-scroll-limbs svg {
    width: 48vw;
  }

  .rh-limb-path {
    stroke-width: 5;
  }

  .rh-limb-path.mid {
    stroke-width: 2.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rh-hero-frame::before,
  .rh-hero-art,
  .rh-hero-sun,
  .rh-window-glow,
  .rh-root-wash,
  .rh-live-sprig,
  .rh-drifting-leaf,
  .rh-floating-nav a,
  .rh-hero-frame [data-fade="brand"] {
    animation: none !important;
    transition: none !important;
  }

  .rh-hero-frame::before,
  .rh-hero-art,
  .rh-hero-sun,
  .rh-window-glow,
  .rh-root-wash,
  .rh-floating-nav a {
    opacity: 1;
    clip-path: none;
    transform: none;
  }

  .rh-live-canopy,
  .rh-drifting-leaf,
  .rh-scroll-limbs {
    display: none;
  }
}
