:root {
  color-scheme: light;
  --navy: #092F58;
  --navy-deep: #061F3D;
  --blue: #006DD9;
  --blue-soft: #E4F0FD;
  --bg: #F4F7FB;
  --surface: #FFFFFF;
  --ink: #0B1A2E;
  --sub: #52627A;
  --muted: #8795AA;
  --line: #D8E1EC;
  --line-strong: #B7C5D7;
  --warn: #C8432B;
  --heading: #092F58;
  --slab: #092F58;
  --on-primary: #FFFFFF;
  --font-body: 'Pretendard Variable', 'Pretendard', -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --font-num: 'Pretendard Variable', 'Pretendard', 'Malgun Gothic', system-ui, sans-serif;
}
/* 다크 모드: 홈페이지와 같은 방식(시스템 설정 + data-theme) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --navy: #EAF1FA; --navy-deep: #FFFFFF; --heading: #EAF1FA; --on-primary: #07121F;
    --blue: #4DA3FF; --blue-soft: #0F2A4A; --bg: #07121F; --surface: #0E1D31;
    --ink: #EAF1FA; --sub: #A4B3C8; --muted: #7C8CA4; --line: #1F344F; --line-strong: #2F4868;
    --warn: #F08A73; --slab: #7CBDFF;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --navy: #EAF1FA; --navy-deep: #FFFFFF; --heading: #EAF1FA; --on-primary: #07121F;
  --blue: #4DA3FF; --blue-soft: #0F2A4A; --bg: #07121F; --surface: #0E1D31;
  --ink: #EAF1FA; --sub: #A4B3C8; --muted: #7C8CA4; --line: #1F344F; --line-strong: #2F4868;
  --warn: #F08A73; --slab: #7CBDFF;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); word-break: keep-all; }
h1, h2, p, ol, figure { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.wrap { width: min(1160px, calc(100% - 64px)); margin-inline: auto; }

/* 머리글 */
.site-head { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.bar { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: block; width: 132px; height: auto; }
.home-link { font-size: .88rem; font-weight: 600; color: var(--sub); text-decoration: none; border: 1px solid var(--line-strong); padding: 8px 12px; border-radius: 4px; white-space: nowrap; }
.home-link:hover { color: var(--heading); border-color: var(--heading); }

/* 도입 */
.intro { padding: clamp(64px, 12vh, 140px) 0 clamp(56px, 10vh, 120px); }
.eyebrow { color: var(--blue); font-weight: 700; font-size: .95rem; margin-bottom: 18px; }
h1 { color: var(--navy); font-size: clamp(2.4rem, 6.4vw, 5rem); line-height: 1.1; letter-spacing: -.04em; font-weight: 700; }
.lede { margin-top: 24px; max-width: 34em; color: var(--sub); font-size: clamp(1rem, 1.6vw, 1.15rem); line-height: 1.75; }
.assume { margin-top: 14px; color: var(--muted); font-size: .88rem; line-height: 1.6; }
.scroll-hint { display: none; }

/* 장면 공통: 기본은 움직임 없는 정지 화면 */
.scene { border-top: 1px solid var(--line); }
.stage { padding: 72px 0; }
.stage-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.chapter { font-size: .88rem; color: var(--muted); font-weight: 600; letter-spacing: .01em; }
.chapter span { color: var(--navy); font-weight: 700; }
.track { height: 2px; background: var(--line); margin: 12px 0 24px; max-width: 220px; overflow: hidden; }
.track i { display: block; height: 100%; width: 100%; background: var(--navy); transform-origin: left; transform: scaleX(1); }
h2 { color: var(--navy); font-size: clamp(1.55rem, 3vw, 2.35rem); line-height: 1.3; letter-spacing: -.03em; font-weight: 700; }
.beats { list-style: none; padding: 0; margin-top: 24px; display: grid; gap: 12px; }
.beats li { color: var(--ink); font-size: clamp(1rem, 1.5vw, 1.12rem); line-height: 1.7; }
.note { margin-top: 20px; color: var(--muted); font-size: .8rem; line-height: 1.6; max-width: 36em; }
.visual { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: clamp(12px, 2vw, 24px); }
.visual svg { display: block; width: 100%; height: auto; }

/* SVG 공통 */
svg text { font-family: var(--font-num); }
.ground, .axis line, .tl { stroke: var(--line-strong); stroke-width: 1.5; }
.principal { fill: var(--line); }
.in-label { fill: var(--navy); font-size: 19px; font-weight: 700; }
.in-sub { fill: var(--sub); font-size: 14px; }
.slab { fill: var(--slab); }
.slab-new { fill: var(--blue); }
.callout { fill: var(--navy); font-size: 17px; font-weight: 700; }
.axis text, .ticks text { fill: var(--muted); font-size: 13px; }
.ticks line { stroke: var(--line); stroke-width: 1; }
.ref { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 6 6; }
.ref-label { fill: var(--muted); font-size: 13px; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.curve-faint { fill: none; stroke: var(--line-strong); stroke-width: 2; }
.curve { fill: none; stroke: var(--navy); stroke-width: 3.5; stroke-linecap: round; }
.gap { fill: var(--blue-soft); }
.dot { fill: var(--blue); stroke: var(--surface); stroke-width: 3; }
.drop { stroke: var(--blue); stroke-width: 1.5; stroke-dasharray: 3 4; }
.tile-head { fill: var(--sub); font-size: 14px; font-weight: 600; }
.tile rect { fill: var(--surface); stroke: var(--navy); stroke-width: 1.5; transition: fill .4s, stroke .4s; }
.tile text { fill: var(--navy); font-size: 15px; font-weight: 700; transition: fill .4s; }
.tile.off rect { fill: var(--bg); stroke: var(--line); }
.tile.off text { fill: var(--muted); }
.tile.keep rect { fill: var(--blue-soft); stroke: var(--blue); }
.tile.keep text { fill: var(--navy); }
.tile .tag { font-size: 12px; font-weight: 600; fill: var(--muted); }
.month { fill: var(--sub); font-size: 13px; }
.cut { stroke: var(--warn); stroke-width: 2; }
.cut-label { fill: var(--warn); font-size: 13px; font-weight: 700; }
.due { stroke: var(--sub); stroke-width: 1.5; stroke-dasharray: 3 3; }
.due-label { fill: var(--sub); font-size: 12px; font-weight: 600; }
.now-label { fill: var(--blue); font-size: 13px; font-weight: 700; }

/* 마무리 */
.pile-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.button { display: inline-flex; align-items: center; min-height: 48px; padding: 12px 20px; font-weight: 700; text-decoration: none; border-radius: 4px; }
.primary { background: var(--navy); color: var(--on-primary); }
.primary:hover { background: var(--navy-deep); }
.ghost { border: 1px solid var(--line-strong); color: var(--navy); background: var(--surface); }
.ghost:hover { border-color: var(--navy); }
.pile-visual { position: relative; aspect-ratio: 6 / 5; padding: 0; overflow: hidden; }
.pile-visual .pile-curve { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; }
.pile-curve path { fill: none; stroke: var(--line-strong); stroke-width: 1.5; stroke-dasharray: 1; stroke-dashoffset: 0; }
.card { position: absolute; width: 38%; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 4px; padding: 12px; display: grid; gap: 4px; will-change: transform; }
.card b { color: var(--navy); font-size: .92rem; }
.card span { color: var(--sub); font-size: .78rem; line-height: 1.45; }
.card .short { display: none; }
.card svg { width: 64px; height: 32px; margin-top: 4px; }
.card rect { fill: var(--navy); }
.card rect.off { fill: var(--line); }
.card .ln { fill: none; stroke: var(--navy); stroke-width: 2.5; }
.card[data-i="0"] { left: 4%; top: 64%; }
.card[data-i="1"] { left: 31%; top: 38%; }
.card[data-i="2"] { left: 58%; top: 10%; }
.here { position: absolute; left: 3%; bottom: 3%; display: flex; align-items: center; gap: 8px; color: var(--blue); font-weight: 700; font-size: .9rem; }
.here-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px var(--surface); }

.note-short, .beat-dots { display: none; }
.reassure { margin-top: 12px; color: var(--muted); font-size: .85rem; }

/* 숫자 카운터(움직임 켤 때만) */
.counter { display: none; }

footer { border-top: 1px solid var(--line); background: var(--surface); }
.foot { padding: 20px 0 28px; display: grid; gap: 6px; color: var(--sub); font-size: .8rem; line-height: 1.6; }
.foot b { color: var(--ink); }
.foot a { color: var(--sub); }

/* ───── 움직임 모드: JS가 켜고, 움직임 줄이기 사용자는 켜지 않는다 ───── */
.motion .scroll-hint { display: block; margin-top: 48px; color: var(--muted); font-size: .85rem; }
.motion .scroll-hint::after { content: ' ↓'; }
.motion .scene { height: 300vh; border-top: 0; }
.motion .finale { height: 240vh; }
.motion .stage { position: sticky; top: 0; height: 100vh; height: 100svh; padding: 0; display: flex; align-items: center; overflow: hidden; }
.motion .stage > .wrap { opacity: var(--fade, 1); transition: opacity .2s linear; }
.motion .track i { transform: scaleX(var(--p, 0)); }
.motion .beats { position: relative; display: block; min-height: 7.2em; }
.motion .beats li { position: absolute; inset: 0 0 auto 0; opacity: 0; transform: translateY(8px); transition: opacity .44s ease, transform .44s ease; }
.motion .beats li.on { opacity: 1; transform: none; }
.motion .card { transition: none; }
.motion .counter { display: flex; position: fixed; right: 20px; bottom: 18px; z-index: 6; align-items: baseline; gap: 8px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; color: var(--sub); font-size: .8rem; opacity: 0; transition: opacity .3s; font-variant-numeric: tabular-nums; }
.motion .counter.on { opacity: 1; }
.motion .counter b { color: var(--navy); font-size: 1.05rem; font-weight: 700; }
.motion .here { opacity: var(--here, 0); }
.motion .beat-dots { display: flex; gap: 8px; margin: -12px 0 16px; }
.motion .beat-dots span { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--line-strong); transition: background-color .3s ease, border-color .3s ease; }
.motion .beat-dots span.on { background: var(--navy); border-color: var(--navy); }

/* 휴대폰 */
@media (max-width: 820px) {
  .wrap { width: calc(100% - 40px); }
  .stage-grid, .pile-grid { grid-template-columns: 1fr; gap: 18px; }
  .stage { padding: 48px 0; }
  .beats li { font-size: 1rem; }
  .card { width: 44%; padding: 8px; }
  .card .long { display: none; }
  .card .short { display: block; font-size: .72rem; }
  .card svg { width: 44px; height: 22px; margin-top: 2px; }
  .card[data-i="0"] { left: 6%; top: 52%; }
  .card[data-i="1"] { left: 28%; top: 28%; }
  .card[data-i="2"] { left: 52%; top: 4%; }
  .pile-grid .copy { display: contents; }
  .pile-grid .chapter, .pile-grid h2, .pile-grid .beats { order: 0; }
  .pile-visual { order: 1; aspect-ratio: 4 / 3; }
  .pile-grid .actions { order: 2; margin-top: 4px; }
  .pile-grid .reassure { order: 3; margin-top: 0; }
  .motion .stage { align-items: center; }
  .motion .stage-grid, .motion .pile-grid { gap: 12px; }
  .motion h2 { font-size: clamp(1.3rem, 5.4vw, 1.6rem); }
  .motion .track { margin: 8px 0 12px; }
  .motion .beats { margin-top: 12px; min-height: 5.6em; }
  .motion .note { display: none; }
  .motion .note-short { display: block; margin-top: 8px; color: var(--muted); font-size: .76rem; line-height: 1.5; }
  .motion .scene { height: 220vh; }
  .motion .finale { height: 180vh; }
  .motion .beat-dots { margin: -4px 0 8px; }
  .motion .visual svg { max-height: 44svh; }
  .motion .pile-visual svg { max-height: none; }
  .motion .counter { right: 12px; bottom: 12px; }
}
@media (max-width: 480px) {
  .logo { width: 112px; }
  .home-link { font-size: .8rem; padding: 6px 10px; }
  .actions .button { width: 100%; justify-content: center; }
}
