:root {
  --bg: #fbfbf8;
  --paper: #ffffff;
  --ink: #182026;
  --muted: #5a6670;
  --line: #d9ded8;
  --accent: #0b6f6a;
  --accent-strong: #064d49;
  --warm: #a94732;
  --soft: #eef3f0;
  --shadow: 0 24px 70px rgba(24, 32, 38, 0.12);
  --measure: 74ch;
  --wide: 1160px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

a {
  color: var(--accent-strong);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

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

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: #fff;
  transform: translateY(-160%);
}

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

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 251, 248, 0.96);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(12px);
}

.site-mark {
  color: var(--ink);
  text-decoration: none;
  display: grid;
  line-height: 1.1;
}

.site-mark__title {
  font-weight: 800;
  font-size: 1rem;
}

.site-mark__note {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  font-size: 0.94rem;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
}

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

.site-main {
  min-height: 70vh;
}

.home-hero {
  min-height: calc(100svh - 74px);
  display: grid;
  align-items: center;
  background: var(--bg);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.home-hero__content {
  width: min(var(--wide), 100%);
  margin: 0 auto;
  padding: clamp(3.5rem, 9vw, 7rem) clamp(1rem, 5vw, 3rem);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 5.5rem);
}

.home-hero__copy {
  max-width: 720px;
  animation: rise-in 580ms ease-out both;
}

.archive-kicker,
.eyebrow {
  margin: 0 0 0.7rem;
  color: var(--warm);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-hero .archive-kicker {
  color: var(--warm);
}

.home-hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2.9rem, 7vw, 6.35rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.hero-lede {
  max-width: 690px;
  margin: 1.4rem 0 0;
  color: var(--muted);
  font-size: clamp(1.06rem, 1.7vw, 1.22rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2rem;
}

.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.72rem 1rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover,
button.button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
  transform: translateY(-1px);
}

.button.secondary {
  background: transparent;
  color: var(--accent-strong);
  border-color: var(--accent);
}

.button.secondary:hover {
  background: var(--soft);
  color: var(--accent-strong);
}

.home-hero__portrait {
  justify-self: end;
  width: min(100%, 460px);
  margin: 0;
  animation: rise-in 680ms ease-out 120ms both;
}

.home-hero__portrait img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center 48%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 28px 80px rgba(24, 32, 38, 0.14);
}

.home-hero__portrait figcaption {
  max-width: 34ch;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.section {
  padding: clamp(3rem, 7vw, 6rem) clamp(1rem, 5vw, 3rem);
}

.section-inner {
  width: min(var(--wide), 100%);
  margin: 0 auto;
}

.section h2,
.page-header h1,
.post-header h1 {
  margin: 0;
  line-height: 1.03;
  letter-spacing: 0;
}

.section h2,
.page-header h1 {
  font-size: clamp(2.1rem, 5vw, 4rem);
}

.section-lede,
.lede {
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 760px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  margin-top: 2rem;
  background: var(--line);
  border: 1px solid var(--line);
}

.stat {
  background: var(--paper);
  padding: 1.25rem;
}

.stat strong {
  display: block;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1;
}

.stat span {
  color: var(--muted);
  font-size: 0.92rem;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 2rem;
  background: var(--line);
  border: 1px solid var(--line);
}

.link-panel {
  min-height: 11rem;
  padding: 1.25rem;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  transition: background 160ms ease, transform 160ms ease;
}

.link-panel:hover {
  background: var(--soft);
  color: var(--ink);
  transform: translateY(-2px);
}

.link-panel strong {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 0.45rem;
}

.link-panel span {
  color: var(--muted);
}

.page-shell,
.post-shell {
  width: min(var(--measure), calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5rem) 0;
}

.post-shell {
  width: min(82ch, calc(100% - 2rem));
}

.page-header,
.post-header {
  margin-bottom: 2rem;
}

.post-header h1 {
  font-size: clamp(2.2rem, 5vw, 4.6rem);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.96rem;
}

.post-notice {
  margin: 0 0 2rem;
  padding: 0.9rem 1rem;
  border-left: 4px solid var(--accent);
  background: var(--soft);
  color: var(--muted);
}

.prose {
  max-width: var(--measure);
}

.prose h2,
.prose h3 {
  line-height: 1.15;
  margin-top: 2.4rem;
  letter-spacing: 0;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote {
  margin: 1rem 0;
}

.prose blockquote {
  margin-left: 0;
  padding-left: 1rem;
  border-left: 4px solid var(--line);
  color: var(--muted);
}

.prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: 0.45rem 0.6rem;
}

.prose img {
  margin: 1.5rem auto;
  box-shadow: var(--shadow);
}

.archive-list,
.result-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}

.archive-list li,
.result-list li {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.archive-list li:last-child,
.result-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.item-title {
  display: block;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
}

.item-meta {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.topic-block {
  padding: 2rem 0;
  border-top: 1px solid var(--line);
}

.topic-block h2 {
  margin-top: 0;
}

.search-form {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  max-width: 720px;
  margin: 1.5rem 0;
}

.search-form input {
  flex: 1;
  min-width: 0;
  min-height: 2.9rem;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 0.7rem 0.85rem;
  font: inherit;
}

.search-form input:focus {
  outline: 3px solid rgba(11, 111, 106, 0.18);
  border-color: var(--accent);
}

.search-status {
  min-height: 1.5rem;
  color: var(--muted);
}

.post-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.site-footer {
  padding: 2rem clamp(1rem, 5vw, 3rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer p {
  max-width: var(--wide);
  margin: 0.4rem auto;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .home-hero {
    min-height: auto;
  }

  .home-hero__content {
    grid-template-columns: 1fr;
  }

  .home-hero__portrait {
    justify-self: start;
    width: min(86vw, 360px);
  }

  .stats-row,
  .link-grid {
    grid-template-columns: 1fr;
  }

  .search-form {
    flex-direction: column;
  }
}
