/* =========================================================================
   Uchimi — Economic Research Initiative
   Shared stylesheet
   -------------------------------------------------------------------------
   Design notes:
   - Editorial / research-journal feel (Financial Times, serious journals).
   - One serif family (Source Serif 4) for reading; one sans (Inter) for
     labels, navigation and metadata.
   - Warm cream ground, dark ink text, hairline rules, a single restrained
     oxblood accent used sparingly.
   - No gradients, no shadows-as-decoration, minimal motion.
   All colours and type sizes live in the :root tokens below, so the whole
   site can be re-skinned from one place.
   ========================================================================= */

:root {
  /* Palette */
  --cream:      #f6f3ec;   /* page background            */
  --paper:      #fbf9f4;   /* raised surfaces / cards    */
  --ink:        #1c1b19;   /* primary text               */
  --ink-soft:   #3a3833;   /* secondary text             */
  --muted:      #6f6b62;   /* metadata, captions         */
  --rule:       #ddd7ca;   /* hairline borders           */
  --rule-soft:  #e8e3d7;   /* faint borders              */
  --accent:     #8a2b26;   /* oxblood — used sparingly   */
  --accent-ink: #6f231f;   /* accent, darker for text    */

  /* Type */
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  /* Rhythm */
  --measure: 34rem;        /* comfortable reading width  */
  --wide:    72rem;        /* max page width             */
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

/* ---------- Layout helpers ---------- */
.wrap {
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.wrap--reading {
  max-width: 48rem;
}

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 3.5rem 0;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0 0 0.9rem;
}

.muted { color: var(--muted); }

/* =========================================================================
   Masthead / navigation
   ========================================================================= */
.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--cream);
}

.masthead__inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 1.4rem;
  padding-bottom: 1.4rem;
  flex-wrap: wrap;
}

.brand {
  text-decoration: none;
  display: inline-flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand__name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.brand__tag {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.35rem;
}

.nav {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
}

.nav ul {
  list-style: none;
  display: flex;
  gap: 1.6rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.nav a {
  text-decoration: none;
  color: var(--ink-soft);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}

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

.nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* =========================================================================
   Skyline banner (home)
   ========================================================================= */
.skyline {
  position: relative;
  width: 100%;
  height: clamp(150px, 23vw, 250px);
  overflow: hidden;
  background: #26251f;
  border-bottom: 1px solid var(--rule);
}
.skyline img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 56%;
  display: block;
}
.skyline__meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.85rem;
}
.skyline__label {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

/* =========================================================================
   Headings & prose
   ========================================================================= */
h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.18;
  margin: 0 0 0.6rem;
}

h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.15rem; }

.lede {
  font-size: 1.35rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* Links inside body prose */
.prose a {
  color: var(--accent-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.prose a:hover { border-bottom-color: var(--accent); }

/* =========================================================================
   Hero (home)
   ========================================================================= */
.hero {
  padding: 4.5rem 0 3rem;
  border-bottom: 1px solid var(--rule);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3.5rem;
  align-items: end;
}

.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
  letter-spacing: -0.02em;
  margin-bottom: 1.2rem;
}

.hero__mission {
  font-size: 1.4rem;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 30rem;
}

.hero__intro p {
  font-size: 1.05rem;
  color: var(--ink-soft);
}

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

/* =========================================================================
   Section headers
   ========================================================================= */
.section {
  padding: 3.5rem 0;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 0.6rem;
  margin-bottom: 2rem;
}

.section__head h2 {
  font-size: 1.15rem;
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0;
}

.section__head a {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--accent-ink);
  white-space: nowrap;
}
.section__head a:hover { text-decoration: underline; }

/* =========================================================================
   Featured articles (home)
   ========================================================================= */
.featured {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2.5rem 3rem;
}

.feature-lead { border: 0; padding: 0; }

.feature-lead .article-card__title { font-size: 1.9rem; }

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  border-left: 1px solid var(--rule);
  padding-left: 2.5rem;
}

/* =========================================================================
   Article card (used on home + archive)
   ========================================================================= */
.article-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.article-card__meta {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.tag {
  color: var(--accent-ink);
}

.article-card__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.22;
  margin: 0 0 0.55rem;
  transition: color 120ms ease;
}

.article-card:hover .article-card__title { color: var(--accent-ink); }

.article-card__abstract {
  font-size: 1rem;
  color: var(--ink-soft);
  margin: 0 0 0.6rem;
}

.article-card__byline {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
}

/* =========================================================================
   Archive list (research page)
   ========================================================================= */
.archive {
  border-top: 1px solid var(--rule);
}

.archive__item {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 2.5rem;
  padding: 2.2rem 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
}

.archive__item:hover .article-card__title { color: var(--accent-ink); }

.archive__date {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
  padding-top: 0.25rem;
}

.archive__date .tag {
  display: block;
  margin-top: 0.4rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.archive__item .article-card__title { font-size: 1.5rem; }

/* Filter bar */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  padding-bottom: 1.5rem;
}
.filters span { color: var(--muted); }
.filters a { color: var(--ink-soft); text-decoration: none; }
.filters a:hover { color: var(--accent-ink); }
.filters a.is-active { color: var(--ink); font-weight: 600; }

/* =========================================================================
   Research themes
   ========================================================================= */
.themes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.theme {
  background: var(--cream);
  padding: 1.8rem 1.6rem;
}

.theme__num {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-ink);
  letter-spacing: 0.06em;
}

.theme h3 {
  font-size: 1.15rem;
  margin: 0.5rem 0 0.5rem;
}

.theme p {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 0;
}

/* =========================================================================
   "About the initiative" band
   ========================================================================= */
.about-band {
  background: var(--paper);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.about-band__grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 3.5rem;
  padding: 4rem 0;
  align-items: start;
}

.about-band h2 { font-size: 1.8rem; }

/* =========================================================================
   Page header (interior pages)
   ========================================================================= */
.page-head {
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--rule);
}

.page-head h1 { margin-bottom: 0.8rem; }

.page-head p { max-width: 40rem; color: var(--ink-soft); font-size: 1.2rem; margin: 0; }

/* =========================================================================
   Team
   ========================================================================= */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

.member__photo {
  aspect-ratio: 1 / 1;
  background: var(--paper);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
  overflow: hidden;
}
.member__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
}

.member h3 { font-size: 1.2rem; margin-bottom: 0.2rem; }

.member__role {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--accent-ink);
  font-weight: 500;
  margin-bottom: 0.7rem;
}

.member p { font-size: 0.95rem; color: var(--ink-soft); }

/* Founder feature (larger photo + fuller description) */
.founder {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 3rem;
  align-items: start;
  margin-bottom: 3.5rem;
}
.founder__photo {
  aspect-ratio: 3 / 4;
  background: var(--paper);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  overflow: hidden;
}
.founder__photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 20%;
}
.founder__bio h2 { font-size: 1.9rem; margin-bottom: 0.25rem; }
.founder__bio .member__role { margin-bottom: 1.1rem; }
.founder__bio p { color: var(--ink-soft); }
.founder__bio p:last-child { margin-bottom: 0; }
@media (max-width: 760px) {
  .founder { grid-template-columns: 1fr; gap: 1.5rem; }
  .founder__photo { max-width: 240px; }
}

/* =========================================================================
   Contact
   ========================================================================= */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.contact-list li,
.contact-list > div {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule);
}
.contact-list dt {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.contact-list dd { margin: 0; font-size: 1.05rem; }
.contact-list a { color: var(--accent-ink); text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }

/* Simple form */
.form label {
  display: block;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.form input,
.form textarea {
  width: 100%;
  font-family: var(--serif);
  font-size: 1rem;
  padding: 0.7rem 0.8rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  color: var(--ink);
  margin-bottom: 1.2rem;
  border-radius: 2px;
}
.form input:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.btn {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: var(--ink);
  color: var(--cream);
  border: 1px solid var(--ink);
  padding: 0.7rem 1.5rem;
  cursor: pointer;
  border-radius: 2px;
  transition: background 120ms ease;
}
.btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); }

/* =========================================================================
   Article (individual publication page)
   ========================================================================= */
.article {
  padding: 3.5rem 0 2rem;
}

.article__header { margin-bottom: 2.5rem; }

.article__meta {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 1.2rem;
}

.article__title {
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin-bottom: 1rem;
}

.article__subtitle {
  font-size: 1.4rem;
  line-height: 1.45;
  color: var(--ink-soft);
  font-weight: 400;
  margin-bottom: 1.8rem;
}

.article__byline {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.article__byline strong { color: var(--ink); font-weight: 600; }

/* Body typography */
.article__body {
  font-size: 1.18rem;
  line-height: 1.72;
}
.article__body > p:first-of-type::first-letter {
  initial-letter: 3;
  -webkit-initial-letter: 3;
  font-weight: 700;
  margin-right: 0.6rem;
  color: var(--ink);
}
.article__body h2 {
  font-size: 1.5rem;
  margin-top: 2.6rem;
  margin-bottom: 0.8rem;
}
.article__body h3 {
  font-size: 1.2rem;
  margin-top: 2rem;
}
.article__body blockquote {
  margin: 2rem 0;
  padding-left: 1.4rem;
  border-left: 3px solid var(--accent);
  font-style: italic;
  color: var(--ink-soft);
}

/* Footnote references in text */
.fn {
  font-family: var(--sans);
  font-size: 0.72em;
  font-weight: 600;
  vertical-align: super;
  line-height: 0;
  color: var(--accent-ink);
  text-decoration: none;
  padding: 0 0.1em;
}
.fn:hover { text-decoration: underline; }

/* =========================================================================
   Figures, tables, charts
   ========================================================================= */
figure {
  margin: 2.4rem 0;
}
figure figcaption {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.7rem;
  line-height: 1.45;
}
figcaption b { color: var(--ink-soft); font-weight: 600; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.92rem;
}
.data-table caption {
  text-align: left;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--ink);
}
.data-table th,
.data-table td {
  text-align: right;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--rule);
}
.data-table th:first-child,
.data-table td:first-child { text-align: left; }
.data-table thead th {
  border-bottom: 2px solid var(--ink);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.data-table tbody tr:last-child td { border-bottom: 1px solid var(--ink); }

/* Bar chart (pure CSS) */
.chart {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  font-family: var(--sans);
  font-size: 0.85rem;
}
.chart__row { display: grid; grid-template-columns: 10rem 1fr; align-items: center; gap: 1rem; }
.chart__label { color: var(--ink-soft); }
.chart__track { background: var(--rule-soft); position: relative; height: 1.4rem; }
.chart__bar {
  height: 100%;
  background: var(--accent);
  display: flex;
  align-items: center;
}
.chart__val {
  color: var(--ink-soft);
  font-weight: 600;
  padding-left: 0.5rem;
  white-space: nowrap;
}

/* Implication / condition lists inside articles */
.impl-list {
  list-style: none;
  margin: 1.4rem 0;
  padding: 0;
}
.impl-list li {
  position: relative;
  padding: 0 0 1rem 1.4rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--rule-soft);
}
.impl-list li:last-child { border-bottom: 0; margin-bottom: 0; }
.impl-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  background: var(--accent);
}
.impl-list strong { color: var(--ink); }

/* Footnotes / references */
.notes {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 2px solid var(--ink);
}
.notes h2 {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}
.notes ol {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.55;
  padding-left: 1.4rem;
  margin: 0;
}
.notes li { margin-bottom: 0.7rem; }
.notes li:target { background: #f0e9d8; }
.notes a { color: var(--accent-ink); }

/* Article footer nav */
.article-foot {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2.5rem 0;
  font-family: var(--sans);
  font-size: 0.9rem;
  border-top: 1px solid var(--rule);
  margin-top: 3rem;
}
.article-foot a { color: var(--accent-ink); text-decoration: none; }
.article-foot a:hover { text-decoration: underline; }

/* =========================================================================
   Footer
   ========================================================================= */
.site-foot {
  border-top: 1px solid var(--rule);
  background: var(--paper);
  margin-top: 4rem;
}
.site-foot__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  padding: 2.5rem 0;
  flex-wrap: wrap;
}
.site-foot__brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
}
.site-foot__brand span {
  display: block;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.35rem;
}
.site-foot nav {
  display: flex;
  gap: 1.4rem;
  font-family: var(--sans);
  font-size: 0.88rem;
  flex-wrap: wrap;
}
.site-foot nav a { color: var(--ink-soft); text-decoration: none; }
.site-foot nav a:hover { color: var(--accent-ink); }
.site-foot__legal {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted);
  padding-bottom: 2.5rem;
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 860px) {
  body { font-size: 1.06rem; }
  .hero__grid,
  .featured,
  .about-band__grid,
  .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
  .feature-list { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 1.6rem; }
  .themes { grid-template-columns: 1fr 1fr; }
  .team-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .masthead__inner { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .nav ul { gap: 1.1rem; }
  .themes,
  .team-grid { grid-template-columns: 1fr; }
  .archive__item { grid-template-columns: 1fr; gap: 0.6rem; }
  .archive__date { padding-top: 0; display: flex; gap: 1rem; align-items: baseline; }
  .archive__date .tag { margin-top: 0; }
  .article__body { font-size: 1.08rem; }
  .section__head { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
}

/* Filter buttons and contact list (added) */
.filters button { font: inherit; background: none; border: 0; padding: 0; color: var(--ink-soft); cursor: pointer; }
.filters button:hover { color: var(--accent-ink); }
.filters button.is-active { color: var(--ink); font-weight: 600; }
