/* =========================================================
   Design Helper — Design Tokens
   새 프로젝트에서는 이 :root 블록과 [data-theme="dark"] 블록만
   복사해도 시스템의 80%를 가져갈 수 있습니다.
   ========================================================= */
:root {
  /* Color — Light */
  --bg: #ffffff;
  --bg-subtle: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #f3f3f5;
  --border: #e7e7eb;
  --border-strong: #d2d2d8;
  --text: #0e0e12;
  --text-muted: #5c5e6b;
  --text-faint: #8a8c98;
  --ink: #0e0e12;            /* 에디토리얼용 진한 먹색 (테마와 무관하게 짙음) */
  --accent: #2563eb;
  --accent-hover: #1d4fd8;
  --accent-fg: #ffffff;
  --accent-soft: #eef3fe;
  --success: #15803d;
  --success-soft: #ecfdf3;
  --warning: #b45309;
  --warning-soft: #fff7ea;
  --danger: #dc2626;
  --danger-soft: #fef1f1;

  /* Typography */
  /* 영문·숫자는 Geist, 한글은 Pretendard로 자동 폴백 (Geist에는 한글 글리프가 없음) */
  --font-sans: "Geist", "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Segoe UI", system-ui, sans-serif;
  --font-serif: "Noto Serif KR", "Nanum Myeongjo", Georgia, serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, "Pretendard Variable", monospace;

  /* Spacing (4px base) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-6: 24px; --s-8: 32px; --s-12: 48px; --s-16: 64px; --s-24: 96px;

  /* Radius */
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-full: 999px;
  --r-btn: var(--r-md);      /* 모드별로 덮어씀: Product = pill, Editorial = 직각에 가깝게 */
  --r-btn-sm: var(--r-sm);

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(16, 16, 24, .05), 0 1px 1px rgba(16, 16, 24, .03);
  --shadow-lg: 0 12px 32px -8px rgba(16, 16, 24, .14), 0 2px 6px rgba(16, 16, 24, .05);

  /* Motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: 160ms;

  /* Layout */
  --container: 1200px;
  --measure: 680px;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0a0a0c;
  --bg-subtle: #101013;
  --surface: #141418;
  --surface-2: #1b1b20;
  --border: #23232a;
  --border-strong: #32323b;
  --text: #f3f3f5;
  --text-muted: #a2a3ae;
  --text-faint: #6f707c;
  --ink: #050507;
  --accent: #5b8cff;
  --accent-hover: #7aa2ff;
  --accent-fg: #0a0a0c;
  --accent-soft: rgba(91, 140, 255, .12);
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, .1);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, .1);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lg: 0 16px 40px -10px rgba(0, 0, 0, .6), 0 0 0 1px var(--border);
  color-scheme: dark;
}

/* Accent preset — Mono: 강조색 없이 흑백만 (Polar 실측 방식). 라이트·다크 모두 동작 */
[data-accent="mono"] {
  --accent: var(--text);
  --accent-hover: var(--text-muted);
  --accent-fg: var(--bg);
  --accent-soft: var(--surface-2);
}

/* Mode scopes — 모드마다 버튼 모서리를 다르게 */
.mode-product { --r-btn: var(--r-full); --r-btn-sm: var(--r-full); }
.mode-editorial { --r-btn: 2px; --r-btn-sm: 2px; }

/* =========================================================
   Base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  word-break: keep-all;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
code, .mono { font-family: var(--font-mono); font-size: .875em; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0 0 1em; }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-fg); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--text); color: var(--bg); padding: 8px 12px; border-radius: var(--r-sm);
}
.skip:focus { left: 8px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--s-6); }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.center { text-align: center; justify-content: center; }

/* =========================================================
   Type
   ========================================================= */
.display {
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin: 0 0 var(--s-6);
}
.display--center { text-align: center; }
.h2 { font-size: clamp(24px, 3vw, 32px); line-height: 1.2; letter-spacing: -0.025em; font-weight: 650; }
.h-sub {
  font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); margin: var(--s-12) 0 var(--s-4);
}
.lead { font-size: 19px; line-height: 1.6; color: var(--text-muted); max-width: 40ch; }
.lead.center { margin-left: auto; margin-right: auto; }
.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: var(--s-3);
}
.eyebrow--accent { color: var(--accent); }
.serif-xl {
  font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(30px, 4vw, 44px); line-height: 1.18; letter-spacing: -0.02em;
  margin-bottom: var(--s-4);
}
.serif-md {
  font-family: var(--font-serif); font-weight: 700;
  font-size: 20px; line-height: 1.35; letter-spacing: -0.01em; margin-bottom: var(--s-2);
}
/* Title pair — 흰 제목 + 회색 부제, 같은 크기·가는 굵기 (Polar 실측: 36px / 400) */
.title-pair {
  font-size: clamp(28px, 3.4vw, 40px); line-height: 1.25; letter-spacing: -0.025em;
  font-weight: 400; margin: 0 0 var(--s-6);
}
.title-pair > span { display: block; color: var(--text-muted); }
.title-pair--lg { font-size: clamp(32px, 4.4vw, 52px); line-height: 1.18; }
.title-pair--xl { font-size: clamp(36px, 5.4vw, 64px); line-height: 1.12; letter-spacing: -0.035em; }
.title-pair--center { text-align: center; }

/* Mono label — 카테고리·메타 라벨 (TR 실측: Mono 12px 대문자 +0.48px) */
.label-mono {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .04em; line-height: 1.4;
  color: var(--text-muted); margin: 0 0 var(--s-3);
}
.label-mono--accent { color: var(--accent); }

.serif-xl a, .serif-md a {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1px; background-repeat: no-repeat; background-position: 0 100%;
  transition: background-size 220ms var(--ease);
}
.serif-xl a:hover, .serif-md a:hover { background-size: 100% 1px; }

/* =========================================================
   Nav
   ========================================================= */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav__inner { display: flex; align-items: center; gap: var(--s-8); height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.02em; }
.logo__mark {
  width: 22px; height: 22px; border-radius: 7px;
  background: var(--text);
  position: relative;
}
.logo__mark::after {
  content: ""; position: absolute; inset: 6px; border-radius: 50%;
  background: var(--bg);
}
.nav__links { display: flex; gap: var(--s-6); font-size: 14px; color: var(--text-muted); }
.nav__links a { transition: color var(--dur) var(--ease); }
.nav__links a:hover { color: var(--text); }
.nav__actions { margin-left: auto; display: flex; gap: var(--s-2); align-items: center; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--border); background: transparent; border-radius: var(--r-md);
  color: var(--text-muted);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
[data-theme="dark"] .i-moon, :root:not([data-theme="dark"]) .i-sun { display: none; }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px;
  font-size: 15px; font-weight: 550; letter-spacing: -0.01em; white-space: nowrap;
  border-radius: var(--r-btn); border: 1px solid transparent;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              color var(--dur) var(--ease), transform 80ms var(--ease), box-shadow var(--dur) var(--ease);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--r-btn-sm); }
.btn--block { width: 100%; }
.btn--primary { background: var(--text); color: var(--bg); }
.btn--primary:hover:not(:disabled) { background: color-mix(in srgb, var(--text) 85%, var(--bg)); }
.btn--secondary { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn--secondary:hover:not(:disabled) { border-color: var(--border-strong); background: var(--surface-2); }
.btn--ghost { background: transparent; color: var(--text-muted); }
.btn--ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn--danger { background: var(--danger-soft); color: var(--danger); }
.btn--danger:hover:not(:disabled) { background: var(--danger); color: #fff; }
.link { color: var(--accent); font-size: 15px; font-weight: 550; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* =========================================================
   Hero
   ========================================================= */
.hero { padding: var(--s-24) var(--s-6) var(--s-16); }
.hero .title-pair { max-width: 26ch; text-wrap: balance; }
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-8); }
.hero__meta {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-6);
  margin: var(--s-16) 0 0; padding-top: var(--s-6); border-top: 1px solid var(--border);
}
.hero__meta dt { font-size: 12px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .08em; }
.hero__meta dd { margin: 4px 0 0; font-weight: 550; }

/* =========================================================
   Sections
   ========================================================= */
.section { padding: var(--s-24) 0; border-top: 1px solid var(--border); }
.section--subtle { background: var(--bg-subtle); }
.section__head { display: grid; grid-template-columns: 64px 1fr; gap: var(--s-4); margin-bottom: var(--s-8); }
.section__head .muted { margin: var(--s-2) 0 0; max-width: 60ch; }
.section__num { font-family: var(--font-mono); font-size: 13px; color: var(--text-faint); padding-top: 10px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-12); }

/* Swatches */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s-3); }
.swatch {
  display: grid; grid-template-columns: 1fr; gap: 2px; text-align: left;
  padding: var(--s-2); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.swatch:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.swatch__chip { height: 56px; border-radius: var(--r-sm); border: 1px solid var(--border); margin-bottom: 6px; }
.swatch b { font-size: 13px; font-weight: 600; padding: 0 4px; }
.swatch code { font-size: 11px; color: var(--text-faint); padding: 0 4px 2px; }

/* Type scale */
.type-scale { border-top: 1px solid var(--border); }
.type-row {
  display: grid; grid-template-columns: 220px 1fr; gap: var(--s-6); align-items: baseline;
  padding: var(--s-6) 0; border-bottom: 1px solid var(--border);
}
.type-row__meta { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }
.type-row .display { font-size: clamp(32px, 5vw, 56px); }
.type-row .lead { max-width: none; }

/* Spacing / radius */
.spacing { display: grid; gap: 10px; }
.spacing div { display: flex; align-items: center; gap: var(--s-4); }
.spacing span { height: 16px; background: var(--accent); border-radius: 2px; opacity: .85; }
.spacing code { font-size: 12px; color: var(--text-muted); }
.radii { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.radius-box {
  height: 88px; display: grid; place-items: end start; padding: var(--s-3);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
}
.radius-box code { font-size: 11px; color: var(--text-muted); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-lg { box-shadow: var(--shadow-lg); border-color: transparent; }

/* =========================================================
   Components
   ========================================================= */
.comp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.comp-grid > * { min-width: 0; } /* 표처럼 줄바꿈 안 되는 내용이 그리드 칸을 늘리지 않게 */
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--s-6); display: flex; flex-direction: column; gap: var(--s-4);
}
.panel--wide { grid-column: span 1; }
.panel__title { font-size: 13px; font-weight: 600; color: var(--text-muted); letter-spacing: .02em; }
.row { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }

/* Inputs */
.field { display: grid; gap: 6px; }
.field__label { font-size: 13px; font-weight: 550; }
.field__hint { font-size: 12px; color: var(--text-faint); }
.input {
  height: 40px; padding: 0 12px; width: 100%;
  font: inherit; font-size: 15px; color: var(--text);
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--r-md);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input::placeholder { color: var(--text-faint); }
.input:hover { border-color: var(--text-faint); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.check, .switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; margin-right: var(--s-4); }
.check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track {
  width: 34px; height: 20px; border-radius: var(--r-full); background: var(--border-strong);
  position: relative; transition: background var(--dur) var(--ease);
}
.switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform var(--dur) var(--ease);
}
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(14px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  font-size: 12px; font-weight: 550; border-radius: var(--r-full);
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
  white-space: nowrap;
}
.badge--accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge--success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge--warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge--danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

/* Tabs */
.tabs { display: flex; gap: var(--s-6); border-bottom: 1px solid var(--border); }
.tab {
  background: none; border: 0; padding: 8px 0 10px; font-size: 14px; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-color: var(--text); font-weight: 550; }
.tabpanel { font-size: 14px; color: var(--text-muted); }
.tabpanel b { color: var(--text); }

/* Alerts */
.alert {
  display: flex; gap: 10px; padding: 10px 14px; font-size: 14px; border-radius: var(--r-md);
  border: 1px solid transparent;
}
.alert--info { background: var(--accent-soft); color: var(--text); }
.alert--info b { color: var(--accent); }
.alert--success { background: var(--success-soft); }
.alert--success b { color: var(--success); }
.alert--danger { background: var(--danger-soft); }
.alert--danger b { color: var(--danger); }
.panel .btn--sm { align-self: flex-start; }

/* Table */
.table-wrap { overflow-x: auto; margin: 0 calc(var(--s-6) * -1); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px var(--s-6); text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { font-size: 12px; font-weight: 550; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; }
.table tbody tr { transition: background var(--dur) var(--ease); }
.table tbody tr:hover { background: var(--bg-subtle); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table td:first-child { display: flex; align-items: center; gap: 10px; font-weight: 550; }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted);
}
.avatar--lg { width: 40px; height: 40px; font-size: 15px; }

/* Empty */
.empty { text-align: center; display: grid; justify-items: center; gap: 6px; padding: var(--s-6) 0; flex: 1; align-content: center; }
.empty .muted { margin: 0 0 var(--s-3); }
.empty__icon {
  width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); margin-bottom: 6px;
}
.empty__title { font-weight: 600; margin: 0; }
.empty .btn { align-self: center !important; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: var(--r-md);
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* =========================================================
   SaaS pattern
   ========================================================= */
.saas-hero { text-align: center; padding: var(--s-12) 0 var(--s-16); }
.saas-hero .display { margin-top: var(--s-6); }
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 14px;
  font-size: 13px; color: var(--text-muted); border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--r-full);
}
.pill__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.window {
  margin: var(--s-16) auto 0; max-width: 960px; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.window__bar { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-bottom: 1px solid var(--border); background: var(--bg-subtle); }
.window__bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.window__bar span { margin-left: auto; margin-right: auto; font-size: 12px; color: var(--text-faint); font-family: var(--font-mono); transform: translateX(-24px); }
.window__body { display: grid; grid-template-columns: 180px 1fr; min-height: 300px; }
.mock-side { border-right: 1px solid var(--border); padding: var(--s-4) var(--s-3); display: grid; align-content: start; gap: 2px; }
.mock-side__item { font-size: 13px; color: var(--text-muted); padding: 7px 10px; border-radius: var(--r-sm); }
.mock-side__item.is-active { background: var(--surface-2); color: var(--text); font-weight: 550; }
.mock-main { padding: var(--s-6); display: grid; gap: var(--s-6); align-content: start; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); }
.kpi { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-4); display: grid; gap: 2px; }
.kpi span { font-size: 12px; color: var(--text-faint); }
.kpi b { font-size: 22px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi em { font-style: normal; font-size: 12px; font-weight: 550; }
.kpi .up { color: var(--success); }
.kpi .down { color: var(--success); }
.chart { width: 100%; height: 120px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.feature { padding: var(--s-8); }
.feature + .feature { border-left: 1px solid var(--border); }
.feature h4 { font-size: 17px; margin: var(--s-4) 0 var(--s-2); letter-spacing: -0.015em; }
.feature p { margin: 0; font-size: 15px; }
.feature__icon {
  width: 36px; height: 36px; border-radius: var(--r-md); display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}

.code-card { margin-top: var(--s-6); background: var(--ink); border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); }
.code-card__head { display: flex; justify-content: space-between; align-items: center; padding: 8px 8px 8px 18px; border-bottom: 1px solid rgba(255,255,255,.08); color: #8a8c98; font-family: var(--font-mono); font-size: 12px; }
.code-card .btn--ghost { color: #a2a3ae; }
.code-card .btn--ghost:hover { background: rgba(255,255,255,.08); color: #fff; }
.code { margin: 0; padding: 20px 18px; color: #e6e6ea; font-family: var(--font-mono); font-size: 14px; line-height: 1.7; overflow-x: auto; }
.c-k { color: #c4a5ff; } .c-s { color: #8fe3b0; } .c-f { color: #7fb4ff; }

.pricing-head { display: grid; justify-items: center; gap: var(--s-4); margin: var(--s-24) 0 var(--s-8); }
.segmented { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-full); }
.segmented button {
  border: 0; background: transparent; height: 32px; padding: 0 16px; border-radius: var(--r-full);
  font-size: 14px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.segmented button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 550; }
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); align-items: stretch; }
.plan {
  position: relative; display: flex; flex-direction: column; gap: var(--s-2);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-8);
}
.plan--featured { border-color: var(--text); box-shadow: var(--shadow-lg); }
.plan__tag { position: absolute; top: var(--s-6); right: var(--s-6); }
.plan h4 { font-size: 15px; color: var(--text-muted); font-weight: 550; }
.plan__price { margin: var(--s-2) 0 0; display: flex; align-items: baseline; gap: 4px; }
.plan__price b { font-size: 36px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.plan__price span { color: var(--text-faint); font-size: 14px; }
.checklist { list-style: none; margin: var(--s-4) 0 var(--s-6); padding: var(--s-4) 0 0; border-top: 1px solid var(--border); display: grid; gap: 10px; font-size: 14px; flex: 1; align-content: start; }
.checklist li { display: flex; gap: 10px; align-items: center; }
.checklist li::before {
  /* 체크 아이콘을 mask로 그려서 --accent(블루/모노 프리셋)를 그대로 따라가게 함 */
  content: ""; width: 16px; height: 16px; flex: none;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.4l2.8 2.8 6.2-6.4' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.4l2.8 2.8 6.2-6.4' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat;
}

/* =========================================================
   Editorial pattern
   ========================================================= */
.masthead {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: var(--s-4);
  padding-bottom: var(--s-4); border-bottom: 3px solid var(--text);
}
.masthead .small { color: var(--text-muted); }
.masthead .small:last-child { text-align: right; }
.masthead__title { font-family: var(--font-serif); font-weight: 900; font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.02em; line-height: 1; }
.topics { display: flex; gap: var(--s-6); padding: var(--s-3) 0; border-bottom: 1px solid var(--text); font-size: 14px; font-weight: 550; overflow-x: auto; }
.topics a { color: var(--text-muted); white-space: nowrap; }
.topics a:hover, .topics a[aria-current="true"] { color: var(--text); }
.topics a[aria-current="true"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }

.news { display: grid; grid-template-columns: 1.6fr 1fr 0.8fr; gap: 0; margin-top: var(--s-8); }
.news > * { padding: 0 var(--s-6); }
.news > *:first-child { padding-left: 0; }
.news > *:last-child { padding-right: 0; }
.news > * + * { border-left: 1px solid var(--border); }
.lead-story__art { aspect-ratio: 16 / 10; overflow: hidden; margin-bottom: var(--s-6); border-radius: 2px; }
.lead-story__art svg { width: 100%; height: 100%; }
.dek { font-size: 17px; line-height: 1.6; color: var(--text-muted); }
.byline { font-size: 13px; color: var(--text-faint); margin: 0; }
.story { padding: var(--s-6) 0; border-bottom: 1px solid var(--border); }
.story:first-child { padding-top: 0; }
.story:last-child { border-bottom: 0; }
.story .label-mono { margin-bottom: var(--s-2); }
.most-read__title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding-bottom: var(--s-3); border-bottom: 2px solid var(--text); margin-bottom: var(--s-2); }
.most-read ol { list-style: none; counter-reset: mr; margin: 0; padding: 0; }
.most-read li { counter-increment: mr; display: grid; grid-template-columns: 28px 1fr; padding: var(--s-4) 0; border-bottom: 1px solid var(--border); font-family: var(--font-serif); font-weight: 700; font-size: 15px; line-height: 1.45; }
.most-read li::before { content: counter(mr); font-family: var(--font-sans); color: var(--accent); font-weight: 700; }
.most-read a:hover { text-decoration: underline; text-underline-offset: 3px; }

.article { max-width: var(--measure); margin: var(--s-24) auto 0; padding-top: var(--s-12); border-top: 3px solid var(--text); }
.article .serif-xl { font-size: clamp(34px, 5vw, 52px); }
.article .dek { font-size: 20px; }
.article__meta { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-6) 0; margin-bottom: var(--s-8); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 14px; line-height: 1.4; }
.prose { font-family: var(--font-serif); font-size: 18px; line-height: 1.9; }
.prose p { margin-bottom: 1.3em; }
.prose b { font-family: var(--font-sans); font-weight: 650; }
.dropcap::first-letter { float: left; font-size: 3.6em; line-height: .9; font-weight: 900; margin: .08em .12em 0 0; }
.pullquote {
  margin: var(--s-8) 0; padding: var(--s-6) 0; border-top: 1px solid var(--text); border-bottom: 1px solid var(--text);
  font-family: var(--font-serif); font-weight: 700; font-size: 26px; line-height: 1.4; letter-spacing: -0.01em; color: var(--accent);
}

/* Editorial headline variant — Sans (기본, TR 실측: Grotesk 600–700)
   .editorial--serif 를 붙이면 세리프 제목으로 전환 */
.mode-editorial:not(.editorial--serif) :is(.serif-xl, .serif-md, .masthead__title, .most-read li, .pullquote) {
  font-family: var(--font-sans);
  font-weight: 650;
  letter-spacing: -0.025em;
}
.mode-editorial:not(.editorial--serif) .serif-xl { line-height: 1.1; }
.mode-editorial:not(.editorial--serif) .masthead__title { font-weight: 700; letter-spacing: -0.04em; }
.mode-editorial:not(.editorial--serif) .most-read li { font-weight: 550; letter-spacing: -0.01em; }

/* Demo controls — 섹션 안에서 변형을 바꿔보는 작은 툴바 */
.demo-controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3);
  margin: 0 0 var(--s-8); font-size: 13px; color: var(--text-muted);
}
.demo-controls .segmented button { height: 28px; padding: 0 12px; font-size: 13px; }

/* =========================================================
   Principles / Footer
   ========================================================= */
.principles { list-style: none; counter-reset: p; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.principles li {
  counter-increment: p; display: grid; gap: var(--s-2); padding: var(--s-6);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
}
.principles li::before { content: "0" counter(p); font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }
.principles b { font-size: 17px; letter-spacing: -0.015em; }
.principles span { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

.footer { border-top: 1px solid var(--border); padding: var(--s-12) 0; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.footer p { margin: 0; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 960px) {
  .nav__links { display: none; }
  .news { grid-template-columns: 1fr 1fr; }
  .news > .most-read { grid-column: 1 / -1; border-left: 0; padding: var(--s-8) 0 0; }
  .pricing, .principles { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .feature + .feature { border-left: 0; border-top: 1px solid var(--border); }
}
@media (max-width: 720px) {
  .container { padding: 0 var(--s-4); }
  .hero { padding: var(--s-16) var(--s-4) var(--s-12); }
  .hero__meta { grid-template-columns: 1fr 1fr; }
  .section { padding: var(--s-16) 0; }
  .section__head { grid-template-columns: 1fr; gap: var(--s-2); }
  .section__num { padding: 0; }
  .grid-2, .comp-grid { grid-template-columns: 1fr; }
  .type-row { grid-template-columns: 1fr; gap: var(--s-2); }
  .window__body { grid-template-columns: 1fr; }
  .mock-side { display: none; }
  .kpis { grid-template-columns: 1fr 1fr 1fr; gap: var(--s-2); }
  .kpi b { font-size: 16px; }
  .news { grid-template-columns: 1fr; }
  .news > * { padding: 0 !important; border-left: 0 !important; }
  .story-list { margin-top: var(--s-8); padding-top: var(--s-6) !important; border-top: 1px solid var(--border); }
  .masthead { grid-template-columns: 1fr; text-align: center; }
  .masthead .small { display: none; }
  .radii { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
  html { scroll-behavior: auto; }
}
