/* =========================================
   Alarmy · 쌓아온 숫자들
   디자인 토큰은 brand.md 기반
   ========================================= */

:root {
  /* 브랜드 컬러 — 로고 SVG에서 직접 추출 */
  --brand-red: #F50026;
  --brand-red-deep: #F50029;
  --brand-pink: #FF0048;
  --brand-orange: #FF6E00;

  /* 시그니처 그라데이션 */
  --brand-gradient: linear-gradient(135deg, #F50029 0%, #FF0048 55%, #FF6E00 100%);
  --brand-gradient-soft: linear-gradient(135deg, rgba(245,0,41,0.08) 0%, rgba(255,110,0,0.08) 100%);

  /* 뉴트럴 — 라이트 */
  --bg: #FFFFFF;
  --bg-alt: #FAFAFA;
  --ink-900: #0A0A0A;
  --ink-700: #1F1F1F;
  --ink-500: #525252;
  --ink-400: #737373;     /* WCAG AA — source 캡션용 */
  --ink-300: #A3A3A3;
  --ink-100: #E5E5E5;
  --ink-50:  #F4F4F4;

  /* 다크 — section--dark, closing 용 */
  --dark-bg:    #0A0A0A;
  --dark-bg-2:  #141414;
  --dark-ink-0: #FAFAFA;
  --dark-ink-1: #B5B5B5;
  --dark-ink-2: #737373;
  --dark-ink-3: #3A3A3A;
  --dark-line:  rgba(255, 255, 255, 0.08);

  /* 타이포 */
  --font-sans: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  /* 사이즈 — 발표 모드 가독성 고려 (잘림 방지 + 작은 글자 상향) */
  --num-display: clamp(64px, 10vw, 156px);
  --num-display-tight: clamp(52px, 8vw, 124px);
  --label-size: clamp(15px, 1.1vw, 18px);
  --cmp-num-size: clamp(28px, 3.4vw, 52px);
  --text-context: clamp(17px, 1.2vw, 20px);
  --text-caption: 14px;

  /* 레이아웃 */
  --section-pad-x: clamp(32px, 6vw, 96px);
  --section-pad-y: clamp(40px, 6vh, 88px);

  /* 모션 */
  --ease-out-cubic: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink-900);
  font-family: var(--font-sans);
  font-feature-settings: "ss06", "tnum";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }

main {
  width: 100%;
}

/* =========================================
   섹션 공통
   ========================================= */
.section {
  position: relative;
  width: 100%;
  min-height: 100vh;
  padding: var(--section-pad-y) var(--section-pad-x);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.section + .section {
  border-top: 1px solid var(--ink-50);
}

/* =========================================
   고정 UI: 진행도, 로고
   ========================================= */
.brand-mark {
  position: fixed;
  top: 28px;
  left: 32px;
  z-index: 50;
  pointer-events: none;
  opacity: 0.95;
}
.brand-mark img {
  height: 22px;
  width: auto;
}

.progress {
  position: fixed;
  top: 50%;
  right: 36px;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--ink-500);
}
.progress-current {
  color: var(--brand-red);
  font-weight: 700;
}
.progress-divider {
  width: 1px;
  height: 36px;
  background: var(--ink-300);
  display: block;
}
.progress-total {
  color: var(--ink-300);
}

/* =========================================
   1. HERO
   ========================================= */
.hero {
  align-items: flex-start;
  justify-content: center;
  background:
    radial-gradient(ellipse at 80% 20%, rgba(255,110,0,0.06), transparent 60%),
    radial-gradient(ellipse at 10% 80%, rgba(245,0,41,0.05), transparent 60%),
    var(--bg);
}
.hero-inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}
.hero-eyebrow {
  font-size: var(--label-size);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin: 0 0 32px;
  font-weight: 500;
}
.hero-title {
  font-size: clamp(56px, 9vw, 144px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 36px;
  color: var(--ink-900);
}
.grad-text {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero-sub {
  font-size: clamp(16px, 1.4vw, 22px);
  line-height: 1.55;
  color: var(--ink-500);
  max-width: 640px;
  margin: 0 0 80px;
  font-weight: 500;
}
.hero-scroll {
  position: absolute;
  left: var(--section-pad-x);
  bottom: 56px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  font-size: 13px;
  letter-spacing: 0.32em;
  color: var(--ink-500);
}
.hero-scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(180deg, var(--ink-700), transparent);
  animation: scroll-pulse 1.8s var(--ease-out-cubic) infinite;
}
@keyframes scroll-pulse {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 1; }
  60%  { transform: scaleY(1); transform-origin: top; opacity: 1; }
  61%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

/* =========================================
   지표 섹션 (공통)
   ========================================= */
.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: clamp(32px, 5vw, 96px);
  align-items: center;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  flex: 1;
}
.divider {
  width: 1px;
  height: 56%;
  background: var(--ink-100);
  justify-self: center;
}

.side {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.side-left { padding-right: 12px; }
.side-right { padding-left: 12px; }

.metric-label,
.cmp-label {
  font-size: var(--label-size);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-500);
  margin: 0;
}

.metric-number {
  font-size: var(--num-display);
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: -0.045em;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}
.metric-number .num,
.metric-number .unit { white-space: nowrap; }
.metric-number--tight {
  font-size: var(--num-display-tight);
}
.metric-number .unit {
  font-size: 0.42em;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.metric-context,
.cmp-context {
  font-size: var(--text-context);
  line-height: 1.55;
  color: var(--ink-500);
  margin: 0;
  font-weight: 500;
}

.cmp-number {
  font-size: var(--cmp-num-size);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink-700);
  font-variant-numeric: tabular-nums;
}
.cmp-unit {
  font-size: 0.55em;
  font-weight: 600;
  color: var(--ink-500);
  margin-left: 2px;
}

.cmp-viz {
  margin-top: 8px;
  min-height: 200px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

/* 등장 애니메이션 — metric 섹션은 2단계 reveal */
.side {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out-cubic), transform 0.8s var(--ease-out-cubic);
}
/* step-1 (기본 in-view): 좌측 알라미 숫자만 등장 */
.section.in-view .side-left  { opacity: 1; transform: none; transition-delay: 0s; }
/* metric 우측은 step-2 에서만 등장 */
.section.metric.in-view.step-2 .side-right { opacity: 1; transform: none; transition-delay: 0s; }
/* metric 아닌 섹션은 in-view 만으로 양쪽 등장 (현재 해당 없음 — 안전망) */
.section:not(.metric).in-view .side-right { opacity: 1; transform: none; transition-delay: 0.22s; }

/* divider 도 step-2 시점에 등장 */
.section.metric .divider { opacity: 0; }
.section.metric.in-view.step-2 .divider {
  opacity: 1;
  animation: divider-grow 0.9s var(--ease-out-cubic) 0.05s both;
}
.section:not(.metric).in-view .divider {
  animation: divider-grow 0.9s var(--ease-out-cubic) 0.1s both;
}
@keyframes divider-grow {
  from { transform: scaleY(0); opacity: 0; }
  to   { transform: scaleY(1); opacity: 1; }
}

/* source — WCAG AA 통과 #737373, 발표 모드 가독성 위해 14px */
.source {
  position: absolute;
  bottom: 32px;
  left: var(--section-pad-x);
  right: var(--section-pad-x);
  font-size: var(--text-caption);
  color: var(--ink-400);
  margin: 0;
  letter-spacing: 0.02em;
}

/* =========================================
   비교 시각화 — Grid
   ========================================= */
.cmp-viz[data-viz="grid"] {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 360px;
}
.cmp-viz[data-viz="grid"] .cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-100);
  transition: color 0.3s var(--ease-out-cubic), transform 0.3s var(--ease-out-cubic);
}
.cmp-viz[data-viz="grid"] .cell svg,
.cmp-viz[data-viz="grid"] .cell [data-lucide] {
  width: 100%;
  height: 100%;
  stroke-width: 1.8;
}
.cmp-viz[data-viz="grid"] .cell.filled {
  color: var(--ink-700);
}
.cmp-viz[data-viz="grid"] .cell.filled.overflow {
  color: var(--brand-red);
}

/* =========================================
   비교 시각화 — Clock (초당 1건)
   ========================================= */
.cmp-viz-clock {
  position: relative;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: 2px solid var(--ink-100);
}
.cmp-viz-clock::before,
.cmp-viz-clock::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: var(--ink-700);
  transform-origin: bottom center;
}
.cmp-viz-clock::before {
  width: 2px;
  height: 38%;
  transform: translate(-50%, -100%) rotate(45deg);
}
.cmp-viz-clock::after {
  width: 2px;
  height: 50%;
  transform: translate(-50%, -100%);
  background: var(--brand-red);
  animation: clock-second 1s linear infinite;
}
.cmp-viz-clock.in-view::after {
  animation-play-state: running;
}
@keyframes clock-second {
  from { transform: translate(-50%, -100%) rotate(0deg); }
  to   { transform: translate(-50%, -100%) rotate(360deg); }
}
.cmp-viz-clock .tick {
  position: absolute;
  inset: 0;
}
.cmp-viz-clock .tick span {
  position: absolute;
  width: 2px;
  height: 8px;
  background: var(--ink-300);
  top: 4px;
  left: 50%;
  transform-origin: center 116px;
}
.cmp-viz-clock .center-dot {
  position: absolute;
  top: 50%; left: 50%;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ink-900);
  transform: translate(-50%, -50%);
  z-index: 2;
}

/* =========================================
   비교 시각화 — Books (책탑)
   ========================================= */
.cmp-viz-books {
  width: 100%;
  max-width: 360px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 6px;
  height: 280px;
  position: relative;
}
.cmp-viz-books .stack {
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  width: 44px;
}
.cmp-viz-books .book {
  width: 100%;
  height: 8px;
  background: var(--ink-100);
  border-radius: 1px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s, background-color 0.3s;
}
.cmp-viz-books .book.on {
  opacity: 1;
  transform: none;
  background: var(--ink-700);
}
.cmp-viz-books .book.on:nth-child(7n) { background: var(--brand-red); }

/* =========================================
   비교 시각화 — Station (지하철)
   ========================================= */
.cmp-viz-station {
  width: 100%;
  max-width: 360px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
}
.cmp-viz-station .station-icon {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  color: var(--ink-700);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cmp-viz-station .station-icon svg {
  width: 100%;
  height: 100%;
  stroke-width: 1.6;
}
.cmp-viz-station .flow {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
}
.cmp-viz-station .flow .dot {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ink-100);
  transition: background-color 0.25s var(--ease-out-cubic), transform 0.25s var(--ease-out-cubic);
}
.cmp-viz-station .flow .dot.on { background: var(--ink-700); }
.cmp-viz-station .flow .dot.overflow { background: var(--brand-red); }

/* =========================================
   비교 시각화 — Ripple (Ring Alarm)
   ========================================= */
.cmp-viz-ripple {
  position: relative;
  width: 260px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cmp-viz-ripple .bell {
  width: 80px;
  height: 80px;
  color: var(--brand-red);
  position: relative;
  z-index: 2;
}
.cmp-viz-ripple .bell svg { width: 100%; height: 100%; stroke-width: 1.6; }
.cmp-viz-ripple .ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 90px; height: 90px;
  border: 2px solid var(--brand-pink);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 0;
}
.section.in-view .cmp-viz-ripple .ring {
  animation: ripple 2.4s var(--ease-out-cubic) infinite;
}
.cmp-viz-ripple .ring:nth-child(2) { animation-delay: 0.8s; }
.cmp-viz-ripple .ring:nth-child(3) { animation-delay: 1.6s; }
@keyframes ripple {
  0%   { transform: translate(-50%, -50%) scale(0.6); opacity: 0.9; border-color: var(--brand-red); }
  100% { transform: translate(-50%, -50%) scale(3); opacity: 0; border-color: var(--brand-orange); }
}

/* =========================================
   비교 시각화 — Hourglass (수면)
   ========================================= */
.cmp-viz-hourglass {
  width: 100%;
  max-width: 360px;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
}
.cmp-viz-hourglass .hg {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-100);
  transition: color 0.3s var(--ease-out-cubic);
}
.cmp-viz-hourglass .hg svg { width: 100%; height: 100%; stroke-width: 1.6; }
.cmp-viz-hourglass .hg.on { color: var(--ink-700); }
.cmp-viz-hourglass .hg.on.overflow { color: var(--brand-red); }

/* =========================================
   비교 시각화 — Bars (DARO)
   ========================================= */
.cmp-viz-bars {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.cmp-viz-bars .bar-row {
  display: grid;
  grid-template-columns: 96px 1fr 130px;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.cmp-viz-bars .bar-row .bar-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-500);
  width: 96px;
  text-align: right;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.cmp-viz-bars .bar-row .bar-fill {
  height: 28px;
  background: var(--ink-700);
  border-radius: 2px;
  transition: width 1.8s var(--ease-out-cubic);
  width: 0;
}
.cmp-viz-bars .bar-row.alarmy .bar-fill {
  background: var(--brand-gradient);
}
.cmp-viz-bars .bar-row.spotify .bar-fill {
  background: #1DB954;
}
.cmp-viz-bars .bar-row.disney .bar-fill {
  background: #113CCF;
}
.cmp-viz-bars .bar-row .bar-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-700);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* =========================================
   비교 시각화 — Calendar (릴리즈 캘린더 그리드)
   ========================================= */
.cmp-viz-calendar {
  display: grid;
  grid-template-columns: repeat(var(--cal-cols, 31), 1fr);
  gap: 3px;
  width: 100%;
  max-width: 380px;
}
.cmp-viz-calendar .cell {
  aspect-ratio: 1;
  border-radius: 1px;
  background: var(--brand-gradient);
}
.cmp-viz-calendar .cell.empty {
  background: var(--ink-200);
  opacity: 0.6;
}

/* =========================================
   비교 시각화 — Dense (10,000 dots)
   ========================================= */
.cmp-viz-dense {
  width: 600px;
  max-width: 100%;
  background: var(--bg);
  border: 1px solid var(--ink-100);
  padding: 8px;
  position: relative;
  box-sizing: border-box;
  display: inline-block;
}
.cmp-viz-dense canvas {
  width: 100% !important;
  height: auto !important;
}
.cmp-viz-dense .highlight-label {
  position: absolute;
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--brand-red);
  font-weight: 700;
  white-space: nowrap;
  text-shadow: 0 0 4px #fff, 0 0 8px #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.cmp-viz-dense .highlight-label .label-arrow {
  width: 14px;
  height: 18px;
  color: var(--brand-red);
}

/* 비교 라벨용 국가 국기 / 도시 아이콘 */
.cmp-label .country-flag,
.cmp-label .country-icon {
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}
.cmp-label .country-flag {
  width: 30px;
  height: 20px;
  border-radius: 2px;
}
.cmp-label .country-icon {
  width: 22px;
  height: 22px;
  color: var(--ink-700);
  stroke-width: 1.8;
}

/* =========================================
   FINALE 섹션 추가 디테일
   ========================================= */
.metric-finale {
  background: linear-gradient(180deg, #FFFFFF 0%, #FFF7F2 100%);
}

/* =========================================
   CLOSING
   ========================================= */
.closing {
  align-items: center;
  justify-content: center;
  text-align: center;
  background: radial-gradient(ellipse at center, #FFF7F2 0%, #FFFFFF 70%);
  position: relative;
}
.closing-inner {
  position: relative;
  z-index: 2;
  max-width: 1400px;
}
.closing-eyebrow {
  font-size: var(--label-size);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin: 0 0 28px;
  font-weight: 500;
}
.closing-title {
  font-size: clamp(44px, 6.5vw, 92px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin: 0 0 40px;
  color: var(--ink-900);
}
.closing-sub {
  font-size: clamp(18px, 1.55vw, 26px);
  line-height: 1.6;
  color: var(--ink-500);
  max-width: 760px;
  margin: 0 auto 56px;
  font-weight: 500;
}
.closing-logo img {
  height: 28px;
  margin: 0 auto;
  opacity: 0.85;
}

.closing-numbers {
  position: absolute;
  inset: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 24px 64px;
  padding: 12vh 8vw;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 1.2s var(--ease-out-cubic), transform 1.2s var(--ease-out-cubic);
  z-index: 1;
  pointer-events: none;
}
.section.in-view .closing-numbers {
  opacity: 1;
  transform: none;
}
.closing-numbers span {
  font-size: clamp(20px, 2.4vw, 36px);
  font-weight: 700;
  color: var(--ink-100);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.closing-numbers span:nth-child(3n) { color: rgba(245, 0, 41, 0.18); }

/* =========================================
   모바일 (≤ 768px)
   ========================================= */
@media (max-width: 768px) {
  :root {
    --num-display: clamp(48px, 12vw, 76px);
    --num-display-tight: clamp(40px, 10vw, 64px);
    --label-size: clamp(13px, 3.6vw, 15px);
    --text-context: clamp(15px, 3.8vw, 17px);
    --text-caption: 13px;
    --section-pad-x: 24px;
    --section-pad-y: 56px;
  }

  .brand-mark { top: 20px; left: 20px; }
  .brand-mark img { height: 18px; }
  .progress { right: 20px; font-size: 11px; }
  .progress-divider { height: 24px; }

  .metric-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 32px;
  }
  .divider {
    width: 56%;
    height: 1px;
    background: var(--ink-100);
    justify-self: start;
  }
  .section.in-view .divider {
    animation: divider-grow-h 0.9s var(--ease-out-cubic) 0.1s both;
  }
  @keyframes divider-grow-h {
    from { transform: scaleX(0); transform-origin: left; opacity: 0; }
    to   { transform: scaleX(1); transform-origin: left; opacity: 1; }
  }
  .side-left, .side-right { padding: 0; }

  .hero-scroll { bottom: 32px; }
  .source {
    position: static;
    margin-top: 32px;
  }
  .section { min-height: auto; padding-bottom: 80px; }
  .hero { min-height: 100vh; }
  .closing { min-height: 100vh; }
  .closing-numbers { padding: 8vh 6vw; }

  .cmp-viz-clock { width: 180px; height: 180px; }
  .cmp-viz-ripple { width: 200px; height: 200px; }
  .cmp-viz-ripple .bell { width: 60px; height: 60px; }
}

/* =========================================
   reduced motion
   ========================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .side { opacity: 1; transform: none; }
}

/* =========================================
   ▼ V2 — CINEMATIC IMPACT LAYER
   ========================================= */

/* ----- 섹션 번호 워터마크 ----- */
.section[data-mark]::before {
  content: attr(data-mark);
  position: absolute;
  right: clamp(24px, 4vw, 64px);
  bottom: clamp(64px, 8vh, 128px);
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(160px, 22vw, 320px);
  line-height: 0.85;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(10, 10, 10, 0.05);
  pointer-events: none;
  z-index: 0;
  user-select: none;
  font-variant-numeric: tabular-nums;
}
.hero[data-mark]::before { display: none; }      /* 히어로는 깔끔하게 */

/* 섹션 내용은 워터마크 위에 (hero-scroll 은 자체 absolute 유지 위해 제외) */
.section > *:not(.hero-scroll) {
  position: relative;
  z-index: 1;
}
.section[data-mark]::before { z-index: 0; }

/* ----- 섹션별 서브틀 코너 글로우 ----- */
.section.metric::after {
  content: "";
  position: absolute;
  width: 60vw;
  height: 60vh;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle, rgba(245, 0, 41, 0.06) 0%, transparent 70%);
}
.section.metric:nth-child(odd)::after  { top: -20vh; right: -15vw; }
.section.metric:nth-child(even)::after { bottom: -20vh; left: -15vw;
  background: radial-gradient(circle, rgba(255, 110, 0, 0.06) 0%, transparent 70%);
}

/* ----- 큰 숫자 등장 모션 강화 ----- */
.metric-number {
  filter: blur(8px);
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  transition:
    filter 0.9s var(--ease-out-expo) 0.05s,
    opacity 0.7s var(--ease-out-expo) 0.05s,
    transform 0.9s var(--ease-out-expo) 0.05s;
}
.section.in-view .metric-number {
  filter: blur(0);
  opacity: 1;
  transform: none;
}

/* ----- 큰 비교 숫자도 살짝 등장 — step-2 에서만 ----- */
.cmp-number {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.7s var(--ease-out-cubic) 0.15s, transform 0.7s var(--ease-out-cubic) 0.15s;
}
.section.metric.in-view.step-2 .cmp-number,
.section:not(.metric).in-view .cmp-number {
  opacity: 1;
  transform: none;
}

/* ----- divider 더 정제된 형태 ----- */
.divider {
  background: linear-gradient(180deg, transparent, var(--ink-100) 20%, var(--ink-100) 80%, transparent);
}

/* =========================================
   ▼ V2 — DARK SECTION 반전 (sec 10, 11)
   ========================================= */
.section--dark {
  background: var(--dark-bg);
  color: var(--dark-ink-0);
}
.section--dark.metric::after {
  background: radial-gradient(circle, rgba(245, 0, 41, 0.18) 0%, transparent 70%);
  opacity: 0.6;
  filter: blur(120px);
}
.section--dark[data-mark]::before {
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.06);
  color: transparent;
}

.section--dark .metric-label,
.section--dark .cmp-label {
  color: var(--dark-ink-2);
}
.section--dark .metric-context,
.section--dark .cmp-context {
  color: var(--dark-ink-1);
}
.section--dark .cmp-number {
  color: var(--dark-ink-0);
}
.section--dark .cmp-unit {
  color: var(--dark-ink-1);
}
.section--dark .divider {
  background: linear-gradient(180deg, transparent, var(--dark-line) 20%, var(--dark-line) 80%, transparent);
}
.section--dark .source {
  color: var(--dark-ink-2);
}

/* dense 캔버스 — 다크 모드에서 별처럼 */
.section--dark .cmp-viz-dense {
  background: var(--dark-bg);
  border: 1px solid var(--dark-line);
}

/* 큰 숫자 그라데이션 — 다크에서 더 강한 글로우 */
.section--dark .metric-number,
.section--dark .grad-text {
  filter: drop-shadow(0 0 24px rgba(245, 0, 41, 0.4));
}
.section.in-view.section--dark .metric-number {
  filter: drop-shadow(0 0 24px rgba(245, 0, 41, 0.4));
}

/* =========================================
   ▼ V2 — CLOSING 다크 재구성
   ========================================= */
.section.closing.section--dark {
  background:
    radial-gradient(ellipse at 50% 50%, rgba(245, 0, 41, 0.15), transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(255, 110, 0, 0.10), transparent 50%),
    var(--dark-bg);
}
.section.closing.section--dark .closing-eyebrow {
  color: var(--dark-ink-2);
}
.section.closing.section--dark .closing-title {
  color: var(--dark-ink-0);
  filter: drop-shadow(0 0 40px rgba(245, 0, 41, 0.35));
}
.section.closing.section--dark .closing-sub {
  color: var(--dark-ink-1);
}
.section.closing.section--dark .closing-logo img {
  filter: brightness(0) invert(1);
  opacity: 0.7;
}
.section.closing.section--dark .closing-numbers span {
  color: var(--dark-ink-3);
}
.section.closing.section--dark .closing-numbers span:nth-child(3n) {
  color: rgba(245, 0, 41, 0.45);
}

/* =========================================
   ▼ V2 — 다크 진입 시 고정 UI 반전
   (JS가 body.is-dark 토글)
   ========================================= */
body.is-dark .brand-mark img {
  filter: brightness(0) invert(1);
  transition: filter 0.6s var(--ease-out-cubic);
}
body.is-dark .progress {
  color: var(--dark-ink-2);
  transition: color 0.6s var(--ease-out-cubic);
}
body.is-dark .progress-current {
  color: var(--brand-orange);
}
body.is-dark .progress-total {
  color: var(--dark-ink-3);
}
body.is-dark .progress-divider {
  background: var(--dark-ink-3);
}
.brand-mark img,
.progress,
.progress-current,
.progress-total,
.progress-divider {
  transition: color 0.6s var(--ease-out-cubic),
              background-color 0.6s var(--ease-out-cubic),
              filter 0.6s var(--ease-out-cubic);
}

/* =========================================
   ▼ V2 — 섹션 사이 연결선 (얇은 그라데이션)
   ========================================= */
.section + .section {
  border-top: 0;
}
.section + .section::after,
.section + .section--dark::after { /* 코너 글로우와 별개로 추가 가능 */ }

/* =========================================
   ▼ V2 — Hero 강화
   ========================================= */
.hero-title { letter-spacing: -0.04em; }
.hero-title .grad-text {
  filter: drop-shadow(0 4px 24px rgba(245, 0, 41, 0.15));
}

/* =========================================
   ▼ V2 — 모바일에서 워터마크 축소
   ========================================= */
@media (max-width: 768px) {
  .section[data-mark]::before {
    font-size: clamp(120px, 32vw, 200px);
    right: 16px;
    bottom: 40px;
  }
}

/* =========================================
   ▼ V3 — REVEAL HINT (Space ▸ 비교 자료 보기)
   metric 섹션이 step-1 상태일 때만 노출
   ========================================= */
.reveal-hint {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink-500);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out-cubic);
}
.reveal-hint kbd {
  display: inline-block;
  border: 1px solid var(--ink-300);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 12px;
  font-family: var(--font-sans);
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink-700);
}
body.has-step1-active .reveal-hint {
  opacity: 1;
}
body.is-dark .reveal-hint { color: var(--dark-ink-1); }
body.is-dark .reveal-hint kbd {
  background: rgba(0, 0, 0, 0.6);
  border-color: var(--dark-ink-3);
  color: var(--dark-ink-0);
}
body.reveal-all .reveal-hint { display: none; }

/* =========================================
   ▼ V3 — REVEAL-ALL 캡처 모드 오버라이드
   ?reveal=all 일 때 metric 우측 즉시 노출
   ========================================= */
body.reveal-all .section.metric .side-right {
  opacity: 1;
  transform: none;
}
body.reveal-all .section.metric .divider {
  opacity: 1;
}
body.reveal-all .section.metric .cmp-number {
  opacity: 1;
  transform: none;
}
/* 캡처 모드: bar-fill의 0→100% transition이 animations:disabled 로 막혀서
   바가 0폭으로 잡히는 문제 → reveal-all 에서는 처음부터 100%로 고정 */
body.reveal-all .cmp-viz-bars .bar-row .bar-fill {
  width: 100% !important;
  transition: none !important;
}

/* 모바일에서 hint는 source 와 겹치지 않게 위로 */
@media (max-width: 768px) {
  .reveal-hint {
    bottom: auto;
    top: 64px;
    font-size: 12px;
  }
  .reveal-hint kbd { font-size: 11px; }
}
