:root {
  --navy-900: #0b1b4d;
  --navy-800: #112867;
  --navy-700: #1b3a8f;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-500: #64748b;
  --slate-300: #cbd5e1;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --white: #ffffff;
  --amber-400: #fbbf24;

  --font-sans: "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Noto Serif KR", Georgia, serif;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 12px;
  --max-width: 1100px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--slate-900);
  background: var(--white);
  line-height: 1.7;
}

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

a {
  color: var(--blue-600);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--navy-900);
  color: var(--white);
  padding: 8px 16px;
  z-index: 100;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

.container {
  width: min(100% - 32px, var(--max-width));
  margin-inline: auto;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--slate-100);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--slate-900);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.brand-school {
  font-size: 12px;
  color: var(--slate-500);
}

.brand-name {
  font-size: 18px;
  color: var(--navy-900);
}

.nav-list {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  font-size: 15px;
  font-weight: 500;
  color: var(--slate-700);
}

.nav-list a:hover {
  color: var(--navy-900);
}

.nav-highlight {
  color: var(--navy-900) !important;
  font-weight: 700 !important;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 3px;
  width: 24px;
  background: var(--navy-900);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 860px) {
  .menu-toggle {
    display: flex;
  }

  .main-nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--slate-100);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .main-nav.open {
    max-height: 300px;
  }

  .nav-list {
    flex-direction: column;
    gap: 0;
    padding: 8px 24px 24px;
  }

  .nav-list a {
    display: block;
    padding: 12px 0;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  border: none;
  transition: transform 0.1s, box-shadow 0.2s, background 0.2s;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-primary {
  background: var(--navy-900);
  color: var(--white);
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  background: var(--navy-800);
}

.btn-secondary {
  background: var(--white);
  color: var(--navy-900);
  border: 1px solid var(--slate-300);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--slate-50);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 8px 16px;
  font-size: 13px;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ---------- Hero ---------- */
.hero {
  padding: 80px 0 90px;
  background: linear-gradient(180deg, var(--blue-50) 0%, var(--white) 100%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 40px;
}

.hero-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--navy-900);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.25;
  margin: 0 0 20px;
  color: var(--navy-900);
}

.hero h1 strong {
  color: var(--blue-600);
}

.hero p {
  font-size: 18px;
  color: var(--slate-700);
  margin: 0 0 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-emblem {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-emblem img {
  width: min(280px, 80%);
  filter: drop-shadow(0 12px 24px rgba(11, 27, 77, 0.15));
  border-radius: 50%;
}

@media (max-width: 760px) {
  .hero {
    padding: 48px 0 60px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-emblem {
    order: -1;
  }

  .hero-emblem img {
    width: 140px;
  }
}

/* ---------- Sections ---------- */
.section {
  padding: 78px 0;
}

.section-tint {
  background: var(--slate-50);
}

.section-navy {
  background: var(--navy-900);
  color: var(--white);
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(26px, 4vw, 34px);
  text-align: center;
  margin: 0 0 16px;
  color: var(--navy-900);
}

.section-title.light {
  color: var(--white);
}

.section-subtitle {
  text-align: center;
  color: var(--slate-500);
  max-width: 720px;
  margin: 0 auto 38px;
}

.section-subtitle.light {
  color: rgba(255, 255, 255, 0.75);
}

/* ---------- Intro cards ---------- */
.intro-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.intro-card {
  background: var(--white);
  border: 1px solid var(--slate-100);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.intro-card h3 {
  margin: 0 0 12px;
  font-size: 18px;
  color: var(--navy-900);
}

.intro-card p {
  margin: 0;
  color: var(--slate-700);
}

@media (max-width: 780px) {
  .intro-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Benefits ---------- */
.benefit-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.benefit-list li {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px 26px;
  box-shadow: var(--shadow-sm);
}

.benefit-list li::before {
  content: "✓";
  position: absolute;
  left: 12px;
  top: 10px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--navy-900);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
}

.benefit-list strong {
  display: block;
  color: var(--navy-900);
  font-size: 17px;
  margin-bottom: 6px;
  padding-left: 30px;
}

.benefit-list span {
  display: block;
  color: var(--slate-700);
  font-size: 15px;
  padding-left: 30px;
}

@media (max-width: 760px) {
  .benefit-list {
    grid-template-columns: 1fr;
  }
}

/* ---------- Process ---------- */
.process-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  counter-reset: step;
}

.process-list li {
  background: var(--white);
  border: 1px solid var(--slate-100);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}

.process-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--navy-900);
  color: var(--white);
  font-weight: 700;
  margin-bottom: 14px;
}

.process-list h3 {
  margin: 0 0 10px;
  color: var(--navy-900);
  font-size: 17px;
}

.process-list p {
  margin: 0;
  color: var(--slate-700);
  font-size: 15px;
}

@media (max-width: 900px) {
  .process-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .process-list {
    grid-template-columns: 1fr;
  }
}

/* ---------- Constitution ---------- */
.law-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.law-search {
  flex: 1 1 260px;
  padding: 12px 18px;
  border-radius: 999px;
  border: none;
  font-size: 15px;
  outline: none;
  box-shadow: var(--shadow-sm);
}

.law-search:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

.law-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
}

.chapter-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.2);
}

.chip.active {
  background: var(--white);
  color: var(--navy-900);
  border-color: var(--white);
  font-weight: 700;
}

.law-document {
  background: var(--white);
  color: var(--slate-900);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}

.chapter {
  border: 1px solid var(--slate-100);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.chapter-header {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 16px 20px;
  background: var(--slate-50);
  border: none;
  color: var(--navy-900);
  font-size: 17px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
}

.chapter-header:hover {
  background: var(--blue-50);
}

.chapter-title {
  flex: 1;
}

.chapter-count {
  font-size: 13px;
  color: var(--slate-500);
  font-weight: 500;
}

.chapter-toggle {
  font-size: 13px;
  color: var(--slate-500);
}

.chapter-body {
  padding: 0 20px;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}

.chapter.open .chapter-body {
  grid-template-rows: 1fr;
}

.chapter-body > div {
  overflow: hidden;
}

.article {
  padding: 16px 0;
  border-bottom: 1px solid var(--slate-100);
}

.article:last-child {
  border-bottom: none;
}

.article.highlight {
  background: #fff8c5;
  margin: 0 -20px;
  padding: 16px 20px;
  border-bottom-color: var(--amber-400);
}

.article-number {
  display: inline-block;
  margin-bottom: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--navy-900);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
}

.article-title {
  font-weight: 700;
  color: var(--navy-900);
  margin-bottom: 6px;
}

.article-content {
  margin: 0;
  color: var(--slate-700);
}

.law-error {
  background: #fff1f2;
  color: #881337;
  border-radius: var(--radius);
  padding: 22px 26px;
}

.law-error ul {
  padding-left: 20px;
  margin: 12px 0 0;
}

.law-error li {
  margin-bottom: 8px;
}

.law-error code {
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
}

.loading {
  text-align: center;
  color: var(--slate-500);
  padding: 30px;
}

.no-result {
  text-align: center;
  color: var(--slate-500);
  padding: 30px 10px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--slate-50);
  padding: 52px 0 36px;
  text-align: center;
  border-top: 1px solid var(--slate-100);
}

.footer-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
}

.site-footer p {
  margin: 6px 0;
  color: var(--slate-700);
}

.copyright {
  font-size: 13px;
  color: var(--slate-500);
  margin-top: 18px;
}

/* ---------- Top button ---------- */
.top-button {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--navy-900);
  color: var(--white);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 40;
}

.top-button.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.top-button:hover {
  background: var(--navy-700);
}

@media print {
  .site-header,
  .menu-toggle,
  .top-button,
  .hero-actions,
  .law-toolbar,
  .chapter-filters {
    display: none !important;
  }

  .chapter-body {
    grid-template-rows: 1fr !important;
  }

  body {
    color: #000;
  }
}
