/* AnaPlan 여행 소개 페이지
   스크롤 효과는 JS가 섹션별 진행도(--p, 0~1)를 넣어 주고 CSS가 그 값으로 변형을 계산한다. */

:root {
  --bg: #000;
  --bg2: #0b0d10;
  --card: #111418;
  --line: #22272e;
  --text: #f5f5f7;
  --muted: #8e959e;
  --accent: #4fc3f7;
  --accent2: #b388ff;
  --warm: #f6c177;
  --nav-h: 52px;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
code { font-family: var(--mono); font-size: .9em; color: var(--accent); }

.wrap { width: min(1080px, 100% - 40px); margin-inline: auto; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: 1.05rem; margin: 0 0 .6rem; letter-spacing: 0; }
h1, h2, h3 { margin: 0; letter-spacing: -0.03em; line-height: 1.1; }
h2 { font-size: clamp(2.3rem, 5.6vw, 4.4rem); font-weight: 700; }
.grad {
  background: linear-gradient(90deg, var(--accent), var(--accent2) 60%, var(--warm));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- 상단 내비 ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(0, 0, 0, .55);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.nav-inner {
  width: min(1080px, 100% - 40px); margin: 0 auto; height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .95rem; }
.nav-links { display: flex; gap: 26px; font-size: .85rem; color: #d2d2d7; }
.nav-links a:hover { color: #fff; }
@media (max-width: 560px) { .nav-links { gap: 14px; font-size: .8rem; } .nav-links a:nth-child(4) { display: none; } }

/* ---------- 공통: 고정되는 스크롤 섹션 ---------- */
[data-scroll] { position: relative; --p: 0; }
.sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }

/* ---------- 차량 디스플레이 목업 ---------- */
.display {
  width: min(1120px, 92vw);
  aspect-ratio: 2.35 / 1;
  padding: 1.1%;
  border-radius: clamp(14px, 2.4vw, 30px);
  background: linear-gradient(160deg, #2a2d33, #0c0d0f 40%, #050506);
  box-shadow: 0 0 0 1px #2c2f35 inset, 0 40px 120px -30px rgba(79, 195, 247, .35), 0 30px 60px -20px #000;
}
.display.small { width: 100%; }
.screen {
  position: relative; width: 100%; height: 100%;
  border-radius: clamp(9px, 1.6vw, 20px); overflow: hidden;
  background: #0e1013; container-type: inline-size;
}

/* 앱 UI 재현 (컨테이너 너비 기준 단위로 크기가 같이 변한다) */
.ui { position: absolute; inset: 0; display: flex; flex-direction: column; gap: .9em; padding: 1.1em 1.4em; font-size: 1.2cqw; color: #e8ecf1; line-height: 1.3; letter-spacing: 0; }
.ui b { font-weight: 650; }
.ui small { display: block; color: #9aa4b0; font-size: .78em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-top { display: flex; align-items: center; gap: .7em; font-size: 1.05em; }
.ui-logo { width: 1.3em; height: 1.3em; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--accent); }
.ui-chip { background: #1e232a; border-radius: 2em; padding: .3em .9em; font-size: .9em; }
.ui-sp { flex: 1; }
.ui-pill { display: flex; align-items: center; gap: .35em; background: #1e232a; border-radius: 2em; padding: .2em .7em; font-size: .75em; color: #9aa4b0; }
.ui-pill i { width: .6em; height: .6em; border-radius: 50%; background: #81c784; }
.ui-clock { font-size: 1.3em; margin-left: .4em; }
.ui-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.05fr 1fr; gap: 1em; }
.ui-body.one { grid-template-columns: 1fr; }
.ui-panel { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: .5em; background: #15181d; border-radius: 1.1em; padding: .9em; }
.ui-panel.plain { background: none; padding: .2em; }
.ui-h { display: flex; justify-content: space-between; align-items: center; font-size: 1.2em; font-weight: 650; }
.ui-title { font-size: 1.7em; font-weight: 700; }
.ui-sub { color: #9aa4b0; font-size: .9em; margin-top: .3em; }
.ui-chips { display: flex; gap: .45em; }
.ui-chips span { border: 1px solid #2a313a; border-radius: .6em; padding: .3em .8em; font-size: .85em; }
.ui-chips .on { background: #1e3a4a; color: var(--accent); border-color: transparent; }
.ui-card, .ui-stop, .ui-row { display: flex; align-items: center; gap: .8em; background: #1e232a; border-radius: .9em; padding: .5em .7em; }
.ui-card.on { background: #1e3a4a; }
.ui-ct { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ui-ct b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb { flex: none; width: 3.2em; height: 3.2em; border-radius: .6em; }
.t1 { background: linear-gradient(135deg, #8d5a3b, #d9a066 60%, #3c5a3a); }
.t2 { background: linear-gradient(135deg, #2f4858, #86bbd8 70%, #f6ae2d); }
.t3 { background: linear-gradient(160deg, #0b132b, #3a506b 50%, #f4d35e); }
.t4 { background: linear-gradient(135deg, #6b705c, #cb997e 70%, #ddbea9); }
.t5 { background: linear-gradient(135deg, #f4a261, #e76f51 60%, #264653); }
.t6 { background: linear-gradient(135deg, #588157, #a3b18a 60%, #dad7cd); }
.ui-add { flex: none; width: 2.3em; height: 2.3em; border-radius: 50%; background: #2a313a; display: grid; place-items: center; }
.ui-card.on .ui-add { background: #2b5468; color: var(--accent); }
.ui-sum { display: grid; grid-template-columns: repeat(4, 1fr); background: #1e232a; border-radius: .8em; padding: .5em; text-align: center; font-weight: 650; }
.ui-sum small { font-weight: 400; }
.ui-stop i { flex: none; width: 2em; height: 2em; border-radius: 50%; background: #b0bec5; color: #0e1013; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: .9em; }
.ui-leg { color: #9aa4b0; font-size: .78em; padding-left: 3.2em; }
.ui-stay { font-size: .85em; color: #cfd8dc; }
.ui-stepper { flex: none; background: #2a313a; border-radius: .6em; padding: .3em .7em; font-size: .85em; color: #9aa4b0; }
.ui-stepper b { color: #e8ecf1; margin: 0 .3em; }
.ui-btn-o { border: 1px solid #2a313a; border-radius: .6em; padding: .2em .7em; font-size: .7em; font-weight: 500; }
.ui-go { margin-top: auto; background: var(--accent); color: #00222f; border-radius: .8em; padding: .75em; text-align: center; font-weight: 700; }
.ui-search { display: flex; justify-content: space-between; align-items: center; border: 1px solid #3a434e; border-radius: .7em; padding: .5em .5em .5em 1em; }
.ui-btn { background: var(--accent); color: #00222f; border-radius: .5em; padding: .35em 1em; font-weight: 650; }
.ui-btn-t { width: fit-content; background: #1e3a4a; color: #cdefff; border-radius: .7em; padding: .55em 1em; }
.ui-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5em; }
.ui-tiles span { background: #1e232a; border-radius: .8em; padding: .6em .8em; font-weight: 650; }
.ui-tiles .hl, .ui-row.hl { box-shadow: 0 0 0 2px var(--accent) inset; }
.ui-row em { font-style: normal; color: var(--accent); font-weight: 650; }
.ui mark { background: none; color: var(--accent); font-weight: 700; }

.ui-map { position: absolute; inset: 0; }
.ui-map svg { width: 100%; height: 100%; }
.ui-tbt { position: absolute; top: 5%; left: 3%; background: #1e3a4a; border-radius: 1em; padding: .8em 1.2em; font-size: 1.2cqw; display: flex; flex-direction: column; }
.ui-tbt b { font-size: 2.2em; line-height: 1.1; }
.ui-eta { position: absolute; left: 3%; bottom: 7%; background: rgba(21, 24, 29, .92); border-radius: 1em; padding: .8em 1.2em; font-size: 1.2cqw; }
.ui-eta b { display: block; font-size: 2.4em; color: var(--accent); line-height: 1.1; }
.ui-eta small { color: #9aa4b0; }
.ui-badge { position: absolute; top: 6%; right: 3%; background: #81c784; color: #0e1013; font-weight: 700; border-radius: 2em; padding: .45em 1.1em; font-size: 1.1cqw; }

/* ---------- HERO ---------- */
.hero { height: 260vh; }
.hero .sticky { display: flex; flex-direction: column; align-items: center; padding-top: calc(var(--nav-h) + 7vh); }
.hero-copy {
  text-align: center; padding-inline: 20px;
  opacity: calc(1 - var(--p) * 2.6);
  transform: translateY(calc(var(--p) * -14vh)) scale(calc(1 - var(--p) * .12));
  will-change: transform, opacity;
}
.hero h1 { font-size: clamp(3.4rem, 10vw, 8rem); font-weight: 800; line-height: 1.02; }
.lede { color: #c7c7cc; font-size: clamp(1.05rem, 1.7vw, 1.35rem); margin: 1.2rem auto 0; max-width: 40em; }
.hero-stage {
  position: absolute; left: 50%; top: 50%;
  perspective: 1600px;
  transform: translate(-50%, calc(-50% + (1 - min(1, var(--p) * 1.5)) * 40vh));
  will-change: transform;
}
.hero .display {
  transform-origin: 50% 100%;
  transform: rotateX(calc((1 - min(1, var(--p) * 1.5)) * 32deg)) scale(calc(.74 + min(1, var(--p) * 1.5) * .26));
}
.glow {
  position: absolute; inset: 20% 10% -30%; z-index: -1; filter: blur(60px);
  background: radial-gradient(closest-side, rgba(79, 195, 247, .35), transparent);
  opacity: calc(.3 + var(--p));
}
@media (max-width: 560px) { .br-wide { display: none; } }

/* ---------- 단어가 밝아지는 문단 ---------- */
.statement { height: 220vh; }
.statement .sticky { display: grid; place-items: center; }
.reveal-words {
  width: min(980px, 100% - 40px); margin: 0;
  font-size: clamp(1.9rem, 4.6vw, 3.6rem); font-weight: 700; line-height: 1.25; letter-spacing: -0.03em;
}
.reveal-words .w { opacity: .16; transition: opacity .15s linear; }

/* ---------- HOW: 단계 전환 ---------- */
.how { height: 460vh; }
.how .sticky { display: grid; place-items: center; padding-top: var(--nav-h); }
.how-grid { width: min(1240px, 100% - 40px); display: grid; grid-template-columns: minmax(260px, .8fr) 1.6fr; gap: clamp(24px, 4vw, 64px); align-items: center; }
.how-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 30px; }
.step { opacity: .22; transform: translateX(-8px); transition: opacity .5s, transform .5s; }
.step .num { font-family: var(--mono); color: var(--accent); font-size: .85rem; }
.step h3 { font-size: clamp(1.4rem, 2.2vw, 1.9rem); margin: .25rem 0 .4rem; }
.step p { margin: 0; color: var(--muted); }
.how-device { position: relative; }
.how .screen .frame { opacity: 0; transform: scale(1.035); transition: opacity .6s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.how-dots { display: flex; justify-content: center; gap: 8px; margin-top: 22px; }
.how-dots i { width: 8px; height: 8px; border-radius: 8px; background: #3a3f46; transition: width .4s, background .4s; }
.how[data-active="0"] .frame[data-frame="0"], .how[data-active="1"] .frame[data-frame="1"],
.how[data-active="2"] .frame[data-frame="2"], .how[data-active="3"] .frame[data-frame="3"] { opacity: 1; transform: none; }
.how[data-active="0"] .step[data-step="0"], .how[data-active="1"] .step[data-step="1"],
.how[data-active="2"] .step[data-step="2"], .how[data-active="3"] .step[data-step="3"] { opacity: 1; transform: none; }
.how[data-active="0"] .how-dots i:nth-child(1), .how[data-active="1"] .how-dots i:nth-child(2),
.how[data-active="2"] .how-dots i:nth-child(3), .how[data-active="3"] .how-dots i:nth-child(4) { width: 28px; background: var(--accent); }
.how .frame[data-frame="1"] .pop { box-shadow: 0 0 0 2px var(--accent) inset; }
.how .nav-route { stroke-dasharray: 1400; stroke-dashoffset: 1400; }
.how[data-active="3"] .nav-route { stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s ease .2s; }

@media (max-width: 900px) {
  .how-grid { grid-template-columns: 1fr; gap: 28px; }
  .how-device { order: -1; }
  .how-steps { display: grid; }
  .how-steps .step { grid-area: 1 / 1; opacity: 0; transform: translateY(10px); }
}

/* ---------- ROUTE: 경로 그리기 ---------- */
.route { height: 320vh; }
.route .sticky { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4vh; padding-top: var(--nav-h); }
.route-copy { text-align: center; padding-inline: 20px; }
.route-map { width: min(1200px, 100% - 40px); height: auto; max-height: 64vh; }
.route-line { stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--d, 0)); filter: drop-shadow(0 0 10px rgba(79, 195, 247, .55)); }
.pin circle { fill: #fff; stroke: var(--accent); stroke-width: 6; }
.pin text { fill: #f5f5f7; font: 600 26px var(--font); text-anchor: middle; }
.pin { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.4); transition: opacity .35s, transform .5s cubic-bezier(.3, 1.6, .5, 1); }
.pin.on { opacity: 1; transform: none; }

/* ---------- TIME ---------- */
.time { padding: 18vh 0 14vh; background: linear-gradient(var(--bg), var(--bg2)); }
.formula { display: grid; gap: 16px; margin: 48px 0 40px; }
.f-card {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .5em 1em;
  font-size: clamp(1.6rem, 3.8vw, 3rem); font-weight: 700; letter-spacing: -0.03em;
  padding: 28px 34px; border-radius: 28px; background: var(--card); border: 1px solid var(--line);
}
.f-eq { color: #fff; }
.f-op { color: var(--muted); font-weight: 400; }
.f-hl { color: var(--accent); }
.f-hl.alt { color: var(--warm); }
.sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.src { padding: 24px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); }
.src b { font-size: 1.1rem; }
.src p { color: var(--muted); margin: .5rem 0 0; font-size: .95rem; }

/* ---------- EXPAND: 카드 → 전체 화면 ---------- */
.expand { height: 300vh; background: var(--bg2); }
.expand .sticky { display: grid; place-items: center; }
.expand-media {
  position: absolute; inset: 0;
  clip-path: inset(calc((1 - min(1, var(--p) * 1.6)) * 22%) calc((1 - min(1, var(--p) * 1.6)) * 18%) round calc((1 - min(1, var(--p) * 1.6)) * 40px));
  will-change: clip-path;
}
.expand-media svg { width: 100%; height: 100%; transform: scale(calc(1.3 - min(1, var(--p) * 1.6) * .3)); }
.expand .h1 { transform: translateY(calc(var(--p) * -30px)); }
.expand .h2 { transform: translateY(calc(var(--p) * -70px)); }
.expand .lane path { animation: lane 1.2s linear infinite; }
@keyframes lane { to { stroke-dashoffset: -90; } }
.expand-copy {
  position: relative; text-align: center; padding-inline: 20px; margin-top: -18vh;
  opacity: clamp(0, (var(--p) - .5) * 4, 1);
  transform: translateY(calc((1 - clamp(0, (var(--p) - .5) * 4, 1)) * 40px));
  text-shadow: 0 2px 30px rgba(0, 0, 0, .5);
}
.expand-copy p { font-size: clamp(1.05rem, 1.8vw, 1.4rem); color: #f0e6ff; margin: 1rem 0 0; }

/* ---------- FEATURES ---------- */
.features { padding: 20vh 0 12vh; background: var(--bg2); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-top: 48px; }
.card {
  padding: 30px; border-radius: 26px; background: var(--card); border: 1px solid var(--line);
  transition: transform .4s, border-color .4s;
}
.card:hover { transform: translateY(-4px); border-color: #34404c; }
.card .ic { font-size: 2rem; }
.card h3 { font-size: 1.35rem; margin: 14px 0 8px; }
.card p { color: var(--muted); margin: 0; }

/* ---------- TECH ---------- */
.tech { padding: 14vh 0; }
.tech-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 48px; align-items: start; }
@media (max-width: 900px) { .tech-grid { grid-template-columns: 1fr; } }
.tech-list dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 14px 22px; }
.tech-list dt { color: var(--muted); }
.tech-list dd { margin: 0; }
.code {
  margin: 0; padding: 26px; border-radius: 22px; background: #0b0e12; border: 1px solid var(--line);
  overflow-x: auto; font: 14px/1.6 var(--mono); color: #d6deeb;
}
.code code { color: inherit; font-size: inherit; }
.code .c { color: #637777; } .code .f { color: #82aaff; } .code .t { color: #ffcb8b; }
.code .s { color: #c3e88d; } .code .n { color: #f78c6c; } .code .k { color: #c792ea; }

/* ---------- CTA / FOOTER ---------- */
.cta { padding: 20vh 0; text-align: center; }
.cta h2 { font-size: clamp(2.6rem, 7vw, 5.6rem); }
.cta p { color: var(--muted); font-size: 1.15rem; margin-top: 1.2rem; }
.foot { border-top: 1px solid var(--line); padding: 28px 0 calc(28px + env(safe-area-inset-bottom, 0px)); font-size: .85rem; }
.foot p { margin: .2rem 0; }
.muted { color: var(--muted); }

/* ---------- 들어오며 나타나기 ---------- */
.fade-up { opacity: 0; transform: translateY(36px); transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.fade-up.in { opacity: 1; transform: none; }

/* ---------- 움직임 줄이기 설정 존중 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero, .statement, .route, .expand { height: auto; }
  .hero .sticky, .statement .sticky, .route .sticky, .expand .sticky { position: relative; height: auto; min-height: 100vh; padding-block: 14vh; }
  .hero-stage { position: relative; left: auto; top: auto; transform: none; margin-top: 6vh; }
  .hero .display, .hero-copy, .expand-media svg, .expand .h1, .expand .h2 { transform: none !important; }
  .hero-copy, .expand-copy { opacity: 1 !important; transform: none !important; }
  .expand-media { clip-path: none; }
  .expand-copy { margin-top: 0; }
  .route-line { stroke-dashoffset: 0; }
  .pin { opacity: 1; transform: none; }
  .reveal-words .w { opacity: 1 !important; }
  .fade-up { opacity: 1; transform: none; }
  .expand .lane path { animation: none; }
  *, *::before, *::after { transition-duration: 0s !important; }
}
