@font-face { font-family: "Pretendard Exition"; src: url("/static/fonts/Pretendard-Regular.subset.woff2") format("woff2"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "Pretendard Exition"; src: url("/static/fonts/Pretendard-Medium.subset.woff2") format("woff2"); font-style: normal; font-weight: 500; font-display: swap; }
@font-face { font-family: "Pretendard Exition"; src: url("/static/fonts/Pretendard-SemiBold.subset.woff2") format("woff2"); font-style: normal; font-weight: 600 800; font-display: swap; }

:root {
  --bg: oklch(98.8% 0.004 245);
  --surface: oklch(100% 0 0);
  --fg: oklch(20% 0.022 252);
  --muted: oklch(50% 0.02 250);
  --border: oklch(91.5% 0.012 248);
  --accent: oklch(55% 0.18 255);
  --accent-strong: oklch(47% 0.18 255);
  --signal: oklch(58% 0.13 205);
  --wash: oklch(95.5% 0.018 245);
  --line: oklch(77% 0.04 245);
  --danger: oklch(54% 0.2 28);
  --font-display: "Pretendard Exition", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
  --font-body: "Pretendard Exition", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
  --font-serif: "Iropke Batang", "Noto Serif KR", Batang, Georgia, serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --header-h: 76px;
  --gutter: clamp(22px, 5vw, 76px);
  --content-max: 1360px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --shadow-menu: 0 18px 56px oklch(20% 0.03 250 / .12);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); color: var(--fg); }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 4px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: var(--fg);
  color: var(--surface);
  transform: translateY(-80px);
  transition: transform 180ms ease;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: fixed;
  z-index: 50;
  inset: 0 0 auto;
  height: var(--header-h);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(24px, 4vw, 58px);
  padding-inline: var(--gutter);
  border-bottom: 1px solid color-mix(in oklch, var(--border) 74%, transparent);
  background: color-mix(in oklch, var(--bg) 94%, transparent);
}

.brand {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -.02em;
}
.brand-logo { width: 28px; height: 28px; flex: 0 0 auto; }

.family-nav { justify-self: center; }
.family-nav ul {
  display: flex;
  gap: clamp(22px, 3vw, 46px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.family-nav a {
  position: relative;
  min-height: 44px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 560;
  letter-spacing: .02em;
  transition: color 180ms ease;
}
.family-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.family-nav a:hover,
.family-nav a[aria-current="page"] { color: var(--fg); }
.family-nav a[aria-current="page"]::after { opacity: 1; transform: translate(-50%, 0); }

.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-trigger {
  width: 44px;
  height: 44px;
  display: none;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}
.nav-trigger svg { width: 18px; height: 18px; }

.account { position: relative; }
.account-trigger {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px 5px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}
.account-trigger:hover { border-color: var(--line); background: var(--wash); }
.account-trigger:active { transform: translateY(1px); }
.account-label { font-size: 13px; font-weight: 570; letter-spacing: .02em; }
.account-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--wash);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 650;
}
.account-chevron { width: 14px; height: 14px; margin-right: 4px; transition: transform 220ms var(--ease); }
.account-trigger[aria-expanded="true"] .account-chevron { transform: rotate(180deg); }
.account-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 218px;
  padding: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-menu);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 180ms ease, transform 220ms var(--ease), visibility 180ms;
}
.account-menu[data-open="true"] {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.account-menu a,
.account-menu button {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  transition: background 160ms ease;
}
.account-menu a:hover,
.account-menu button:hover { background: var(--wash); }
.menu-note { color: var(--muted); font-size: 12px; }

.mobile-nav-panel {
  position: fixed;
  z-index: 45;
  top: var(--header-h);
  left: 0;
  right: 0;
  display: none;
  padding: 12px 18px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 18px 32px oklch(20% 0.02 250 / .08);
}
.mobile-nav-panel[data-open="true"] { display: block; }
.mobile-nav-panel a {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 560;
}
.mobile-nav-panel a:last-child { border-bottom: 0; }
.mobile-nav-panel a[aria-current="page"] { color: var(--accent-strong); }

.primary-action,
.secondary-action,
.text-action {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: .02em;
  cursor: pointer;
}
.primary-action {
  padding: 0 21px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--surface);
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.primary-action:hover { background: var(--accent-strong); border-color: var(--accent-strong); transform: translateY(-2px); }
.primary-action:active { transform: translateY(0); }
.secondary-action {
  padding: 0 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 180ms ease, background 180ms ease;
}
.secondary-action:hover { border-color: var(--line); background: var(--wash); }
.text-action {
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  transition: border-color 180ms ease;
}
.text-action:hover { border-color: var(--fg); }
.action-arrow { width: 18px; height: 18px; flex: 0 0 auto; }

.eyebrow {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .08em;
}
.lede {
  max-width: 58ch;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 1.3vw, 18px);
  line-height: 1.75;
  word-break: keep-all;
}
.hero-actions { display: flex; align-items: center; gap: 20px; margin-top: 32px; }

.math-svg text { font-family: var(--font-mono); fill: var(--muted); }
.math-svg .grid-line { stroke: var(--border); stroke-width: 1; }
.math-svg .axis { stroke: var(--line); stroke-width: 1.3; fill: none; }
.math-svg .main-line { stroke: var(--fg); stroke-width: 2; fill: none; }
.math-svg .accent-line { stroke: var(--accent); stroke-width: 2.4; fill: none; }
.math-svg .signal-line { stroke: var(--signal); stroke-width: 2.4; fill: none; }
.math-svg .soft-line { stroke: var(--muted); stroke-width: 1.2; fill: none; opacity: .58; }
.math-svg .point { fill: var(--fg); }
.math-svg .accent-point { fill: var(--accent); }
.math-svg .signal-point { fill: var(--signal); }
.draw-path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.is-visible .draw-path { animation: draw-line 1.3s var(--ease) forwards; }
@keyframes draw-line { to { stroke-dashoffset: 0; } }

.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 24px;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border: 1px solid var(--border);
  background: var(--fg);
  color: var(--surface);
  box-shadow: var(--shadow-menu);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 220ms var(--ease), visibility 180ms;
  font-size: 14px;
}
.toast[data-open="true"] { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

@media (max-width: 760px) {
  :root { --header-h: 66px; --gutter: 16px; }
  .site-header { grid-template-columns: auto 1fr auto; gap: 10px; }
  .family-nav { display: none; }
  .nav-trigger { display: grid; justify-self: end; }
  .account-label, .account-chevron { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .account-trigger { width: 44px; padding: 5px; }
  .account-avatar { width: 32px; height: 32px; }
  .hero-actions { gap: 14px; margin-top: 24px; }
  .primary-action { padding-inline: 17px; }
}

@media (max-width: 390px) {
  .brand { font-size: 18px; gap: 9px; }
  .brand-logo { width: 26px; height: 26px; }
  .hero-actions { align-items: flex-start; flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .draw-path { stroke-dashoffset: 0; }
}
