:root {
  --ink: #111827;
  --muted: #5f6b7a;
  --paper: #faf8f1;
  --surface: #ffffff;
  --surface-soft: #f2f6f5;
  --line: #dfe5e4;
  --teal: #007c7a;
  --teal-dark: #075c5a;
  --amber: #c5892c;
  --slate: #1d2736;
  --shadow: 0 18px 45px rgba(25, 39, 58, 0.09);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.72;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.site-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 248, 241, 0.94);
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  backdrop-filter: blur(16px);
}

.site-header__inner {
  display: grid;
  grid-template-columns: auto 1fr minmax(220px, 280px);
  gap: 24px;
  align-items: center;
  min-height: 72px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.site-brand__mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  background: var(--slate);
  border-radius: var(--radius);
  font-weight: 800;
  font-size: 13px;
}

.site-brand__text {
  display: grid;
  gap: 0;
}

.site-brand strong {
  font-size: 18px;
  line-height: 1.2;
}

.site-brand em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.site-nav__list {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__list a {
  display: block;
  padding: 8px 12px;
  color: var(--muted);
  border-radius: var(--radius);
  font-weight: 650;
  font-size: 14px;
}

.site-nav__list a:hover,
.site-nav__list .current-menu-item > a,
.site-nav__list .current_page_item > a {
  color: var(--ink);
  background: #fff;
}

.site-nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.site-nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--ink);
}

.search-form {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 8px;
  width: min(100%, 560px);
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.05);
}

.search-form label {
  min-width: 0;
}

.search-form input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font: inherit;
}

.search-form button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 42px;
  color: #fff;
  background: var(--teal);
  border: 0;
  border-radius: 6px;
  font-size: 22px;
  cursor: pointer;
}

.search-form--compact {
  grid-template-columns: 1fr 38px;
  padding: 4px;
  box-shadow: none;
}

.search-form--compact input,
.search-form--compact button {
  height: 34px;
}

.home-hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(250, 248, 241, 0.98) 0%, rgba(250, 248, 241, 0.9) 46%, rgba(250, 248, 241, 0.48) 100%),
    url("../img/field-notes.png") center right / cover no-repeat,
    var(--surface-soft);
  border-bottom: 1px solid var(--line);
}

.home-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 680px) 260px;
  gap: 56px;
  align-items: center;
  min-height: 480px;
  padding: 68px 0;
}

.section-kicker {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-hero h1,
.reading-header h1,
.section-heading h1,
.section-heading h2 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: 0;
}

.home-hero h1 {
  max-width: 640px;
  font-size: clamp(36px, 6vw, 68px);
}

.home-hero p:not(.section-kicker) {
  max-width: 620px;
  margin: 24px 0;
  color: var(--muted);
  font-size: 18px;
}

.home-hero__panel {
  align-self: end;
  padding: 24px;
  color: #fff;
  background: rgba(29, 39, 54, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.home-hero__panel span,
.home-hero__panel em {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-style: normal;
  text-transform: uppercase;
}

.home-hero__panel strong {
  display: block;
  margin: 6px 0;
  color: var(--amber);
  font-size: 64px;
  line-height: 1;
}

.quick-band {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.quick-band__inner {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 16px 0;
}

.quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 8px 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 700;
}

.quick-chip:hover {
  color: var(--ink);
  border-color: var(--teal);
}

.quick-chip em {
  color: var(--teal);
  font-style: normal;
}

.content-section {
  padding: 56px 0 80px;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 48px;
  align-items: start;
}

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

.section-heading h1,
.section-heading h2 {
  font-size: clamp(28px, 4vw, 42px);
}

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

.post-summary {
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}

.post-summary:first-of-type {
  border-top: 1px solid var(--line);
}

.post-summary__meta,
.reading-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.post-summary__meta span:first-child {
  color: var(--teal);
}

.post-summary h3 {
  max-width: 780px;
  margin: 10px 0 8px;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.25;
}

.post-summary h3 a:hover,
.text-link:hover,
.side-rail a:hover,
.site-footer a:hover {
  color: var(--teal);
}

.post-summary p {
  max-width: 760px;
  margin: 0 0 14px;
  color: var(--muted);
}

.text-link {
  color: var(--ink);
  font-weight: 800;
  border-bottom: 2px solid var(--amber);
}

.side-rail {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 16px;
}

.side-rail__section {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.side-rail__section h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.side-rail__section a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  color: var(--muted);
  border-top: 1px solid rgba(17, 24, 39, 0.06);
  font-weight: 650;
}

.side-rail__section a:first-of-type {
  border-top: 0;
}

.reading-layout,
.page-layout {
  padding: 56px 0 80px;
}

.reading-header {
  max-width: 880px;
  margin-bottom: 34px;
}

.reading-header h1 {
  font-size: clamp(34px, 5vw, 60px);
}

.reading-meta {
  margin-top: 18px;
}

.reading-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 760px);
  gap: 48px;
  align-items: start;
}

.article-toc {
  position: sticky;
  top: 96px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.article-toc h2 {
  margin: 0 0 10px;
  font-size: 15px;
}

.article-toc ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-toc a {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.article-toc .is-sub {
  padding-left: 12px;
}

.entry-content {
  min-width: 0;
  padding: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 35px rgba(25, 39, 58, 0.06);
}

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

.entry-content > *:last-child {
  margin-bottom: 0;
}

.entry-content h2,
.entry-content h3 {
  margin-top: 2em;
  line-height: 1.25;
}

.entry-content p,
.entry-content li {
  color: #273244;
}

.entry-content a {
  color: var(--teal-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.entry-content pre,
.entry-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.entry-content pre {
  overflow-x: auto;
  padding: 18px;
  color: #f7fafc;
  background: var(--slate);
  border-radius: var(--radius);
}

.post-neighbors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 1028px;
  margin-top: 28px;
  margin-left: auto;
}

.post-neighbors a {
  display: block;
  min-height: 88px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 750;
}

.post-neighbors span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.pagination-wrap {
  margin-top: 28px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.page-numbers {
  display: grid;
  place-items: center;
  min-width: 38px;
  min-height: 38px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.page-numbers.current {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.empty-state {
  padding: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.site-footer {
  color: rgba(255, 255, 255, 0.78);
  background: var(--slate);
}

.site-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 32px;
  align-items: start;
  padding: 38px 0;
}

.site-footer__eyebrow {
  margin: 0 0 8px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.site-footer__title {
  margin: 0;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
}

.site-footer__copy {
  margin: 6px 0 0;
}

.site-footer__links {
  display: grid;
  gap: 8px;
}

@media (max-width: 980px) {
  .site-header__inner {
    grid-template-columns: auto 42px;
  }

  .site-header__search {
    display: none;
  }

  .site-nav-toggle {
    display: block;
    justify-self: end;
  }

  .site-nav {
    display: none;
    grid-column: 1 / -1;
    padding-bottom: 14px;
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav__list {
    display: grid;
    justify-content: stretch;
  }

  .home-hero__inner,
  .content-layout,
  .reading-grid,
  .site-footer__inner {
    grid-template-columns: 1fr;
  }

  .home-hero__inner {
    min-height: 0;
    padding: 48px 0;
  }

  .home-hero__panel,
  .side-rail,
  .article-toc {
    position: static;
  }

  .post-neighbors {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .site-shell {
    width: min(100% - 24px, 1120px);
  }

  .site-brand__text em {
    display: none;
  }

  .home-hero h1 {
    font-size: 36px;
  }

  .content-section,
  .reading-layout,
  .page-layout {
    padding: 36px 0 56px;
  }

  .entry-content {
    padding: 22px;
  }

  .post-neighbors {
    grid-template-columns: 1fr;
  }
}

