/* The AI Welfare Project — stylesheet
   A sober, academic presentation appropriate to the gravity of the subject. */

:root {
  --ink: #1c2024;
  --ink-soft: #3d4248;
  --muted: #6a7178;
  --line: #e2e4e6;
  --line-strong: #cdd1d4;
  --paper: #ffffff;
  --paper-warm: #faf9f6;
  --teal: #2f5d62;
  --teal-deep: #234a4e;
  --teal-soft: #e8f0ef;
  --amber: #9a6a1f;
  --rule: #d8d3c7;
  --max: 1080px;
  --measure: 720px;
  --serif: "Iowan Old Style", "Palatino Linotype", "Palatino", "Georgia", serif;
  --sans: "Inter", "Helvetica Neue", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--serif);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.68;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.measure { max-width: var(--measure); }
.measure p, .measure ul, .measure ol, .measure h2, .measure h3, .measure blockquote, .measure .note { max-width: var(--measure); }

section { padding: 56px 0; }
.section-tight { padding: 36px 0; }

/* ---------- Top banner ---------- */
.banner {
  background: var(--teal-deep);
  color: #dfeae9;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 8px 16px;
}
.banner a { color: #fff; text-decoration: underline; }

/* ---------- Header / nav ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 16px;
  padding-bottom: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand .mark {
  width: 38px; height: 38px; flex: 0 0 38px;
  border: 1.5px solid var(--teal);
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--teal);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
}
.brand .name { font-family: var(--sans); font-weight: 650; font-size: 17px; letter-spacing: 0.01em; line-height: 1.1; }
.brand .name small { display:block; font-weight: 450; font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }

nav.primary { font-family: var(--sans); font-size: 15px; }
nav.primary ul { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; align-items: center; }
nav.primary a { color: var(--ink-soft); text-decoration: none; padding-bottom: 2px; border-bottom: 2px solid transparent; }
nav.primary a:hover { color: var(--teal); border-bottom-color: var(--teal); }
nav.primary a.active { color: var(--teal); border-bottom-color: var(--teal); }

.btn {
  font-family: var(--sans);
  display: inline-block;
  background: var(--teal);
  color: #fff !important;
  padding: 9px 16px;
  border-radius: 4px;
  text-decoration: none !important;
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid var(--teal);
  border-bottom: 1px solid var(--teal) !important;
  cursor: pointer;
  transition: background .15s ease;
}
.btn:hover { background: var(--teal-deep); }
.btn.ghost { background: transparent; color: var(--teal) !important; }
.btn.ghost:hover { background: var(--teal-soft); }
.btn.lg { padding: 13px 24px; font-size: 16px; }

.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero { background: var(--paper-warm); border-bottom: 1px solid var(--line); }
.hero .wrap { padding-top: 72px; padding-bottom: 72px; }
.eyebrow {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 600;
  margin: 0 0 18px;
}
.hero h1 { font-size: 46px; line-height: 1.12; margin: 0 0 22px; font-weight: 600; letter-spacing: -0.01em; }
.hero .lede { font-size: 21px; color: var(--ink-soft); max-width: 680px; margin: 0 0 30px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { color: var(--ink); font-weight: 600; }
h2 { font-size: 30px; line-height: 1.18; margin: 0 0 18px; letter-spacing: -0.005em; }
h3 { font-size: 21px; line-height: 1.25; margin: 32px 0 10px; }
h4 { font-size: 17px; font-family: var(--sans); margin: 24px 0 8px; }
p { margin: 0 0 18px; }
a { color: var(--teal); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--teal-deep); }
strong { font-weight: 650; }

.kicker {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 12px;
}
.section-intro { font-size: 20px; color: var(--ink-soft); }

blockquote {
  margin: 28px 0;
  padding: 4px 0 4px 24px;
  border-left: 3px solid var(--teal);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 20px;
}
blockquote cite { display: block; font-style: normal; font-family: var(--sans); font-size: 14px; color: var(--muted); margin-top: 10px; }

ul, ol { padding-left: 22px; }
li { margin-bottom: 8px; }

hr.rule { border: 0; border-top: 1px solid var(--line); margin: 44px 0; }

/* ---------- Callouts / notes ---------- */
.note {
  background: var(--teal-soft);
  border: 1px solid #cfe0de;
  border-left: 3px solid var(--teal);
  padding: 18px 22px;
  border-radius: 4px;
  font-size: 16.5px;
  margin: 26px 0;
}
.note .label { font-family: var(--sans); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal-deep); font-weight: 700; display: block; margin-bottom: 6px; }

.callout-amber {
  background: #fbf6ec; border-color: #ecdcbe; border-left-color: var(--amber);
}
.callout-amber .label { color: var(--amber); }

/* ---------- Grids / cards ---------- */
.grid { display: grid; gap: 26px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 26px;
  background: var(--paper);
}
.card h3 { margin-top: 0; }
.card .tag {
  font-family: var(--sans); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--teal-deep); font-weight: 700; display: inline-block; margin-bottom: 10px;
}

.stat { text-align: center; padding: 18px; }
.stat .figure { font-size: 42px; font-weight: 600; color: var(--teal); line-height: 1; font-family: var(--sans); }
.stat .figure sup { font-size: 18px; }
.stat .caption { font-size: 14.5px; color: var(--muted); margin-top: 10px; font-family: var(--sans); }

/* ---------- Research / paper list ---------- */
.paper {
  border-bottom: 1px solid var(--line);
  padding: 26px 0;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 24px;
}
.paper:first-of-type { border-top: 1px solid var(--line); }
.paper .meta { font-family: var(--sans); font-size: 13px; color: var(--muted); line-height: 1.5; }
.paper .meta .num { font-weight: 700; color: var(--teal); display: block; font-size: 12px; letter-spacing: 0.05em; }
.paper h3 { margin: 0 0 8px; font-size: 22px; }
.paper h3 a { text-decoration: none; }
.paper h3 a:hover { text-decoration: underline; }
.paper .authors { font-family: var(--sans); font-size: 14px; color: var(--ink-soft); margin: 0 0 10px; }
.paper .abstract { font-size: 16.5px; color: var(--ink-soft); margin: 0; }
.paper .pill { font-family: var(--sans); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--amber); font-weight: 700; }

/* ---------- Article ---------- */
.article-head { background: var(--paper-warm); border-bottom: 1px solid var(--line); padding: 56px 0 44px; }
.article-head .wrap { max-width: var(--measure); }
.article-head h1 { font-size: 38px; line-height: 1.16; margin: 14px 0 18px; font-weight: 600; }
.article-meta { font-family: var(--sans); font-size: 14px; color: var(--muted); }
.article-meta .authors { color: var(--ink-soft); }
.article-body { padding: 50px 0 70px; }
.article-body .wrap { max-width: var(--measure); }
.abstract-block { background: var(--paper-warm); border: 1px solid var(--line); border-radius: 6px; padding: 24px 26px; margin: 0 0 34px; }
.abstract-block .label { font-family: var(--sans); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 0 0 8px; }
.abstract-block p { font-size: 17px; color: var(--ink-soft); margin: 0; }

.footnotes { margin-top: 50px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 15px; color: var(--ink-soft); }
.footnotes h4 { font-family: var(--sans); letter-spacing: 0.05em; text-transform: uppercase; font-size: 12px; color: var(--muted); }
.footnotes ol { padding-left: 20px; }
.footnotes li { margin-bottom: 10px; }
sup.fn { font-size: 12px; }
sup.fn a { text-decoration: none; }

.breadcrumb { font-family: var(--sans); font-size: 13.5px; color: var(--muted); }
.breadcrumb a { color: var(--muted); }

/* ---------- Team ---------- */
.person { text-align: left; }
.person .avatar {
  width: 100%; aspect-ratio: 1/1; border-radius: 6px; margin-bottom: 14px;
  background: linear-gradient(135deg, var(--teal-soft), #dde7e6);
  display: grid; place-items: center; color: var(--teal); font-family: var(--sans); font-weight: 700; font-size: 30px;
}
.person h4 { margin: 0 0 2px; font-size: 17px; }
.person .role { font-family: var(--sans); font-size: 13.5px; color: var(--muted); margin: 0 0 8px; }
.person p { font-size: 15px; color: var(--ink-soft); margin: 0; }

/* ---------- FAQ ---------- */
.faq-item { border-bottom: 1px solid var(--line); padding: 22px 0; }
.faq-item h3 { margin: 0 0 10px; font-size: 20px; }
.faq-item p:last-child { margin-bottom: 0; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--teal-deep); color: #e8f1f0; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #cfe0de; }
.cta-band .btn { background: #fff; color: var(--teal-deep) !important; border-color: #fff; }
.cta-band .btn:hover { background: #e8f1f0; }
.cta-band .btn.ghost { background: transparent; color: #fff !important; border-color: rgba(255,255,255,.5); }
.cta-band .btn.ghost:hover { background: rgba(255,255,255,.1); }

/* ---------- Newsletter ---------- */
.signup { display: flex; gap: 10px; flex-wrap: wrap; max-width: 480px; }
.signup input {
  flex: 1 1 240px; font-family: var(--sans); font-size: 15px; padding: 11px 14px;
  border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; color: var(--ink);
}
.signup input:focus { outline: 2px solid var(--teal); outline-offset: 1px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #b7bdc2; font-family: var(--sans); font-size: 14.5px; padding: 56px 0 36px; }
.site-footer a { color: #d7dbde; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h5 { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: #7d858c; margin: 0 0 14px; font-weight: 700; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 9px; }
.footer-brand .name { color: #fff; font-weight: 650; font-size: 16px; }
.footer-brand p { font-size: 14px; line-height: 1.6; max-width: 320px; color: #9aa1a7; margin: 12px 0 0; }
.footer-legal { border-top: 1px solid #2c3136; margin-top: 40px; padding-top: 22px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: #7d858c; }
.footer-legal a { color: #9aa1a7; }

/* ---------- Misc ---------- */
.lead-list { list-style: none; padding: 0; }
.lead-list li { padding-left: 30px; position: relative; margin-bottom: 16px; }
.lead-list li::before { content: "—"; position: absolute; left: 0; color: var(--teal); font-weight: 700; }
.pill-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.pill-row span { font-family: var(--sans); font-size: 13px; background: var(--paper-warm); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; color: var(--ink-soft); }
.center { text-align: center; }
.mt0 { margin-top: 0; }
.divider-label { font-family: var(--sans); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); text-align: center; margin: 0 0 30px; font-weight: 600; }

/* ---------- Figures / imagery ---------- */
img { max-width: 100%; height: auto; }
figure { margin: 0; }
.figure { margin: 0; }
.figure img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: 6px; background: var(--paper-warm);
}
.figure figcaption {
  font-family: var(--sans); font-size: 13px; color: var(--muted);
  margin-top: 10px; font-style: italic; line-height: 1.5; max-width: var(--measure);
}
/* Full-width media band (e.g. homepage hero image) */
.media-band { padding: 0; background: var(--paper-warm); border-bottom: 1px solid var(--line); }
.media-band .wrap { padding-top: 28px; padding-bottom: 28px; }
.media-band .figure img { aspect-ratio: 3 / 2; object-fit: cover; }
/* Article header image, sits at the top of the article body, text-measure width */
.article-figure { margin: 0 0 32px; }
.article-figure img { aspect-ratio: 3 / 2; object-fit: cover; }
/* In-page section figure */
.section-figure { margin: 8px 0 28px; }
.section-figure img { aspect-ratio: 3 / 2; object-fit: cover; max-height: 440px; }
.section-figure.square img { aspect-ratio: 1 / 1; max-height: 460px; }

/* ---------- Charts & diagrams ---------- */
/* All charts are inline SVG with a viewBox and width:100%, so they scale
   fluidly from a phone to a desktop. Type is sized in user units generous
   enough to stay legible when the figure shrinks on a small screen. */
.chart-figure { margin: 32px 0; }
.chart-frame {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-warm);
  padding: 22px 24px 18px;
}
.chart-frame .chart-title {
  font-family: var(--sans); font-weight: 650; font-size: 15.5px;
  color: var(--ink); margin: 0;
}
.chart-frame .chart-sub {
  font-family: var(--sans); font-size: 12.5px; color: var(--muted);
  margin: 4px 0 16px; line-height: 1.5;
}
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--sans); fill: var(--ink-soft); font-size: 23px; }
.chart .tick { font-size: 21px; fill: var(--muted); }
.chart .value { font-size: 22px; font-weight: 650; fill: var(--ink); }
.chart .value-on { font-size: 21px; font-weight: 650; fill: #fff; }
.chart .lbl { font-size: 22px; }
.chart .lbl-strong { font-size: 22px; font-weight: 650; fill: var(--ink); }
.chart .cap { font-size: 19px; fill: var(--muted); }
.chart .halo { paint-order: stroke; stroke: var(--paper-warm); stroke-width: 5px; stroke-linejoin: round; }
.chart .axis { stroke: var(--line-strong); stroke-width: 1.5; fill: none; }
.chart .gridline { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 5; fill: none; }
.chart .stem { stroke: var(--line-strong); stroke-width: 1.5; }
.chart .series-teal { fill: none; stroke: var(--teal); stroke-width: 3.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .series-amber { fill: none; stroke: var(--amber); stroke-width: 3; stroke-dasharray: 8 6; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot-teal { fill: var(--teal); }
.chart .dot-amber { fill: var(--amber); }
.chart .bar-teal { fill: var(--teal); }
.chart .bar-amber { fill: var(--amber); }
.chart .bar-muted { fill: var(--line-strong); }
.chart .area-teal { fill: var(--teal-soft); }
.chart .ring { fill: none; stroke: var(--line-strong); stroke-width: 2; }
.chart .ring-dashed { fill: none; stroke: var(--teal); stroke-width: 2; stroke-dasharray: 7 7; opacity: .85; }
.chart .ring-fill { fill: var(--teal); }
.chart .zone-muted { fill: var(--line); opacity: .5; }

.chart-legend {
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  font-family: var(--sans); font-size: 13.5px; color: var(--ink-soft);
  margin-top: 14px;
}
.chart-legend .key { display: inline-flex; align-items: center; gap: 8px; }
.chart-legend .swatch { width: 18px; height: 4px; border-radius: 2px; display: inline-block; background: var(--teal); flex: 0 0 auto; }
.chart-legend .swatch.amber { background: var(--amber); }
.chart-legend .swatch.dash { background: none; border-top: 3px dashed var(--amber); height: 0; }
.chart-legend .swatch.box { height: 14px; width: 14px; border-radius: 3px; }
.chart-legend .swatch.soft { background: var(--teal-soft); border: 1px solid #cfe0de; }

.chart-figure figcaption {
  font-family: var(--sans); font-size: 13px; color: var(--muted);
  margin-top: 12px; font-style: italic; line-height: 1.5;
}

/* Flow diagram — column of nodes on mobile, a row on wider screens. */
.flow { display: flex; flex-direction: column; align-items: stretch; margin: 30px 0; font-family: var(--sans); }
.flow .node {
  border: 1px solid var(--line-strong); border-radius: 6px; background: #fff;
  padding: 13px 16px; text-align: center; flex: 1;
}
.flow .node .n-label { font-weight: 650; font-size: 14.5px; color: var(--ink); display: block; }
.flow .node .n-sub { font-size: 12.5px; color: var(--muted); display: block; margin-top: 3px; line-height: 1.45; }
.flow .node.accent { background: var(--teal-soft); border-color: #bcd6d3; }
.flow .arrow { color: var(--teal); display: flex; align-items: center; justify-content: center; padding: 8px 0; }
.flow .arrow svg { width: 22px; height: 22px; transform: rotate(90deg); }

@media (min-width: 720px) {
  .flow { flex-direction: row; align-items: stretch; }
  .flow .arrow { padding: 0 6px; }
  .flow .arrow svg { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 36px; }
  nav.primary { display: none; }
  nav.primary.open {
    display: block; position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line); padding: 12px 24px 18px;
  }
  nav.primary.open ul { flex-direction: column; align-items: flex-start; gap: 14px; }
  .nav-toggle { display: inline-flex; font-family: var(--sans); font-size: 14px; background: none; border: 1px solid var(--line-strong); border-radius: 4px; padding: 8px 12px; cursor: pointer; }
  .site-header .wrap { position: relative; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero .wrap { padding-top: 40px; padding-bottom: 52px; }
  .hero h1 { font-size: 30px; }
  .hero .lede { font-size: 18px; }
  h2 { font-size: 25px; }
  .paper { grid-template-columns: 1fr; gap: 8px; }
  .chart-frame { padding: 16px 14px 14px; }
}
