:root {
  color-scheme: light;
  --bg: #fbfaf6;
  --surface: #ffffff;
  --surface-2: #f2efe7;
  --text: #17211d;
  --muted: #5f6d65;
  --border: #ddd6c8;
  --brand: #15372c;
  --brand-2: #24594a;
  --accent: #c9552a;
  --accent-2: #1f7a8c;
  --gold: #d89922;
  --shadow: 0 18px 40px rgba(32, 42, 37, 0.10);
  --radius: 8px;
  --container: 1180px;
  --header-h: 74px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101715;
  --surface: #17211f;
  --surface-2: #1e2b27;
  --text: #f2f1e9;
  --muted: #bcc8bf;
  --border: #31443e;
  --brand: #8bd8bd;
  --brand-2: #9ce4cd;
  --accent: #f08a58;
  --accent-2: #7ed0df;
  --gold: #e8bb54;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
}

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

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

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

h1, h2, h3 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 4.4vw, 3.75rem);
  max-width: 14ch;
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.45rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0;
}

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 20;
  background: var(--text);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: var(--radius);
}

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

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

.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  min-width: max-content;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--accent-2));
  color: white;
  font-weight: 900;
}

.brand-copy {
  display: grid;
  gap: 0;
}

.brand-copy strong {
  font-size: 1.04rem;
  line-height: 1.1;
}

.brand-copy span {
  color: var(--muted);
  font-size: 0.78rem;
}

.site-nav {
  margin-left: auto;
  display: flex;
  gap: 4px;
  align-items: center;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 10px 10px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.93rem;
}

.site-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  gap: 4px;
}

.nav-toggle span {
  width: 18px;
  height: 2px;
  background: currentColor;
}

.theme-toggle-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid currentColor;
  box-shadow: inset 7px -2px 0 currentColor;
}

.home-hero {
  min-height: min(620px, calc(100svh - var(--header-h) - 64px));
  padding: clamp(24px, 4vw, 42px) 0 26px;
  display: grid;
  align-items: center;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-2) 88%, transparent) 0%, var(--bg) 54%, color-mix(in srgb, var(--accent) 10%, var(--bg)) 100%);
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(340px, 0.72fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.hero-copy {
  display: grid;
  gap: 22px;
}

.hero-copy h1 {
  max-width: 15ch;
}

.hero-lede {
  color: var(--muted);
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  max-width: 62ch;
}

.hero-actions,
.section-heading-row,
.card-footer,
.post-meta,
.footer-bottom {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.button {
  appearance: none;
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  min-height: 44px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.button.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.button.secondary:hover {
  background: var(--surface-2);
  color: var(--text);
}

.full-width {
  width: 100%;
}

.eyebrow {
  color: var(--accent);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.section-block {
  padding: clamp(44px, 7vw, 84px) 0;
}

.home-page .home-hero + .section-block {
  padding-top: 24px;
}

.muted-band {
  background: var(--surface-2);
  border-block: 1px solid var(--border);
}

.section-heading-row {
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-heading-row > div {
  display: grid;
  gap: 7px;
}

.text-link {
  font-weight: 900;
  color: var(--brand-2);
}

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

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

.post-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  overflow: clip;
  box-shadow: var(--shadow);
  min-width: 0;
}

.post-card:hover .post-media img {
  transform: scale(1.035);
}

.post-media {
  display: block;
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 16 / 9;
}

.post-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.post-card-body {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.post-card h2 {
  font-size: clamp(1.08rem, 2vw, 1.42rem);
}

.post-card h2 a {
  text-decoration: none;
}

.post-card p {
  color: var(--muted);
}

.post-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-2) 13%, var(--surface));
  color: var(--brand-2);
  font-weight: 900;
  text-decoration: none;
}

.card-footer {
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.featured-card .post-card-body {
  padding: 16px;
  gap: 10px;
}

.featured-card h2 {
  font-size: clamp(1.25rem, 2.1vw, 1.75rem);
}

.hero-feature .post-media {
  aspect-ratio: 21 / 10;
}

.hero-feature .post-card p {
  font-size: 0.98rem;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

.two-column > div:first-child {
  display: grid;
  gap: 12px;
}

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

.section-chip-grid a {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
}

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

.page-hero {
  padding: clamp(42px, 7vw, 86px) 0;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.compact-hero .container {
  display: grid;
  gap: 14px;
}

.compact-hero h1 {
  max-width: 16ch;
}

.compact-hero p:not(.eyebrow) {
  max-width: 72ch;
  color: var(--muted);
}

.breadcrumbs ol {
  list-style: none;
  padding: 0;
  margin: 0 0 6px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.86rem;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 8px;
  color: var(--muted);
}

.search-tools {
  display: grid;
  gap: 14px;
  margin-top: 10px;
}

.search-box {
  display: grid;
  gap: 6px;
  max-width: 620px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 12px 13px;
  font: inherit;
}

input:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent-2) 55%, transparent);
  outline-offset: 2px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
  cursor: pointer;
}

.filter-chip.active,
.filter-chip:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.empty-state {
  margin-top: 20px;
  color: var(--muted);
  font-weight: 800;
}

.article-header {
  padding: clamp(34px, 6vw, 70px) 0;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.article-header-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.7fr);
  gap: clamp(24px, 5vw, 54px);
  align-items: center;
}

.article-header-grid > div:first-child {
  display: grid;
  gap: 16px;
}

.article-header h1 {
  max-width: 15ch;
  font-size: clamp(1.9rem, 4vw, 3.45rem);
}

.dek {
  color: var(--muted);
  font-size: 1.16rem;
  max-width: 66ch;
}

.article-figure {
  margin: 0;
  border-radius: var(--radius);
  overflow: clip;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--surface);
}

.article-figure figcaption {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.article-figure figcaption a {
  font-weight: 700;
}

.reading-progress {
  position: fixed;
  top: var(--header-h);
  left: 0;
  width: 0;
  height: 3px;
  background: var(--accent);
  z-index: 11;
}

.article-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 760px);
  gap: 42px;
  align-items: start;
  padding-block: clamp(44px, 7vw, 82px);
}

.article-aside {
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.aside-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
  display: grid;
  gap: 14px;
}

.aside-box dl {
  margin: 0;
  display: grid;
  gap: 10px;
}

.aside-box div {
  display: grid;
  gap: 2px;
}

.aside-box dt {
  color: var(--muted);
  font-size: 0.82rem;
}

.aside-box dd {
  margin: 0;
  font-weight: 800;
}

.article-content {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.article-content p {
  font-size: 1.07rem;
}

.article-content h2 {
  margin-top: 12px;
  font-size: 1.75rem;
}

.source-list {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  display: grid;
  gap: 12px;
}

.source-list h2 {
  font-size: 1.35rem;
}

.source-list p,
.source-list li {
  color: var(--muted);
}

.source-list ul {
  margin: 0;
  padding-left: 20px;
}

.related-block {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}

.narrow-page {
  max-width: 820px;
  display: grid;
  gap: 18px;
}

.narrow-page h2 {
  margin-top: 12px;
  font-size: 1.75rem;
}

.contact-form {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

.contact-form label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.form-note {
  color: var(--muted);
  font-size: 0.93rem;
}

.site-footer {
  background: #0f1d19;
  color: #f8f3e8;
  padding: 46px 0 24px;
}

.site-footer a {
  color: inherit;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.3fr) repeat(3, minmax(150px, 0.7fr));
  gap: 28px;
}

.footer-grid h2 {
  font-size: 1rem;
  margin-bottom: 10px;
}

.footer-grid p,
.footer-grid li {
  color: #cfdad2;
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

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

.footer-bottom {
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: #cfdad2;
}

@media (max-width: 980px) {
  .nav-toggle {
    display: inline-grid;
  }

  .site-nav {
    position: absolute;
    inset: var(--header-h) 16px auto 16px;
    display: none;
    margin-left: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
  }

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

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

  .theme-toggle {
    margin-left: 0;
  }

  .hero-grid,
  .article-header-grid,
  .two-column,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    order: 1;
  }

  .hero-feature {
    order: 2;
  }

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

  .article-aside {
    position: static;
  }

  .aside-box {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  :root {
    --header-h: 68px;
  }

  body {
    font-size: 15px;
  }

  .container {
    width: min(100% - 24px, var(--container));
  }

  .brand-copy span {
    display: none;
  }

  .hero-actions .button,
  .page-hero .button,
  .contact-form .button {
    width: 100%;
  }

  .post-grid,
  .post-grid.compact,
  .section-chip-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

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

  h1,
  .article-header h1,
  .compact-hero h1 {
    max-width: 100%;
  }

  .footer-bottom {
    align-items: flex-start;
  }
}
