:root {
  --paper: #F5F6F3;
  --surface: #FFFFFF;
  --ink: #1F2A33;
  --ink-soft: #56636D;
  --line: #D9DEDD;
  --patina: #2E6B5E;
  --patina-dark: #23544A;
  --patina-soft: #E4EFEB;
  --footer: #EBEEEB;
  --font-display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Literata', Georgia, 'Times New Roman', serif;
  --container: 1200px;
  --narrow: 760px;
  --radius: 6px;
  --gable: polygon(0 15%, 50% 0, 100% 15%, 100% 100%, 0 100%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
}

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

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--patina);
  outline-offset: 3px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: var(--font-display);
  font-stretch: 112%;
  line-height: 1.15;
  color: var(--ink);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

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

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 300;
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-display);
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  border: 1px solid var(--patina);
  border-radius: 4px;
  background: var(--patina);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.button:hover {
  background: var(--patina-dark);
  border-color: var(--patina-dark);
}

.button--small {
  padding: 10px 18px;
  font-size: 0.9375rem;
}

.button--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.button--ghost:hover {
  background: var(--paper);
  border-color: var(--ink-soft);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  color: var(--patina);
}

.brand-text {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  line-height: 1.1;
}

.brand-small {
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  font-stretch: 118%;
}

.site-nav ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: 10px 14px;
  border-radius: 4px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.site-nav a:hover {
  background: var(--patina-soft);
  color: var(--patina-dark);
}

.nav-toggle {
  display: none;
}

.hero {
  padding: 56px 0 72px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.hero-article {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  gap: 56px;
}

.hero-article--no-image {
  grid-template-columns: minmax(0, 1fr);
  max-width: var(--narrow);
}

.hero-kicker {
  margin: 0 0 16px;
  color: var(--patina);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
}

.hero-title {
  margin-bottom: 20px;
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  font-weight: 750;
  letter-spacing: -0.01em;
}

.hero-title a {
  text-decoration: none;
  transition: color 0.2s ease;
}

.hero-title a:hover {
  color: var(--patina-dark);
}

.hero-excerpt {
  max-width: 46ch;
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 1.125rem;
}

.hero-text .card-meta {
  margin: 0 0 28px;
}

.hero-media {
  display: block;
}

.hero-media img {
  width: 100%;
  aspect-ratio: 6 / 5;
  object-fit: cover;
  clip-path: var(--gable);
}

.card-category {
  margin: 0 0 8px;
  color: var(--patina);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 0.8125rem;
}

.section {
  padding: 80px 0;
}

.section-head {
  margin-bottom: 36px;
}

.section-title {
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  font-weight: 700;
}

.latest-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 48px;
}

.lead-card-media {
  display: block;
  margin-bottom: 22px;
}

.lead-card-media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius);
}

.lead-card-title {
  margin-bottom: 12px;
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  font-weight: 700;
  line-height: 1.2;
}

.lead-card-excerpt {
  max-width: 60ch;
  margin: 0;
  color: var(--ink-soft);
}

.latest-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.latest-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.latest-item:first-child {
  padding-top: 0;
  border-top: none;
}

.latest-item--no-image {
  grid-template-columns: minmax(0, 1fr);
}

.latest-item-media img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
}

.latest-item-title {
  font-size: 1.125rem;
  font-weight: 650;
  line-height: 1.3;
}

.lead-card-title a,
.latest-item-title a,
.post-card-title a {
  text-decoration: none;
  transition: color 0.2s ease;
}

.lead-card-title a:hover,
.latest-item-title a:hover,
.post-card-title a:hover {
  color: var(--patina-dark);
}

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

.welcome-inner {
  max-width: var(--narrow);
  margin: 0 auto;
}

.welcome-title {
  margin-bottom: 28px;
  font-size: clamp(2rem, 3.6vw, 2.9rem);
  font-weight: 750;
  letter-spacing: -0.01em;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px 32px;
}

.post-card-media {
  display: block;
}

.post-card-media img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 4px;
}

.post-card-body {
  padding-top: 18px;
}

.post-card-title {
  margin-bottom: 10px;
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1.3;
}

.post-card-excerpt {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.6;
}

.popular {
  background: var(--patina-soft);
}

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

.popular-item {
  position: relative;
  padding: 20px 0 20px 64px;
  border-top: 1px solid rgba(46, 107, 94, 0.2);
  counter-increment: popular;
}

.popular-item::before {
  content: counter(popular);
  position: absolute;
  top: 14px;
  left: 0;
  color: var(--patina);
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  font-stretch: 125%;
  line-height: 1;
}

.popular-link {
  display: block;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  transition: color 0.2s ease;
}

.popular-link:hover {
  color: var(--patina-dark);
}

.popular-views {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 0.8125rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding-top: 28px;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 0.875rem;
}

.breadcrumbs a {
  color: var(--ink-soft);
  text-underline-offset: 3px;
}

.breadcrumbs a:hover {
  color: var(--patina-dark);
}

.article-header {
  max-width: var(--narrow);
  padding: 28px 0 40px;
}

.article-title {
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  font-weight: 750;
  letter-spacing: -0.01em;
}

.article-lead {
  max-width: 60ch;
  margin: 20px 0 0;
  color: var(--ink-soft);
  font-size: 1.2rem;
  line-height: 1.6;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 0.9rem;
}

.article-meta strong {
  color: var(--ink);
  font-weight: 600;
}

.article-image {
  margin: 0 0 56px;
}

.article-image img {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  border-radius: var(--radius);
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--narrow)) 280px;
  justify-content: space-between;
  align-items: start;
  gap: 64px;
  padding-bottom: 72px;
}

.article-layout--single {
  grid-template-columns: minmax(0, var(--narrow));
}

.article-aside {
  position: sticky;
  top: 100px;
}

.toc {
  padding: 4px 0 4px 20px;
  border-left: 2px solid var(--patina);
}

.toc-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.toc-list {
  margin: 0;
  padding-left: 20px;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.toc-list li {
  margin-bottom: 10px;
}

.toc-list li::marker {
  color: var(--patina);
  font-weight: 600;
}

.toc-list a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}

.toc-list a:hover {
  color: var(--patina-dark);
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 40px 0 72px;
  border-top: 1px solid var(--line);
}

.post-nav-link {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.2s ease;
}

.post-nav-link:hover {
  border-color: var(--patina);
}

.post-nav-link--next {
  grid-template-columns: minmax(0, 1fr) 88px;
  text-align: right;
}

.post-nav-link--no-image {
  grid-template-columns: minmax(0, 1fr);
}

.post-nav-link img {
  width: 88px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
}

.post-nav-label {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 0.8125rem;
}

.post-nav-title {
  display: block;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.related {
  padding: 72px 0 88px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.prose {
  font-size: 1.125rem;
  line-height: 1.75;
}

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

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

.prose p {
  margin: 0 0 1.3em;
}

.prose h2 {
  margin: 2.2em 0 0.7em;
  font-size: clamp(1.55rem, 2.4vw, 1.95rem);
  font-weight: 700;
  scroll-margin-top: 100px;
}

.prose h3 {
  margin: 1.8em 0 0.6em;
  font-size: 1.35rem;
  font-weight: 650;
  scroll-margin-top: 100px;
}

.prose h4 {
  margin: 1.6em 0 0.5em;
  font-size: 1.125rem;
  font-weight: 650;
}

.prose h5,
.prose h6 {
  margin: 1.4em 0 0.4em;
  font-size: 1rem;
  font-weight: 600;
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

.prose a {
  color: var(--patina);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(46, 107, 94, 0.4);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  word-break: break-word;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.prose a:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

.prose a:has(img) {
  display: inline-block;
  text-decoration: none;
}

.prose h2 a,
.prose h3 a,
.prose h4 a {
  color: inherit;
  font-weight: inherit;
}

.prose ul,
.prose ol {
  margin: 1.4em 0 1.6em;
  padding-left: 24px;
}

.prose ul {
  list-style-type: disc;
}

.prose ol {
  list-style-type: decimal;
}

.prose li {
  margin-bottom: 10px;
  padding-left: 6px;
}

.prose li:last-child {
  margin-bottom: 0;
}

.prose li::marker {
  color: var(--patina);
}

.prose ol > li::marker {
  font-weight: 600;
}

.prose li ul,
.prose li ol {
  margin: 10px 0 0;
}

.prose li ul {
  list-style-type: circle;
}

.prose blockquote {
  margin: 2em 0;
  padding: 4px 0 4px 24px;
  border-left: 3px solid var(--patina);
  color: var(--ink);
  font-style: italic;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose img {
  margin: 2em 0;
  border-radius: var(--radius);
}

.prose figure {
  margin: 2em 0;
}

.prose figure img {
  margin: 0;
}

.prose figcaption {
  margin-top: 10px;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 0.875rem;
}

.prose hr {
  margin: 2.5em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.prose code {
  padding: 0.1em 0.35em;
  border-radius: 3px;
  background: var(--patina-soft);
  font-size: 0.9em;
}

.prose iframe,
.prose video {
  max-width: 100%;
}

.table-wrap {
  width: 100%;
  margin: 2em 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.prose table {
  width: 100% !important;
  border: none;
  border-collapse: collapse;
  background: var(--surface);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  line-height: 1.5;
  text-align: left;
}

.prose th,
.prose td {
  padding: 14px 18px;
  border: none;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.prose th,
.prose thead td {
  background: var(--patina-soft);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 700;
}

.prose tr:last-child td {
  border-bottom: none;
}

.prose tbody tr:hover {
  background: rgba(46, 107, 94, 0.03);
}

.prose table p {
  margin: 0;
}

.site-footer {
  padding: 64px 0 0;
  background: var(--footer);
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 0.9375rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 40px;
}

.footer-brand .brand {
  margin-bottom: 18px;
}

.footer-text {
  max-width: 36ch;
  margin: 0;
  line-height: 1.6;
}

.footer-heading {
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
}

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

.footer-links li {
  margin-bottom: 10px;
  line-height: 1.4;
}

.footer-links a,
.footer-legal a,
.footer-legal button {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover,
.footer-legal a:hover,
.footer-legal button:hover {
  color: var(--patina-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-mail {
  margin: 12px 0 0;
}

.footer-mail a {
  color: var(--patina-dark);
  font-weight: 600;
  word-break: break-all;
  text-underline-offset: 3px;
}

.footer-disclaimer {
  margin-top: 48px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.footer-disclaimer p {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 32px;
}

.copyright {
  margin: 0;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.footer-legal button {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  cursor: pointer;
}

.cookie-modal {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 100;
  width: min(380px, calc(100% - 32px));
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--patina);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(31, 42, 51, 0.14);
  font-family: var(--font-display);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.cookie-modal[hidden] {
  display: none;
}

.cookie-modal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.cookie-title {
  margin-bottom: 8px;
  font-size: 1.125rem;
  font-weight: 700;
}

.cookie-text {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.cookie-text a {
  color: var(--patina-dark);
  text-underline-offset: 3px;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 1080px) {
  .article-layout,
  .article-layout--single {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .article-aside {
    position: static;
    order: -1;
  }

  .toc {
    padding: 20px 20px 20px 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 3px solid var(--patina);
    border-radius: 4px;
  }
}

@media (max-width: 960px) {
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
    cursor: pointer;
  }

  .nav-toggle-bar {
    display: block;
    height: 2px;
    background: var(--ink);
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .site-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(31, 42, 51, 0.08);
  }

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

  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 4px 24px 16px;
  }

  .site-nav a {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }

  .site-nav li:last-child a {
    border-bottom: none;
  }

  .site-nav a:hover {
    background: none;
  }

  .hero-article {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .hero-media {
    order: -1;
  }

  .latest-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 18px;
  }

  .header-inner {
    min-height: 64px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-name {
    font-size: 1.125rem;
  }

  .hero {
    padding: 32px 0 48px;
  }

  .section {
    padding: 56px 0;
  }

  .latest-item {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 16px;
  }

  .post-grid,
  .popular-list,
  .footer-grid,
  .post-nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .popular-item {
    padding-left: 52px;
  }

  .popular-item::before {
    font-size: 1.875rem;
  }

  .prose {
    font-size: 1.0625rem;
  }

  .article-image {
    margin-bottom: 36px;
  }

  .article-image img {
    aspect-ratio: 3 / 2;
  }

  .cookie-modal {
    bottom: 16px;
    left: 16px;
    padding: 20px;
  }
}

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

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