:root {
  color-scheme: light;
  --bg: #f4f1eb;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #fffdf9;
  --text: #171715;
  --muted: #66645f;
  --faint: #8a877f;
  --line: rgba(23, 23, 21, 0.1);
  --accent: #b94f2b;
  --accent-soft: rgba(185, 79, 43, 0.11);
  --shadow: 0 18px 50px rgba(55, 45, 30, 0.07);
  --radius: 22px;
  --max-width: 1040px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151514;
  --surface: rgba(35, 35, 33, 0.78);
  --surface-solid: #222220;
  --text: #f1eee7;
  --muted: #b8b4ac;
  --faint: #918d86;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #e58b66;
  --accent-soft: rgba(229, 139, 102, 0.12);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 75% 12%, var(--accent-soft), transparent 25rem),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.68;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

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

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

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  width: min(calc(100% - 48px), var(--max-width));
  min-height: 82px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(18px);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 18px;
  font-weight: 760;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.wordmark-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

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

.nav-link {
  position: relative;
  color: var(--muted);
  font-size: 14px;
  font-weight: 680;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.nav-link::after {
  position: absolute;
  right: 0;
  bottom: -8px;
  left: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  content: "";
  opacity: 0;
  transform: scaleX(0.5);
  transition: 160ms ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
}

.nav-link:hover::after,
.nav-link.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.theme-toggle {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

.theme-toggle:hover {
  border-color: var(--faint);
  transform: rotate(12deg);
}

.hero,
.writing,
.site-footer,
.article-shell {
  width: min(calc(100% - 48px), var(--max-width));
  margin-right: auto;
  margin-left: auto;
}

.hero {
  padding: 118px 0 130px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0.19em;
}

.hero h1 {
  max-width: 960px;
  margin: 0;
  font-size: clamp(52px, 7.2vw, 88px);
  font-weight: 760;
  letter-spacing: -0.018em;
  line-height: 1.08;
}

.accent-text {
  color: var(--accent);
}

.role-line {
  margin: 38px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 510;
  letter-spacing: -0.02em;
}

.role-line span {
  padding: 0 8px;
  color: var(--faint);
}

.intro-copy {
  display: grid;
  max-width: 845px;
  margin-top: 34px;
  gap: 16px;
  color: var(--muted);
  font-size: 18px;
}

.intro-copy p {
  margin: 0;
}

.intro-copy a,
.article-content a {
  color: var(--text);
  font-weight: 670;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.intro-copy a:hover,
.article-content a:hover {
  color: var(--accent);
}

.social-links {
  display: flex;
  margin-top: 34px;
  flex-wrap: wrap;
  gap: 12px;
}

.social-link {
  display: inline-flex;
  height: 46px;
  padding: 0 17px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 6px 20px rgba(55, 45, 30, 0.035);
  color: var(--text);
  font-size: 14px;
  font-weight: 680;
  text-decoration: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.social-link:hover {
  border-color: var(--faint);
  background: var(--surface-solid);
  transform: translateY(-2px);
}

.social-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.writing {
  padding: 0 0 120px;
}

.section-heading {
  display: flex;
  margin-bottom: 36px;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

.section-heading .eyebrow {
  margin-bottom: 10px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(36px, 5vw, 56px);
  letter-spacing: -0.055em;
  line-height: 1;
}

.section-note {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  text-align: right;
}

.category-filter {
  display: flex;
  margin: 0 0 28px;
  flex-wrap: wrap;
  gap: 9px;
}

.category-filter button {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 680;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.category-filter button:hover {
  border-color: var(--faint);
  color: var(--text);
}

.category-filter button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: var(--accent-soft);
  color: var(--accent);
}

.post-list {
  display: grid;
  gap: 18px;
}

.post-card {
  display: grid;
  min-height: 230px;
  padding: clamp(28px, 5vw, 50px);
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 36px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.post-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--surface-solid);
  transform: translateY(-3px);
}

.post-meta {
  display: flex;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-meta span + span::before {
  margin-right: 9px;
  content: "·";
}

.post-meta .post-type {
  color: var(--accent);
}

.post-card h3 {
  max-width: 790px;
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  letter-spacing: -0.047em;
  line-height: 1.1;
}

.post-summary {
  max-width: 720px;
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.post-arrow {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font-size: 23px;
  transition:
    background 180ms ease,
    transform 180ms ease;
}

.post-card:hover .post-arrow {
  background: var(--accent-soft);
  transform: translateX(4px);
}

.empty-state {
  padding: clamp(34px, 6vw, 62px);
  border: 1px dashed color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: var(--radius);
  background: var(--surface);
}

.empty-state p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
}

.empty-state strong {
  display: block;
  margin-bottom: 9px;
  color: var(--text);
  font-size: 22px;
}

.site-footer {
  display: flex;
  min-height: 110px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 13px;
}

.site-footer a {
  color: var(--muted);
  font-weight: 650;
  text-decoration: none;
}

/* Article template */
.article-shell {
  max-width: 820px;
  padding: 82px 0 120px;
}

.back-link {
  color: var(--muted);
  font-size: 14px;
  font-weight: 680;
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent);
}

.article-header {
  padding: 60px 0 46px;
  border-bottom: 1px solid var(--line);
}

.article-header h1 {
  margin: 12px 0 22px;
  font-size: clamp(38px, 5.4vw, 58px);
  letter-spacing: -0.018em;
  line-height: 1.12;
}

.article-dek {
  max-width: 710px;
  margin: 0;
  color: var(--muted);
  font-size: 20px;
}

.article-source {
  display: inline-flex;
  margin-top: 24px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.article-source:hover {
  color: var(--accent);
}

.article-cover {
  margin: 42px 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-solid);
  box-shadow: var(--shadow);
}

.article-cover img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}

.article-content {
  padding-top: 52px;
  color: color-mix(in srgb, var(--text) 86%, var(--muted));
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1.82;
}

.article-content h2,
.article-content h3 {
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.article-content h2 {
  margin: 2.4em 0 0.7em;
  font-size: 34px;
}

.article-content h3 {
  margin: 2em 0 0.6em;
  font-size: 25px;
}

.article-content p,
.article-content ul,
.article-content ol,
.article-content blockquote {
  margin: 0 0 1.35em;
}

.article-content li + li {
  margin-top: 0.65em;
}

.article-content strong {
  color: var(--text);
}

.article-figure {
  width: min(920px, calc(100vw - 48px));
  margin: 2.4em 0 2.7em;
  margin-left: 50%;
  transform: translateX(-50%);
}

.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-solid);
  box-shadow: var(--shadow);
}

.article-figure figcaption {
  max-width: 760px;
  margin: 12px auto 0;
  color: var(--faint);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}

.article-content blockquote {
  padding-left: 24px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}

.article-content code {
  padding: 0.16em 0.35em;
  border-radius: 5px;
  background: var(--accent-soft);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.82em;
}

.article-gallery {
  display: grid;
  margin: 2.4em 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.article-gallery figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-solid);
}

.article-gallery figure:only-child {
  grid-column: 1 / -1;
}

.article-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
}

.research-metrics {
  display: grid;
  margin: 42px 0 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.research-metric {
  padding: 28px;
}

.research-metric + .research-metric {
  border-left: 1px solid var(--line);
}

.research-metric strong,
.research-metric span {
  display: block;
}

.research-metric strong {
  color: var(--text);
  font-size: clamp(30px, 5vw, 48px);
  letter-spacing: -0.055em;
  line-height: 1;
}

.research-metric span {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.finding-callout {
  margin: 2em 0;
  padding: 24px 26px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 14px;
  background: var(--accent-soft);
}

.finding-callout p:last-child {
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .site-header,
  .hero,
  .writing,
  .site-footer,
  .article-shell {
    width: min(calc(100% - 32px), var(--max-width));
  }

  .site-header {
    min-height: 70px;
  }

  .wordmark-mark {
    width: 31px;
    height: 31px;
  }

  .hero {
    padding: 76px 0 94px;
  }

  .hero h1 {
    font-size: clamp(46px, 15vw, 68px);
  }

  .role-line span {
    padding: 0 3px;
  }

  .intro-copy {
    font-size: 16px;
  }

  .section-heading {
    display: block;
  }

  .section-note {
    margin-top: 18px;
    text-align: left;
  }

  .post-card {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .post-arrow {
    width: 46px;
    height: 46px;
  }

  .site-footer {
    min-height: 96px;
  }

  .article-shell {
    padding-top: 54px;
  }

  .article-header {
    padding-top: 42px;
  }

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

  .article-gallery {
    grid-template-columns: 1fr;
  }

  .article-figure {
    width: calc(100vw - 32px);
  }

  .research-metrics {
    grid-template-columns: 1fr;
  }

  .research-metric + .research-metric {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

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

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