/* ================================================================
   태양계 학습 페이지 — 디자인 시스템 토큰 + 글로벌 스타일
   ================================================================ */

:root {
  /* 다크 우주 베이스 */
  --bg-0: #050510;            /* 우주 심연 */
  --bg-1: #0A0A1A;            /* 패널 배경 */
  --bg-2: #11122A;            /* 카드 배경 */
  --bg-3: #1A1B36;            /* 호버/액티브 */
  --bg-elev: #161734;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  /* 텍스트 */
  --text-0: #F5F6FF;          /* 강조 */
  --text-1: #C9CBE5;          /* 본문 */
  --text-2: #8A8DAE;          /* 보조 */
  --text-3: #5A5D7A;          /* 캡션 */

  /* 강조 (사이언) */
  --accent: oklch(0.82 0.13 210);
  --accent-soft: oklch(0.82 0.13 210 / 0.14);
  --accent-line: oklch(0.82 0.13 210 / 0.35);
  --accent-glow: oklch(0.82 0.13 210 / 0.5);

  /* 타이포 */
  --font-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --fs: 1;

  /* 간격 / 레이아웃 */
  --maxw: 1280px;
  --pad: clamp(20px, 4vw, 64px);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  /* 모션 */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --orbit-speed: 1;
}

/* 강조 컬러 변형 */
[data-accent="cyan"]   { --accent: oklch(0.82 0.13 210); --accent-soft: oklch(0.82 0.13 210 / 0.14); --accent-line: oklch(0.82 0.13 210 / 0.35); --accent-glow: oklch(0.82 0.13 210 / 0.5); }
[data-accent="violet"] { --accent: oklch(0.78 0.16 295); --accent-soft: oklch(0.78 0.16 295 / 0.14); --accent-line: oklch(0.78 0.16 295 / 0.35); --accent-glow: oklch(0.78 0.16 295 / 0.5); }
[data-accent="amber"]  { --accent: oklch(0.82 0.15 75);  --accent-soft: oklch(0.82 0.15 75 / 0.14);  --accent-line: oklch(0.82 0.15 75 / 0.35);  --accent-glow: oklch(0.82 0.15 75 / 0.5); }
[data-accent="rose"]   { --accent: oklch(0.78 0.15 15);  --accent-soft: oklch(0.78 0.15 15 / 0.14);  --accent-line: oklch(0.78 0.15 15 / 0.35);  --accent-glow: oklch(0.78 0.15 15 / 0.5); }
[data-accent="lime"]   { --accent: oklch(0.86 0.18 135); --accent-soft: oklch(0.86 0.18 135 / 0.14); --accent-line: oklch(0.86 0.18 135 / 0.35); --accent-glow: oklch(0.86 0.18 135 / 0.5); }

/* 라이트 테마 */
[data-theme="light"] {
  --bg-0: #F4F5F9;
  --bg-1: #FFFFFF;
  --bg-2: #FFFFFF;
  --bg-3: #EEF0F7;
  --bg-elev: #FFFFFF;
  --line: rgba(15, 18, 50, 0.08);
  --line-strong: rgba(15, 18, 50, 0.18);
  --text-0: #0B0E2A;
  --text-1: #2A2D4F;
  --text-2: #5A5D7A;
  --text-3: #8A8DAE;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  background: var(--bg-0);
  color-scheme: dark;
  scroll-behavior: smooth;
}
[data-theme="light"] html { color-scheme: light; }

body {
  font-family: var(--font-sans);
  font-size: calc(16px * var(--fs));
  line-height: 1.6;
  color: var(--text-1);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* 미세 별빛 배경 (전 페이지) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, oklch(0.4 0.15 270 / 0.18), transparent 60%),
    radial-gradient(800px 500px at -10% 100%, oklch(0.5 0.18 210 / 0.12), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
[data-theme="light"] body::before {
  background:
    radial-gradient(1200px 600px at 80% -10%, oklch(0.85 0.08 270 / 0.4), transparent 60%),
    radial-gradient(800px 500px at -10% 100%, oklch(0.9 0.05 210 / 0.5), transparent 60%);
}

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

/* ================================================================
   타이포그래피
   ================================================================ */
.eyebrow {
  font-family: var(--font-mono);
  font-size: calc(12px * var(--fs));
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
}

h1.display {
  font-size: clamp(40px, 7vw, 96px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-0);
  margin: 0;
  text-wrap: balance;
}
h2.section {
  font-size: clamp(28px, 4vw, 56px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-0);
  margin: 0;
  text-wrap: balance;
}
h3.h3 {
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-0);
  margin: 0;
}
.lede {
  font-size: clamp(16px, 1.4vw, 20px);
  line-height: 1.65;
  color: var(--text-1);
  max-width: 64ch;
  text-wrap: pretty;
}
.mono { font-family: var(--font-mono); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ================================================================
   레이아웃
   ================================================================ */
.shell {
  position: relative;
  z-index: 1;
}
.section-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(80px, 10vh, 140px) var(--pad);
}
.section-head {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 56px;
  max-width: 760px;
}

/* ================================================================
   네비게이션
   ================================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--pad);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in oklab, var(--bg-0) 70%, transparent);
  border-bottom: 1px solid var(--line);
  transition: background .3s var(--ease), border-color .3s var(--ease);
}
.nav[data-scrolled="false"] {
  background: transparent;
  border-bottom-color: transparent;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-0);
}
.nav-brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, oklch(0.95 0.1 80), oklch(0.7 0.18 50));
  box-shadow: 0 0 14px oklch(0.7 0.18 50 / 0.6);
}
.nav-links {
  display: flex;
  gap: 4px;
}
.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  transition: color .2s var(--ease), background .2s var(--ease);
  cursor: pointer;
  background: transparent;
  border: none;
  font-family: inherit;
}
.nav-link:hover { color: var(--text-0); background: var(--bg-3); }
.nav-link[data-active="true"] { color: var(--text-0); background: var(--accent-soft); }
@media (max-width: 760px) { .nav-links { display: none; } }

/* ================================================================
   카드 / 일반 컴포넌트
   ================================================================ */
.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-1);
  text-transform: uppercase;
}
.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
  text-decoration: none;
}
.btn-primary {
  background: var(--text-0);
  color: var(--bg-0);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--text-0);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--bg-3); }

/* ================================================================
   섹션 분리선 (모노 라벨)
   ================================================================ */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 var(--pad);
  max-width: var(--maxw);
  margin: 0 auto;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ================================================================
   푸터
   ================================================================ */
.footer {
  padding: 60px var(--pad) 80px;
  border-top: 1px solid var(--line);
  margin-top: 60px;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  flex-wrap: wrap;
}
.footer-credits {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.8;
}
.footer-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: -0.01em;
}

/* ================================================================
   스크롤바 / 셀렉션
   ================================================================ */
::selection { background: var(--accent); color: var(--bg-0); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--line-strong); }
