:root {
  /* --- Brand palette --------------------------------------------------- */
  --navy: #234C74;
  --navy-hover: #1a3a5c;
  --navy-deep: #14273e;
  --yellow-soft: #fff7d1;
  --yellow-mid: #ffe680;
  --yellow-ink: #7a5e00;

  /* --- Surfaces / bg --------------------------------------------------- */
  --bg: #eef2f6;            /* light gray-blue body bg (white nav pops) */
  --surface: #ffffff;
  --surface-alt: #f5f6f8;
  --surface-hover: #e4eaf0;
  --surface-tint: #e3ebf3;

  /* --- Ink ------------------------------------------------------------- */
  --ink: #14273e;
  --ink-soft: #3d4a5f;
  --muted: #6b7688;

  /* --- Semantic -------------------------------------------------------- */
  --primary: var(--navy);
  --primary-hover: var(--navy-hover);
  --accent: var(--yellow-soft);
  --danger: #b3352d;
  --success: #2a7a45;

  /* --- Shape ----------------------------------------------------------- */
  --radius-sm: 2px;
  --radius: 4px;
  --radius-lg: 6px;

  /* --- Type (OS default: 맑은 고딕 on Windows, system on others) --------- */
  --sans: "Malgun Gothic", "맑은 고딕", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Apple SD Gothic Neo", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  min-height: 100%;
  scroll-padding-top: 96px;
  scroll-behavior: smooth;
}

/* JS가 헤더/푸터를 이 slot div 안에 렌더링하는데, 래퍼 div가 sticky의
   containing block이 되어 헤더 높이만큼만 붙어버림. display: contents로
   div를 레이아웃에서 제거해서 .site-header의 containing block이 body가
   되도록 한다. */
[data-header], [data-footer] { display: contents; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  font-weight: 400;
  font-feature-settings: "ss01", "cv11";
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--sans);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
h1 { font-size: clamp(1.9rem, 3.2vw, 2.8rem); }
h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
h3 { font-size: 1.15rem; font-weight: 600; }
p { color: var(--ink-soft); }

/* Full-bleed container — fills the whole viewport width. */
.container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 48px;
}
@media (max-width: 720px) { .container { padding: 0 20px; } }

/* --- Header ------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #fff;
  color: var(--ink);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 96px;
  gap: 32px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
  color: var(--ink);
}
.brand-logo {
  height: 96px;
  width: auto;
  display: block;
  object-fit: contain;
}
.brand-name {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1;
}
.brand-name b { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; color: var(--ink); line-height: 1; }
.brand-name small {
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 3px;
  font-weight: 500;
  line-height: 1;
}

.nav {
  flex: 1;
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: space-evenly;
}
.nav a {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: 16px;
  font-weight: 700;
  transition: color .12s, background .12s;
}
.nav a:hover { color: var(--ink); }
.nav a.active {
  color: var(--navy);
  font-weight: 700;
  background: var(--yellow-soft);
}

.auth-nav { display: flex; gap: 8px; align-items: center; color: var(--ink); }

/* 헤더 안의 로그인/회원가입/관리자/로그아웃 버튼은 네비 링크와 같은 톤/사이즈
   로 맞춰서 둥근 테두리 없이 각지게 표시. */
.site-header .btn {
  font-size: 16px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 0;
}

/* --- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--sans);
  border: 0;
  cursor: pointer;
  transition: background .12s, color .12s;
  background: transparent;
  color: inherit;
  line-height: 1;
  text-decoration: none;
  letter-spacing: -0.005em;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-hover); }
.btn-outline { background: var(--surface-alt); color: var(--ink); }
.btn-outline:hover { background: var(--surface-hover); color: var(--navy); }
.btn-ghost { color: var(--ink-soft); }
.btn-ghost:hover { background: var(--surface-alt); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { display: flex; width: 100%; justify-content: center; padding: 12px 18px; }

/* --- Hero -------------------------------------------------------------- */
.hero {
  padding: 96px 0 64px;
}
.hero .eyebrow {
  display: inline-block;
  font-size: 16px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 22px;
  font-weight: 700;
  position: relative;
  padding-bottom: 8px;
}
.hero .eyebrow::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 40px; height: 3px;
  background: var(--yellow-mid);
}
.hero h1 { max-width: 820px; margin-bottom: 20px; }
.hero p { max-width: 640px; font-size: 1rem; margin-bottom: 28px; color: var(--ink-soft); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Full-viewport hero with photo background. Fills the screen below the
   sticky navbar so the next section (What we do) appears on scroll. */
.hero-full {
  min-height: calc(100vh - 96px);
  padding: 0;
  display: flex;
  align-items: center;
  color: #fff;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.hero-full h1 { color: #fff; max-width: 820px; }
.hero-full p { color: rgba(255, 255, 255, 0.92); max-width: 640px; }
.hero-full .eyebrow { color: #fff; }
.hero-full .eyebrow::after { background: var(--yellow-mid); }
.hero-full .btn-primary { background: #fff; color: var(--navy); }
.hero-full .btn-primary:hover { background: var(--yellow-soft); color: var(--navy); }
.hero-full .btn-outline { background: rgba(255, 255, 255, 0.14); color: #fff; }
.hero-full .btn-outline:hover { background: rgba(255, 255, 255, 0.26); color: #fff; }

/* Wide image banner (25:9) — used for subpage headers. Shorter than 16:9
   so the section doesn't dominate the viewport. */
.hero-banner {
  aspect-ratio: 25 / 9;
  padding: 0 0 40px;
  color: #fff;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: flex-end;
}
.hero-banner h1, .hero-banner .eyebrow { color: #fff; }
.hero-banner p { color: rgba(255, 255, 255, 0.92); }
.hero-banner .eyebrow::after { background: var(--yellow-mid); }

/* --- Sections ---------------------------------------------------------- */
.section { padding: 72px 0; }
.section-full {
  min-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 0;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.section-head .eyebrow {
  font-size: 16px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 10px;
  font-weight: 700;
}
.section-head h2 { color: var(--ink); }
.section-head p { max-width: 540px; color: var(--ink-soft); font-size: 14px; }

/* --- Cards / grid ------------------------------------------------------ */
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface-alt);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 32px;
  transition: background .12s;
}
.card:hover { background: var(--surface-hover); }
.card h3 { color: var(--ink); margin-bottom: 8px; }
.card p { color: var(--ink-soft); font-size: 14px; }
.card .meta {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 14px;
  font-weight: 600;
}
.card .card-cta {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--navy);
  font-weight: 600;
  font-size: 13px;
}

/* Single-word focus card: one large centered term with a supporting line. */
.card-word {
  text-align: center;
  padding: 56px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}
.card-word .word {
  font-size: clamp(2rem, 3.4vw, 2.6rem);
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.card-word p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 320px;
  margin: 0 auto;
}

/* --- Notice list ------------------------------------------------------- */
.notice-list { }
.notice-item {
  display: grid;
  grid-template-columns: 90px 1fr 110px 110px 90px;
  align-items: center;
  padding: 18px 12px;
  gap: 20px;
  cursor: pointer;
  transition: background .12s;
  color: var(--ink);
}
.notice-item:hover { background: var(--surface-alt); }
.notice-item .tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0.02em;
  justify-self: start;
  font-weight: 500;
}
.notice-item .tag.important {
  background: var(--yellow-soft);
  color: var(--yellow-ink);
  font-weight: 600;
}
.notice-item .title { font-weight: 500; font-size: 15px; color: var(--ink); }
.notice-item .date { color: var(--muted); font-size: 13px; }
.notice-item .author { color: var(--muted); font-size: 13px; }
.notice-item .views { color: var(--muted); font-size: 13px; text-align: right; }
@media (max-width: 720px) {
  .notice-item { grid-template-columns: 80px 1fr; }
  .notice-item .date, .notice-item .author, .notice-item .views { display: none; }
}

/* --- Filter row / tabs ------------------------------------------------- */
.filter-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 24px;
}
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab {
  padding: 8px 16px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-family: var(--sans);
  font-weight: 500;
  border-radius: var(--radius);
  transition: color .12s, background .12s;
}
.tab:hover { color: var(--ink); background: var(--surface-alt); }
.tab.active { color: var(--navy); background: var(--yellow-soft); font-weight: 700; }

.search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--surface-alt);
  min-width: 240px;
}
.search input {
  border: 0; outline: 0; background: transparent;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  width: 100%;
}
.search input::placeholder { color: var(--muted); }

/* --- Forms ------------------------------------------------------------- */
.form-wrap {
  min-height: calc(100vh - 96px - 200px);
  display: grid;
  place-items: center;
  padding: 64px 24px;
}
.form-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface-alt);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 40px;
}
.form-card h1 { font-size: 1.6rem; margin-bottom: 6px; color: var(--ink); font-weight: 700; }
.form-card .sub { color: var(--muted); margin-bottom: 26px; font-size: 14px; }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 7px;
  font-weight: 500;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--sans);
  font-size: 14.5px;
  color: var(--ink);
  transition: box-shadow .12s, background .12s;
}
.field textarea { resize: vertical; min-height: 100px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 0;
  box-shadow: 0 0 0 2px var(--navy);
}
.field .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.field .err { font-size: 12px; color: var(--danger); margin-top: 6px; display: none; }
.field.error input, .field.error select { box-shadow: 0 0 0 2px var(--danger); }
.field.error .err { display: block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

.form-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.form-footer a { color: var(--navy); font-weight: 600; }

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 18px;
}
.alert-danger { background: #fbeceb; color: #7a1c19; }
.alert-success { background: #eaf5ee; color: #234f2f; }
.alert-info { background: var(--yellow-soft); color: var(--yellow-ink); }

/* --- Footer ------------------------------------------------------------ */
.site-footer {
  padding: 40px 0;
  margin-top: 80px;
  background: var(--surface-alt);
  color: var(--muted);
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13px;
}
.site-footer .foot-links { display: flex; gap: 18px; }
.site-footer .foot-links a { color: var(--ink-soft); }
.site-footer .foot-links a:hover { color: var(--navy); }

/* --- Contest card ------------------------------------------------------ */
.contest-card {
  background: var(--surface-alt);
  color: var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.contest-card .cover {
  aspect-ratio: 16/9;
  background: var(--navy);
  color: #fff;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.contest-card .cover.alt { background: var(--navy-deep); }
.contest-card .cover.dark { background: var(--ink); }
.contest-card .cover .kicker { font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase; opacity: .85; font-weight: 500; }
.contest-card .cover .title { font-size: 1.35rem; line-height: 1.3; font-weight: 700; }
.contest-card .body { padding: 22px 24px 24px; }
.contest-card .body .meta { font-size: 13px; color: var(--muted); margin-bottom: 10px; display: flex; gap: 12px; flex-wrap: wrap; }
.contest-card .body p { font-size: 14px; margin-bottom: 14px; color: var(--ink-soft); }
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--surface-alt);
  color: var(--ink-soft);
  font-weight: 600;
}
.status-badge.open { background: var(--yellow-soft); color: var(--yellow-ink); }
.status-badge.upcoming { background: var(--surface-tint); color: var(--navy); }
.status-badge.closed { background: var(--surface-alt); color: var(--muted); }

/* --- About-specific ---------------------------------------------------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

.timeline { padding-left: 24px; }
.timeline .item { position: relative; padding-bottom: 28px; }
.timeline .item::before {
  content: "";
  position: absolute; left: -24px; top: 10px;
  width: 8px; height: 8px;
  background: var(--navy);
  border-radius: 50%;
}
.timeline .item .year { font-size: 1rem; color: var(--navy); margin-bottom: 4px; font-weight: 700; }
.timeline .item p { color: var(--ink-soft); font-size: 14px; }

/* --- Hero panel (about page) ------------------------------------------ */
.hero-panel {
  color: var(--ink);
  padding: 72px 48px 48px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  position: relative;
  text-align: center;
}
/* Big decorative opening/closing quotation marks at top-left and
   bottom-right — visual "quote card" effect. */
.hero-panel::before,
.hero-panel::after {
  position: absolute;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 7rem;
  line-height: 1;
  color: var(--navy);
  opacity: 0.22;
  font-weight: 400;
  pointer-events: none;
}
.hero-panel::before { content: "\201C"; top: 18px; left: 32px; }
.hero-panel::after  { content: "\201D"; bottom: 40px; right: 32px; }

.hero-panel .quote {
  font-size: clamp(1.35rem, 1.7vw, 1.65rem);
  line-height: 1.55;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 1;
}
.hero-panel .attrib {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  position: relative;
  z-index: 1;
}

/* --- Modal ------------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 30, 50, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 620px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}
.modal .close {
  float: right;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 22px;
  line-height: 1;
}
.modal h2 { margin-bottom: 8px; color: var(--ink); }
.modal .meta { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.modal p { color: var(--ink-soft); }

/* --- Admin ------------------------------------------------------------- */
.admin-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 96px);
  background: var(--surface);
  color: var(--ink);
}
@media (max-width: 900px) { .admin-shell { grid-template-columns: 1fr; } }
.admin-side {
  background: var(--surface-alt);
  color: var(--ink);
  padding: 32px 20px;
}
.admin-side h4 { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 20px 0 10px; font-weight: 600; }
.admin-side a {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.admin-side a:hover { background: var(--surface-hover); color: var(--ink); }
.admin-side a.active { background: var(--navy); color: #fff; font-weight: 600; }
.admin-main { padding: 40px 48px; color: var(--ink); }
.admin-main .page-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 26px; gap: 16px; flex-wrap: wrap;
}
.admin-main h2 { font-size: 1.5rem; color: var(--ink); font-weight: 700; }
.admin-main p { color: var(--ink-soft); }

.table {
  width: 100%;
  background: var(--surface-alt);
  border-radius: var(--radius);
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--ink);
}
.table th, .table td {
  padding: 14px 18px;
  text-align: left;
  font-size: 13.5px;
  color: var(--ink);
}
.table th {
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}
.table tbody tr:nth-child(even) td { background: var(--surface); }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }

/* --- KPI cards --------------------------------------------------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 32px; }
@media (max-width: 720px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi {
  background: var(--surface-alt);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 20px;
}
.kpi .label { font-size: 11.5px; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; }
.kpi .value { font-size: 1.75rem; margin-top: 6px; color: var(--ink); font-weight: 700; letter-spacing: -0.02em; }
.kpi .delta { font-size: 12px; color: var(--success); margin-top: 4px; }

/* --- Mobile nav toggle ------------------------------------------------- */
.mobile-menu-btn { display: none; }
@media (max-width: 820px) {
  .nav, .auth-nav { display: none; }
  .mobile-menu-btn { display: inline-flex; }
  .nav.open, .auth-nav.open { display: flex; }
  .site-header .container { flex-wrap: wrap; }
  .nav.open, .auth-nav.open { flex-basis: 100%; padding: 12px 0; flex-direction: column; align-items: stretch; }
}
