:root {
  --bg: #eceef1;
  --surface: #f7f8fa;
  --surface-2: #eef1f4;
  --text: #1f2933;
  --muted: #52606d;
  --line: #c7ced6;
  --accent: #8b1e2d;
  --accent-2: #6f1723;
}

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

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f3f5f7 0%, var(--bg) 100%);
  color: var(--text);
  font-family: "Source Sans 3", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: url("images/charity-of-war-cover.png");
  background-size: cover;
  background-position: center;
  filter: grayscale(20%) contrast(110%) saturate(105%);
  opacity: 0.72;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(243, 245, 247, 0.36), rgba(236, 238, 241, 0.4));
  pointer-events: none;
}

.site-header,
main,
.site-footer {
  width: min(1080px, 92vw);
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: "Source Serif 4", serif;
  font-size: 1.1rem;
  font-weight: 700;
}

nav {
  display: flex;
  gap: 1rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

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

.hero {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1rem;
  align-items: center;
  padding: 2.8rem 0 1.8rem;
}

.hero-content {
  max-width: 760px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
  font-family: "Source Serif 4", serif;
}

h1 {
  margin-top: 0.6rem;
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.hero-copy {
  margin: 1rem 0 1.4rem;
  color: var(--muted);
  line-height: 1.65;
}

.hero-image-wrap {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0.4rem;
}

.hero-image {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  border: 1px solid transparent;
  font-weight: 700;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-2);
}

.btn-secondary {
  border-color: var(--line);
  color: var(--text);
  background: transparent;
}

.btn-secondary:hover {
  background: var(--surface-2);
}

.panel {
  margin-top: 1.1rem;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 1.1rem;
}

.panel h2 {
  margin-bottom: 0.8rem;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
}

.card-grid,
.work-grid,
.image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.card,
.work-grid article,
.post-item {
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 1rem;
}

.card h3,
.work-grid h3,
.post-item h3 {
  margin: 0;
  font-family: "Source Serif 4", serif;
  font-size: 1.05rem;
}

.card p,
.work-grid p,
.post-item p {
  margin: 0.55rem 0 0;
  line-height: 1.55;
  color: var(--muted);
}

.card a,
.work-grid a,
.post-item a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 700;
}

.card a:hover,
.work-grid a:hover,
.post-item a:hover {
  color: var(--accent-2);
}

.card-link h3 a {
  text-decoration: none;
}

.card-link h3 a:hover {
  text-decoration: underline;
}

.tag {
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.news-rotator {
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 1rem;
}

.news-layout {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 0.9rem;
  align-items: start;
}

.news-rotator h3 {
  margin: 0.25rem 0 0.35rem;
  font-family: "Source Serif 4", serif;
  font-size: 1.12rem;
}

#news-summary {
  margin: 0;
}

.news-controls {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.news-image-wrap {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0.35rem;
}

.news-image {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
}

.image-grid img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.site-footer {
  margin: 1.8rem auto;
  text-align: center;
  padding: 1.6rem 0.8rem;
  border-top: 1px solid var(--line);
}

.site-footer h2 {
  margin-bottom: 0.8rem;
}

.subpage-main {
  min-height: 68vh;
  padding-top: 1rem;
}

.subpage-main h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.project-hero,
.project-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1rem;
  align-items: start;
}

.project-image-frame,
.project-text,
.project-notes {
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.project-image-frame {
  padding: 0.5rem;
}

.project-image {
  display: block;
  width: 100%;
  min-height: 360px;
  object-fit: cover;
  background: linear-gradient(180deg, #f2f4f7 0%, #dde4ea 100%);
}

.project-text,
.project-notes {
  padding: 1rem;
}

.project-text h2,
.project-notes h2 {
  margin-bottom: 0.7rem;
}

.project-text p,
.project-notes p {
  margin: 0.7rem 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.publication-feature {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.publication-feature-image-wrap {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0.3rem;
  width: 160px;
}

.publication-feature-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 210px;
  object-fit: contain;
  background: #fff;
}

.publication-feature-full {
  grid-template-columns: 170px minmax(0, 1fr);
}

.publication-feature-full .publication-feature-image {
  max-height: 230px;
}

.cv-page {
  display: grid;
  gap: 1.1rem;
}

.cv-section {
  display: grid;
  gap: 1rem;
}

.cv-list,
.cv-columns {
  display: grid;
  gap: 0.8rem;
}

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

.cv-item,
.cv-card {
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 1rem;
}

.cv-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
}

.cv-item h3,
.cv-card h3 {
  margin: 0;
  font-family: "Source Serif 4", serif;
  font-size: 1.05rem;
}

.cv-item p,
.cv-card p,
.cv-bullets li {
  color: var(--muted);
  line-height: 1.6;
}

.cv-item p {
  margin: 0.45rem 0 0;
}

.cv-date {
  margin: 0;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.cv-bullets {
  margin: 0.7rem 0 0;
  padding-left: 1.2rem;
}

.cv-bullets li + li {
  margin-top: 0.55rem;
}

.cv-copy {
  margin: 0.7rem 0 0;
}

.post-list {
  display: grid;
  gap: 0.8rem;
}

.reveal {
  opacity: 0;
  transform: translateY(10px);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

@media (max-width: 800px) {
  nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 2rem;
  }

  .card-grid,
  .work-grid,
  .image-grid {
    grid-template-columns: 1fr;
  }

  .news-layout {
    grid-template-columns: 1fr;
  }

  .project-hero,
  .project-layout {
    grid-template-columns: 1fr;
  }

  .publication-feature,
  .publication-feature-full {
    grid-template-columns: 1fr;
  }

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

  .cv-date {
    white-space: normal;
  }
}
