:root {
  --ink: #24292f;
  --muted: #57606a;
  --subtle: #6e7781;
  --line: #d8dee4;
  --paper: #ffffff;
  --soft: #f6f8fa;
  --link: #0969da;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Inter", "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15.5px;
  line-height: 1.72;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

p {
  color: var(--muted);
}

code {
  padding: 0.12rem 0.28rem;
  border-radius: 4px;
  background: var(--soft);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
}

.site-header {
  display: flex;
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 22px;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.site-title {
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 700;
}

.site-title:hover {
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.92rem;
}

.site-nav a {
  color: var(--muted);
}

.site-nav a.active,
.site-nav a:hover {
  color: var(--ink);
}

.site-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 48px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 42px 24px 72px;
}

.sidebar {
  font-size: 0.94rem;
}

.profile-image {
  display: block;
  width: 112px;
  height: 112px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
}

.profile-name {
  margin-bottom: 6px;
  color: var(--ink);
  font-weight: 700;
}

.profile-desc {
  margin-bottom: 24px;
  color: var(--muted);
}

.side-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.side-section.no-top {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.side-section h2 {
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.side-section ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.side-section li + li {
  margin-top: 7px;
}

.content {
  max-width: 760px;
}

.page-intro {
  margin-bottom: 34px;
}

.kicker,
.post-meta {
  margin-bottom: 8px;
  color: var(--subtle);
  font-size: 0.86rem;
}

.page-intro h1 {
  margin-bottom: 12px;
  font-size: 2rem;
  line-height: 1.28;
}

.post-list h2,
.archive-section h2 {
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 1.2rem;
}

.post-preview {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.post-preview h3 {
  margin-bottom: 4px;
  font-size: 1.08rem;
  line-height: 1.38;
}

.post-preview p {
  margin-bottom: 0;
}

.archive-section {
  margin-bottom: 36px;
}

.curriculum-section {
  margin-bottom: 34px;
}

.curriculum-section h2 {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 1.12rem;
}

.curriculum-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.curriculum-list li + li {
  margin-top: 6px;
}

.empty-note {
  padding: 14px 0 4px;
  color: var(--subtle);
}

.text-section,
.timeline-list article {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.text-section:first-of-type,
.timeline-list article:first-child {
  border-top: 1px solid var(--line);
}

.text-section h2,
.timeline-list h2 {
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.text-section ul {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
}

.post-layout {
  max-width: 820px;
  margin: 0 auto;
  padding: 46px 24px 76px;
}

.post-body h1 {
  margin-bottom: 14px;
  font-size: 2rem;
  line-height: 1.28;
}

.post-body h2 {
  margin: 34px 0 10px;
  font-size: 1.28rem;
}

.post-body p {
  margin-bottom: 16px;
}

.post-body ul {
  margin: 0 0 18px;
  padding-left: 22px;
  color: var(--muted);
}

.post-body ol {
  margin: 0 0 18px;
  padding-left: 22px;
  color: var(--muted);
}

.math-display {
  margin: 24px 0;
  overflow-x: auto;
  text-align: center;
  color: var(--ink);
}

.post-figure {
  margin: 28px 0;
}

.post-figure img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.post-figure.compact img {
  max-width: 560px;
  margin: 0 auto;
}

.post-figure figcaption {
  margin-top: 8px;
  color: var(--subtle);
  font-size: 0.9rem;
  line-height: 1.55;
}

.site-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px;
  border-top: 1px solid var(--line);
  color: var(--subtle);
  font-size: 0.9rem;
}

.visitor-counter {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  color: var(--subtle);
  font-size: 0.8rem;
}

.visitor-counter strong {
  color: var(--subtle);
  font-weight: 600;
}

.site-footer p {
  margin: 0;
  color: var(--subtle);
}

@media (max-width: 780px) {
  .site-header {
    display: block;
  }

  .site-nav {
    margin-top: 12px;
  }

  .site-shell {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 30px;
  }

  .sidebar {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 0 16px;
  }

  .profile-image {
    width: 72px;
    height: 72px;
    grid-row: span 2;
  }

  .profile-desc {
    margin-bottom: 0;
  }

  .side-section {
    grid-column: 1 / -1;
  }

  .page-intro h1,
  .post-body h1 {
    font-size: 1.65rem;
  }
}
