:root {
  color-scheme: light dark;
  --bg: #f4f7f3;
  --paper: #fffefa;
  --paper-soft: #eef3ed;
  --ink: #18201d;
  --muted: #607068;
  --line: rgba(24, 32, 29, 0.16);
  --accent: #2f6f5e;
  --accent-strong: #214f44;
  --accent-ink: #f4fff9;
  --shadow: 0 18px 44px rgba(24, 32, 29, 0.12);
  --radius: 8px;
  --container: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151916;
    --paper: #1d2420;
    --paper-soft: #202b26;
    --ink: #edf4ef;
    --muted: #b5c3bb;
    --line: rgba(237, 244, 239, 0.16);
    --accent: #8bc7ad;
    --accent-strong: #b9e4cf;
    --accent-ink: #102019;
    --shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(47, 111, 94, 0.08), transparent 460px),
    var(--bg);
  color: var(--ink);
  font-family: Avenir Next, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

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

a {
  color: inherit;
  text-underline-offset: 0.18em;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.container {
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 18px;
  line-height: 1;
}

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  padding: 9px 12px;
  font: inherit;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  border-radius: var(--radius);
  color: var(--muted);
  padding: 9px 12px;
  text-decoration: none;
}

.site-nav a[aria-current="page"],
.site-nav a:hover {
  background: var(--paper);
  color: var(--ink);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(320px, 0.94fr);
  align-items: center;
  gap: 56px;
  padding: 58px 0 44px;
}

.hero h1,
.page-title,
.post-title {
  margin: 0;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1;
  text-wrap: balance;
}

.hero h1 {
  max-width: 660px;
  font-size: 56px;
}

.hero p {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 20px;
}

.hero-actions,
.page-actions,
.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  font-weight: 750;
  text-decoration: none;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--accent-ink);
}

.button:active {
  transform: translateY(1px);
}

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

.button.secondary:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent-strong);
}

.hero-figure {
  margin: 0;
}

.hero-figure img,
.feature-photo,
.post-hero img,
.about-photo {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-soft);
  box-shadow: var(--shadow);
  object-fit: cover;
}

.hero-figure img {
  aspect-ratio: 1 / 1;
  object-position: center;
}

.section {
  padding: 58px 0;
}

.section.tight {
  padding-top: 24px;
}

.section-header {
  max-width: 720px;
  margin-bottom: 28px;
}

.section-header h2,
.content-block h2,
.article-body h2 {
  margin: 0;
  font-size: 36px;
  line-height: 1.12;
  letter-spacing: 0;
}

.section-header p,
.content-block p {
  margin: 12px 0 0;
  color: var(--muted);
}

.post-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

.post-card {
  display: grid;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.post-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  box-shadow: var(--shadow);
  color: inherit;
}

.post-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.post-card.large {
  grid-row: span 2;
}

.post-card.large img {
  aspect-ratio: 16 / 12;
}

.post-card-body {
  padding: 20px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.post-card h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.18;
  letter-spacing: 0;
}

.post-card p {
  margin: 12px 0 0;
  color: var(--muted);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.theme-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 22px;
}

.theme-item:nth-child(3) {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 20%, transparent), transparent),
    var(--paper);
}

.theme-item:nth-child(4) {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    var(--paper-soft);
}

.theme-item h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.theme-item p {
  margin: 10px 0 0;
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: center;
  gap: 44px;
}

.feature-photo {
  aspect-ratio: 4 / 3;
}

.notebook-grid {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 34px;
  align-items: start;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding-top: 34px;
  padding-bottom: 34px;
}

.note-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.note-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 18px;
}

.note-item time {
  display: block;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 750;
  margin-bottom: 10px;
}

.note-item h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.2;
}

.note-item p {
  margin: 10px 0 0;
  color: var(--muted);
}

.page-hero {
  padding: 54px 0 26px;
}

.page-title {
  max-width: 850px;
  font-size: 64px;
}

.page-lead {
  max-width: 700px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 20px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 30px 0 10px;
}

.filter-row button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  padding: 9px 14px;
  font: inherit;
  cursor: pointer;
}

.filter-row button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.archive-grid .post-card {
  grid-template-rows: auto 1fr;
}

[hidden] {
  display: none !important;
}

.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 40px;
  align-items: start;
}

.about-photo {
  aspect-ratio: 4 / 5;
}

.content-block {
  border-top: 1px solid var(--line);
  padding-top: 26px;
}

.content-block + .content-block {
  margin-top: 34px;
}

.list-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.list-grid li {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 16px;
}

.timeline {
  display: grid;
  gap: 14px;
  margin: 20px 0 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.timeline-item strong {
  color: var(--accent-strong);
}

.contact-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 34px;
}

.contact-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 22px;
}

.contact-card h2 {
  margin: 0 0 12px;
  font-size: 26px;
}

.contact-card p {
  margin: 0;
  color: var(--muted);
}

.contact-card a {
  display: inline-block;
  margin-top: 12px;
  font-weight: 750;
}

.post-shell {
  max-width: 820px;
  margin: 0 auto;
  padding: 52px 0 66px;
}

.post-title {
  font-size: 60px;
}

.post-lead {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 21px;
}

.post-hero {
  margin: 34px 0;
}

.post-hero img {
  aspect-ratio: 16 / 9;
}

.article-body {
  font-size: 18px;
}

.article-body p {
  margin: 0 0 22px;
}

.article-body h2 {
  margin: 42px 0 14px;
}

.quote {
  margin: 34px 0;
  border-left: 1px solid var(--accent);
  padding: 2px 0 2px 22px;
  color: var(--accent-strong);
  font-size: 22px;
  line-height: 1.45;
}

.post-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  margin-top: 46px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  color: var(--muted);
}

.footer-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

@media (max-width: 920px) {
  .hero,
  .split,
  .about-grid,
  .notebook-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 34px;
  }

  .hero h1,
  .page-title,
  .post-title {
    font-size: 50px;
  }

  .post-grid,
  .theme-grid,
  .archive-grid,
  .contact-panel,
  .note-list {
    grid-template-columns: 1fr;
  }

  .post-card.large {
    grid-row: auto;
  }
}

@media (max-width: 700px) {
  .container {
    width: min(100% - 28px, var(--container));
  }

  .nav-shell {
    min-height: 64px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    left: 14px;
    right: 14px;
    top: 72px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    padding: 8px;
    box-shadow: var(--shadow);
  }

  .site-nav[data-open] {
    display: flex;
  }

  .site-nav a {
    padding: 11px 12px;
  }

  .hero,
  .page-hero,
  .section,
  .post-shell {
    padding-top: 34px;
    padding-bottom: 34px;
  }

  .hero h1,
  .page-title,
  .post-title {
    font-size: 42px;
    line-height: 1.04;
  }

  .hero p,
  .page-lead,
  .post-lead {
    font-size: 18px;
  }

  .hero-actions,
  .page-actions,
  .post-actions,
  .post-footer,
  .footer-shell {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .list-grid,
  .timeline-item {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    gap: 4px;
  }
}
