:root {
  --paper: #ffffff;
  --tint: #f4f6f8;
  --ink: #101a2e;
  --navy: #14213d;
  --text: #232c3d;
  --muted: #5d6676;
  --rule: #dde2e8;
  --green: #2b4f8c;
  --green-tint: #e9eef6;
  --serif: 'Noto Serif KR', 'Nanum Myeongjo', 'Batang', serif;
  --sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --wrap: 1120px;
  --gutter: 24px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}
main > .section-tint:last-child {
  flex: 1;
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

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

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

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--navy);
  color: #fff;
}
.skip:focus {
  top: 12px;
}

/* ---------- 머리말 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
}
.mark {
  flex: none;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.brand-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.brand-sub {
  font-size: 12.5px;
  color: var(--muted);
}

.nav-toggle {
  display: none;
}

.nav-list {
  display: flex;
  gap: 4px;
}
.nav-item {
  position: relative;
}
.nav-link {
  display: block;
  padding: 24px 16px;
  font-weight: 600;
  font-size: 15.5px;
  color: var(--ink);
}
.nav-link:hover,
.nav-item:focus-within > .nav-link {
  color: var(--green);
}
.nav-link[aria-current='true'] {
  box-shadow: inset 0 -2px 0 var(--navy);
}

.nav-sub {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 168px;
  padding: 6px 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 2px solid var(--navy);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.12s ease, visibility 0.12s;
}
.nav-item:hover > .nav-sub,
.nav-item:focus-within > .nav-sub {
  visibility: visible;
  opacity: 1;
}
.nav-sub a {
  display: block;
  padding: 9px 16px;
  font-size: 15px;
}
.nav-sub a:hover,
.nav-sub a:focus-visible {
  background: var(--tint);
  color: var(--green);
}

/* ---------- 메인: 첫 화면 ---------- */
.hero {
  padding: 56px 0 64px;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 56px;
  align-items: center;
}
.hero-name {
  margin-bottom: 14px;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.01em;
  color: var(--green);
}
.hero-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(34px, 4.6vw, 54px);
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.hero-text {
  margin-top: 20px;
  max-width: 30em;
  font-size: 17.5px;
  color: var(--muted);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}
.btn-solid,
.btn-line {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 26px;
  border: 1px solid var(--navy);
  border-radius: 2px;
  font-weight: 600;
  font-size: 15.5px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.btn-solid {
  background: var(--navy);
  color: #fff;
}
.btn-solid:hover {
  background: #0c1730;
}
.btn-line {
  color: var(--navy);
}
.btn-line:hover {
  background: var(--navy);
  color: #fff;
}
.btn-solid:active,
.btn-line:active {
  transform: translateY(1px);
}

.hero-figure {
  position: relative;
}
.hero-figure::before {
  content: '';
  position: absolute;
  inset: 14px -14px -14px 14px;
  border: 1px solid var(--navy);
  opacity: 0.35;
}
.hero-figure img {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--tint);
}

/* ---------- 시험 D-day ---------- */
.dday {
  background: var(--navy);
  color: #fff;
}
.dday-list {
  display: flex;
  flex-wrap: wrap;
}
.dday-item {
  flex: 1 1 0;
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 28px 22px 0;
}
.dday-item + .dday-item {
  padding-left: 28px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}
.dday-count {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dday-info {
  display: flex;
  flex-direction: column;
  line-height: 1.45;
}
.dday-name {
  font-weight: 600;
  font-size: 15.5px;
}
.dday-date {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.72);
}

/* ---------- 구역 공통 ---------- */
.section {
  padding: 64px 0;
}
.section-tint {
  background: var(--tint);
  border-top: 1px solid var(--rule);
}
.cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 56px;
}
.cols-wide-left {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.section-title {
  flex: 1;
  padding: 14px 0 14px;
  border-top: 2px solid var(--navy);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.section-head {
  border-top: 2px solid var(--navy);
}
.section-head .section-title {
  border-top: 0;
}
.more {
  padding: 8px 0;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}
.more:hover {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.empty {
  padding: 28px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-size: 15px;
}

/* ---------- 일정 목록 ---------- */
.sched {
  border-top: 1px solid var(--rule);
}
.sched-item {
  display: grid;
  grid-template-columns: 12.5em minmax(0, 1fr);
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}
.sched-when {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 15.5px;
  color: var(--green);
  line-height: 1.6;
}
.sched-title {
  font-weight: 600;
  font-size: 16.5px;
  color: var(--ink);
  line-height: 1.55;
}
.sched-note {
  margin-top: 2px;
  font-size: 14.5px;
  color: var(--muted);
}
.sched-link {
  display: inline-block;
  margin-top: 2px;
  padding: 4px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- 글 목록 ---------- */
.rows {
  border-top: 1px solid var(--rule);
}
.row {
  border-bottom: 1px solid var(--rule);
}
.row-link {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 15px 4px;
  transition: background-color 0.12s ease;
}
.row-link:hover {
  background: rgba(20, 33, 61, 0.04);
}
.row-link:hover .row-title {
  color: var(--green);
}
.row-board {
  flex: none;
  width: 12.5em;
  white-space: nowrap;
  font-size: 13.5px;
  color: var(--muted);
}
.row-title {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.55;
}
.row.is-pinned .row-title {
  font-weight: 600;
}
.row-meta {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.row-files {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.tag {
  display: inline-block;
  margin-right: 8px;
  padding: 0 6px;
  border: 1px solid var(--green);
  border-radius: 2px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--green);
  vertical-align: 1px;
}
.tag-muted {
  border-color: var(--muted);
  color: var(--muted);
}
.new {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--green);
  vertical-align: 2px;
}

/* ---------- 게시판 ---------- */
.page {
  padding-top: 56px;
  padding-bottom: 88px;
}
.page-head {
  margin-bottom: 32px;
}
.page-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(28px, 3.4vw, 36px);
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.page-intro {
  margin-top: 10px;
  color: var(--muted);
}
.tabs {
  display: flex;
  gap: 28px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 8px;
}
.tab {
  padding: 12px 0;
  margin-bottom: -1px;
  font-weight: 600;
  font-size: 16px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.tab:hover {
  color: var(--ink);
}
.tab[aria-current='page'] {
  color: var(--ink);
  border-bottom-color: var(--navy);
}
.count {
  padding: 16px 0 10px;
  font-size: 14px;
  color: var(--muted);
}
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 36px;
  font-variant-numeric: tabular-nums;
}
.pager-num,
.pager-step {
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 15px;
  color: var(--muted);
}
.pager-num:hover,
.pager-step:hover {
  border-color: var(--rule);
  color: var(--ink);
}
.pager-num.is-current {
  border-color: var(--navy);
  color: var(--ink);
  font-weight: 700;
}

/* ---------- 글 보기 ---------- */
.post {
  max-width: calc(800px + var(--gutter) * 2);
}
.crumbs a {
  display: inline-block;
  padding: 6px 0;
}
.crumbs {
  font-size: 14px;
  color: var(--green);
  font-weight: 600;
}
.crumbs a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.notice-bar {
  margin-top: 16px;
  padding: 10px 14px;
  background: var(--tint);
  border-left: 3px solid var(--muted);
  font-size: 14.5px;
}
.post-head {
  margin-top: 12px;
  padding-bottom: 22px;
  border-bottom: 2px solid var(--navy);
}
.post-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(24px, 3vw, 31px);
  line-height: 1.42;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.post-meta {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.prose {
  padding: 32px 0 8px;
  font-size: 16.5px;
  line-height: 1.85;
}
.prose p + p,
.prose ul + p,
.prose p + ul {
  margin-top: 1.1em;
}
.prose h2 {
  margin: 1.8em 0 0.6em;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink);
}
.prose h2:first-child {
  margin-top: 0;
}
.prose ul {
  padding-left: 1.2em;
  list-style: disc;
}
.prose li + li {
  margin-top: 0.3em;
}
.prose a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose strong {
  color: var(--ink);
}

.files {
  margin-top: 32px;
  border: 1px solid var(--rule);
  background: var(--tint);
}
.files-title {
  padding: 12px 18px;
  border-bottom: 1px solid var(--rule);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}
.file {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: var(--paper);
}
.file + .file {
  border-top: 1px solid var(--rule);
}
.file-name {
  flex: 1;
  min-width: 0;
  font-size: 15.5px;
  color: var(--ink);
}
.file-size {
  flex: none;
  font-size: 13.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.file-get {
  flex: none;
  padding: 7px 16px;
  border-radius: 2px;
  background: var(--navy);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  transition: background-color 0.15s ease;
}
.file-get:hover {
  background: #0c1730;
}
.post-back {
  margin-top: 40px;
}
.back-link {
  display: inline-block;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--navy);
  font-weight: 600;
  font-size: 15px;
  color: var(--navy);
}
.back-link:hover {
  color: var(--green);
  border-color: var(--green);
}
.message .page-intro {
  margin-bottom: 28px;
}

/* ---------- 꼬리말 ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--paper);
  padding: 32px 0 40px;
  font-size: 14px;
  color: var(--muted);
}
.section-tint + .site-footer,
main:has(> .section-tint:last-child) + .site-footer {
  border-top-color: var(--rule);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}
.footer-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
}
.footer-line {
  margin-top: 4px;
}
.footer-side {
  text-align: right;
}
.footer-admin {
  display: inline-block;
  margin-top: 2px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-admin:hover {
  color: var(--ink);
}

/* ---------- 좁은 화면 ---------- */
@media (max-width: 880px) {
  :root {
    --gutter: 20px;
  }
  .header-inner {
    min-height: 64px;
    flex-wrap: wrap;
  }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-right: -10px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--navy);
    cursor: pointer;
  }
  .nav-toggle-bars,
  .nav-toggle-bars::before,
  .nav-toggle-bars::after {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
  }
  .nav-toggle-bars {
    position: relative;
  }
  .nav-toggle-bars::before,
  .nav-toggle-bars::after {
    content: '';
    position: absolute;
    left: 0;
  }
  .nav-toggle-bars::before {
    top: -7px;
  }
  .nav-toggle-bars::after {
    top: 7px;
  }
  .nav {
    display: none;
    flex-basis: 100%;
    padding: 0 0 12px;
    border-top: 1px solid var(--rule);
    max-height: calc(100dvh - 64px);
    overflow-y: auto;
  }
  .nav.is-open {
    display: block;
  }
  .nav-list {
    display: block;
  }
  .nav-item + .nav-item {
    border-top: 1px solid var(--rule);
  }
  .nav-link {
    padding: 14px 0 6px;
  }
  .nav-item:not(.has-sub) .nav-link {
    padding-bottom: 14px;
  }
  .nav-link[aria-current='true'] {
    box-shadow: none;
    color: var(--green);
  }
  .nav-sub {
    position: static;
    visibility: visible;
    opacity: 1;
    border: 0;
    padding: 0 0 10px;
    display: flex;
    gap: 20px;
  }
  .nav-sub a {
    padding: 6px 0;
    color: var(--muted);
  }

  .hero {
    padding: 36px 0 44px;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .hero-figure::before {
    inset: 10px -8px -10px 10px;
  }
  .hero-figure {
    margin-right: 8px;
  }
  .dday-item,
  .dday-item + .dday-item {
    flex-basis: 100%;
    padding: 16px 0;
    border-left: 0;
  }
  .dday-item + .dday-item {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
  }
  .dday-count {
    min-width: 3.4em;
    font-size: 26px;
  }
  .section {
    padding: 44px 0;
  }
  .cols,
  .cols-wide-left {
    grid-template-columns: 1fr;
    gap: 44px;
  }
  .page {
    padding-top: 36px;
    padding-bottom: 64px;
  }
}

@media (max-width: 600px) {
  .brand-sub {
    display: none;
  }
  .sched-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .row-link {
    flex-wrap: wrap;
    gap: 2px 12px;
    padding: 13px 2px;
  }
  .row-board {
    width: auto;
    order: 1;
  }
  .row-title {
    flex-basis: 100%;
    order: 0;
  }
  .row-meta {
    order: 2;
    margin-left: auto;
  }
  .file {
    flex-wrap: wrap;
    gap: 6px 12px;
  }
  .file-name {
    flex-basis: 100%;
  }
  .file-get {
    margin-left: auto;
  }
  .footer-inner {
    flex-direction: column;
  }
  .footer-side {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}
