:root {
  color-scheme: light dark;
  --bg: #fff;
  --ink: #0b0b0b;
  --prose: #2d2d2a;
  --muted: #666;
  --faint: #8a8a84;
  --line: #dedede;
  --surface: #f7f7f5;
  --surface-strong: #f1f1ee;
  --header-bg: rgba(255, 255, 255, 0.92);
  --header-line: rgba(222, 222, 222, 0.72);
  --code-bg: #0f0f0f;
  --code-ink: #f4f4f1;
  --max: 1120px;
  --measure: 720px;
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --ink: #fff;
    --prose: #e6e6e1;
    --muted: #a6a6a6;
    --faint: #7d7d7d;
    --line: #2b2b2b;
    --surface: #080808;
    --surface-strong: #111;
    --header-bg: rgba(0, 0, 0, 0.9);
    --header-line: rgba(43, 43, 43, 0.8);
    --code-bg: #080808;
    --code-ink: #f4f4f1;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

a:hover {
  color: var(--ink);
}

a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--header-line);
  background: var(--header-bg);
  backdrop-filter: blur(16px);
}

.site-header__inner {
  width: min(calc(100% - 32px), var(--max));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.brand {
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}

.site-main {
  min-height: calc(100vh - 192px);
}

.wrap {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
}

.hero {
  min-height: calc(100svh - 64px);
  padding: 96px 0 128px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
}

.hero > div {
  max-width: var(--max);
}

.hero h1,
.page-hero h1,
.article-header h1,
.archive-header h1 {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 1040px;
  font-size: clamp(56px, 9vw, 120px);
  line-height: 0.94;
}

.hero p {
  max-width: 560px;
  margin: 32px 0 0;
  color: var(--muted);
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.32;
}

section[aria-labelledby] {
  padding: 128px 0;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  max-width: 720px;
  margin: 0 0 64px;
  color: var(--ink);
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
}

.post-list {
  border-top: 1px solid var(--line);
}

.post-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.45fr) minmax(0, 1fr);
  gap: 32px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.post-row__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
}

.post-row__body {
  min-width: 0;
}

.post-row h2 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(22px, 2vw, 32px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: 0;
}

.post-row p {
  max-width: 620px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 1.7vw, 22px);
  line-height: 1.35;
}

.post-row:hover h2 {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.more-link {
  display: inline-flex;
  margin-top: 32px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.more-link:hover {
  color: var(--ink);
}

.page-hero,
.archive-header {
  max-width: 880px;
  padding: 128px 0 64px;
}

.page-hero h1,
.archive-header h1 {
  font-size: clamp(56px, 8vw, 96px);
  line-height: 0.98;
}

.page-hero p,
.archive-header p {
  max-width: 560px;
  margin: 32px 0 0;
  color: var(--muted);
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.32;
}

.archive-header + .post-list {
  margin-top: 64px;
}

.article {
  padding-bottom: 96px;
}

.article-header {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  padding: 128px 0 64px;
}

.article-header h1 {
  max-width: 980px;
  font-size: clamp(56px, 8vw, 112px);
  line-height: 0.96;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 32px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}

.article-meta a:hover {
  color: var(--ink);
}

.article-image {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto 64px;
}

.article-image img {
  width: 100%;
  border-radius: var(--radius);
  background: var(--surface);
}

.prose {
  width: min(calc(100% - 32px), var(--measure));
  margin: 0 auto;
  color: var(--prose);
  font-size: 20px;
  line-height: 1.6;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose h2,
.prose h3 {
  margin: 2.2em 0 0.7em;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0;
}

.prose h2 {
  font-size: clamp(32px, 4vw, 48px);
}

.prose h3 {
  font-size: clamp(24px, 3vw, 32px);
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre {
  margin: 1.1em 0;
}

.prose ul,
.prose ol {
  padding-left: 1.35em;
}

.prose li + li {
  margin-top: 0.35em;
}

.prose a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.prose blockquote {
  margin-left: 0;
  padding: 2px 0 2px 20px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.4em 0;
}

.prose img {
  border-radius: var(--radius);
  background: var(--surface);
}

.prose pre {
  overflow-x: auto;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--code-bg);
  color: var(--code-ink);
  font-size: 15px;
  line-height: 1.62;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.prose pre code {
  display: block;
  min-width: max-content;
  color: inherit;
}

.prose :not(pre) > code {
  padding: 0.13em 0.34em;
  border-radius: 5px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 0.9em;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #8f9b8f;
}

.token.punctuation {
  color: #d9d7ce;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol {
  color: #ffd166;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #8bd49c;
}

.token.operator,
.token.entity,
.token.url,
.token.variable {
  color: #d9d7ce;
}

.token.atrule,
.token.attr-value,
.token.function,
.token.class-name {
  color: #7cc7ff;
}

.token.keyword {
  color: #ff8fab;
}

.token.regex,
.token.important {
  color: #ffb86b;
}

.post-nav {
  width: min(calc(100% - 32px), var(--measure));
  margin: 64px auto 0;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.post-nav a {
  max-width: 45%;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.post-nav a:hover {
  color: var(--ink);
}

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

.site-footer__inner {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  padding: 64px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  font-size: 15px;
}

.social-links {
  display: flex;
  gap: 32px;
}

.social-links a {
  font-weight: 500;
}

.social-links a:hover {
  color: var(--ink);
}

@media (max-width: 760px) {
  .site-header__inner {
    min-height: 0;
    padding: 24px 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .site-nav {
    width: 100%;
    justify-content: space-between;
    gap: 18px;
  }

  .hero {
    min-height: auto;
    padding: 96px 0;
  }

  .hero h1 {
    font-size: clamp(56px, 18vw, 80px);
  }

  .hero p {
    font-size: 20px;
  }

  section[aria-labelledby] {
    padding: 96px 0;
  }

  .section-heading {
    margin-bottom: 48px;
  }

  .post-row {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 28px 0;
  }

  .post-row__meta {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .page-hero,
  .archive-header,
  .article-header {
    padding: 96px 0 48px;
  }

  .page-hero h1,
  .archive-header h1,
  .article-header h1 {
    font-size: clamp(48px, 15vw, 72px);
  }

  .page-hero p,
  .archive-header p {
    font-size: 20px;
  }

  .archive-header + .post-list {
    margin-top: 48px;
  }

  .article-image {
    margin-bottom: 48px;
  }

  .prose {
    font-size: 18px;
  }

  .post-nav {
    flex-direction: column;
  }

  .post-nav a {
    max-width: none;
  }

  .site-footer__inner {
    grid-template-columns: 1fr;
  }
}
