/* EnergyWay — 오행 상생상극 원환 (input atmosphere) */

:root {
  --font-brush: "Ma Shan Zheng", "Nanum Brush Script", "Noto Serif KR", cursive;
}

.atmosphere__content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100dvh;
  padding: 36px 20px 44px;
}

.atmosphere__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  width: min(100%, 460px);
  margin: 0 auto;
}

/* 오행 원환: 시계방향 상생 · 오각성 상극 */
.ohang-gallery {
  position: relative;
  width: min(100%, 460px);
  aspect-ratio: 1;
  margin: 0 auto 12px;
  overflow: visible;
}

.ohang-cycle {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.ohang-cycle .ring-saeng {
  fill: none;
  stroke: color-mix(in oklch, var(--celadon) 45%, transparent);
  stroke-width: 1.1;
  stroke-dasharray: 5 4 1.5 4;
  stroke-linecap: round;
  animation: ohang-saeng-flow 9s linear infinite;
}

.ohang-cycle .ring-saeng-soft {
  fill: none;
  stroke: color-mix(in oklch, var(--fg) 14%, transparent);
  stroke-width: 0.6;
}

.ohang-cycle .arrow-saeng {
  fill: none;
  stroke: color-mix(in oklch, var(--celadon) 70%, transparent);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-dasharray: 10 40;
  marker-end: url(#arrowHead);
  animation: ohang-saeng-arrow 9s linear infinite;
}

.ohang-cycle .arrow-saeng:nth-of-type(1) { animation-delay: 0s; }
.ohang-cycle .arrow-saeng:nth-of-type(2) { animation-delay: -1.8s; }
.ohang-cycle .arrow-saeng:nth-of-type(3) { animation-delay: -3.6s; }
.ohang-cycle .arrow-saeng:nth-of-type(4) { animation-delay: -5.4s; }
.ohang-cycle .arrow-saeng:nth-of-type(5) { animation-delay: -7.2s; }

.ohang-cycle .star-geuk {
  fill: none;
  stroke: color-mix(in oklch, var(--accent) 55%, transparent);
  stroke-width: 0.85;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: 3.5 3;
  animation: ohang-geuk-flow 6.5s linear infinite;
}

.ohang-cycle .star-geuk-glow {
  fill: none;
  stroke: color-mix(in oklch, var(--accent) 22%, transparent);
  stroke-width: 1.8;
  stroke-linejoin: round;
  opacity: 0.5;
  animation: ohang-geuk-pulse 3.2s var(--ease) infinite;
}

.ohang-cycle .core-label {
  font-family: var(--font-brush);
  font-size: 5.2px;
  font-weight: 400;
  fill: color-mix(in oklch, var(--fg) 48%, transparent);
  letter-spacing: 0.08em;
}

.ohang-cycle .core-label--saeng {
  fill: color-mix(in oklch, var(--celadon) 55%, var(--fg));
  animation: ohang-label-pulse 9s var(--ease) infinite;
}

.ohang-cycle .core-label--geuk {
  fill: color-mix(in oklch, var(--accent) 58%, transparent);
  animation: ohang-label-pulse 6.5s var(--ease) infinite reverse;
}

@keyframes ohang-saeng-flow {
  to { stroke-dashoffset: -28; }
}
@keyframes ohang-saeng-arrow {
  0% { stroke-dashoffset: 50; opacity: 0.25; }
  20% { opacity: 0.95; }
  100% { stroke-dashoffset: 0; opacity: 0.25; }
}
@keyframes ohang-geuk-flow {
  to { stroke-dashoffset: 26; }
}
@keyframes ohang-geuk-pulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.55; }
}
@keyframes ohang-label-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.75; }
}

.ohang-gallery .el {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 30%;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  overflow: visible;
  z-index: 1;
  transform: translate(-50%, -50%);
  margin: 0;
}

.ohang-gallery .el--wood  { left: 50%;   top: 7%; }
.ohang-gallery .el--fire  { left: 90.9%; top: 36.7%; }
.ohang-gallery .el--earth { left: 75.3%; top: 84.8%; }
.ohang-gallery .el--metal { left: 24.7%; top: 84.8%; }
.ohang-gallery .el--water { left: 9.1%;  top: 36.7%; }

.ohang-gallery .el__art {
  width: 100%;
  aspect-ratio: 1;
  filter:
    grayscale(0.35) contrast(1.05) brightness(0.98)
    drop-shadow(0 1px 3px color-mix(in oklch, var(--fg) 10%, transparent));
  opacity: 0.92;
}

.ohang-gallery .el__art svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.ohang-gallery .el__label {
  margin-top: 0;
  font-family: var(--font-brush);
  font-size: clamp(1.55rem, 4.2vw, 2rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  color: oklch(0.22 0.02 55);
  text-shadow: 0 0 8px color-mix(in oklch, var(--surface) 50%, transparent);
  user-select: none;
}

.ohang-gallery .el--wood .el__label  { transform: rotate(-8deg); opacity: 0.88; }
.ohang-gallery .el--fire .el__label  { transform: rotate(6deg);  opacity: 0.9; }
.ohang-gallery .el--earth .el__label { transform: rotate(-3deg); opacity: 0.86; }
.ohang-gallery .el--metal .el__label { transform: rotate(5deg);  opacity: 0.88; }
.ohang-gallery .el--water .el__label { transform: rotate(-5deg); opacity: 0.87; }

/* 木 */
.ohang-gallery .el--wood .stem {
  transform-origin: 50% 100%;
  animation: ohang-wood-sway 5s ease-in-out infinite;
}
.ohang-gallery .el--wood .needle {
  transform-origin: 50% 100%;
  animation: ohang-needle-breathe 3.6s ease-in-out infinite;
}
.ohang-gallery .el--wood .needle-b { animation-delay: -1.1s; }
.ohang-gallery .el--wood .needle-c { animation-delay: -2s; }
.ohang-gallery .el--wood .mist-dot {
  animation: ohang-mist-float 6s ease-in-out infinite;
  opacity: 0.35;
}
@keyframes ohang-wood-sway {
  0%, 100% { transform: rotate(-1.8deg); }
  50% { transform: rotate(1.8deg); }
}
@keyframes ohang-needle-breathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.04); opacity: 1; }
}
@keyframes ohang-mist-float {
  0%, 100% { transform: translateX(-3px); opacity: 0.25; }
  50% { transform: translateX(4px); opacity: 0.45; }
}

/* 火 */
.ohang-gallery .el--fire .flame-main {
  transform-origin: 50% 92%;
  animation: ohang-flame-flicker 1.25s ease-in-out infinite;
}
.ohang-gallery .el--fire .flame-mid {
  transform-origin: 50% 88%;
  animation: ohang-flame-flicker 0.95s ease-in-out infinite reverse;
}
.ohang-gallery .el--fire .flame-core {
  transform-origin: 50% 85%;
  animation: ohang-flame-core 1.5s ease-in-out infinite;
}
.ohang-gallery .el--fire .ember {
  animation: ohang-ember-rise 2.8s linear infinite;
  opacity: 0;
}
.ohang-gallery .el--fire .ember-2 { animation-delay: 0.9s; }
.ohang-gallery .el--fire .ember-3 { animation-delay: 1.7s; }
@keyframes ohang-flame-flicker {
  0%, 100% { transform: scaleY(1) scaleX(1) skewX(0deg); }
  30% { transform: scaleY(1.06) scaleX(0.95) skewX(1.5deg); }
  60% { transform: scaleY(0.97) scaleX(1.05) skewX(-1.5deg); }
}
@keyframes ohang-flame-core {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.1); opacity: 1; }
}
@keyframes ohang-ember-rise {
  0% { transform: translateY(0); opacity: 0; }
  20% { opacity: 0.75; }
  100% { transform: translateY(-26px); opacity: 0; }
}

/* 土 */
.ohang-gallery .el--earth .hill-back {
  animation: ohang-hill-breathe 7s ease-in-out infinite;
  transform-origin: 50% 100%;
}
.ohang-gallery .el--earth .hill-front {
  animation: ohang-hill-breathe 5.5s ease-in-out infinite reverse;
  transform-origin: 50% 100%;
}
.ohang-gallery .el--earth .mist-band {
  animation: ohang-mist-drift 8s ease-in-out infinite;
  opacity: 0.4;
}
.ohang-gallery .el--earth .mist-band-2 { animation-delay: -3s; }
@keyframes ohang-hill-breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.5px); }
}
@keyframes ohang-mist-drift {
  0%, 100% { transform: translateX(-5px); opacity: 0.28; }
  50% { transform: translateX(6px); opacity: 0.5; }
}

/* 金 */
.ohang-gallery .el--metal .disc {
  transform-origin: 50% 50%;
  animation: ohang-disc-tilt 9s ease-in-out infinite;
}
.ohang-gallery .el--metal .gleam {
  animation: ohang-gleam-sweep 3.6s ease-in-out infinite;
}
.ohang-gallery .el--metal .ring-pulse {
  transform-origin: 50% 50%;
  animation: ohang-ring-expand 4.5s ease-out infinite;
}
.ohang-gallery .el--metal .cloud-orn {
  animation: ohang-cloud-fade 5s ease-in-out infinite;
}
.ohang-gallery .el--metal .cloud-orn-2 { animation-delay: -2.2s; }
@keyframes ohang-disc-tilt {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}
@keyframes ohang-gleam-sweep {
  0% { opacity: 0; }
  40% { opacity: 0.7; }
  100% { opacity: 0; }
}
@keyframes ohang-ring-expand {
  0% { transform: scale(0.94); opacity: 0.45; }
  70% { transform: scale(1.1); opacity: 0; }
  100% { opacity: 0; }
}
@keyframes ohang-cloud-fade {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.65; }
}

/* 水 */
.ohang-gallery .el--water .wave-a { animation: ohang-wave-flow 4.2s ease-in-out infinite; }
.ohang-gallery .el--water .wave-b {
  animation: ohang-wave-flow 5.4s ease-in-out infinite reverse;
  animation-delay: -1s;
}
.ohang-gallery .el--water .wave-c {
  animation: ohang-wave-flow 3.8s ease-in-out infinite;
  animation-delay: -0.6s;
}
.ohang-gallery .el--water .cloud-scroll {
  animation: ohang-cloud-drift 7s ease-in-out infinite;
}
.ohang-gallery .el--water .cloud-scroll-2 { animation-delay: -2.5s; }
@keyframes ohang-wave-flow {
  0%, 100% { transform: translateX(-5px); }
  50% { transform: translateX(7px); }
}
@keyframes ohang-cloud-drift {
  0%, 100% { transform: translateX(-4px); opacity: 0.45; }
  50% { transform: translateX(5px); opacity: 0.75; }
}

@media (max-width: 900px) {
  .atmosphere__content {
    min-height: 52vh;
    padding: 56px 16px 28px;
    justify-content: flex-end;
  }
  .ohang-gallery {
    width: min(100%, 300px);
    margin: 16px auto 10px;
  }
  .ohang-cycle {
    transform: scale(0.84);
    transform-origin: center center;
  }
  .ohang-gallery .el { width: 26%; }
  .ohang-gallery .el--wood  { left: 50%;   top: 14%; }
  .ohang-gallery .el--fire  { left: 84.2%; top: 38.9%; }
  .ohang-gallery .el--earth { left: 71.2%; top: 79.1%; }
  .ohang-gallery .el--metal { left: 28.8%; top: 79.1%; }
  .ohang-gallery .el--water { left: 15.8%; top: 38.9%; }
  .ohang-gallery .el__label { font-size: 1.25rem; }
  .atmosphere__footer { width: min(100%, 300px); }
}

@media (prefers-reduced-motion: reduce) {
  .ohang-cycle .ring-saeng,
  .ohang-cycle .arrow-saeng,
  .ohang-cycle .star-geuk,
  .ohang-cycle .star-geuk-glow,
  .ohang-cycle .core-label--saeng,
  .ohang-cycle .core-label--geuk,
  .ohang-gallery .el--wood .stem,
  .ohang-gallery .el--wood .needle,
  .ohang-gallery .el--wood .mist-dot,
  .ohang-gallery .el--fire .flame-main,
  .ohang-gallery .el--fire .flame-mid,
  .ohang-gallery .el--fire .flame-core,
  .ohang-gallery .el--fire .ember,
  .ohang-gallery .el--earth .hill-back,
  .ohang-gallery .el--earth .hill-front,
  .ohang-gallery .el--earth .mist-band,
  .ohang-gallery .el--metal .disc,
  .ohang-gallery .el--metal .gleam,
  .ohang-gallery .el--metal .ring-pulse,
  .ohang-gallery .el--metal .cloud-orn,
  .ohang-gallery .el--water .wave-a,
  .ohang-gallery .el--water .wave-b,
  .ohang-gallery .el--water .wave-c,
  .ohang-gallery .el--water .cloud-scroll {
    animation: none !important;
  }
}
