/* 상세 페이지 상단 히어로(.hero) 기상·주야간·달령·태풍·도로살얼음(0~3단계) 동적 연출 스타일 */

.hero.has-dynamic-scene {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #ffffff;
  transition: background 0.55s ease, box-shadow 0.45s ease;
  background: linear-gradient(108deg, #0d3a40 6%, #175255 58%, #367b6d 100%);
}

/* 왼쪽 텍스트 영역 가독성 보호용 그라데이션 스크림 */
.hero.has-dynamic-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(6, 20, 26, 0.44) 0%,
    rgba(6, 20, 26, 0.28) 28%,
    rgba(6, 20, 26, 0.10) 48%,
    rgba(6, 20, 26, 0) 68%
  );
}

.hero.has-dynamic-scene .herodata {
  position: relative;
  z-index: 2;
  text-shadow: 0 1px 10px rgba(4, 14, 22, 0.34);
}

.hero.has-dynamic-scene #refresh {
  z-index: 4;
}

.hero.has-dynamic-scene .horizon {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  opacity: 1;
  pointer-events: none;
}

/* --- 레이어 적층 순서 --- */
.hs-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hs-stars { z-index: 1; }
.hs-celestial {
  position: absolute;
  right: 11.5%;
  top: 6px;
  width: 124px;
  height: 124px;
  z-index: 2;
  pointer-events: none;
  transition: transform 0.5s ease, opacity 0.4s ease;
}
.hs-celestial.is-low {
  top: 22px;
  right: 11%;
}
.hs-orb-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.hs-clouds { z-index: 3; }
.hs-terrain {
  top: auto;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 84%;
  z-index: 4;
}
.hs-road-group {
  opacity: 0.84;
  transition: opacity 0.3s ease;
}
.hs-fx { z-index: 5; }
.hs-particle-canvas { z-index: 6; }

/* --- 태풍 특보 정보 배지 (우측 하늘 영역, #refresh 하단/좌측 안전 배치) --- */
.hs-typhoon-cluster {
  position: absolute;
  right: 132px;
  top: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  pointer-events: none;
}
.hs-typhoon-svg {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 10px rgba(14, 165, 233, 0.36));
}
@keyframes hsTyphoonSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}
.hs-typhoon-arms {
  transform-box: fill-box;
  transform-origin: center;
  animation: hsTyphoonSpin 11s linear infinite;
}
@keyframes hsTyWavePulse {
  0%, 100% { opacity: 0.25; transform: scale(0.96); }
  50% { opacity: 0.65; transform: scale(1.04); }
}
.hs-ty-wave {
  transform-box: fill-box;
  transform-origin: center;
  animation: hsTyWavePulse 3.6s ease-in-out infinite;
}
.hs-typhoon-tag {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 11px;
  border-radius: 10px;
  background: rgba(8, 28, 46, 0.72);
  border: 1px solid rgba(125, 211, 252, 0.48);
  backdrop-filter: blur(4px);
  color: #f0f9ff;
  box-shadow: 0 4px 14px rgba(2, 12, 24, 0.35);
}
.hs-typhoon-tag strong {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: #ffffff;
  white-space: nowrap;
}
.hs-typhoon-tag span {
  font-size: 11px;
  font-weight: 600;
  color: #bae6fd;
  white-space: nowrap;
}

/* --- 도로 살얼음 1·2·3단계 우측 하단 갓길 배지 --- */
.hs-road-stage-pill {
  position: absolute;
  right: 16px;
  bottom: 10px;
  z-index: 7;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.1px;
  background: rgba(15, 23, 42, 0.82);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.32);
}
.hs-stage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.hs-road-stage-pill.rank-1 {
  color: #fef08a;
  border-color: #eab308;
}
.hs-road-stage-pill.rank-1 .hs-stage-dot {
  background: #eab308;
  box-shadow: 0 0 6px #facc15;
}
.hs-road-stage-pill.rank-2 {
  color: #fed7aa;
  border-color: #f97316;
}
.hs-road-stage-pill.rank-2 .hs-stage-dot {
  background: #f97316;
  box-shadow: 0 0 7px #fb923c;
}
.hs-road-stage-pill.rank-3 {
  color: #fecaca;
  border-color: #ef4444;
  background: rgba(69, 10, 10, 0.86);
}
.hs-road-stage-pill.rank-3 .hs-stage-dot {
  background: #ef4444;
  box-shadow: 0 0 8px #f87171;
}

/* ================================
   주야간 × 날씨별 하늘 배경 팔레트
   ================================ */

/* [주간 DAY] */
.hero.has-dynamic-scene[data-dayphase="day"][data-weather="clear"] {
  background: linear-gradient(108deg, #0d3a40 6%, #175255 58%, #367b6d 100%);
}
.hero.has-dynamic-scene[data-dayphase="day"][data-weather="partly_cloudy"] {
  background: linear-gradient(108deg, #163f4c 6%, #26606d 58%, #4d888c 100%);
}
.hero.has-dynamic-scene[data-dayphase="day"][data-weather="overcast"] {
  background: linear-gradient(108deg, #25363d 6%, #364b54 58%, #546a72 100%);
}
.hero.has-dynamic-scene[data-dayphase="day"][data-weather="fog"] {
  background: linear-gradient(108deg, #2b3e42 6%, #455c60 58%, #6d8486 100%);
}
.hero.has-dynamic-scene[data-dayphase="day"][data-weather="rain"] {
  background: linear-gradient(108deg, #162936 6%, #243f52 58%, #3a5b6e 100%);
}
.hero.has-dynamic-scene[data-dayphase="day"][data-weather="thunder"] {
  background: linear-gradient(108deg, #15172b 6%, #242746 58%, #3c3a5e 100%);
}
.hero.has-dynamic-scene[data-dayphase="day"][data-weather="typhoon"] {
  background: linear-gradient(108deg, #102033 6%, #1a354d 58%, #2a526b 100%);
}
.hero.has-dynamic-scene[data-dayphase="day"][data-weather="snow"] {
  background: linear-gradient(108deg, #1e3547 6%, #31536b 58%, #577b91 100%);
}
.hero.has-dynamic-scene[data-dayphase="day"][data-weather="heavy_snow"] {
  background: linear-gradient(108deg, #243442 6%, #3a5263 58%, #637f91 100%);
}

/* [새벽·여명 DAWN] */
.hero.has-dynamic-scene[data-dayphase="dawn"][data-weather="clear"] {
  background: linear-gradient(106deg, #102a3b 6%, #23475c 46%, #7d5c62 82%, #b77e5d 100%);
}
.hero.has-dynamic-scene[data-dayphase="dawn"][data-weather="partly_cloudy"] {
  background: linear-gradient(106deg, #172d3d 6%, #2e4b5c 50%, #6d616b 84%, #967770 100%);
}
.hero.has-dynamic-scene[data-dayphase="dawn"][data-weather="fog"] {
  background: linear-gradient(106deg, #1f313b 6%, #3c4f57 54%, #767d7d 100%);
}
.hero.has-dynamic-scene[data-dayphase="dawn"][data-weather="overcast"] {
  background: linear-gradient(106deg, #1d2933 6%, #34414c 58%, #5a5d66 100%);
}
.hero.has-dynamic-scene[data-dayphase="dawn"][data-weather="rain"],
.hero.has-dynamic-scene[data-dayphase="dawn"][data-weather="typhoon"] {
  background: linear-gradient(106deg, #13212e 6%, #233547 58%, #3c4959 100%);
}
.hero.has-dynamic-scene[data-dayphase="dawn"][data-weather="thunder"] {
  background: linear-gradient(106deg, #131326 6%, #222340 58%, #3b3554 100%);
}
.hero.has-dynamic-scene[data-dayphase="dawn"][data-weather="snow"],
.hero.has-dynamic-scene[data-dayphase="dawn"][data-weather="heavy_snow"] {
  background: linear-gradient(106deg, #1a2d3d 6%, #31495e 56%, #666c7a 100%);
}

/* [황혼·해질녘 DUSK] */
.hero.has-dynamic-scene[data-dayphase="dusk"][data-weather="clear"] {
  background: linear-gradient(106deg, #112338 6%, #243859 44%, #6e4158 78%, #b56145 100%);
}
.hero.has-dynamic-scene[data-dayphase="dusk"][data-weather="partly_cloudy"] {
  background: linear-gradient(106deg, #162538 6%, #2c3a54 48%, #5e4459 82%, #8c5c54 100%);
}
.hero.has-dynamic-scene[data-dayphase="dusk"][data-weather="fog"] {
  background: linear-gradient(106deg, #1b2836 6%, #384452 54%, #6a6368 100%);
}
.hero.has-dynamic-scene[data-dayphase="dusk"][data-weather="overcast"] {
  background: linear-gradient(106deg, #1a222e 6%, #303947 58%, #53525e 100%);
}
.hero.has-dynamic-scene[data-dayphase="dusk"][data-weather="rain"],
.hero.has-dynamic-scene[data-dayphase="dusk"][data-weather="typhoon"] {
  background: linear-gradient(106deg, #101c29 6%, #1f3042 58%, #394457 100%);
}
.hero.has-dynamic-scene[data-dayphase="dusk"][data-weather="thunder"] {
  background: linear-gradient(106deg, #121124 6%, #211f3d 58%, #3c3052 100%);
}
.hero.has-dynamic-scene[data-dayphase="dusk"][data-weather="snow"],
.hero.has-dynamic-scene[data-dayphase="dusk"][data-weather="heavy_snow"] {
  background: linear-gradient(106deg, #192638 6%, #2f3f57 58%, #5e6073 100%);
}

/* [야간 NIGHT] */
.hero.has-dynamic-scene[data-dayphase="night"][data-weather="clear"] {
  background: linear-gradient(110deg, #061420 5%, #0c2438 56%, #183d54 100%);
}
.hero.has-dynamic-scene[data-dayphase="night"][data-weather="partly_cloudy"] {
  background: linear-gradient(110deg, #091722 5%, #12283a 56%, #223f54 100%);
}
.hero.has-dynamic-scene[data-dayphase="night"][data-weather="overcast"] {
  background: linear-gradient(110deg, #0d161d 5%, #192631 58%, #293a46 100%);
}
.hero.has-dynamic-scene[data-dayphase="night"][data-weather="fog"] {
  background: linear-gradient(110deg, #101b23 5%, #202f39 58%, #344752 100%);
}
.hero.has-dynamic-scene[data-dayphase="night"][data-weather="rain"] {
  background: linear-gradient(110deg, #08121b 5%, #122232 58%, #1e3547 100%);
}
.hero.has-dynamic-scene[data-dayphase="night"][data-weather="thunder"] {
  background: linear-gradient(110deg, #080a17 5%, #14162d 58%, #242142 100%);
}
.hero.has-dynamic-scene[data-dayphase="night"][data-weather="typhoon"] {
  background: linear-gradient(110deg, #07111c 5%, #0f2033 58%, #1c364f 100%);
}
.hero.has-dynamic-scene[data-dayphase="night"][data-weather="snow"] {
  background: linear-gradient(110deg, #0c1926 5%, #193044 58%, #2a4961 100%);
}
.hero.has-dynamic-scene[data-dayphase="night"][data-weather="heavy_snow"] {
  background: linear-gradient(110deg, #111d29 5%, #213445 58%, #374f63 100%);
}

/* [한파 / 살얼음 0~3단계 하단·상단 테두리 신호] */
.hero.has-dynamic-scene[data-cold-wave="true"][data-dayphase="day"][data-weather="clear"],
.hero.has-dynamic-scene[data-cold-wave="true"][data-dayphase="day"][data-weather="partly_cloudy"] {
  background: linear-gradient(108deg, #0c2942 6%, #17496b 58%, #357594 100%);
}
.hero.has-dynamic-scene[data-cold-wave="true"][data-dayphase="night"][data-weather="clear"],
.hero.has-dynamic-scene[data-cold-wave="true"][data-dayphase="night"][data-weather="partly_cloudy"] {
  background: linear-gradient(110deg, #051024 5%, #0a1f40 56%, #173c68 100%);
}
.hero.has-dynamic-scene[data-ice-rank="1"] {
  box-shadow: inset 0 -2px 0 rgba(234, 179, 8, 0.7);
}
.hero.has-dynamic-scene[data-ice-rank="2"] {
  box-shadow: inset 0 -3px 0 rgba(249, 115, 22, 0.85), 0 6px 18px rgba(249, 115, 22, 0.14);
}
.hero.has-dynamic-scene[data-ice-rank="3"] {
  box-shadow: inset 0 -3px 0 rgba(239, 68, 68, 0.92), 0 8px 22px rgba(239, 68, 68, 0.22);
}
.hero.has-dynamic-scene[data-cold-wave="true"] {
  box-shadow: inset 0 1.5px 0 rgba(224, 242, 254, 0.48), inset 0 -2px 0 rgba(125, 211, 252, 0.4);
}

/* ================================
   은은하고 자연스러운 애니메이션
   ================================ */
@keyframes hsTwinkle {
  0%, 100% { opacity: 0.92; }
  50% { opacity: 0.32; }
}
.hs-star-t1 { animation: hsTwinkle 4.2s ease-in-out infinite; }
.hs-star-t2 { animation: hsTwinkle 5.6s ease-in-out 1.4s infinite; }
.hs-star-t3 { animation: hsTwinkle 3.6s ease-in-out 2.5s infinite; }

@keyframes hsCloudFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(calc(var(--hs-cloud-dx, -14px) * 0.45), calc(var(--hs-cloud-dy, 2.2px) * -1), 0); }
  50% { transform: translate3d(var(--hs-cloud-dx, -14px), 0.5px, 0); }
  75% { transform: translate3d(calc(var(--hs-cloud-dx, -14px) * 0.42), var(--hs-cloud-dy, 2.2px), 0); }
}
.hs-cloud-drift-a { animation: hsCloudFloat var(--hs-cloud-dur, 28s) ease-in-out infinite; will-change: transform; }
.hs-cloud-drift-b { animation: hsCloudFloat calc(var(--hs-cloud-dur, 28s) * 0.82) ease-in-out -7s infinite; will-change: transform; }
.hs-cloud-drift-slow { animation: hsCloudFloat calc(var(--hs-cloud-dur, 28s) * 1.28) ease-in-out -12s infinite; will-change: transform; }

@keyframes hsThunderPulse {
  0%, 72%, 100% { opacity: 0.72; }
  74% { opacity: 1; }
  77% { opacity: 0.78; }
  80% { opacity: 0.98; }
  85% { opacity: 0.72; }
}
@keyframes hsThunderGlow {
  0%, 70%, 100% { opacity: 0.16; }
  75% { opacity: 0.62; }
  82% { opacity: 0.22; }
}
.hs-bolt-1 { animation: hsThunderPulse 4.6s ease-in-out infinite; }
.hs-bolt-2 { animation: hsThunderPulse 4.6s ease-in-out -2.1s infinite; }
.hs-thunder-glow { animation: hsThunderGlow 4.6s ease-in-out infinite; }

@keyframes hsFogDrift {
  0%, 100% { transform: translateX(-14px); }
  50% { transform: translateX(18px); }
}
.hs-fog-1 { animation: hsFogDrift 18s ease-in-out infinite; }
.hs-fog-2 { animation: hsFogDrift 24s ease-in-out -6s infinite; }
.hs-fog-3 { animation: hsFogDrift 29s ease-in-out -14s infinite; }

@keyframes hsIceGlint {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.96; }
}
.hs-ice-sheen { animation: hsIceGlint 2.8s ease-in-out infinite; }

@media (max-width: 720px) {
  .hero.has-dynamic-scene {
    padding: 15px 14px 36px;
  }
  /* 모바일 좁은 폭에서는 텍스트 가독성이 최우선이므로 배경 스크림을 부드럽게 보강하고 도로·지형 에셋 투명도를 차분하게 낮춤 */
  .hero.has-dynamic-scene::before {
    background: linear-gradient(
      180deg,
      rgba(6, 20, 26, 0.28) 0%,
      rgba(6, 20, 26, 0.38) 62%,
      rgba(6, 20, 26, 0.46) 100%
    );
  }
  .hero.has-dynamic-scene .hs-terrain {
    opacity: 0.72;
  }
  .hero.has-dynamic-scene .hs-road-group {
    opacity: 0.32;
  }
  .hero.has-dynamic-scene .hs-particle-canvas {
    opacity: 0.68;
  }
  .hero.has-dynamic-scene .eyebrow {
    display: block;
    padding-right: 88px;
    font-size: 10px;
    letter-spacing: 1.4px;
  }
  .hero.has-dynamic-scene .heroNums {
    gap: 12px;
  }
  .hero.has-dynamic-scene .heroNums strong {
    font-size: 42px;
    letter-spacing: -2px;
  }
  .hero.has-dynamic-scene .heroNums b {
    font-size: 15px;
  }
  .hero.has-dynamic-scene #stamp {
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.35;
  }
  .hero.has-dynamic-scene #refresh {
    right: 12px;
    top: 12px;
    padding: 5px 9px;
    font-size: 11px;
  }
  .hero.has-dynamic-scene[data-weather="typhoon"] {
    padding-bottom: 58px;
  }
  .hs-celestial {
    right: 6%;
    top: 4px;
    width: 96px;
    height: 96px;
  }
  .hs-celestial.is-low {
    top: 14px;
    right: 6%;
  }
  .hs-typhoon-cluster {
    left: 14px;
    bottom: 8px;
    top: auto;
    right: auto;
  }
  .hs-typhoon-tag {
    padding: 4px 8px;
  }
  .hs-typhoon-tag strong { font-size: 11px; }
  .hs-typhoon-tag span { font-size: 9.5px; }
  .hs-road-stage-pill {
    right: 10px;
    bottom: 8px;
    font-size: 10px;
    padding: 2px 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero.has-dynamic-scene * {
    animation: none !important;
    transition: none !important;
  }
}
