:root {
  color-scheme: light dark;
  --bg: #fffaf2;
  --ink: #1f1b16;
  --muted: #756b60;
  --line: #eadfce;
  --panel: rgba(255, 255, 255, 0.72);
  --accent: #9b3a22;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 18% 0%, #ffe7c6, transparent 34rem), var(--bg);
  color: var(--ink);
}

a { color: inherit; }

.page {
  width: min(760px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 72px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 64px;
  font-size: 0.95rem;
}

.brand,
.nav a {
  text-decoration: none;
  font-weight: 800;
}

.hero { margin-bottom: 44px; }

.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.5rem 0 1rem;
  font-size: clamp(2.5rem, 9vw, 5rem);
  font-weight: 850;
  letter-spacing: -0.07em;
  line-height: 0.95;
}

.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 0 14px;
  font-weight: 900;
}

.home-post a {
  display: block;
  margin: 12px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  text-decoration: none;
}

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

.home-post h2 {
  margin: 0;
  font-size: 1.28rem;
  letter-spacing: -0.03em;
}

.home-post-meta,
.post-meta {
  margin-top: 4px;
  font-size: 0.86rem;
}

.home-post p { margin: 12px 0 0; }

.post h1 {
  font-size: clamp(2.2rem, 7vw, 4.2rem);
}

.post-content {
  margin-top: 32px;
  line-height: 1.75;
}

.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: 18px;
  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: #0f172a;
    --ink: #f8fafc;
    --muted: #94a3b8;
    --line: #263246;
    --panel: rgba(15, 23, 42, 0.72);
    --accent: #fb923c;
  }

  body { background: radial-gradient(circle at 18% 0%, #3a2418, transparent 34rem), var(--bg); }
}
