:root {
  --bg: #f6f8fb;
  --bg-elev: #ffffff;
  --bg-soft: #eef3f8;
  --ink: #0f2438;
  --ink-soft: #3a4a5d;
  --ink-muted: #6b7a8d;
  --line: #d9e2ec;
  --line-strong: #c2cfdd;
  --accent: #1457c9;
  --accent-soft: #e6efff;
  --accent-2: #1fb6a6;
  --accent-2-soft: #e3f6f3;
  --shadow-sm: 0 1px 2px rgba(15, 36, 56, 0.06);
  --shadow-md: 0 6px 18px rgba(15, 36, 56, 0.08);
  --shadow-lg: 0 18px 40px rgba(15, 36, 56, 0.10);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --maxw: 1140px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 10px 16px; z-index: 100; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; color: #fff; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(246, 248, 251, 0.85); backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; color: var(--accent); }
.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.primary-nav a { display: inline-block; padding: 8px 14px; border-radius: 999px; color: var(--ink-soft); font-weight: 500; font-size: 0.95rem; }
.primary-nav a:hover { background: var(--bg-soft); text-decoration: none; }
.primary-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle-bar { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero */
.hero { padding: 64px 0 48px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--accent-2-soft); color: #0c6b60; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.02em; }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); }
h1.hero-title { font-size: clamp(2.1rem, 4vw, 3.1rem); line-height: 1.12; margin: 18px 0 16px; letter-spacing: -0.02em; }
.hero-lede { font-size: 1.12rem; color: var(--ink-soft); max-width: 56ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 10px; font-weight: 600; font-size: 0.98rem; border: 1px solid transparent; cursor: pointer; transition: transform .12s, box-shadow .12s, background .12s; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: #1040a8; }
.btn-secondary { background: var(--bg-elev); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--bg-soft); }
.btn-accent { background: var(--accent-2); color: #fff; }
.btn-accent:hover { background: #16988a; }
.btn-ghost { background: transparent; color: var(--accent); padding: 10px 16px; }
.hero-art { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); border: 1px solid var(--line); background: var(--bg-elev); }

/* Sections */
.section { padding: 56px 0; }
.section.tight { padding: 40px 0; }
.section-head { max-width: 64ch; margin-bottom: 28px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-title { font-size: clamp(1.6rem, 2.4vw, 2.1rem); letter-spacing: -0.015em; margin: 0 0 12px; }
.section-lede { color: var(--ink-soft); font-size: 1.05rem; }
.alt-bg { background: var(--bg-elev); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* Cards grid */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s, border-color .15s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.card-media { aspect-ratio: 16/9; background: var(--bg-soft); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 0.8rem; color: var(--ink-muted); }
.tag { padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 0.76rem; }
.tag.alt { background: var(--accent-2-soft); color: #0c6b60; }
.card-title { font-size: 1.18rem; margin: 0; letter-spacing: -0.01em; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-summary { color: var(--ink-soft); margin: 0; font-size: 0.96rem; }
.card-foot { margin-top: auto; padding-top: 6px; }
.card-link { font-weight: 600; font-size: 0.92rem; }

/* Pathway */
.pathway { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: step; }
.pathway-step { position: relative; padding: 22px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-md); counter-increment: step; }
.pathway-step::before { content: counter(step); display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; margin-bottom: 12px; }
.pathway-step h3 { margin: 0 0 6px; font-size: 1.05rem; }
.pathway-step p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }

/* App / feature */
.app-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center; }
.feature-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 14px; }
.feature-list li { display: flex; gap: 12px; align-items: flex-start; }
.feature-list .dot { flex: 0 0 10px; width: 10px; height: 10px; margin-top: 8px; border-radius: 50%; background: var(--accent-2); }
.feature-list strong { display: block; margin-bottom: 2px; }
.feature-list span { color: var(--ink-soft); font-size: 0.95rem; }

/* Article */
.article-layout { display: grid; grid-template-columns: 1fr 280px; gap: 40px; align-items: start; }
.article-body { font-size: 1.04rem; }
.article-body h2 { margin-top: 36px; letter-spacing: -0.01em; }
.article-body h3 { margin-top: 26px; }
.article-body p, .article-body li { color: var(--ink-soft); }
.callout { padding: 18px 20px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 24px 0; }
.callout.alt { border-color: var(--accent-2); background: var(--accent-2-soft); }
.callout .callout-label { font-weight: 700; color: var(--ink); display: block; margin-bottom: 4px; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; }
.callout p { margin: 0; color: var(--ink); }
.toc { position: sticky; top: 92px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 18px 20px; }
.toc h2 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted); margin: 0 0 10px; }
.toc ol { margin: 0; padding-left: 18px; font-size: 0.9rem; }
.toc a { color: var(--ink-soft); }
.related { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.related h2 { font-size: 1.2rem; }
.related ul { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.related a { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); font-size: 0.9rem; }
.related a:hover { background: var(--bg-soft); text-decoration: none; }

/* Diagrams */
.diagram { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 24px; margin: 24px 0; }
.diagram svg { width: 100%; height: auto; display: block; }
.diagram figcaption { text-align: center; color: var(--ink-muted); font-size: 0.86rem; margin-top: 12px; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; background: var(--bg-elev); font-size: 0.94rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
th { background: var(--bg-soft); font-weight: 600; color: var(--ink); }
tr:last-child td { border-bottom: 0; }

/* Forms */
.form-card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-sm); max-width: 640px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.95rem; }
.field .hint { color: var(--ink-muted); font-size: 0.86rem; font-weight: 400; }
.field input, .field textarea, .field select { width: 100%; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 10px; font: inherit; background: #fff; color: var(--ink); }
.field input.invalid, .field textarea.invalid { border-color: #c0392b; background: #fdf3f1; }
.field-error { display: none; color: #b03a2e; font-size: 0.86rem; margin-top: 6px; }
.field-error.show { display: block; }
.form-status { margin-top: 14px; padding: 12px 16px; border-radius: 10px; font-size: 0.95rem; }
.form-status.ok { background: var(--accent-2-soft); color: #0c6b60; }
.form-status.err { background: #fdf3f1; color: #b03a2e; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.details-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.details-list li { padding: 16px 18px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-md); }
.details-list .label { display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-muted); margin-bottom: 4px; }

/* Legal prose */
.prose { max-width: 760px; }
.prose h2 { margin-top: 36px; letter-spacing: -0.01em; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--ink-soft); }
.prose ul { padding-left: 20px; }

/* 404 */
.notfound { text-align: center; padding: 96px 0; }
.notfound .code { font-family: var(--font-mono); font-size: clamp(4rem, 12vw, 7rem); color: var(--accent); margin: 0; letter-spacing: -0.04em; }
.notfound .actions { display: flex; gap: 12px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }

/* Footer */
.site-footer { background: #0c1d33; color: #c8d4e3; margin-top: 40px; border-top: 1px solid #0a1729; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding: 48px 24px 32px; }
.footer-tagline { color: #9fb2c8; margin: 0 0 16px; max-width: 46ch; font-size: 0.96rem; }
.footer-address { font-style: normal; color: #c8d4e3; font-size: 0.92rem; line-height: 1.7; }
.footer-address a { color: #fff; }
.footer-heading { color: #fff; font-weight: 600; margin: 0 0 12px; font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.06em; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-nav a { color: #c8d4e3; font-size: 0.92rem; }
.footer-nav a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1a2c45; padding: 20px 24px; display: flex; flex-direction: column; gap: 8px; }
.footer-disclaimer { color: #8aa0bb; font-size: 0.84rem; margin: 0; max-width: 90ch; }
.footer-copy { color: #8aa0bb; font-size: 0.84rem; margin: 0; }

/* Cookie banner */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: #0c1d33; color: #e6eefb; border-top: 1px solid #1a2c45; box-shadow: var(--shadow-lg); }
.cookie-banner[hidden] { display: none; }
.cookie-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 24px; flex-wrap: wrap; }
.cookie-inner p { margin: 0; font-size: 0.92rem; max-width: 70ch; color: #c8d4e3; }
.cookie-inner a { color: #fff; text-decoration: underline; }
.cookie-actions { display: flex; gap: 10px; }
.cookie-actions button { padding: 10px 18px; border-radius: 8px; border: 1px solid #2a3f5c; background: #16314f; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.cookie-actions button[data-cookie-accept] { background: var(--accent); border-color: var(--accent); }
.cookie-actions button:hover { transform: translateY(-1px); }

/* Responsive */
@media (max-width: 960px) {
  .hero-grid, .app-grid, .contact-grid { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .pathway { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; }
  .toc { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .primary-nav { position: absolute; top: 68px; left: 0; right: 0; background: var(--bg-elev); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md); padding: 12px 24px 20px; transform: translateY(-12px); opacity: 0; pointer-events: none; transition: transform .2s, opacity .2s; }
  .primary-nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .primary-nav ul { flex-direction: column; gap: 4px; }
  .primary-nav a { display: block; padding: 12px 14px; }
  .grid-2, .grid-3, .grid-4, .pathway { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 40px 0 32px; }
  .section { padding: 40px 0; }
  .form-card { padding: 22px; }
}
