:root {
  --bg: oklch(96.5% 0.018 135);
  --surface: oklch(98.8% 0.008 120);
  --surface-muted: oklch(92.8% 0.03 138);
  --ink: oklch(21% 0.035 145);
  --muted: oklch(47% 0.033 145);
  --line: oklch(86.5% 0.025 135);
  --accent: oklch(44% 0.088 155);
  --accent-strong: oklch(32% 0.076 155);
  --accent-soft: oklch(91.5% 0.04 145);
  --warm: oklch(60% 0.12 80);
  --shadow: 0 18px 40px oklch(24% 0.05 145 / 0.1);
  --container: 1160px;
  --font-body: Aptos, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Iowan Old Style", "Sitka Text", Charter, Georgia, serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.23, 1, 0.32, 1);
}

@supports not (color: oklch(50% 0.1 100)) {
  :root {
    --bg: #f5f7f0;
    --surface: #fbfcf8;
    --surface-muted: #e9f1e4;
    --ink: #17211b;
    --muted: #667368;
    --line: #d9e0d4;
    --accent: #2f6f55;
    --accent-strong: #214d3c;
    --accent-soft: #dfeadf;
    --warm: #c98d2b;
    --shadow: 0 18px 40px rgba(26, 49, 36, 0.1);
  }

  body {
    background:
      linear-gradient(180deg, rgba(238, 243, 232, 0.85), rgba(245, 247, 240, 0) 360px),
      var(--bg);
  }

  body::before {
    background-image:
      linear-gradient(rgba(23, 33, 27, 0.045) 1px, transparent 1px),
      linear-gradient(90deg, rgba(23, 33, 27, 0.045) 1px, transparent 1px);
  }

  a:focus-visible,
  button:focus-visible,
  input:focus-visible {
    outline-color: rgba(47, 111, 85, 0.35);
  }

  .navbar {
    background: rgba(245, 247, 240, 0.92);
    border-bottom-color: rgba(217, 224, 212, 0.9);
  }

  .button-link:hover {
    box-shadow: 0 12px 26px rgba(47, 111, 85, 0.18);
  }

  .post-toolbar,
  .post-card,
  .content {
    background: rgba(251, 252, 248, 0.86);
  }

  .post-card.is-highlight {
    background:
      linear-gradient(135deg, rgba(223, 234, 223, 0.64), rgba(251, 252, 248, 0.9)),
      var(--surface);
  }

  .project-snapshot div {
    border-top-color: rgba(23, 33, 27, 0.12);
  }

  article.post p {
    color: #2c382f;
  }

  .featured-card:hover,
  .post-card:hover,
  .member-card:hover {
    border-color: rgba(47, 111, 85, 0.42);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, oklch(92.8% 0.03 138 / 0.85), oklch(96.5% 0.018 135 / 0) 360px),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    linear-gradient(oklch(21% 0.035 145 / 0.045) 1px, transparent 1px),
    linear-gradient(90deg, oklch(21% 0.035 145 / 0.045) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, rgb(1 1 1) 0, transparent 540px);
}

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

a {
  color: var(--accent-strong);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid oklch(44% 0.088 155 / 0.35);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  line-height: 1.1;
  letter-spacing: 0;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 50;
  transform: translateY(-180%);
  background: var(--ink);
  color: var(--surface);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  transition: transform 180ms var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

.reading-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 45;
  height: 3px;
  pointer-events: none;
}

.reading-progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--accent), var(--warm));
  transition: transform 80ms linear;
}

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

.navbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: oklch(96.5% 0.018 135 / 0.92);
  border-bottom: 1px solid oklch(86.5% 0.025 135 / 0.9);
  backdrop-filter: blur(18px);
}

.navbar .container {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.navbar-brand {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: none;
}

.navbar-brand:hover {
  color: var(--accent-strong);
}

.navbar-toggler {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.navbar-toggler-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: currentColor;
  transition: background-color 120ms ease;
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: transform 160ms var(--ease-out);
}

.navbar-toggler-icon::before {
  top: -6px;
}

.navbar-toggler-icon::after {
  top: 6px;
}

.navbar-toggler.is-open .navbar-toggler-icon {
  background: transparent;
}

.navbar-toggler.is-open .navbar-toggler-icon::before {
  transform: translateY(6px) rotate(45deg);
}

.navbar-toggler.is-open .navbar-toggler-icon::after {
  transform: translateY(-6px) rotate(-45deg);
}

.navbar-collapse {
  visibility: visible;
}

.navbar-nav {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  color: var(--muted) !important;
  font-weight: 650;
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease, transform 160ms var(--ease-out);
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-strong) !important;
}

.nav-link:active,
.button-link:active,
.filter-button:active {
  transform: scale(0.98);
}

main {
  flex: 1;
}

.site-main {
  padding: 4.5rem 0 5rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 3rem;
  align-items: stretch;
}

.hero-copy {
  padding: 2.5rem 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 1.1rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: oklch(98.8% 0.008 120 / 0.72);
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 700;
}

.hero h1 {
  max-width: 13ch;
  font-size: 5rem;
  line-height: 0.96;
}

.hero-text {
  max-width: 64ch;
  margin-top: 1.35rem;
  color: var(--muted);
  font-size: 1.12rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-top: 2rem;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--surface);
  font-weight: 750;
  text-decoration: none;
  transition: background-color 180ms ease, transform 160ms var(--ease-out), box-shadow 180ms ease;
}

.button-link:hover {
  background: var(--accent-strong);
  color: var(--surface);
  box-shadow: 0 12px 26px oklch(44% 0.088 155 / 0.18);
}

.text-link {
  font-weight: 750;
  text-decoration: none;
}

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

.featured-card img {
  width: 100%;
  height: 290px;
  object-fit: cover;
}

.featured-card-body {
  padding: 1.35rem;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 750;
}

.featured-card h2 {
  font-size: 2rem;
}

.featured-card p {
  margin-top: 0.9rem;
  color: var(--muted);
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 4.5rem 0 1.25rem;
}

.section-header h2 {
  font-size: 2.4rem;
}

.section-header p {
  max-width: 58ch;
  color: var(--muted);
}

.post-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.4rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: oklch(98.8% 0.008 120 / 0.74);
}

.search-field label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.search-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.filter-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition: background-color 180ms ease, color 180ms ease, transform 160ms var(--ease-out);
}

.filter-button:hover,
.filter-button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--surface);
}

.post-count {
  margin-bottom: 0.9rem;
  color: var(--muted);
  font-weight: 700;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 1rem;
}

.post-card {
  display: flex;
  grid-column: span 2;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: oklch(98.8% 0.008 120 / 0.86);
  color: var(--ink);
  text-decoration: none;
  animation: card-enter 420ms var(--ease-out) both;
  transition: transform 220ms var(--ease-out), border-color 180ms ease, box-shadow 220ms ease;
}

.post-card:nth-child(2) {
  animation-delay: 45ms;
}

.post-card:nth-child(3) {
  animation-delay: 90ms;
}

.post-card:nth-child(4) {
  animation-delay: 135ms;
}

.post-card:nth-child(5) {
  animation-delay: 180ms;
}

.post-card:nth-child(6) {
  animation-delay: 225ms;
}

.post-card:nth-child(7) {
  animation-delay: 270ms;
}

.post-card.is-wide {
  grid-column: span 3;
  display: grid;
  grid-template-columns: minmax(145px, 0.85fr) minmax(0, 1.15fr);
}

.post-card.is-wide img {
  height: 100%;
  min-height: 100%;
  aspect-ratio: auto;
}

.post-card.is-highlight {
  background:
    linear-gradient(135deg, oklch(91.5% 0.04 145 / 0.64), oklch(98.8% 0.008 120 / 0.9)),
    var(--surface);
}

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

.post-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1rem;
}

.post-card h3 {
  font-size: 1.45rem;
}

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

.post-card .read-more {
  margin-top: auto;
  color: var(--accent-strong);
  font-weight: 800;
}

.empty-state {
  margin-top: 1rem;
  padding: 1.5rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-shell,
.article-shell {
  padding: 3.5rem 0 5rem;
}

.content {
  width: min(100%, 900px);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: oklch(98.8% 0.008 120 / 0.88);
  box-shadow: var(--shadow);
}

.page-content {
  padding: 2rem;
}

.page-content h1,
.page-content h2 {
  margin-bottom: 1rem;
  font-size: 2.8rem;
}

.page-content p + p {
  margin-top: 1rem;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 1.5rem;
  align-items: start;
}

.about-note {
  padding: 1.25rem;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
}

.about-note h2 {
  margin-bottom: 0.6rem;
  font-size: 1.4rem;
}

.project-snapshot {
  display: grid;
  gap: 0.75rem;
  margin: 1.25rem 0 0;
}

.project-snapshot div {
  padding-top: 0.75rem;
  border-top: 1px solid oklch(21% 0.035 145 / 0.12);
}

.project-snapshot dt {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.project-snapshot dd {
  margin: 0.1rem 0 0;
  color: var(--ink);
  font-weight: 650;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.member-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 0.85rem;
  text-align: left;
  transition: transform 220ms var(--ease-out), border-color 180ms ease, box-shadow 220ms ease;
}

.member-img {
  grid-row: span 2;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-muted);
}

.member-card h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.35;
}

.member-role {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.article-shell .content {
  width: min(100%, 860px);
  padding: 0;
}

article.post {
  padding: 2rem;
}

article.post h1 {
  margin-bottom: 0.8rem;
  font-size: 3rem;
}

article.post h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.75rem;
}

article.post p {
  max-width: 68ch;
  color: oklch(28% 0.032 145);
}

article.post p + p {
  margin-top: 1rem;
}

.author,
article.post > p:first-of-type {
  color: var(--muted);
  font-weight: 750;
}

.back-link {
  display: inline-flex;
  margin-bottom: 1.25rem;
  font-weight: 800;
  text-decoration: none;
}

.post-image,
.grounding {
  width: 100%;
  max-height: 520px;
  margin: 1.5rem 0;
  border-radius: 8px;
  object-fit: cover;
}

.grounding {
  width: min(100%, 560px);
}

.references,
.footnotes,
.bibliography {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.references h2,
.footnotes h2,
.bibliography h2 {
  margin-top: 0;
  font-size: 1.4rem;
}

.references ol,
.footnotes ol,
.bibliography ul {
  padding-left: 1.25rem;
}

.references li,
.footnotes li,
.bibliography li {
  margin-bottom: 0.75rem;
  color: var(--muted);
}

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

footer .container {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
}

footer p {
  margin: 0;
}

footer a {
  font-weight: 750;
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .featured-card:hover,
  .post-card:hover,
  .member-card:hover {
    transform: translateY(-3px);
    border-color: oklch(44% 0.088 155 / 0.42);
    color: var(--ink);
    box-shadow: var(--shadow);
  }
}

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

  .hero h1 {
    max-width: 13ch;
    font-size: 3.25rem;
  }

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

  .post-card,
  .post-card.is-wide {
    grid-column: auto;
  }

  .post-card.is-wide {
    display: flex;
  }

  .post-card.is-wide img {
    height: auto;
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

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

  .filter-group {
    justify-content: flex-start;
  }

  .member-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 15px;
  }

  .navbar .container {
    min-height: 64px;
  }

  .navbar-toggler {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .navbar-collapse {
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: calc(100% + 0.5rem);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px) scale(0.98);
    transform-origin: top right;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    transition: opacity 160ms ease, transform 180ms var(--ease-out), visibility 0ms linear 180ms;
  }

  .navbar-collapse.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transition-delay: 0ms;
  }

  .navbar-nav {
    display: grid;
    gap: 0.2rem;
    padding: 0.5rem;
  }

  .nav-link {
    width: 100%;
  }

  .site-main,
  .page-shell,
  .article-shell {
    padding: 2.5rem 0 3.5rem;
  }

  .hero-copy {
    padding: 0;
  }

  .hero h1 {
    font-size: 2.65rem;
  }

  .featured-card img {
    height: 220px;
  }

  .section-header {
    display: block;
    margin-top: 3rem;
  }

  .section-header h2,
  .page-content h1,
  .page-content h2 {
    font-size: 2.1rem;
  }

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

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

  .post-toolbar,
  .page-content,
  article.post {
    padding: 1.1rem;
  }

  article.post h1 {
    font-size: 2.25rem;
  }

  article.post h2 {
    font-size: 1.45rem;
  }

  footer .container {
    min-height: 96px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
