/* ==========================================================
   Thomas Robert Malthus — shared styles
   Light beige paper, dark ink, oxblood accent.
   ========================================================== */

:root {
  --bg: #f3ecdd;          /* light beige page */
  --paper: #faf6ec;       /* lighter card surface */
  --paper-2: #ece3d0;     /* darker beige for wells */
  --ink: #2a2521;         /* main text */
  --ink-soft: #5e554b;    /* secondary text */
  --rule: #d8cbb2;        /* hairlines */
  --accent: #7a2e24;      /* oxblood */
  --accent-soft: #a65a4c;
  --green: #3f5a3c;       /* used by games */
  --gold: #b08a3e;

  --f-script: "Pinyon Script", "Snell Roundhand", cursive;
  --f-display: "Cormorant Garamond", "Garamond", Georgia, serif;
  --f-body: "Source Serif 4", Georgia, "Times New Roman", serif;

  --wrap: 1120px;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(42, 37, 33, .06), 0 8px 24px rgba(42, 37, 33, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
/* faint paper grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(42,37,33,.035) 1px, transparent 1px);
  background-size: 3px 3px;
  z-index: 0;
}
main, header, footer { position: relative; z-index: 1; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--ink); }

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: .005em;
}
h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.45rem; }
p { margin: 0 0 1.1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* ---------- Header / nav ---------- */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: rgba(243, 236, 221, .92);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 50;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 64px;
}
.brand {
  font-family: var(--f-script);
  font-size: 1.9rem;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--rule); border-radius: var(--radius);
  font: 600 .95rem var(--f-body); color: var(--ink);
  padding: 6px 12px; cursor: pointer;
}
.nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.nav a {
  font-family: var(--f-display);
  font-size: 1.08rem; font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 1.5px solid transparent;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

@media (max-width: 980px) {
  .nav-toggle { display: inline-block; }
  .nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    padding: 8px 16px 16px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 10px 0; border-bottom: 1px solid var(--rule); }
  .nav a[aria-current="page"] { border-bottom-color: var(--rule); }
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 96px;
  border-top: 1px solid var(--rule);
  padding: 28px 0 40px;
  color: var(--ink-soft);
  font-size: .9rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* ---------- Page scaffolding ---------- */
.page-head { padding: 64px 0 24px; }
.eyebrow {
  font-family: var(--f-display);
  text-transform: uppercase; letter-spacing: .18em;
  font-size: .85rem; font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
}
.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 60ch; }
.prose { max-width: 68ch; }
.prose p:first-of-type::first-letter {
  font-family: var(--f-display);
  float: left; font-size: 4.2rem; line-height: .8;
  padding: 8px 10px 0 0; color: var(--accent);
}
.ornament {
  text-align: center; color: var(--gold);
  font-size: 1.4rem; letter-spacing: .6em; margin: 40px 0;
}
.cite { font-size: .85rem; color: var(--ink-soft); }

.btn {
  display: inline-block;
  font: 600 1rem var(--f-body);
  padding: 11px 22px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  color: var(--ink); background: transparent;
  text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--ink); border-color: var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.grid { display: grid; gap: 22px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* ---------- Home hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  gap: 40px;
  min-height: calc(100vh - 65px);
  padding: 40px 0;
}
.hero-name {
  font-family: var(--f-script);
  font-weight: 400;
  font-size: clamp(3.6rem, 6.4vw, 6rem);
  line-height: 1.05;
  margin: 0 0 18px;
  color: var(--ink);
}
.hero-tagline {
  font-family: var(--f-display);
  font-style: italic;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  color: var(--accent);
  margin: 0 0 8px;
}
.hero-dates {
  font-family: var(--f-display);
  letter-spacing: .3em; font-size: 1rem; font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 28px;
}
.hero-blurb { max-width: 46ch; color: var(--ink-soft); margin-bottom: 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-portrait { position: relative; justify-self: center; max-width: 460px; width: 100%; }
.hero-portrait img {
  width: 100%;
  mix-blend-mode: multiply;          /* lets the beige show through the highlights */
  -webkit-mask-image: radial-gradient(ellipse 50% 52% at 50% 46%, #000 62%, transparent 100%);
          mask-image: radial-gradient(ellipse 50% 52% at 50% 46%, #000 62%, transparent 100%);
}
.hero-portrait figcaption {
  text-align: center; font-size: .8rem; color: var(--ink-soft); margin-top: 6px;
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; min-height: 0; text-align: center; gap: 12px; }
  .hero-blurb { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-portrait { max-width: 320px; }
}

.home-sections { padding: 40px 0 0; }
.tile {
  display: block; text-decoration: none; color: var(--ink);
  transition: transform .15s, box-shadow .15s;
}
.tile:hover { transform: translateY(-2px); color: var(--ink); }
.tile h3 { margin-bottom: 6px; }
.tile p { color: var(--ink-soft); margin: 0; font-size: .98rem; }
.tile .arrow { color: var(--accent); font-weight: 700; }

/* ---------- Figures / portraits ---------- */
.portrait-frame {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  padding: 8px;
  border-radius: 4px;
}
.portrait-frame img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; }
figure { margin: 0; }
figcaption { font-size: .85rem; color: var(--ink-soft); margin-top: 6px; }

/* ---------- Key ideas ---------- */
.idea-card h3 { display: flex; gap: 10px; align-items: baseline; }
.idea-card .num { font-family: var(--f-script); color: var(--accent); font-size: 2rem; line-height: 1; }
.idea-card blockquote {
  margin: 14px 0 0; padding: 10px 14px;
  border-left: 3px solid var(--gold);
  background: var(--paper-2);
  font-style: italic; font-size: .95rem;
}

/* ---------- Critics ---------- */
.person {
  display: grid; grid-template-columns: 170px 1fr; gap: 24px; align-items: start;
}
.person + .person { margin-top: 28px; }
.person .role { color: var(--accent); font-family: var(--f-display); font-weight: 600; font-size: 1.1rem; margin: -4px 0 10px; }
.person .years { color: var(--ink-soft); font-size: .95rem; }
.tag {
  display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; padding: 2px 10px; border-radius: 999px;
  border: 1px solid currentColor; margin-bottom: 8px;
}
.tag.critic { color: var(--accent); }
.tag.ally { color: var(--green); }
.tag.mixed { color: var(--gold); }
@media (max-width: 620px) { .person { grid-template-columns: 1fr; } .person .portrait-frame { max-width: 200px; } }

/* ---------- Quotes ---------- */
.quote {
  position: relative;
  padding: 28px 28px 22px 64px;
}
.quote::before {
  content: "\201C";
  position: absolute; left: 18px; top: 4px;
  font-family: var(--f-display); font-size: 5rem; line-height: 1; color: var(--gold);
}
.quote q { quotes: none; font-family: var(--f-display); font-size: 1.35rem; line-height: 1.4; display: block; margin-bottom: 12px; }
.quote .src { font-size: .85rem; color: var(--ink-soft); margin-bottom: 12px; }
.quote .note { font-size: .97rem; border-top: 1px solid var(--rule); padding-top: 12px; margin: 0; }

/* ---------- Sources ---------- */
.credits { width: 100%; border-collapse: collapse; font-size: .95rem; }
.credits th, .credits td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.credits th { font-family: var(--f-display); font-size: 1.05rem; }
.credits img { width: 48px; height: 48px; object-fit: cover; border-radius: 3px; }
.table-scroll { overflow-x: auto; }

/* ---------- Utility ---------- */
.muted { color: var(--ink-soft); }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
