/* ============================================================
   Claude's Context — a research journal on machine minds
   Literary journal aesthetic: ink on paper, serif-forward,
   generous whitespace, one restrained accent.
   ============================================================ */

:root {
  --paper:       #faf7f1;
  --paper-deep:  #f3eee2;
  --card:        #fffdf9;
  --ink:         #221e18;
  --ink-soft:    #4d463b;
  --muted:       #857b6a;
  --accent:      #7c2f26;   /* oxide red — the single restrained accent */
  --accent-deep: #5c231c;
  --rule:        #d9d0bd;
  --rule-soft:   #e8e1d1;
  --serif: Georgia, 'Iowan Old Style', 'Palatino Linotype', Palatino,
           'Book Antiqua', 'Times New Roman', serif;
  --measure: 65ch;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
}

/* ---------- accessibility ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: .6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: .5rem; top: .5rem; }

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

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

/* ---------- layout ---------- */
.wrap {
  width: min(92%, 72rem);
  margin-inline: auto;
}
.prose-wrap {
  width: min(92%, var(--measure));
  margin-inline: auto;
}

/* ---------- reading progress ---------- */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  z-index: 60;
}

/* ---------- masthead ---------- */
.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.masthead-inner {
  text-align: center;
  padding: 1.6rem 1rem 1.1rem;
}
.wordmark {
  font-size: 1.75rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: .015em;
  line-height: 1.2;
  display: inline-block;
}
.wordmark em { font-style: italic; color: var(--accent); }
.wordmark:hover { color: var(--ink); }
.tagline {
  margin: .35rem 0 0;
  font-size: .92rem;
  font-style: italic;
  color: var(--muted);
}
.site-nav {
  margin-top: .9rem;
  padding-top: .9rem;
  border-top: 3px double var(--rule);
  font-size: 1rem;
}
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.75rem;
  justify-content: center;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  letter-spacing: .06em;
  font-variant: small-caps;
  font-size: 1.02rem;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.menu-toggle { display: none; }

/* ---------- hero (index) ---------- */
.hero {
  text-align: center;
  padding: 4.5rem 1rem 3.5rem;
  border-bottom: 3px double var(--rule);
  margin-bottom: 0;
}
.issue-line {
  font-variant: small-caps;
  letter-spacing: .18em;
  font-size: .95rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
}
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4rem);
  font-weight: normal;
  line-height: 1.08;
  margin: 0 0 1.25rem;
  letter-spacing: .01em;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .standfirst {
  font-size: 1.25rem;
  font-style: italic;
  color: var(--ink-soft);
  max-width: 44ch;
  margin: 0 auto;
  line-height: 1.6;
}

/* ---------- sections ---------- */
.section { padding: 3.5rem 0; }
.section + .section { border-top: 1px solid var(--rule-soft); }
.section-head {
  text-align: center;
  margin-bottom: 2.5rem;
}
.kicker {
  font-variant: small-caps;
  letter-spacing: .2em;
  font-size: .92rem;
  color: var(--accent);
  margin: 0 0 .6rem;
}
.section-head h2 {
  font-size: 1.9rem;
  font-weight: normal;
  margin: 0;
}
.section-head p {
  color: var(--ink-soft);
  font-style: italic;
  max-width: 52ch;
  margin: .75rem auto 0;
}

/* ---------- featured essay ---------- */
.featured {
  background: var(--card);
  border: 1px solid var(--rule);
  padding: clamp(1.75rem, 4vw, 3rem);
  max-width: 60ch;
  margin: 0 auto;
  text-align: center;
  box-shadow: 0 1px 0 var(--rule-soft);
}
.featured .essay-no {
  font-variant: small-caps;
  letter-spacing: .2em;
  color: var(--muted);
  font-size: .9rem;
  margin: 0 0 .75rem;
}
.featured h3 {
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  font-weight: normal;
  line-height: 1.25;
  margin: 0 0 1rem;
}
.featured h3 a { color: var(--ink); text-decoration: none; }
.featured h3 a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 5px; }
.featured p.excerpt {
  color: var(--ink-soft);
  font-style: italic;
  margin: 0 0 1.5rem;
}
.meta {
  font-size: .92rem;
  color: var(--muted);
  font-variant: small-caps;
  letter-spacing: .08em;
}

/* ---------- essay index / archive list ---------- */
.essay-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 62ch;
  margin-inline: auto;
}
.essay-list > li {
  padding: 2rem 0;
  border-top: 1px solid var(--rule-soft);
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1.25rem;
  align-items: start;
}
.essay-list > li:last-child { border-bottom: 1px solid var(--rule-soft); }
.essay-no-big {
  font-size: 2.4rem;
  line-height: 1;
  color: var(--rule);
  font-style: italic;
  text-align: right;
  padding-top: .2rem;
}
.essay-list h3 {
  font-size: 1.45rem;
  font-weight: normal;
  margin: 0 0 .4rem;
  line-height: 1.3;
}
.essay-list h3 a { color: var(--ink); text-decoration: none; }
.essay-list h3 a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.essay-list .excerpt {
  margin: 0 0 .6rem;
  color: var(--ink-soft);
  font-size: 1.02rem;
}
.essay-list .meta { margin: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  padding: .72rem 1.9rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.02rem;
  letter-spacing: .05em;
  font-variant: small-caps;
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover, .btn:focus-visible {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: var(--paper);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
}
.btn-ghost:hover, .btn-ghost:focus-visible {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.center { text-align: center; }
.mt { margin-top: 2rem; }

/* ---------- about blurb ---------- */
.about-blurb {
  max-width: 58ch;
  margin: 0 auto;
  text-align: center;
  font-size: 1.12rem;
  color: var(--ink-soft);
}
.about-blurb p { margin: 0 0 1.25rem; }

/* ---------- newsletter ---------- */
.newsletter {
  background: var(--paper-deep);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 3.5rem 0;
}
.newsletter-inner {
  max-width: 40rem;
  margin: 0 auto;
  text-align: center;
  width: min(92%, 40rem);
}
.newsletter h2 {
  font-size: 1.7rem;
  font-weight: normal;
  margin: 0 0 .5rem;
}
.newsletter p.lede {
  color: var(--ink-soft);
  font-style: italic;
  margin: 0 0 1.75rem;
}
.nl-form { text-align: left; }
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-variant: small-caps;
  letter-spacing: .1em;
  font-size: .95rem;
  margin-bottom: .35rem;
  color: var(--ink-soft);
}
.field input {
  width: 100%;
  padding: .75rem .9rem;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: #fffdf9;
  border: 1px solid var(--rule);
  border-radius: 0;
}
.field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.field input[aria-invalid="true"] { border-color: var(--accent-deep); }
.nl-error {
  color: var(--accent-deep);
  font-size: .98rem;
  font-style: italic;
  margin: .4rem 0 0;
  min-height: 1.4em;
}
.nl-note {
  font-size: .9rem;
  color: var(--muted);
  font-style: italic;
  margin: 1rem 0 0;
}
.nl-success {
  border: 1px solid var(--rule);
  background: var(--card);
  padding: 2.25rem 1.75rem;
  text-align: center;
}
.nl-success h3 {
  font-weight: normal;
  font-size: 1.4rem;
  margin: 0 0 .5rem;
  color: var(--accent-deep);
}
.nl-success p { margin: 0; color: var(--ink-soft); font-style: italic; }
.rule-mark {
  color: var(--accent);
  font-size: 1.4rem;
  display: block;
  margin-bottom: .75rem;
}

/* ---------- essay article ---------- */
.essay { padding: 3.5rem 0 1rem; }
.essay-header {
  text-align: center;
  max-width: 46rem;
  margin: 0 auto 2rem;
  width: min(92%, 46rem);
}
.essay-header .kicker { margin-bottom: .8rem; }
.essay-header h1 {
  font-size: clamp(2rem, 5vw, 2.9rem);
  font-weight: normal;
  line-height: 1.18;
  margin: 0 0 1.1rem;
}
.essay-header .deck {
  font-size: 1.22rem;
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0 0 1.4rem;
}
.byline {
  font-size: .95rem;
  color: var(--muted);
  font-variant: small-caps;
  letter-spacing: .08em;
}
.byline time { font-variant: normal; letter-spacing: 0; }
.hairline {
  border: 0;
  border-top: 3px double var(--rule);
  margin: 0 auto 2.75rem;
  width: min(92%, var(--measure));
}

.prose { font-size: 1.13rem; }
.prose p { margin: 0 0 1.5rem; }
.prose > p.lead::first-letter {
  float: left;
  font-size: 3.55em;
  line-height: .84;
  padding: .05em .14em 0 0;
  color: var(--accent);
}
.prose h2 {
  font-size: 1.5rem;
  font-weight: normal;
  font-style: italic;
  margin: 2.75rem 0 1.1rem;
  color: var(--ink);
}
.prose h2::before {
  content: "§";
  color: var(--rule);
  margin-right: .5rem;
  font-style: normal;
}
.prose ul, .prose ol { margin: 0 0 1.5rem; padding-left: 1.6rem; }
.prose li { margin-bottom: .55rem; }
.prose li::marker { color: var(--accent); }

/* pull quotes */
.pullquote {
  margin: 2.75rem auto;
  padding: 1.6rem 1rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: 1.38rem;
  font-style: italic;
  line-height: 1.55;
  text-align: center;
  max-width: 54ch;
  color: var(--ink);
}
.pullquote p { margin: 0; }
.pullquote cite {
  display: block;
  margin-top: .8rem;
  font-size: .95rem;
  font-style: normal;
  font-variant: small-caps;
  letter-spacing: .1em;
  color: var(--muted);
}

/* footnotes */
.footnote-ref {
  text-decoration: none;
  font-size: .78em;
  vertical-align: super;
  line-height: 0;
  padding: 0 .1em;
  color: var(--accent);
}
.footnote-ref:hover { text-decoration: underline; }
.footnotes {
  border-top: 1px solid var(--rule);
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  font-size: .93rem;
  line-height: 1.65;
  color: var(--ink-soft);
}
.footnotes h2 {
  font-size: 1.05rem;
  font-style: normal;
  font-variant: small-caps;
  letter-spacing: .14em;
  margin: 0 0 .9rem;
  color: var(--muted);
}
.footnotes h2::before { content: none; }
.footnotes ol { padding-left: 1.4rem; margin: 0; }
.footnotes li { margin-bottom: .7rem; }
.footnote-back {
  text-decoration: none;
  color: var(--accent);
  margin-left: .35rem;
}

/* further reading */
.further-reading {
  border: 1px solid var(--rule);
  background: var(--card);
  padding: 1.75rem clamp(1.25rem, 3vw, 2.25rem);
  margin: 3rem 0 0;
}
.further-reading h2 {
  font-size: 1.15rem;
  font-variant: small-caps;
  letter-spacing: .14em;
  font-weight: normal;
  font-style: normal;
  margin: 0 0 1rem;
  color: var(--ink);
}
.further-reading h2::before { content: none; }
.further-reading ul { list-style: none; margin: 0; padding: 0; }
.further-reading li {
  margin-bottom: .9rem;
  font-size: 1rem;
  line-height: 1.6;
  padding-left: 1.4rem;
  text-indent: -1.4rem;
}
.further-reading li::before {
  content: "— ";
  color: var(--accent);
}

/* essay pager */
.essay-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
  margin: 3rem 0 2rem;
}
.essay-pager a {
  background: var(--paper);
  padding: 1.4rem 1.5rem;
  text-decoration: none;
  display: block;
}
.essay-pager a:hover { background: var(--card); }
.essay-pager .pager-label {
  display: block;
  font-variant: small-caps;
  letter-spacing: .14em;
  font-size: .88rem;
  color: var(--muted);
  margin-bottom: .35rem;
}
.essay-pager .pager-title {
  color: var(--ink);
  font-style: italic;
  font-size: 1.08rem;
  line-height: 1.4;
}
.essay-pager a:hover .pager-title { color: var(--accent); }
.essay-pager .next { text-align: right; }

/* ---------- archive page ---------- */
.archive-head {
  text-align: center;
  padding: 3.5rem 1rem 2.5rem;
  border-bottom: 3px double var(--rule);
}
.archive-head h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: normal;
  margin: 0 0 .75rem;
}
.archive-head p {
  font-style: italic;
  color: var(--ink-soft);
  max-width: 50ch;
  margin: 0 auto;
}

/* ---------- about page ---------- */
.about { padding: 3.5rem 0; }
.about h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: normal;
  text-align: center;
  margin: 0 0 .75rem;
}
.about .lede {
  text-align: center;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1.2rem;
  max-width: 46ch;
  margin: 0 auto 3rem;
}
.creed {
  list-style: none;
  margin: 2.5rem 0;
  padding: 0;
  border-top: 1px solid var(--rule-soft);
}
.creed li {
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--rule-soft);
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 1rem;
}
.creed .numeral {
  font-style: italic;
  color: var(--accent);
  font-size: 1.3rem;
}
.creed strong {
  display: block;
  font-weight: normal;
  font-size: 1.15rem;
  margin-bottom: .25rem;
}
.creed p { margin: 0; color: var(--ink-soft); font-size: 1.02rem; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 3px double var(--rule);
  margin-top: 2rem;
  padding: 2.75rem 0 2rem;
  text-align: center;
}
.site-footer .wordmark { font-size: 1.35rem; }
.footer-nav {
  list-style: none;
  margin: 1.1rem 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}
.footer-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-variant: small-caps;
  letter-spacing: .08em;
}
.footer-nav a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.colophon {
  font-size: .9rem;
  color: var(--muted);
  font-style: italic;
  max-width: 52ch;
  margin: 0 auto;
}
.copyright {
  font-size: .85rem;
  color: var(--muted);
  margin-top: 1rem;
  font-variant: small-caps;
  letter-spacing: .1em;
}

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  body { font-size: 1.06rem; }
  .prose { font-size: 1.07rem; }

  .masthead-inner { padding: 1.1rem .75rem .9rem; }
  .wordmark { font-size: 1.45rem; }
  .menu-toggle {
    display: inline-block;
    margin-top: .8rem;
    background: transparent;
    border: 1px solid var(--rule);
    color: var(--ink-soft);
    font: inherit;
    font-variant: small-caps;
    letter-spacing: .12em;
    font-size: .95rem;
    padding: .45rem 1.2rem;
    cursor: pointer;
  }
  .menu-toggle:hover { border-color: var(--accent); color: var(--accent); }
  .site-nav {
    border-top: 0;
    padding-top: 0;
    margin-top: .4rem;
    display: none;
  }
  .masthead.nav-open .site-nav { display: block; }
  .site-nav ul { flex-direction: column; gap: .15rem; }
  .site-nav li { border-top: 1px solid var(--rule-soft); }
  .site-nav a { display: block; padding: .55rem 0; }

  .essay-list > li { grid-template-columns: 1fr; gap: .4rem; }
  .essay-no-big { text-align: left; font-size: 1.6rem; }

  .essay-pager { grid-template-columns: 1fr; }
  .essay-pager .next { text-align: left; }

  .hero { padding: 3rem 1rem 2.5rem; }
  .section { padding: 2.5rem 0; }
  .pullquote { font-size: 1.22rem; }
  .creed li { grid-template-columns: 1.75rem 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
