/* klicious.github.io — dossier-document surface, v2 (canvas-approved 2026-08-25).
   Dark-first: :root carries the dark palette; html.light overrides.
   Type: Newsreader (display + essay body) / Inter (UI) / JetBrains Mono (meta).
   Accent = 회청 grey-blue from the retrieved obangsaek tokens. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Newsreader:opsz,wght@6..72,400;6..72,500;6..72,600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #131110;
  --ink: #f0eadd;
  --ink-2: #a89e8c;
  --ink-3: #8d8574;
  --line: #34302a;
  --accent: #8fb0cf;
  --seal: #cd5148;
  --seal-glyph: #f5efe3;
  --measure: 640px;
  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', 'Avenir Next', 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
}

html.light {
  --bg: #faf7f1;
  --ink: #221e18;
  --ink-2: #6f6759;
  --ink-3: #948b7b;
  --line: #e5dfd3;
  --accent: #3f6382;
  --seal: #b8433a;
  --seal-glyph: #faf7f1;
}

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

html { font-size: 17px; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 47rem;
  margin: 0 auto;
  padding: 5rem 1.5rem 5rem;
}

/* ---- top bar (crumb / toggle) ---- */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.78rem;
  margin-bottom: 3.2rem;
}

.topbar a { color: var(--ink-2); text-decoration: none; }
.topbar a:hover { color: var(--accent); }

#theme-toggle {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-2);
  background: none;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
}

#theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* ---- masthead ---- */

.masthead { margin-bottom: 3.8rem; display: flex; flex-direction: column; gap: 1.05rem; }

.name-row { display: flex; align-items: center; gap: 1rem; }

.seal {
  width: 34px;
  height: 34px;
  flex: none;
  background: var(--seal);
  color: var(--seal-glyph);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
}

.masthead h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 2.6rem;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.masthead .hanja {
  color: var(--ink-2);
  font-weight: 400;
  font-size: 1.55rem;
  margin-left: 0.35rem;
}

.masthead .role {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink-2);
  letter-spacing: 0.04em;
}

.masthead .intro { max-width: var(--measure); font-size: 1.03rem; }

.masthead .intro.second { color: var(--ink-2); }

/* ---- sections as baseline rows ---- */

section { margin-top: 3.6rem; }

section > h2 {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-2);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.row {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.row:hover .row-title, .row:focus-visible .row-title { color: var(--accent); }

.row-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1.3;
  color: var(--ink);
  transition: color 120ms ease;
}

.row-title .arrow { color: var(--accent); font-family: var(--sans); font-size: 0.95rem; }

.row-desc { color: var(--ink-2); font-size: 0.92rem; line-height: 1.65; max-width: var(--measure); }

.row-meta {
  font-family: var(--mono);
  font-size: 0.73rem;
  color: var(--ink-3);
  letter-spacing: 0.02em;
  margin-top: 0.1rem;
}

/* ---- essay page ---- */

.essay header { margin-bottom: 2.8rem; display: flex; flex-direction: column; gap: 1.05rem; }

.essay h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 2.45rem;
  line-height: 1.22;
  letter-spacing: -0.01em;
  max-width: 20ch;
}

.essay .dateline { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-2); }

.essay .body { display: flex; flex-direction: column; gap: 1.55rem; }

.essay .body p {
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.75;
  max-width: var(--measure);
}

.essay .body p:first-child {
  font-size: 1.35rem;
  line-height: 1.55;
  font-weight: 500;
}

.essay .seam {
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--ink-2);
}

.essay .rule { border: 0; border-top: 1px solid var(--line); margin: 2.8rem 0 1.8rem; max-width: var(--measure); }

.essay .sources { max-width: var(--measure); font-family: var(--sans); font-size: 0.86rem; color: var(--ink-2); }

.essay .sources h2 {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 0.7rem;
}

.essay .sources li { margin: 0.35rem 0 0.35rem 1.1rem; line-height: 1.7; }

/* ---- shared ---- */

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2.5px; }

a:focus-visible, .row:focus-visible, #theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

footer {
  margin-top: 4.5rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.78rem;
  display: flex;
  gap: 1.7rem;
}

footer a { color: var(--ink-2); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }

footer a:hover { color: var(--accent); }

@media (max-width: 480px) {
  html { font-size: 16px; }
  .page { padding-top: 3rem; }
  .masthead h1 { font-size: 1.9rem; }
  .essay h1 { font-size: 1.8rem; }
}
