/* Polymath Letters — styles
   Palette and type follow the Polymath Letters brand guide. */

:root {
  --parchment: #F1E8D5;
  --slate: #202A30;
  --bronze: #9A7438;
  --bronze-text: #7A5A22;   /* darker bronze for small text on parchment */
  --stone: #C9B99A;
  --slate-blue: #536775;
  --olive: #6E704C;
  --ink-soft: #3A464D;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(20px, 5vw, 64px);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--parchment);
  color: var(--slate);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { display: block; }

a { color: var(--slate); text-decoration: none; }
a:hover { color: var(--bronze-text); }
:focus-visible { outline: 2px solid var(--bronze); outline-offset: 3px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.rule { height: 1px; background: var(--bronze); opacity: 0.6; margin: 0 var(--gutter); }
.divider { width: 64px; height: 1px; background: var(--bronze); }
.spacer { height: clamp(72px, 10vw, 128px); }
.inline-link {
  color: var(--bronze-text); text-decoration: underline;
  text-decoration-color: var(--bronze); text-underline-offset: 3px;
}

/* ------------------------------------------------------------- Header */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px 32px; padding: 28px var(--gutter);
}
.wordmark {
  font-family: var(--serif); font-size: 18px; font-weight: 600;
  letter-spacing: 0.3em; text-transform: uppercase;
}
.nav { display: flex; flex-wrap: wrap; gap: 8px 32px; }
.nav a {
  font-size: 12px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase;
  padding-bottom: 3px; border-bottom: 1px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--bronze); }

/* --------------------------------------------------------------- Hero */
.hero {
  width: 100%; max-width: 900px; margin: 0 auto;
  padding: clamp(64px, 10vw, 120px) 24px clamp(56px, 8vw, 96px);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 28px;
}
.emblem { width: 132px; height: 132px; }
.hero h1 {
  margin: 0; font-family: var(--serif); font-weight: 600;
  font-size: clamp(34px, 7.4vw, 76px); line-height: 1.05;
  letter-spacing: 0.3em; padding-left: 0.3em; text-transform: uppercase;
}
.credit {
  font-size: 12px; font-weight: 500; letter-spacing: 0.24em; padding-left: 0.24em;
  text-transform: uppercase; color: var(--slate-blue);
}
.tagline {
  margin: 12px 0 0; max-width: 560px; font-family: var(--serif); font-style: italic;
  font-size: clamp(24px, 3.4vw, 32px); line-height: 1.3;
}
.lede { margin: 0; max-width: 520px; font-size: 16px; line-height: 1.6; color: var(--ink-soft); }

/* ----------------------------------------------------- Subscribe form */
.subscribe {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
  width: 100%; max-width: 520px; margin-top: 8px;
}
.subscribe input {
  flex: 1 1 260px; min-width: 0; height: 52px; padding: 0 18px;
  font: 400 15px var(--sans); color: var(--slate);
  background: transparent; border: 1px solid var(--slate); border-radius: 0;
}
.subscribe input::placeholder { color: #5C666C; }
.subscribe button {
  flex: 0 0 auto; height: 52px; padding: 0 28px;
  font: 600 12px var(--sans); letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--parchment); background: var(--slate);
  border: 1px solid var(--slate); border-radius: 0; cursor: pointer;
}
.subscribe button:hover { background: #2F3C44; }
.form-note { min-height: 1.4em; margin: 0; font-size: 13px; color: var(--ink-soft); text-align: center; }

/* ------------------------------------------------------ Subjects strip */
.subjects {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 12px 20px; padding: 0 24px; margin: 0; list-style: none;
  font-size: 11px; font-weight: 600; letter-spacing: 0.26em; text-transform: uppercase;
}
.subjects li + li::before {
  content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--bronze); margin-right: 20px; vertical-align: middle;
}

/* ------------------------------------------------------------ Sections */
.section { width: 100%; max-width: 860px; margin: 0 auto; padding: clamp(72px, 10vw, 128px) 24px 0; }
.section--tight { padding-top: clamp(40px, 6vw, 64px); }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding-bottom: 18px; border-bottom: 1px solid var(--slate);
}
.eyebrow { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.26em; text-transform: uppercase; }
.section-link {
  font-size: 11px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--bronze-text);
}
.section-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Page headings (archive, about, 404) */
.page-head {
  max-width: 860px; margin: 0 auto; text-align: center;
  padding: clamp(56px, 8vw, 96px) 24px 0;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.page-title {
  margin: 0; font-family: var(--serif); font-weight: 600;
  font-size: clamp(32px, 6vw, 56px); line-height: 1.05;
  letter-spacing: 0.3em; padding-left: 0.3em; text-transform: uppercase;
}
.page-sub { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink-soft); }
.page-head--lost .page-sub:first-child { font-size: 12px; font-weight: 600; letter-spacing: 0.26em; color: var(--bronze-text); }

/* ------------------------------------------------------------- Letters */
.letters { list-style: none; margin: 0; padding: 0; }
.letter a, .letter .letter-static {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 28px;
  padding: 32px 0; border-bottom: 1px solid var(--stone);
}
.letter .num { flex: 0 0 56px; font-size: 12px; font-weight: 600; letter-spacing: 0.12em; color: var(--bronze-text); }
.title-wrap { flex: 1 1 320px; display: flex; flex-direction: column; gap: 10px; }
.letter .title {
  font-family: var(--serif); font-weight: 500; line-height: 1.15;
  font-size: clamp(26px, 3.4vw, 34px);
}
.letter a:hover .title { color: var(--bronze-text); }
.letter .summary { font-size: 14px; line-height: 1.6; color: var(--ink-soft); }
.tag {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: #4A565D;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--slate); }
.dot.history { background: var(--bronze); }
.dot.art { background: var(--olive); }
.dot.music { background: var(--slate-blue); }
.dot.philosophy { background: var(--slate); }

/* --------------------------------------------------------------- About */
.about {
  display: flex; flex-wrap: wrap; gap: 32px 56px; align-items: flex-start;
  padding-bottom: clamp(72px, 10vw, 128px);
}
.emblem-small { width: 96px; height: 96px; flex: 0 0 auto; }
.about-body { flex: 1 1 360px; display: flex; flex-direction: column; gap: 20px; }
.about-body .eyebrow { color: var(--bronze-text); }
.about-lead { margin: 0; font-family: var(--serif); font-size: clamp(22px, 2.8vw, 28px); line-height: 1.4; }
.about-text { margin: 0; font-size: 15px; line-height: 1.7; color: var(--ink-soft); }

/* --------------------------------------------------------------- Essay */
.essay { width: 100%; max-width: 700px; margin: 0 auto; padding: clamp(48px, 7vw, 88px) 24px 0; }
.essay--page { padding-top: clamp(40px, 6vw, 64px); }

.essay-head { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 18px; }
.back {
  font-size: 11px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--bronze-text);
}
.back::before { content: "\2190\00a0\00a0"; }
.back:hover { text-decoration: underline; text-underline-offset: 4px; }
.essay-meta { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 10px 24px; }
.essay-meta .num { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; color: var(--bronze-text); }
.essay-head h1 {
  margin: 0; width: 100%; font-family: var(--serif); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; font-size: clamp(30px, 5.2vw, 52px); line-height: 1.1; text-wrap: balance;
  padding-bottom: 24px; border-bottom: 1px solid var(--bronze);
}
.byline {
  margin: 0; font-size: 12px; font-weight: 500; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--slate-blue);
}
.pdf-link { color: var(--bronze-text); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

/* Long-form text: follows the Polymath Letters brand guide (Montserrat body, Cormorant Garamond display) */
.prose {
  margin-top: clamp(36px, 5vw, 56px);
  font-family: var(--sans); font-weight: 400;
  font-size: 16px; line-height: 1.8; color: var(--slate);
  hyphens: auto; -webkit-hyphens: auto;
}
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.15em; }
.prose .lead {
  font-family: var(--serif); font-weight: 500; font-size: clamp(22px, 2.7vw, 27px);
  line-height: 1.42; margin: 0 0 1.5em;
}
.prose h2 {
  margin: 2.3em 0 0.6em; font-family: var(--serif); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; line-height: 1.2; font-size: clamp(23px, 3vw, 30px); text-wrap: balance;
}
.prose h3 {
  margin: 1.9em 0 0.5em; font-family: var(--serif); font-weight: 700; letter-spacing: 0.01em;
  line-height: 1.25; font-size: clamp(19px, 2.4vw, 22px); color: var(--slate);
}
.prose a {
  color: inherit; text-decoration: underline;
  text-decoration-color: var(--bronze); text-underline-offset: 4px; text-decoration-thickness: 1px;
}
.prose a:hover { color: var(--bronze-text); }
.prose strong { font-weight: 600; }
.prose blockquote {
  margin: 1.9em 0; padding: 0 0 0 1.3em; border-left: 3px solid var(--bronze);
  font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(19px, 2.3vw, 21px); line-height: 1.55;
}
.prose blockquote > :last-child { margin-bottom: 0; }
.prose blockquote.pull-quote {
  margin: 2.6em 1.5em; padding: 1.1em 0; text-align: center; border-left: 0;
  border-top: 1px solid var(--bronze); border-bottom: 1px solid var(--bronze);
  font-size: clamp(24px, 3.3vw, 32px); line-height: 1.3;
}
.prose .caption { margin: 0.7em 0 2.2em; font-size: 12px; line-height: 1.55; color: var(--slate-blue); }
.prose .label {
  margin: 2.8em 0 0.7em; font-size: 11px; font-weight: 600; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--slate-blue);
}
.prose .sources { margin: 0 0 0.6em; font-size: 13px; line-height: 1.6; hyphens: none; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.7em; }
.prose ul { list-style: none; }
.prose ul > li { position: relative; }
.prose ul > li::before { content: "\2014"; position: absolute; left: -1.7em; color: var(--bronze); }
.prose li { margin: 0 0 0.45em; padding-left: 0.1em; }
.prose li::marker { color: var(--bronze); }
.prose hr { border: 0; margin: 2.6em 0; text-align: center; height: auto; }
.prose hr::after { content: "\2022\2003\2022\2003\2022"; color: var(--bronze); letter-spacing: 0.2em; }
.prose img { display: block; max-width: 100%; height: auto; margin: 2em auto; }
.prose code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.78em;
  background: rgba(32, 42, 48, 0.07); padding: 0.12em 0.4em;
}
.prose pre { overflow-x: auto; background: rgba(32, 42, 48, 0.07); padding: 1em 1.2em; margin: 0 0 1.35em; }
.prose pre code { background: none; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.35em; font-family: var(--sans); font-size: 14px; line-height: 1.5; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--stone); }
.prose th { font-weight: 600; border-bottom-color: var(--slate); }

/* End of an essay */
.essay-end {
  margin-top: clamp(56px, 8vw, 96px);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 24px;
}
.essay-end-lead { margin: 0; font-family: var(--serif); font-style: italic; font-size: clamp(24px, 3vw, 30px); }
.pager {
  width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px;
  margin-top: clamp(32px, 5vw, 56px); padding-top: 28px; border-top: 1px solid var(--stone);
  text-align: left;
}
.pager a { display: flex; flex-direction: column; gap: 8px; }
.pager-newer { text-align: right; grid-column: 2; }
.pager-label { font-size: 11px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--bronze-text); }
.pager-title { font-family: var(--serif); font-size: 22px; font-weight: 500; line-height: 1.2; }
.pager a:hover .pager-title { color: var(--bronze-text); }
.essay { padding-bottom: clamp(72px, 10vw, 128px); }

/* -------------------------------------------------------------- Footer */
.site-footer { margin-top: auto; padding: 0 var(--gutter); }
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 32px; padding: 32px 0 40px; font-size: 12px; letter-spacing: 0.08em; color: #4A565D;
}
.footer-inner .wordmark { font-size: 16px; color: var(--slate); }
.footer-inner .credit { padding-left: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-links a { font-weight: 500; }

@media (max-width: 520px) {
  .pager { grid-template-columns: 1fr; }
  .pager-newer { grid-column: auto; text-align: left; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ------------------------------------------- Signup extras */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-fine { margin: 4px 0 0; font-size: 12px; color: var(--ink-soft); text-align: center; }
.form-fine a { color: inherit; text-underline-offset: 3px; }
.form-note.is-error { color: #8A3A2B; }
.unsub { margin-top: 18px; display: flex; justify-content: center; }
.unsub button {
  height: 52px; padding: 0 28px; font: 600 12px var(--sans); letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--parchment); background: var(--slate); border: 1px solid var(--slate); border-radius: 0; cursor: pointer;
}
.unsub button:hover { background: #2F3C44; }
.unsub button[disabled] { opacity: 0.5; cursor: default; }

/* Footer social icons */
.footer-links { align-items: center; }
.icon-link { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; color: var(--slate); }
.icon-link:hover { color: var(--bronze-text); }
