/* NWBW 모션 그래픽 (index.html · en/index.html 공용)
   산 능선 · 등고선 · 트레일 드로잉 · 러너 · 내비 칩 · 코스 여정(스크롤) · 등장 효과
   prefers-reduced-motion이면 모든 움직임을 끄고 최종 상태만 보여준다. */

/* ---------- Hero scene ---------- */
.hero { position: relative; isolation: isolate; padding-bottom: clamp(220px, 26vw, 340px) !important; }
.hero > *:not(.hero-scene) { position: relative; z-index: 2; }

.hero-scene {
    position: absolute;
    top: -96px;
    bottom: -40px;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.hero-scene svg { position: absolute; display: block; }
/* 아래쪽을 페이지 배경으로 자연스럽게 녹인다 */
.hero-scene::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 140px;
    background: linear-gradient(to bottom, rgba(13, 13, 13, 0), var(--darker));
}

/* 등고선: 우상단, 천천히 숨쉬듯 */
.hs-contours {
    top: -8%;
    right: -12%;
    width: min(900px, 90vw);
    height: auto;
    opacity: 0.55;
    animation: contourBreath 14s ease-in-out infinite alternate;
    transform-origin: 60% 40%;
}
.hs-contours path {
    fill: none;
    stroke: rgba(255, 138, 101, 0.10);
    stroke-width: 1.2;
}
.hs-contours path:nth-child(3n) { stroke: rgba(255, 138, 101, 0.18); }

@keyframes contourBreath {
    from { transform: rotate(-2deg) scale(1); }
    to   { transform: rotate(3deg) scale(1.04); }
}

/* 일출 빛 */
.hs-glow {
    position: absolute;
    left: 50%;
    bottom: 120px;
    width: 760px;
    height: 420px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at 50% 70%, rgba(255, 87, 34, 0.28), rgba(255, 87, 34, 0) 65%);
    filter: blur(10px);
    animation: glowPulse 6s ease-in-out infinite alternate;
}
@keyframes glowPulse {
    from { opacity: 0.65; }
    to   { opacity: 1; }
}

/* 능선 */
.hs-ridges {
    left: 0;
    bottom: 0;
    width: 100%;
    height: clamp(260px, 32vw, 440px);
}
.hs-ridges .layer { will-change: transform; transform: translateY(calc(var(--sy, 0) * var(--depth, 0) * 1px)); }
.hs-ridges .r3 { fill: #1d1716; --depth: 0.10; }
.hs-ridges .r2 { fill: #151211; --depth: 0.18; }
.hs-ridges .r1 { fill: #0f0d0c; --depth: 0.28; }
.hs-ridges .rim { fill: none; stroke: rgba(255, 112, 67, 0.35); stroke-width: 1.2; }

/* 안개 */
.hs-mist {
    position: absolute;
    left: -20%;
    width: 140%;
    height: 90px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 70%);
    filter: blur(6px);
}
.hs-mist.m1 { bottom: 26%; animation: mistDrift 26s linear infinite alternate; }
.hs-mist.m2 { bottom: 12%; animation: mistDrift 34s linear infinite alternate-reverse; opacity: 0.8; }
@keyframes mistDrift {
    from { transform: translateX(-6%); }
    to   { transform: translateX(6%); }
}

/* 트레일 드로잉 + 러너 */
.hs-trail {
    fill: none;
    stroke: var(--primary);
    stroke-width: 2.6;
    stroke-linecap: round;
    filter: drop-shadow(0 0 6px rgba(255, 87, 34, 0.8));
    stroke-dasharray: var(--len, 2000);
    stroke-dashoffset: var(--len, 2000);
    animation: drawTrail 3.2s cubic-bezier(.6, .1, .2, 1) 0.6s forwards;
}
.hs-trail-ghost {
    fill: none;
    stroke: rgba(255, 255, 255, 0.18);
    stroke-width: 1.4;
    stroke-dasharray: 2 7;
    stroke-linecap: round;
}
@keyframes drawTrail { to { stroke-dashoffset: 0; } }

.hs-runner circle.core { fill: #fff; }
.hs-runner circle.halo {
    fill: rgba(255, 87, 34, 0.35);
    transform-box: fill-box;
    transform-origin: center;
    animation: halo 1.6s ease-out infinite;
}
@keyframes halo {
    from { transform: scale(0.6); opacity: 1; }
    to   { transform: scale(2.4); opacity: 0; }
}

.hs-flag { opacity: 0; animation: flagIn 0.6s ease 3.6s forwards; }
.hs-flag path { fill: var(--primary); }
.hs-flag line { stroke: #fff; stroke-width: 1.6; }
@keyframes flagIn { to { opacity: 1; } }

/* 내비 칩 (Watch 안내처럼) */
.nav-chips { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.nav-chip {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 10px 10px;
    border-radius: 16px;
    background: rgba(22, 24, 24, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    font-size: 0.82rem;
    color: var(--light);
    white-space: nowrap;
    opacity: 0;
    animation: chipIn 0.7s cubic-bezier(.2, .8, .2, 1) forwards, chipFloat 5s ease-in-out infinite alternate;
}
.nav-chip b { display: block; font-size: 1.05rem; font-weight: 700; line-height: 1.1; }
.nav-chip small { display: block; color: var(--gray); font-size: 0.72rem; }
.nav-chip .ic {
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-size: 1.05rem;
}
.nav-chip .ic svg { width: 20px; height: 20px; }
.nav-chip.go .ic { background: #00E676; color: #000; }
.nav-chip.climb .ic { background: rgba(255, 87, 34, 0.18); color: var(--primary); }
.nav-chip.cp .ic { background: rgba(41, 121, 255, 0.18); color: #64B5F6; }
.nav-chip.go b { color: #00E676; }

.nav-chip.c1 { left: 6%; bottom: 120px; animation-delay: 1.2s, 1.9s; }
.nav-chip.c2 { right: 6%; top: 34%; animation-delay: 1.8s, 2.5s; }
.nav-chip.c3 { right: 12%; bottom: 70px; animation-delay: 2.4s, 3.1s; }

.nav-chip .arrow { animation: arrowNudge 1.8s ease-in-out infinite; }
@keyframes arrowNudge {
    0%, 100% { transform: translateY(1px); }
    50% { transform: translateY(-2px); }
}
@keyframes chipIn {
    from { opacity: 0; transform: translateY(14px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes chipFloat {
    from { translate: 0 0; }
    to   { translate: 0 -8px; }
}

/* ---------- Journey (scroll story) ---------- */
.journey { position: relative; height: 420vh; margin: 40px 0 0; }
.journey-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 28px;
    padding: 72px 0 32px;
}
.journey-head { text-align: center; }
.journey-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 10px; }
.journey-head p { color: var(--gray); font-size: 1.05rem; }

.journey-stage {
    position: relative;
    border-radius: 28px;
    background:
        radial-gradient(120% 90% at 50% 0%, rgba(255, 87, 34, 0.10), rgba(255, 87, 34, 0) 60%),
        rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 22px 22px 18px;
    overflow: hidden;
}
.journey-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, #000 40%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent);
    pointer-events: none;
}
.journey-svg { position: relative; width: 100%; height: auto; display: block; overflow: visible; }
.jp-area { fill: url(#jpFill); }
.jp-line { fill: none; stroke: rgba(255, 255, 255, 0.25); stroke-width: 2; }
.jp-done { fill: none; stroke: var(--primary); stroke-width: 3.2; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(255, 87, 34, 0.7)); }
.jp-stop circle { fill: var(--darker); stroke: rgba(255, 255, 255, 0.35); stroke-width: 2; transition: all 0.3s ease; }
.jp-stop.passed circle { fill: var(--primary); stroke: var(--primary); }
.jp-stop.current circle { r: 9; fill: var(--primary); stroke: #fff; }
.jp-stop text { fill: var(--gray); font-size: 13px; font-family: 'Outfit', sans-serif; text-anchor: middle; transition: fill 0.3s ease; }
.jp-stop.passed text, .jp-stop.current text { fill: var(--light); }
.jp-runner .core { fill: #fff; }
.jp-runner .halo { fill: rgba(255, 87, 34, 0.4); transform-box: fill-box; transform-origin: center; animation: halo 1.4s ease-out infinite; }
.jp-meta { display: flex; justify-content: space-between; color: var(--gray); font-size: 0.85rem; margin-top: 6px; font-variant-numeric: tabular-nums; }
.jp-meta b { color: var(--light); font-weight: 600; }

.journey-cards { position: relative; min-height: 190px; }
.jcard {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 22px;
    align-items: center;
    padding: 26px 28px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.07);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}
.jcard.active { opacity: 1; transform: none; }
.jcard .hud {
    width: 132px;
    height: 132px;
    border-radius: 34px;
    background: #000;
    border: 6px solid #2a2a2a;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.jcard .hud .big { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.jcard .hud .sub { font-size: 0.72rem; color: var(--gray); }
.jcard .hud .tag { font-size: 0.72rem; font-weight: 700; }
.jcard .kicker { color: var(--primary); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 6px; }
.jcard h3 { font-size: 1.4rem; margin-bottom: 8px; }
.jcard p { color: var(--gray); line-height: 1.6; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2, .8, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

.badge-new {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 100px;
    background: var(--primary);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    vertical-align: middle;
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
    .hs-ridges { height: 250px; }
    .hs-contours { width: 140vw; right: -50%; opacity: 0.4; }
    .nav-chip { font-size: 0.74rem; padding: 8px 10px 8px 8px; }
    .nav-chip .ic { width: 30px; height: 30px; }
    .nav-chip b { font-size: 0.9rem; }
    .nav-chip.c1 { left: 4%; top: auto; bottom: 110px; }
    .nav-chip.c2 { right: 4%; top: auto; bottom: 36px; }
    .nav-chip.c3 { display: none; }
    .journey { height: 480vh; }
    .journey-sticky { padding-top: 64px; gap: 18px; }
    .journey-stage { padding: 14px 10px 10px; border-radius: 20px; }
    .jp-stop text { font-size: 22px; }
    .jp-meta { font-size: 0.72rem; gap: 8px; }
    .jp-meta span { white-space: nowrap; }
    .jcard { grid-template-columns: 1fr; gap: 12px; padding: 18px; }
    .jcard .hud { width: 100%; height: auto; flex-direction: row; gap: 10px; padding: 10px 14px; border-radius: 16px; border-width: 3px; justify-content: flex-start; }
    .jcard .hud .big { font-size: 1.15rem; }
    .journey-cards { min-height: 250px; }
    .jcard h3 { font-size: 1.15rem; }
    .jcard p { font-size: 0.92rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .hs-contours, .hs-glow, .hs-mist, .hs-runner circle.halo, .jp-runner .halo, .nav-chip .arrow { animation: none !important; }
    .hs-trail { animation: none; stroke-dashoffset: 0; }
    .hs-flag { animation: none; opacity: 1; }
    .nav-chip { animation: none; opacity: 1; }
    .hs-ridges .layer { transform: none; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .journey { height: auto; }
    .journey-sticky { position: static; height: auto; }
    .journey-cards { min-height: 0; display: grid; gap: 14px; }
    .jcard { position: static; opacity: 1; transform: none; }
}
