/* ==========================================================
   혁신시대 — base
   Palette: paper & ink. Single committed light theme with
   inverted (black) sections for rhythm.
   ========================================================== */
:root {
  color-scheme: light;
  --paper: #FFFFFF;
  --wash: #F5F5F3;      /* image wells, inputs */
  --rule: #E4E3DF;      /* hairlines */
  --pencil: #86857F;    /* meta text */
  --graphite: #3B3B39;  /* secondary text */
  --ink: #0C0C0B;       /* primary text, black sections */
  --ink-2: #1B1B1A;     /* raised surface on black */
  --ink-rule: #2E2E2C;  /* hairlines on black */

  --f-display: "Hahmlet", "Nanum Myeongjo", "Noto Serif KR", "AppleMyungjo", serif;
  --f-body: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --wrap: 1280px;
  --gutter: clamp(20px, 4vw, 48px);
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 64px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.7 var(--f-body);
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
body.is-locked { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p, dl, dd, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { text-wrap: balance; font-weight: 600; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
::selection { background: var(--ink); color: var(--paper); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--f-mono); letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Header ---------- */
.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; gap: 48px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand-mark { width: 22px; height: 23px; fill: currentColor; }
.brand-word { font-weight: 700; font-size: 19px; letter-spacing: -0.04em; }
.gnb { display: flex; gap: 40px; margin-left: auto; }
.gnb a { position: relative; font-size: 15px; font-weight: 500; color: var(--graphite); padding-block: 6px; transition: color .2s; }
.gnb a:hover, .gnb a[aria-current="page"] { color: var(--ink); }
.gnb a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--ink);
}
.header-util { display: flex; align-items: center; gap: 20px; }
.util-link { font-size: 13px; color: var(--pencil); }
.util-link:hover { color: var(--ink); }
.menu-btn { display: none; width: 32px; height: 32px; position: relative; }
.menu-btn span { position: absolute; left: 6px; right: 6px; height: 1.5px; background: var(--ink); transition: transform .25s; }
.menu-btn span:first-child { top: 12px; }
.menu-btn span:last-child { top: 19px; }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: var(--header-h) 0 0; z-index: 49;
  background: var(--paper); overflow-y: auto;
  padding: 24px var(--gutter) 48px;
}
.mobile-menu nav a {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 22px 0; border-bottom: 1px solid var(--rule);
  font: 500 28px/1.2 var(--f-display); letter-spacing: -0.03em;
}
.mobile-menu nav a small { font: 400 11px var(--f-mono); letter-spacing: .12em; color: var(--pencil); }
.mobile-menu .mm-util { display: flex; gap: 24px; margin-top: 32px; font-size: 14px; color: var(--graphite); }

@media (max-width: 900px) {
  .gnb, .util-link { display: none; }
  .menu-btn { display: block; }
  .header-inner { justify-content: space-between; }
  :root { --header-h: 60px; }
}

/* ---------- Exam-paper page title ----------
   Borrowed from the 수능 문제지 header: period on the left,
   subject title in the middle, boxed form type on the right,
   closed by a thick + thin double rule. */
.paper-head { padding-top: clamp(40px, 7vw, 88px); }
.paper-kicker {
  display: flex; justify-content: space-between; gap: 16px;
  font-size: 13px; color: var(--pencil); padding-bottom: 14px;
}
.paper-title-row {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 16px;
  padding-bottom: 18px;
  border-bottom: 3px solid var(--ink);
  position: relative;
}
.paper-title-row::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 1px; background: var(--ink);
}
.paper-period { font-size: 15px; font-weight: 500; letter-spacing: .3em; }
.paper-title {
  font: 600 clamp(38px, 6vw, 72px)/1.05 var(--f-display);
  letter-spacing: -0.04em; text-align: center;
}
.paper-type {
  justify-self: end; border: 1.5px solid var(--ink);
  padding: 6px 12px; font: 500 12px var(--f-mono); letter-spacing: .14em;
}
.paper-lede {
  max-width: 44em; margin: 40px auto 0; text-align: center;
  font-size: 17px; color: var(--graphite);
}
@media (max-width: 640px) {
  .paper-title-row { grid-template-columns: 1fr auto; }
  .paper-period { display: none; }
  .paper-title { text-align: left; }
  .paper-kicker span:last-child { display: none; }
}

/* ---------- Section heads ---------- */
.sec { padding-block: clamp(72px, 10vw, 136px); }
.sec + .sec { padding-top: 0; }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 40px; }
.eyebrow { display: block; font: 500 12px var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--pencil); margin-bottom: 14px; }
.sec-title { font: 600 clamp(28px, 3.4vw, 44px)/1.25 var(--f-display); letter-spacing: -0.035em; }
.more-link { flex: none; font-size: 14px; color: var(--graphite); border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.more-link:hover { color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 56px; padding: 0 28px;
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  border: 1px solid var(--ink); transition: background .2s, color .2s;
}
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--graphite); border-color: var(--graphite); }
.btn-line { background: var(--paper); color: var(--ink); }
.btn-line:hover { background: var(--wash); }
.btn-inv { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn-inv:hover { background: var(--rule); }
.btn-block { width: 100%; }
.btn[disabled] { background: var(--rule); border-color: var(--rule); color: var(--pencil); cursor: not-allowed; }
.icon-btn { width: 56px; height: 56px; display: inline-grid; place-items: center; border: 1px solid var(--rule); flex: none; }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.icon-btn[aria-pressed="true"] svg { fill: currentColor; }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px;
  font-size: 12px; font-weight: 500; border: 1px solid var(--ink); white-space: nowrap;
}
.chip-ink { background: var(--ink); color: var(--paper); }
.chip-mute { border-color: var(--rule); color: var(--graphite); }
.chip-sample { border: 1px dashed var(--pencil); color: var(--pencil); font-weight: 400; }

/* ---------- Black section ---------- */
.inverse { background: var(--ink); color: var(--paper); }
.inverse .eyebrow { color: #8F8E88; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding: 56px 0 40px; font-size: 13px; color: var(--graphite); }
.footer-top { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; padding-bottom: 32px; border-bottom: 1px solid var(--rule); }
.footer-brand .brand { color: var(--ink); }
.footer-brand p { margin-top: 12px; font: 400 12px var(--f-mono); letter-spacing: .1em; color: var(--pencil); text-transform: uppercase; }
.footer-nav { display: flex; gap: 32px; flex-wrap: wrap; }
.footer-nav a:hover { color: var(--ink); }
.footer-legal { display: flex; flex-wrap: wrap; gap: 4px 16px; padding-top: 28px; color: var(--pencil); line-height: 1.9; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 24px; color: var(--pencil); }
.footer-bottom nav { display: flex; gap: 20px; }
.footer-bottom nav a:first-child { color: var(--ink); font-weight: 500; }

/* ---------- Empty state ---------- */
.empty-note { padding: 40px 0; color: var(--pencil); }
.empty-note a { color: var(--ink); border-bottom: 1px solid currentColor; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 100;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper);
  padding: 14px 22px; font-size: 14px; max-width: calc(100vw - 40px);
  transition: opacity .25s, transform .25s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
}
