/* =============================================
   Base & Reset
   ============================================= */

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

:root {
  --bg:        #fafaf8;
  --fg:        #1c1c1a;
  --muted:     #6b7068;
  --border:    #e2e0da;
  --accent:    #4a5c35;
  --link:      #1c1c1a;
  --link-hover:#4a5c35;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-serif: "EB Garamond", Georgia, "Times New Roman", serif;

  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;

  --leading:   1.7;
  --max-w:     780px;
  --space:     1.5rem;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =============================================
   Typography
   ============================================= */

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-xl); margin-bottom: 0.5rem; }
h3 { font-size: var(--text-lg); font-weight: 500; }

p {
  color: var(--fg);
  max-width: 62ch;
}

p + p { margin-top: 1em; }

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}

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

/* =============================================
   Layout
   ============================================= */

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* =============================================
   Site Header & Navigation
   ============================================= */

.site-header {
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.site-header .container {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.site-name {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: 0;
  text-decoration: none;
  color: var(--fg);
  white-space: nowrap;
}

.site-name:hover {
  text-decoration: none;
  color: var(--muted);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

nav a {
  font-size: var(--text-sm);
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

nav a:hover {
  color: var(--fg);
  text-decoration: none;
}

nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}

/* =============================================
   Main content
   ============================================= */

main {
  padding-bottom: 5rem;
}

/* =============================================
   Page intro (used on inner pages)
   ============================================= */

.page-intro {
  margin-bottom: 3rem;
}

.page-intro h1 {
  font-size: var(--text-2xl);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--fg);
  margin-bottom: 0.5rem;
}

.page-intro p {
  font-size: var(--text-base);
}

/* =============================================
   Home / About
   ============================================= */

.home-hero {
  margin-bottom: 4rem;
}

.home-hero h1 {
  font-size: var(--text-3xl);
  margin-bottom: 0.6rem;
}

.home-hero .subtitle {
  color: var(--muted);
  font-size: var(--text-lg);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.home-photo {
  float: right;
  width: 240px;
  margin: 0.25rem 0 1.5rem 2rem;
}

.home-photo img {
  width: 100%;
  border-radius: 3px;
  display: block;
}

.home-bio {}

.home-bio p {
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--fg);
}

.section-preview {
  margin-bottom: 3rem;
}

.section-preview h2 {
  font-size: var(--text-base);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.section-preview-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: var(--text-sm);
  color: var(--muted);
}

/* =============================================
   Publication / Report list
   ============================================= */

.pub-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.pub-item {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 0 1rem;
  align-items: start;
}

.pub-year {
  font-size: var(--text-sm);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 0.15rem;
}

.pub-body {}

.pub-title {
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1.4;
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}

.pub-title:hover {
  text-decoration-color: var(--accent);
}

.pub-meta {
  margin-top: 0.2rem;
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.5;
}

.pub-abstract {
  margin-top: 0.5rem;
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.65;
  max-width: 58ch;
}

.pub-tags {
  margin-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag {
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* =============================================
   Tool / Project cards
   ============================================= */

.card-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  transition: border-color 0.15s;
}

.card-preview {
  margin: -1.25rem -1.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
  border-radius: 3px 3px 0 0;
  overflow: hidden;
  line-height: 0;
}

.card-preview img,
.card-preview svg {
  width: 100%;
  display: block;
}

.card:hover {
  border-color: #b0ada6;
}

.card-title {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--fg);
  text-decoration: none;
}

.card-title:hover {
  text-decoration: none;
  color: var(--accent);
}

.card-desc {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.6;
  max-width: 56ch;
}

.card-meta {
  margin-top: 0.6rem;
  font-size: var(--text-sm);
  color: var(--muted);
}

.card-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: var(--text-sm);
  color: var(--fg);
  font-weight: 500;
}

/* =============================================
   Section divider label
   ============================================= */

.section-label {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg);
  display: block;
  margin-bottom: 1.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* =============================================
   Filter bar (for research / policy pages)
   ============================================= */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.filter-btn {
  font-size: var(--text-sm);
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.filter-btn:hover,
.filter-btn.active {
  border-color: var(--fg);
  color: var(--fg);
  background: var(--fg);
  color: var(--bg);
}

/* =============================================
   Site Footer
   ============================================= */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 4rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}

.footer-note {
  font-size: var(--text-sm);
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.footer-links a {
  font-size: var(--text-sm);
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--fg);
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 600px) {
  html { font-size: 16px; }

  .site-header { margin-bottom: 2rem; }

  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-hero h1 { font-size: var(--text-2xl); }

  .home-photo {
    float: none;
    width: 120px;
    margin: 0 0 1.5rem 0;
  }

  .pub-item {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .pub-year { font-size: var(--text-sm); }

  .site-footer .container {
    flex-direction: column;
    align-items: flex-start;
  }
}
