:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --surface: #fffdf8;
  --text: #24201c;
  --muted: #6f675e;
  --line: #ded6ca;
  --accent: #1f7a6d;
  --warm: #c65a3b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.75;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

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

.brand {
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
}

.header-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem 1rem;
}

.tagline {
  color: var(--muted);
  font-size: 0.9rem;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.social-links a {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.social-links a:hover,
.social-links a:focus-visible {
  border-color: var(--line);
  background: var(--surface);
  outline: none;
}

.social-links svg {
  display: block;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 46px 20px 80px;
}

.intro {
  margin-bottom: 34px;
}

.intro h1,
.article-header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4.8vw, 3rem);
  line-height: 1.15;
}

.intro p,
.article-header p {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.05rem;
}

.eyebrow,
.draft-label {
  margin: 0 0 0.75rem;
  color: var(--warm);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-list {
  display: grid;
  gap: 18px;
}

.article-card {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.article-card time,
.article-header time {
  color: var(--muted);
  font-size: 0.88rem;
}

.article-card h2 {
  margin: 0.2rem 0;
  font-size: clamp(1.35rem, 4vw, 2rem);
  line-height: 1.2;
}

.article-card p {
  max-width: 720px;
  margin: 0.35rem 0 0.7rem;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
}

.tags a {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.article {
  max-width: 760px;
}

.error-page {
  max-width: 680px;
}

.error-page h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4.8vw, 3rem);
  line-height: 1.15;
}

.error-page p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.05rem;
}

.text-link {
  display: inline-flex;
  margin-top: 1rem;
  color: var(--accent);
  font-weight: 800;
}

.article-header {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.article-body {
  padding-top: 28px;
  font-size: 1.05rem;
}

.article-footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.article-footer p {
  margin: 0;
}

.article-body h2,
.article-body h3 {
  margin-top: 2.2rem;
  line-height: 1.25;
}

.article-body pre {
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
}

.article-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.article-body figure {
  margin: 1.6rem 0;
}

.article-body img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.article-body figcaption {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
  text-align: center;
}

.article-body .table-wrap {
  margin: 1.6rem 0;
  overflow-x: auto;
}

.article-body table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.article-body th,
.article-body td {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.article-body th:first-child,
.article-body td:first-child {
  text-align: left;
}

.article-body th {
  background: var(--surface);
  font-weight: 800;
}

.article-body :not(pre) > code {
  padding: 0.12em 0.28em;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}

.highlight {
  color: #2c2620;
}

.highlight .c,
.highlight .cm,
.highlight .c1 {
  color: #84786d;
  font-style: italic;
}

.highlight .k,
.highlight .kd,
.highlight .kn,
.highlight .kp,
.highlight .kr {
  color: #9b3f2f;
  font-weight: 700;
}

.highlight .s,
.highlight .s1,
.highlight .s2,
.highlight .ss {
  color: #1f6f63;
}

.highlight .m,
.highlight .mi,
.highlight .mf {
  color: #8a4f3f;
}

.highlight .nf,
.highlight .nc,
.highlight .nb {
  color: #285f8f;
  font-weight: 700;
}

.highlight .o,
.highlight .p {
  color: #6f675e;
}

.article-body blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 4px solid var(--warm);
  color: var(--muted);
}

@media (max-width: 640px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-meta {
    justify-content: flex-start;
  }

  .page {
    padding-top: 34px;
  }
}
