:root {
  color-scheme: light dark;
  --bg: #f4f1ea;
  --ink: #1b1c19;
  --muted: #696b63;
  --line: #d5d2c8;
  --panel: #faf8f3;
  --accent: #c5472d;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Pretendard, "Noto Sans KR", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

.page {
  width: min(920px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 34px 0 96px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(76px, 12vw, 132px);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.brand,
.nav a {
  text-decoration: none;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-variant: small-caps;
}

.brand::before {
  content: "●";
  margin-right: 0.55rem;
  color: var(--accent);
  font-size: 0.75em;
}

.nav a {
  display: inline-flex;
  width: 1.9rem;
  height: 1.9rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 0;
}

.nav a::before {
  content: "⌂";
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1;
}

.nav a:hover { border-color: var(--accent); color: var(--accent); }

.hero {
  max-width: 790px;
  margin-bottom: clamp(68px, 10vw, 112px);
}

.kicker,
.home-post-meta,
.post-meta,
.section-title small {
  color: var(--muted);
}

.kicker {
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 650;
  letter-spacing: -0.055em;
  line-height: 1.04;
  text-wrap: balance;
}

.hero h1 {
  font-size: clamp(4rem, 10vw, 7.5rem);
  font-weight: 470;
  letter-spacing: -0.07em;
  line-height: 0.98;
}

.hero p,
.post-description,
.home-post p {
  color: var(--muted);
  line-height: 1.7;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--ink);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-post a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8.5rem;
  column-gap: 32px;
  margin: 0;
  padding: 30px 0 32px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: color 160ms ease, padding-left 160ms ease;
}

.home-post a:hover {
  padding-left: 10px;
  color: var(--accent);
}

.home-post h2 {
  margin: 0;
  font-size: clamp(1.28rem, 2.7vw, 1.72rem);
  font-weight: 720;
  letter-spacing: -0.04em;
  line-height: 1.25;
}

.home-post-meta,
.post-meta {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.home-post-meta {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}

.home-post p {
  grid-column: 1;
  max-width: 42rem;
  margin: 10px 0 0;
  font-size: 0.96rem;
}

.post h1 {
  max-width: 850px;
  font-size: clamp(2.6rem, 7vw, 5.4rem);
}

.post-description { max-width: 680px; font-size: 1.08rem; }

.post-content {
  max-width: 720px;
  margin-top: 64px;
  font-size: 1.03rem;
  line-height: 1.82;
}

.post-content h1,
.post-content h2,
.post-content h3 {
  margin: 2rem 0 1rem;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.post-content h1 { font-size: 2rem; }
.post-content h2 { font-size: 1.55rem; }
.post-content h3 { font-size: 1.25rem; }

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.post-content pre {
  overflow-x: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  line-height: 1.65;
}

.youtube-embed {
  margin: 1.75rem 0;
}

.youtube-embed iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

.youtube-embed figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

.post-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
}

.post-content blockquote {
  margin: 1.75rem 0;
  padding: 0.25rem 1.25rem;
  border-left: 4px solid var(--accent);
  color: var(--muted);
  background: var(--panel);
  border-radius: 0 14px 14px 0;
}

.post-content blockquote p {
  margin: 1rem 0;
}

.post-content p code,
.post-content li code {
  padding: 0.1rem 0.3rem;
  border-radius: 0.35rem;
  background: var(--panel);
}

.footnotes {
  margin-top: 3rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.footnotes hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin-bottom: 1.25rem;
}

.footnotes li {
  padding-left: 0.25rem;
}

.footnote-ref,
.footnote-backref {
  text-decoration: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171815;
    --ink: #f1efe8;
    --muted: #a3a299;
    --line: #393a35;
    --panel: #20211d;
    --accent: #f06a4c;
  }
}

@media (max-width: 600px) {
  .page { width: min(100% - 32px, 920px); padding-top: 24px; }
  .site-header { margin-bottom: 72px; }
  .hero { margin-bottom: 68px; }
  .home-post a { grid-template-columns: 1fr; gap: 0; padding: 24px 0 26px; }
  .home-post a:hover { padding-left: 0; }
  .home-post-meta { grid-column: 1; grid-row: 2; justify-self: start; margin-top: 8px; }
  .home-post p { grid-column: 1; grid-row: 3; }
  .post-content { margin-top: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .home-post a { transition: none; }
}
