:root {
  --bg: #f7f3ea;
  --bg-soft: #efe4d3;
  --surface: #fffdf8;
  --text: #1f1b16;
  --text-soft: #3b342d;
  --muted: #6f6354;
  --accent: #0b6e4f;
  --accent-strong: #075a40;
  --line: #e7dccd;
  --shadow: 0 10px 30px rgba(43, 31, 20, 0.06);
  --nav-pill-bg: #fff7ec;
  --selection: #d7efdf;
  --code-bg: #f3ebde;
  --code-border: #eadbc4;
  --pre-bg: #efe5d6;
  --pre-border: #e5d4bc;
  --stamp-text: #8c7d6c;
  --stamp-outline: rgba(141, 120, 96, 0.28);
  --stamp-highlight: rgba(255, 255, 255, 0.72);
  --stamp-shadow: rgba(104, 83, 59, 0.12);
  --font-ui: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", serif;
  --font-reading: Baskerville, "Baskerville Old Face", "Hoefler Text", Garamond, "Times New Roman", serif;
  --texture: url("/assets/nut.svg");
}

html[data-theme="dark"] {
  --bg: #17191b;
  --bg-soft: #202428;
  --surface: #1d2024;
  --text: #e7eaee;
  --text-soft: #d3d8de;
  --muted: #aab2bc;
  --accent: #7fd4b2;
  --accent-strong: #97e8c6;
  --line: #31373d;
  --shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
  --nav-pill-bg: #262b30;
  --selection: #2d4d41;
  --code-bg: #23272b;
  --code-border: #3a4249;
  --pre-bg: #1f2327;
  --pre-border: #343b42;
  --stamp-text: #8b949e;
  --stamp-outline: rgba(145, 154, 163, 0.2);
  --stamp-highlight: rgba(255, 255, 255, 0.05);
  --stamp-shadow: rgba(0, 0, 0, 0.28);
  --texture: url("/assets/nut.svg");
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  font-family: var(--font-ui);
  color: var(--text);
  line-height: 1.75;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--texture) center / 400px;
  filter: blur(4px);
  transform: scale(1.02); /* prevents blur from leaving a white edge */
  opacity: 0.12;
}

main,
.site-header,
.site-footer {
  width: min(820px, 92vw);
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0 1rem;
}

.site-header nav {
  display: flex;
  gap: 0.7rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.site-header nav a {
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.site-header nav a:hover {
  color: var(--accent-strong);
  border-color: var(--line);
  background: var(--nav-pill-bg);
  text-decoration: none;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.2rem;
}

.theme-option {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease;
}

.theme-option svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-option:hover {
  color: var(--accent);
}

.theme-option.is-active {
  background: var(--nav-pill-bg);
  color: var(--accent-strong);
}

.theme-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand {
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  text-decoration: none;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-strong);
}

main {
  animation: enter 550ms ease;
}

.hero,
.post,
.page {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 1.7rem;
  margin: 0.6rem 0 2rem;
}

.hero h1 {
  margin: 0.25rem 0 0.7rem;
  font-size: clamp(1.9rem, 4.8vw, 2.6rem);
  line-height: 1.16;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
}

.eyebrow {
  color: var(--muted);
  margin: 0;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: 0.01em;
}

h2 {
  margin: 2rem 0 0.8rem;
}

section {
  margin-bottom: 2.2rem;
}

.post,
.page {
  padding: 2.2rem;
}

.post {
  max-width: 740px;
  margin: 0 auto;
}

.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.post p,
.post li,
.page p,
.page li,
.post blockquote,
.page blockquote {
  font-family: var(--font-reading);
  font-size: 1.16rem;
  letter-spacing: 0;
  line-height: 1.92;
  color: var(--text-soft);
}

.post h1,
.page h1 {
  margin-top: 0.1rem;
  margin-bottom: 0.55rem;
  font-size: clamp(2.2rem, 4.9vw, 3.05rem);
  line-height: 1.12;
}

.post h2,
.post h3,
.page h2,
.page h3 {
  margin-top: 2.2rem;
  margin-bottom: 0.7rem;
}

.post p + p,
.page p + p {
  margin-top: 1.2rem;
}

.post ul,
.post ol,
.page ul,
.page ol {
  padding-left: 1.35rem;
}

.post li + li,
.page li + li {
  margin-top: 0.45rem;
}

.post-signoff {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.post-signoff img {
  display: block;
  width: min(220px, 46vw);
  height: auto;
  margin-left: auto;
  opacity: 0.92;
}

html[data-theme="dark"] .post-signoff img {
  filter: invert(1);
}

.page-note {
  font-family: var(--font-ui);
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  text-align: right;
  color: var(--muted);
}



.meta,
.site-footer,
.post-list span {
  color: var(--muted);
  font-size: 0.94rem;
}

.post .meta {
  font-family: var(--font-ui);
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list li {
  display: block;
  border-bottom: 1px solid var(--line);
  padding: 1.4rem 0;
}

.post-list li:hover {
  background: transparent;
}

.post-list li:last-child {
  border-bottom: 0;
}

.post-card h2 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  line-height: 1.2;
}

.post-card p {
  font-family: var(--font-reading);
  font-size: 1.04rem;
  line-height: 1.72;
  color: var(--text-soft);
  margin: 0 0 0.6rem;
  max-width: 62ch;
}

.post-card span {
  display: block;
  font-family: var(--font-ui);
  margin-top: 0.2rem;
}

.post-list a {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.post-list a:hover {
  color: var(--accent-strong);
  text-decoration: none;
}


code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
  font-size: 0.92em;
}

pre {
  background: var(--pre-bg);
  border: 1px solid var(--pre-border);
  border-radius: 10px;
  padding: 0.9rem;
  overflow: auto;
}

pre code {
  border: 0;
  padding: 0;
  background: transparent;
}

.site-footer {
  padding: 2.2rem 0;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-row p {
  margin: 0;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.footer-link:hover {
  color: var(--accent-strong);
  border-color: var(--accent);
  background: var(--nav-pill-bg);
  text-decoration: none;
}

.github-icon {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

::selection {
  background: var(--selection);
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(9px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  main {
    animation: none;
  }
}

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

  .site-header nav {
    flex-wrap: wrap;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .hero,
  .post,
  .page {
    padding: 1.2rem;
    border-radius: 12px;
  }

  .post-list li {
    padding: 1.1rem 0;
  }

  .footer-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
