/* 스크롤 내러티브 — 공통 셸 + TEXT(tn)
 * 모바일 주소창으로 innerHeight가 흔들리면 단계(progress)가 튀어 사업영역으로 보이는 현상이 남 — instant scroll */
html {
  scroll-behavior: auto !important;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
:root {
  --blue: #0080ff;
  --cyan: #1ec0ff;
  --dark: #0d1228;
  --darker: #060f28;
  --fs-h1: clamp(36px, 3.2vw, 56px);
}

.aos {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1), transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}
.aos.visible {
  opacity: 1;
  transform: none;
}
.d1 {
  transition-delay: 0.04s;
}
.d2 {
  transition-delay: 0.08s;
}
.d3 {
  transition-delay: 0.12s;
}
.d4 {
  transition-delay: 0.16s;
}
.d5 {
  transition-delay: 0.2s;
}

.sn-wrap {
  position: relative;
}
.sn-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
@media (max-width: 768px) {
  .page-narrative-test .sn-sticky {
    height: var(--app-visible-h, calc(100vh - var(--app-dock-h, 56px) - env(safe-area-inset-bottom, 0px)));
    box-sizing: border-box;
  }
  .page-narrative-test .sn-counter,
  .page-narrative-test .sn-scroll-hint {
    bottom: clamp(16px, 3vh, 28px);
  }
}
.sn-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 32px 56px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
  pointer-events: none;
}
.sn-section-lbl {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3.5px;
  color: var(--blue);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 12px;
}
.sn-section-lbl::before {
  content: "";
  width: 16px;
  height: 1px;
  background: var(--blue);
}
.sn-progress {
  position: absolute;
  right: clamp(20px, 3vw, 52px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 20;
}
.sn-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  transition: all 0.4s ease;
  cursor: default;
}
.sn-dot.on {
  background: var(--blue);
  box-shadow: 0 0 8px rgba(0, 128, 255, 0.7);
  transform: scale(1.6);
}
.sn-counter {
  position: absolute;
  bottom: 40px;
  left: clamp(20px, 4vw, 56px);
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.2);
  letter-spacing: 2px;
  z-index: 20;
}
.sn-counter strong {
  color: rgba(255, 255, 255, 0.5);
}
.sn-ghost {
  position: absolute;
  font-weight: 900;
  line-height: 1;
  color: rgba(255, 255, 255, 0.028);
  pointer-events: none;
  user-select: none;
  transition: opacity 0.5s;
  z-index: 1;
  font-size: clamp(180px, 22vw, 340px);
  letter-spacing: -12px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.sn-phase {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.36s cubic-bezier(0.22, 1, 0.36, 1), transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 10;
  display: flex;
  align-items: center;
}
.sn-phase.on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.sn-phase.out {
  opacity: 0;
  transform: translateY(-22px);
}
.sn-sticky::before,
.sn-sticky::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 128, 255, 0.25), transparent);
  z-index: 5;
}
.sn-sticky::before {
  top: 0;
}
.sn-sticky::after {
  bottom: 0;
}
.sn-scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  z-index: 20;
  transition: opacity 0.4s;
}
.sn-scroll-hint span {
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.18);
}
.sn-mouse {
  width: 20px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  display: flex;
  justify-content: center;
  padding-top: 5px;
}
.sn-wheel {
  width: 2px;
  height: 5px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 1px;
  animation: narrWheel 2s ease-in-out infinite;
}
@keyframes narrWheel {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(8px);
    opacity: 0;
  }
}

.tn-wrap {
  background: var(--darker);
  height: 1667vh;
}
@media (max-width: 768px) {
  .tn-wrap {
    height: 625vh;
  }
}
.tn-sticky {
  background: var(--darker);
}
.tn-phase {
  padding: 0 clamp(24px, 10vw, 240px);
  text-align: center;
  flex-direction: column;
  justify-content: center;
}
.tn-eyebrow {
  font-size: clamp(11px, 0.9vw, 14px);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.33);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
}
.tn-eyebrow::before,
.tn-eyebrow::after {
  content: "";
  flex: 1;
  max-width: 44px;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
}
.tn-big {
  font-size: clamp(28px, 4.2vw, 68px);
  font-weight: 900;
  color: #fff;
  line-height: 1.22;
  letter-spacing: clamp(-1px, -0.04em, -2px);
  word-break: keep-all;
}
.tn-big em:not(.flower-scroll-em) {
  font-style: normal;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: narrShimmer 4s linear infinite;
  background-size: 200% auto;
}
@keyframes narrShimmer {
  to {
    background-position: 200% center;
  }
}
.tn-stagger span {
  display: block;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0s, transform 0s;
}
.sn-phase.on .tn-stagger span {
  opacity: 1;
  transform: none;
}
.sn-phase.on .tn-stagger span:nth-child(1) {
  transition: opacity 0.3s 0.03s ease, transform 0.3s 0.03s ease;
}
.sn-phase.on .tn-stagger span:nth-child(2) {
  transition: opacity 0.3s 0.12s ease, transform 0.3s 0.12s ease;
}
.sn-phase.on .tn-stagger span:nth-child(3) {
  transition: opacity 0.3s 0.21s ease, transform 0.3s 0.21s ease;
}
.tn-accent {
  width: 44px;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  margin: 28px auto 0;
  border-radius: 1px;
  opacity: 0;
  transform: scaleX(0);
  transition: opacity 0s, transform 0s;
}
.sn-phase.on .tn-accent {
  opacity: 1;
  transform: scaleX(1);
  transition: opacity 0.32s 0.22s ease, transform 0.36s 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (max-width: 1280px) {
  .sn-header {
    padding: 28px 40px 0;
  }
}
.tn-br-mo {
  display: none;
}

@media (max-width: 768px) {
  .tn-br-mo {
    display: block;
  }

  .sn-header {
    padding: 24px 24px 0;
  }
  .sn-counter {
    left: 24px;
    bottom: 32px;
  }
  .sn-progress {
    right: 16px;
  }
}
@media (max-width: 480px) {
  .tn-phase {
    padding: 0 24px;
  }
  .sn-section-lbl {
    font-size: 12px;
    letter-spacing: 0.22em;
  }
  .sn-scroll-hint span {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sn-wheel {
    animation: none !important;
  }
  .tn-big em:not(.flower-scroll-em) {
    animation: none !important;
    background-position: 0 center !important;
  }
}
