/* ============================================
   HERO SCENE — 수묵 산수 모션그래픽
   모든 움직임은 느리게(수십 초 단위) 유지한다.
   ============================================ */

.hero-scene {
  --hs-paper: #f3ede1;
  --hs-ink: #2a2522;
  --hs-nav: 72px;
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  background: var(--hs-paper);
  pointer-events: none;
}

.hs-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.hero-scene svg,
.hero-scene img {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  user-select: none;
}

/* --- 한지 바탕 --- */
.hs-paper {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 70% at 50% 45%, rgba(255, 252, 245, 0.7), rgba(255, 252, 245, 0) 70%),
    radial-gradient(ellipse 120% 100% at 50% 50%, rgba(0, 0, 0, 0) 55%, rgba(120, 98, 74, 0.14) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .3 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.004 .03' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .42 0 0 0 0 .33 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='600' height='600' filter='url(%23f)'/%3E%3C/svg%3E"),
    var(--hs-paper);
}

/* --- 공통 등장: 먹이 번지듯 천천히 --- */
.hs-sun,
.hs-cloud,
.hs-range,
.hs-pavilion,
.hs-plum {
  opacity: 0;
  animation: hsInkIn 3.2s cubic-bezier(0.25, 0.6, 0.3, 1) var(--d, 0s) forwards;
}

@keyframes hsInkIn {
  from { opacity: 0; filter: blur(6px); }
  to { opacity: 1; filter: blur(0); }
}

/* --- 산 레이어: 움직이지 않음(등장만 서서히) --- */
.hs-range {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 64%;
}

.hs-range--far { height: 60%; }
.hs-range--shore { height: 64%; }

/* --- 안개 띠 --- */
.hs-mist {
  position: absolute;
  left: -20%;
  width: 140%;
  pointer-events: none;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(243, 237, 225, 0.95) 0%, rgba(243, 237, 225, 0.7) 40%, rgba(243, 237, 225, 0) 72%);
  will-change: transform;
}

.hs-mist--1 {
  bottom: 22%;
  height: 16%;
  opacity: 0.8;
  animation: hsMist 70s ease-in-out -10s infinite alternate;
}

.hs-mist--2 {
  bottom: 10%;
  height: 18%;
  opacity: 0.85;
  animation: hsMist 84s ease-in-out -40s infinite alternate-reverse;
}

.hs-mist--3 {
  bottom: -4%;
  height: 20%;
  opacity: 0.9;
  animation: hsMist 64s ease-in-out -20s infinite alternate;
}

@keyframes hsMist {
  from { transform: translate3d(-7%, 0, 0); }
  to { transform: translate3d(7%, 0, 0); }
}

/* --- 해: 은은한 숨쉬기 --- */
.hs-sun {
  --d: 0.6s;
  position: absolute;
  left: 21%;
  top: 19%;
  width: clamp(96px, 10.5vw, 190px);
  aspect-ratio: 1;
}

.hs-sun-glow {
  transform-box: fill-box;
  transform-origin: center;
  animation: hsGlow 9s ease-in-out infinite alternate;
}

@keyframes hsGlow {
  from { opacity: 0.55; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1.06); }
}

/* --- 구름: 천천히 흘러감 --- */
.hs-cloud {
  position: absolute;
  aspect-ratio: 280 / 90;
  --d: 2s;
}

.hs-cloud > svg {
  animation: hsDrift var(--cd, 60s) ease-in-out var(--cdl, 0s) infinite alternate;
}

.hs-cloud--1 { left: 6%; top: 31%; width: clamp(150px, 15vw, 280px); --cd: 58s; }
.hs-cloud--2 { left: 34%; top: 12%; width: clamp(120px, 11vw, 210px); --cd: 72s; --cdl: -30s; opacity: 0.9; }
.hs-cloud--3 { right: 7%; top: 47%; width: clamp(120px, 12vw, 230px); --cd: 66s; --cdl: -12s; }
.hs-cloud--4 { left: 42%; bottom: 8%; width: clamp(110px, 10vw, 190px); --cd: 80s; --cdl: -50s; }

@keyframes hsDrift {
  from { translate: -36px 0; }
  to { translate: 36px 0; }
}

/* --- 새떼: 90초에 걸쳐 화면을 가로지름 --- */
.hs-birds {
  position: absolute;
  top: 16%;
  left: 0;
  width: clamp(110px, 10vw, 180px);
  aspect-ratio: 170 / 60;
  animation: hsFly 96s linear -30s infinite;
  will-change: transform;
}

.hs-birds-bob {
  width: 100%;
  height: 100%;
  animation: hsBob 11s ease-in-out infinite alternate;
}

@keyframes hsFly {
  from { transform: translate3d(-20vw, 6vh, 0); }
  to { transform: translate3d(110vw, -4vh, 0); }
}

@keyframes hsBob {
  from { translate: 0 -6px; }
  to { translate: 0 6px; }
}

.hs-bird {
  transform-box: fill-box;
  transform-origin: center;
  animation: hsFlap 2.6s ease-in-out var(--fd, 0s) infinite alternate;
}

@keyframes hsFlap {
  from { transform: scaleY(1); }
  to { transform: scaleY(0.45); }
}

/* --- 정자와 소나무 --- */
.hs-pavilion {
  --d: 1.6s;
  position: absolute;
  left: 0;
  bottom: 0;
  width: clamp(280px, 36vw, 620px);
  aspect-ratio: 640 / 380;
}

/* --- 매화 가지: 바람에 아주 조금 흔들림 --- */
.hs-plum {
  --d: 1.9s;
  position: absolute;
  right: 0;
  top: var(--hs-nav);
  width: clamp(300px, 46vw, 820px);
  aspect-ratio: 900 / 600;
}

.hs-plum-sway {
  width: 100%;
  height: 100%;
  transform-origin: 100% 4%;
  will-change: transform;
  animation: hsBranch 16s ease-in-out infinite alternate;
}

@keyframes hsBranch {
  from { transform: rotate(-0.5deg); }
  to { transform: rotate(0.7deg); }
}

/* --- 떨어지는 꽃잎 --- */
.hs-petals {
  position: absolute;
  inset: 0;
}

.hs-petal {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 10px;
  height: 8px;
  opacity: 0;
  animation: hsFall var(--dur, 26s) linear var(--del, 0s) infinite;
}

.hs-petal::before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 70% 30% 70% 30%;
  background: radial-gradient(circle at 30% 30%, #ef8a86, #c92f38 70%);
  animation: hsFlutter 5.5s ease-in-out var(--del, 0s) infinite alternate;
}

@keyframes hsFall {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  8% { opacity: 0.9; }
  80% { opacity: 0.75; }
  100% { transform: translate3d(var(--dx, -80px), 62vh, 0); opacity: 0; }
}

@keyframes hsFlutter {
  from { transform: translateX(-14px) rotate(-30deg) scaleX(1); }
  to { transform: translateX(14px) rotate(50deg) scaleX(0.55); }
}

/* --- 슬로건 뒤 한지 빛 --- */
.hs-veil {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 46% 26% at 50% 50%, rgba(246, 241, 231, 0.88) 0%, rgba(246, 241, 231, 0.55) 50%, rgba(246, 241, 231, 0) 100%);
}

/* --- 화면 밖이면 멈춤 --- */
.hero-scene.is-paused *,
.hero-scene.is-paused {
  animation-play-state: paused !important;
}

/* --- 슬로건: 먹색 --- */
.hero-section .hero-text {
  z-index: 2;
}

.hero-section .slogan-slide {
  color: var(--hs-ink, #2a2522);
}

.hero-section .slogan-slide h1 {
  color: #231f1c;
  text-shadow: 0 0 24px rgba(246, 241, 231, 0.95), 0 0 6px rgba(246, 241, 231, 0.9);
}

.hero-section .slogan-slide p {
  color: #4f453e;
  opacity: 1;
  text-shadow: 0 0 16px rgba(246, 241, 231, 0.95);
}

.hero-section .hero-scroll-indicator {
  z-index: 3;
}

.hero-section .hero-scroll-indicator span {
  border-color: rgba(42, 37, 34, 0.45);
}

.hero-section .hero-scroll-indicator span::after {
  background: rgba(42, 37, 34, 0.6);
}

/* --- 태블릿 / 모바일 --- */
@media (max-width: 768px) {
  .hero-scene { --hs-nav: 60px; }

  .hs-range { height: 46%; }
  .hs-range--far { height: 44%; }

  .hs-sun { left: 9%; top: 25%; width: 24vw; }

  .hs-plum { width: 74vw; }

  .hs-pavilion { width: 72vw; }

  .hs-cloud--1 { left: -6%; top: 36%; width: 40vw; }
  .hs-cloud--2 { left: 40%; top: 22%; width: 30vw; }
  .hs-cloud--3 { right: -4%; top: 62%; width: 30vw; }
  .hs-cloud--4 { display: none; }

  .hs-birds { top: 22%; width: 26vw; }

  .hs-veil {
    background: radial-gradient(ellipse 70% 22% at 50% 50%, rgba(246, 241, 231, 0.9) 0%, rgba(246, 241, 231, 0.55) 55%, rgba(246, 241, 231, 0) 100%);
  }
}

/* --- 움직임 줄이기 설정 존중 --- */
@media (prefers-reduced-motion: reduce) {
  .hero-scene *,
  .hero-scene *::before,
  .hero-scene *::after {
    animation: none !important;
  }

  .hs-sun,
  .hs-cloud,
  .hs-range,
  .hs-pavilion,
  .hs-plum {
    opacity: 1;
  }

  .hs-petals {
    display: none;
  }
}
