:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-soft: #f2f5f8;
  --text: #191f28;
  --muted: #6b7684;
  --line: #e5e8eb;
  --blue: #3182f6;
  --blue-soft: #e8f3ff;
  --mint: #00b894;
  --coral: #ff6f61;
  --yellow: #f5bd22;
  --shadow: 0 14px 36px rgba(25, 31, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 clamp(20px, 5vw, 56px);
  background: rgba(247, 248, 250, 0.82);
  border-bottom: 1px solid rgba(229, 232, 235, 0.72);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: var(--blue);
  color: white;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.2;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.profile-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
}

.icon-button span {
  font-size: 24px;
  transform: translateY(-1px);
}

.profile-button {
  background: #243242;
  color: white;
  font-weight: 800;
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0 12px;
}

.hero {
  position: relative;
  display: grid;
  min-height: 132px;
  overflow: hidden;
  align-items: center;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.86) 45%, rgba(255, 255, 255, 0.28) 100%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  padding: clamp(20px, 3vw, 30px) clamp(24px, 5vw, 42px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 3.5vw, 42px);
  line-height: 1.06;
  font-weight: 800;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-panel {
  margin: 16px 0;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(25, 31, 40, 0.04);
}

.search-box span {
  color: var(--muted);
  font-size: 23px;
  transform: translateY(-1px);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.search-box input::placeholder {
  color: #8b95a1;
}

.department-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.department-card {
  min-height: 238px;
  padding: 14px;
  border: 1px solid rgba(229, 232, 235, 0.88);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(25, 31, 40, 0.04);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.card-icon {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 14px;
  color: var(--accent);
  background: var(--accent-bg);
}

.card-icon svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-kicker {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.department-card h3 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.25;
}

.link-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.portal-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-height: 33px;
  padding: 0 8px 0 10px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: #333d4b;
  font-size: 13px;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.portal-link span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-link:hover,
.portal-link:focus-visible {
  background: var(--accent-bg);
  color: var(--accent);
  transform: translateY(-1px);
  outline: none;
}

.portal-link span:last-child {
  display: grid;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.76);
}

.credit {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto 18px;
  color: #8b95a1;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.department-card[hidden] {
  display: none;
}

@media (max-width: 980px) {
  .department-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .topbar {
    height: 64px;
    padding: 0 16px;
  }

  main {
    width: min(100% - 24px, 1120px);
    padding-top: 14px;
  }

  .brand small {
    display: none;
  }

  .hero {
    min-height: 132px;
    border-radius: 16px;
  }

  .hero::after {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.86) 64%, rgba(255, 255, 255, 0.4) 100%);
  }

  .hero-copy {
    align-self: start;
    padding: 18px;
  }

  h1 {
    font-size: 28px;
  }

  .department-grid {
    grid-template-columns: 1fr;
  }

  .department-card {
    min-height: auto;
  }
}
