/* ==========================================================
   Design tokens — neutral grayscale, light/dark adaptive
   ========================================================== */
:root {
  --bg: #ffffff;
  --surface: #f6f6f6;
  --border: #e4e4e4;
  --text: #141414;
  --text-muted: #6f6f6f;
  --overlay: rgba(0, 0, 0, 0.5);

  --font-body: "Pretendard", "Noto Sans KR", sans-serif;
  --radius: 2px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101010;
    --surface: #1a1a1a;
    --border: #2c2c2c;
    --text: #f2f2f2;
    --text-muted: #9a9a9a;
    --overlay: rgba(0, 0, 0, 0.7);
  }
}

* { 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: inherit; text-decoration: none; }

/* ---------------- Nav ---------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 20px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.nav-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.nav-links { display: flex; gap: 22px; }

.nav-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); }

.nav-contact { margin-left: auto; }

/* ---------------- Hero ---------------- */
.hero {
  padding: 120px 24px 96px;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  font-size: clamp(36px, 6vw, 52px);
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

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

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

.dept {
  padding: 56px 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: 72px;
}

.dept h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 28px;
}

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

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

.card:hover { border-color: var(--text-muted); }

.card-tag {
  align-self: flex-start;
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: var(--radius);
}

.card h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.card-link {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-muted);
}

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

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

.sub-dept {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px dashed var(--border);
}

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

/* ---------------- Contact (modal, opened via nav button) ---------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--overlay);
}

.modal-overlay[hidden] { display: none; }

.modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 28px 28px;
}

.modal h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 20px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 6px 10px;
}

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

.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(--border);
  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(--text-muted);
  outline-offset: 2px;
}

button[type="submit"] {
  align-self: flex-start;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  padding: 11px 20px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

button[type="submit"]:hover { opacity: 0.8; }
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: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.contact-alt a { color: var(--text); }

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

/* ---------------- Responsive ---------------- */
@media (max-width: 560px) {
  .nav { padding: 16px; gap: 16px; }
  .nav-links { gap: 14px; }
  .hero { padding: 80px 16px 64px; }
  main { padding: 0 16px 64px; }
  .field-row { flex-direction: column; }
}
