/* Hero background + subtle parallax tweaks.
   Note: Only this file (and heroParallax.js) should differ from the _Ref assets. */
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@700;900&family=Noto+Sans+JP:wght@700;900&family=Noto+Sans+SC:wght@700;900&family=Noto+Sans+TC:wght@700;900&display=swap");

:root {
  --hero-bg-c1: rgba(58, 50, 13, 0.75);
  --hero-bg-c2: rgba(73, 9, 59, 0.75);
  --hero-bg-c3: rgba(17, 11, 31, 0.7);
  --hero-bg-night: #05060c;
  --hero-mx: 0px;
  --hero-my: 0px;
  --hero-mx0: 0px;
  --hero-my0: 0px;
  --hero-mx1: 0px;
  --hero-my1: 0px;
  --hero-mx2: 0px;
  --hero-my2: 0px;
  --hero-mx3: 0px;
  --hero-my3: 0px;
  --hero-layer-0: none;
  --hero-layer-1: none;
  --hero-layer-2: none;
  --hero-layer-3: none;
  --hero-size-0: 90%;
  --hero-size-1: 90%;
  --hero-size-2: 90%;
  --hero-size-3: 90%;
  --hero-pos-x0: 50;
  --hero-pos-y0: 0;
  --hero-pos-x1: 50;
  --hero-pos-y1: 0;
  --hero-pos-x2: 50;
  --hero-pos-y2: 0;
  --hero-pos-x3: 50;
  --hero-pos-y3: 0;
  --hero-text-size: clamp(50px, 4vw, 88px);
  --hero-header-offset: 90px;
}

body {
  position: relative;
  min-height: 100vh;
  background: var(--hero-bg-night);
  overflow-x: hidden;
}

#root {
  position: relative;
  background: transparent !important;
}

/* Flowing plasma over the page */
body::before {
  content: "";
  position: fixed;
  inset: -18% -25%;
  background:
    radial-gradient(35% 32% at 20% 25%, var(--hero-bg-c1), transparent 65%),
    radial-gradient(42% 38% at 75% 20%, var(--hero-bg-c2), transparent 68%),
    radial-gradient(40% 40% at 45% 65%, var(--hero-bg-c3), transparent 70%),
    radial-gradient(55% 50% at 50% 50%, rgba(255, 255, 255, 0.06), transparent 75%);
  filter: blur(70px) saturate(140%);
  mix-blend-mode: screen;
  opacity: 0.9;
  animation: hero-bg-plasma 18s ease-in-out infinite alternate, hero-bg-shift-color 36s linear infinite;
  pointer-events: none;
  z-index: 0;
}

/* Grain and glint 
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.04), transparent 35%, rgba(255, 255, 255, 0.06) 55%, transparent 75%),
    radial-gradient(1px 1px at 10% 15%, rgba(255, 255, 255, 0.35), transparent 45%),
    radial-gradient(1px 1px at 80% 20%, rgba(255, 180, 120, 0.4), transparent 50%),
    radial-gradient(1px 1px at 30% 75%, rgba(118, 186, 255, 0.3), transparent 45%),
    radial-gradient(1px 1px at 65% 60%, rgba(232, 98, 255, 0.35), transparent 50%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.28'/%3E%3C/svg%3E");
  background-blend-mode: screen, screen, screen, screen, screen, soft-light;
  opacity: 1.35;
  mix-blend-mode: screen;
  animation: hero-bg-glint 22s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
*/


/* Hero area */
.contentWrap .heightbox {
  position: relative;
  cursor: pointer;
  margin-top: calc(-1 * var(--hero-header-offset, 0px));
  padding-top: calc((var(--hero-header-offset, 0px) * 2) + clamp(10px, 18vw, 110px));
  padding-bottom: clamp(5px, 3vw, 18px);
  padding-left: 0;
  padding-right: 0;
  background-image:
    var(--hero-layer-3),
    var(--hero-layer-2),
    var(--hero-layer-1),
    var(--hero-layer-0);
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
  background-position:
    calc(var(--hero-pos-x3, 50%) + var(--hero-mx3)) calc(var(--hero-pos-y3, 0%) + var(--hero-my3)),
    calc(var(--hero-pos-x2, 50%) + var(--hero-mx2)) calc(var(--hero-pos-y2, 0%) + var(--hero-my2)),
    calc(var(--hero-pos-x1, 50%) + var(--hero-mx1)) calc(var(--hero-pos-y1, 0%) + var(--hero-my1)),
    calc(var(--hero-pos-x0, 50%) + var(--hero-mx0)) calc(var(--hero-pos-y0, 0%) + var(--hero-my0));
  background-size:
    var(--hero-size-3, 90%) auto,
    var(--hero-size-2, 90%) auto,
    var(--hero-size-1, 90%) auto,
    var(--hero-size-0, 90%) auto;
  min-height: clamp(200px, 42vh, 620px);
  overflow: visible;
  z-index: 1;
}

.contentWrap .heightbox .hero-layer-overlay-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 1;
}

.hero-layer-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: var(--overlay-size, var(--hero-size-3, 90%)) auto;
  background-position:
    calc(var(--overlay-pos-x, var(--hero-pos-x3, 50%)) + var(--hero-mx3, 0px))
    calc(var(--overlay-pos-y, var(--hero-pos-y3, 0%)) + var(--hero-my3, 0px));
  opacity: 0;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.45));
  will-change: opacity, transform;
}

.hero-layer-overlay-enter {
  animation: hero-layer-enter 0.7s ease forwards;
}

.hero-layer-overlay-exit {
  animation: hero-layer-exit 0.7s ease forwards;
}

.hero-split-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 clamp(2vw, 4vw, 48px) clamp(12px, 5vw, 64px);
  pointer-events: none;
  z-index: 2;
}

.hero-split-wrap.hero-split-wrap--clickable {
  pointer-events: auto;
}

.hero-split-wrap .hero-text-link {
  pointer-events: auto;
  text-decoration: none;
  color: inherit;
  display: inline-block;
}

.hero-split-wrap h1 {
  margin: 0;
  font-family: "Noto Sans KR", "Noto Sans JP", "Noto Sans SC", "Noto Sans TC", sans-serif;
  font-weight: 900;
  font-style: italic;
  font-size: var(--hero-text-size, clamp(50px, 4vw, 88px));
  letter-spacing: 0.08em;
  color: #f9f7ff;
  text-shadow:
    0 3px 1px rgba(0, 0, 0, 1),
    0 0 8px rgb(255, 235, 50),
    0 0 18px rgba(255, 215, 150, 0.4),
    0 6px 18px rgba(0, 0, 0, 0.55);
  filter: drop-shadow(0 0 10px rgba(2, 2, 2, 0.88));
  padding: 0 clamp(4vw, 6vw, 64px);
  text-align: center;
  box-sizing: border-box;
}

.hero-split-wrap h1 span {
  display: inline-block;
}

.hero-split-wrap h1 .hero-char {
  position: relative;
  color: #f7e0a5;
}

.hero-split-wrap h1 .hero-char::after {
  content: attr(data-char);
  position: absolute;
  inset: 0;
  color: transparent;
  -webkit-text-fill-color: transparent;
  background: linear-gradient(
    180deg,
    #ffe262 0%,
    #ffffff 20%,
    #d8b150 50%,
    #ad7a24 75%,
    #4d2700 100%
  );
  background-clip: text;
  -webkit-background-clip: text;
  pointer-events: none;
  z-index: 1;
}

.hero-split-wrap .hero-word {
  display: inline-block;
  white-space: nowrap;
}

@media (min-width: 1500px) {
  .contentWrap .heightbox {
    min-height: clamp(350px, 52vh, 720px);
    padding-bottom: clamp(12px, 6vw, 90px);
  }
}

@media (max-width: 1024px) and (min-width: 720px) {
  .contentWrap .heightbox {
    min-height: clamp(320px, 42vh, 620px);
    padding-bottom: clamp(6px, 4vw, 44px);
  }
}

@media (max-width: 768px) {
  .contentWrap .heightbox {
    margin-top: calc(-1 * (var(--hero-header-offset, 0px) * 0.6));
    padding-top: calc((var(--hero-header-offset, 0px) * 1.2) + clamp(10px, 14vw, 90px));
    padding-bottom: clamp(6px, 8vw, 20px);
    padding-left: 0;
    padding-right: 0;
    min-height: clamp(260px, 62vw, 380px);
    /* JSON/변수로 전달된 레이어별 크기를 그대로 사용 */
    background-size:
      var(--hero-size-3, 90%) auto,
      var(--hero-size-2, 90%) auto,
      var(--hero-size-1, 90%) auto,
      var(--hero-size-0, 90%) auto;
    animation-duration: 16s;
  }
}

.contentWrap .maintitle {
  position: relative;
  z-index: 3;
}

@keyframes hero-bg-plasma {
  0% {
    transform: translate3d(-4%, -6%, 0) scale(1.05) rotate(-1deg);
  }
  50% {
    transform: translate3d(6%, 4%, 0) scale(1.12) rotate(1deg);
  }
  100% {
    transform: translate3d(-5%, 3%, 0) scale(1.08) rotate(-0.5deg);
  }
}

@keyframes hero-bg-shift-color {
  from {
    filter: blur(70px) hue-rotate(0deg);
  }
  to {
    filter: blur(70px) hue-rotate(35deg);
  }
}

/*
@keyframes hero-bg-glint {
  0% {
    background-position: -10% 10%, 0 0, 0 0, 0 0, 0 0, 0 0;
  }
  50% {
    background-position: 120% 0%, -100px 80px, 100px -50px, -60px -40px, 40px 120px, 50% 50%;
  }
  100% {
    background-position: -10% 10%, 0 0, 0 0, 0 0, 0 0, 100% 100%;
  }
}
*/

@keyframes hero-bg-shift {
  0% {
    background-position: calc(50% + var(--hero-mx)) calc(0% + var(--hero-my));
  }
  50% {
    background-position: calc(52% + var(--hero-mx)) calc(4% + var(--hero-my));
  }
  100% {
    background-position: calc(48% + var(--hero-mx)) calc(-2% + var(--hero-my));
  }
}

@keyframes hero-layer-enter {
  0% {
    opacity: 0;
    transform: translate3d(70px, 0, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes hero-layer-exit {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
  100% {
    opacity: 0;
    transform: translate3d(-70px, 0, 0);
  }
}

@media (max-width: 768px) {
  body::before {
    filter: blur(55px);
    opacity: 0.8;
  }
  body::after {
    opacity: 0.28;
  }
}
