/* ==========================================================
   Design tokens
   Concept: 정책 문서 · 관인(官印) 서류철 + 개발자 터미널
   ========================================================== */
:root {
  --bg: #0f1410;
  --surface: #171d18;
  --surface-2: #1e2620;
  --line: #2b332c;
  --gold: #b08d57;
  --gold-soft: #8f7245;
  --pine: #4a6a5f;
  --text: #ede7da;
  --text-muted: #8c9186;
  --seal-red: #8c3b32;

  --font-display: "Noto Serif KR", serif;
  --font-body: "Pretendard", "Noto Sans KR", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --radius: 2px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------------- Tabs (folder navigation) ---------------- */
.tabs {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  gap: 2px;
  padding: 0 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  color: var(--text-muted);
  font-size: 14px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tab:hover { color: var(--text); }

.tab-code {
  font-size: 11px;
  color: var(--gold);
  border: 1px solid var(--gold-soft);
  padding: 1px 5px;
  border-radius: var(--radius);
}

/* ---------------- Cover / overview ---------------- */
.cover {
  position: relative;
  padding: 96px 24px 72px;
  max-width: 760px;
  margin: 0 auto;
}

.stamp {
  position: absolute;
  top: 40px;
  right: 24px;
  width: 92px;
  height: 92px;
  opacity: 0.9;
}

.stamp svg { width: 100%; height: 100%; }

.stamp-ring {
  fill: none;
  stroke: var(--seal-red);
  stroke-width: 2.5;
}

.stamp-ring-inner {
  fill: none;
  stroke: var(--seal-red);
  stroke-width: 1;
}

.stamp-glyph {
  fill: var(--seal-red);
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin: 0 0 12px;
}

.cover h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 7vw, 64px);
  font-weight: 700;
  margin: 0 0 24px;
  letter-spacing: -0.01em;
}

.lede {
  font-size: 17px;
  color: var(--text);
  max-width: 60ch;
  margin: 0 0 12px;
}

.lede-sub {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 58ch;
  margin: 0 0 40px;
}

.timeline {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.t-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
}

.t-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}

/* ---------------- Departments (sections) ---------------- */
main { max-width: 960px; margin: 0 auto; padding: 0 24px; }

.dept {
  padding: 64px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 60px;
}

.dept-head { max-width: 640px; margin-bottom: 36px; }

.dept-code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.1em;
}

.dept-head h2 {
  font-family: var(--font-display);
  font-size: 32px;
  margin: 8px 0 12px;
}

.dept-desc { color: var(--text-muted); font-size: 15px; margin: 0; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover {
  border-color: var(--gold-soft);
  transform: translateY(-2px);
}

.card-tag {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--pine);
  background: rgba(74, 106, 95, 0.12);
  padding: 2px 8px;
  border-radius: var(--radius);
  letter-spacing: 0.04em;
}

.card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 0;
}

.card p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

.card-link {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.card-placeholder {
  border-style: dashed;
  opacity: 0.6;
}

.sub-dept {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px dashed var(--line);
}

.sub-dept-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 16px;
}

/* ---------------- Contact (fixed footer section) ---------------- */
.contact {
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  padding: 72px 24px 56px;
}

.contact-inner { max-width: 520px; margin: 0 auto; }

.contact h2 {
  font-family: var(--font-display);
  font-size: 28px;
  margin: 8px 0 8px;
}

.contact-desc {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 28px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-row {
  display: flex;
  gap: 12px;
}

.field-row input {
  flex: 1;
  min-width: 0;
}

input, textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 12px 14px;
  resize: vertical;
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }

input:focus, textarea:focus, button:focus, a:focus {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

button[type="submit"] {
  align-self: flex-start;
  background: var(--gold);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  padding: 12px 22px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

button[type="submit"]:hover { background: var(--gold-soft); }
button[type="submit"]:disabled { opacity: 0.5; cursor: not-allowed; }

.form-status {
  font-size: 13px;
  color: var(--text-muted);
  min-height: 18px;
  margin: 0;
}

.contact-alt {
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------------- Motion / accessibility ---------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card { transition: none; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 560px) {
  .tabs { padding: 0 12px; }
  .tab { padding: 12px 10px; font-size: 13px; }
  .cover { padding: 72px 16px 48px; }
  .stamp { width: 64px; height: 64px; top: 24px; right: 16px; }
  main { padding: 0 16px; }
  .field-row { flex-direction: column; }
}
