:root {
  --bg: #fcfbf8;
  --bg-soft: #ffffff;
  --paper: #fffdfa;
  --ink: #1d1d1b;
  --muted: #64635f;
  --line: rgba(20, 20, 18, 0.1);
  --accent: #82583c;
  --accent-soft: rgba(130, 88, 60, 0.16);
  --shadow: 0 8px 24px rgba(20, 20, 18, 0.04);
  --max-width: 1180px;
  --radius: 16px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(180deg, #fffdfa 0%, #fbfaf7 100%);
  font-family: "Literata", Georgia, serif;
  line-height: 1.75;
}

a {
  color: inherit;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header {
  margin-bottom: 2.5rem;
  padding: 0.5rem 0 1rem;
  border-bottom: 1px solid var(--line);
}

.wordmark,
.top-nav {
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
}

.wordmark {
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.95rem;
}

.top-nav a {
  color: var(--muted);
  text-decoration: none;
}

.top-nav a.active,
.top-nav a:hover,
.text-link:hover,
.mini-links a:hover,
.site-footer a:hover {
  color: var(--accent);
}

.home-grid,
.content-grid {
  display: grid;
  gap: 1.4rem;
}

.home-grid {
  grid-template-columns: repeat(12, 1fr);
}

.content-grid {
  grid-template-columns: minmax(0, 3fr) minmax(280px, 1.1fr);
  align-items: start;
}

.about-layout {
  display: grid;
  gap: 1.5rem;
}

.about-intro {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.about-body {
  display: grid;
  gap: 1.25rem;
  justify-items: start;
}

.hero,
.section-card,
.sidebar-card,
.timeline-block,
.content-main,
.content-side {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero,
.section-card,
.sidebar-card,
.content-main,
.content-side {
  padding: 1.5rem;
}

.hero {
  grid-column: span 8;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.sidebar-card {
  grid-column: span 4;
  align-self: start;
}

.portrait-block {
  margin: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 12px;
  background: #f4f1eb;
}

.portrait-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.section-card {
  grid-column: span 4;
}

.stretch {
  grid-column: span 6;
}

.content-main {
  min-width: 0;
  max-width: 46rem;
}

.content-side {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.about-body .content-main {
  width: 100%;
}

.books-layout {
  display: grid;
  gap: 1.5rem;
}

.books-header,
.books-panel {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.books-header {
  max-width: 48rem;
}

.books-intro,
.books-epigraph {
  max-width: 58ch;
}

.books-epigraph {
  color: var(--muted);
  font-style: italic;
}

.books-search-wrap {
  display: grid;
  gap: 0.45rem;
}

.books-search-label {
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
}

.books-search {
  width: 100%;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.books-search:focus {
  outline: 2px solid rgba(130, 88, 60, 0.14);
  outline-offset: 1px;
  border-color: rgba(130, 88, 60, 0.32);
}

.books-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.1rem;
  padding-bottom: 0.35rem;
  color: var(--muted);
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.88rem;
}

.books-list {
  border-top: 1px solid var(--line);
}

.book-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.book-copy h2 {
  font-size: 1.08rem;
  line-height: 1.3;
}

.book-copy p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.book-meta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.book-marker {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #faf8f4;
  color: var(--muted);
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.78rem;
}

.book-marker.is-partial {
  color: var(--accent);
  border-color: rgba(130, 88, 60, 0.24);
  background: rgba(130, 88, 60, 0.06);
}

.books-empty {
  margin: 1rem 0 0;
  color: var(--muted);
}

.timeline-block {
  grid-column: 1 / -1;
  padding: 0.4rem 1.5rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: 1.2rem;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item:last-child {
  border-bottom: 0;
}

.timeline-meta,
.section-kicker,
.sidebar-label,
.eyebrow,
.site-footer,
.margin-note {
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
}

.eyebrow,
.section-kicker,
.sidebar-label {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  font-weight: 500;
  line-height: 1.08;
}

h1 {
  max-width: 18ch;
  font-size: clamp(2rem, 3.8vw, 3.2rem);
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.2rem, 1.7vw, 1.5rem);
  letter-spacing: -0.02em;
}

p,
li {
  font-size: 1rem;
}

.lede {
  max-width: 60ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.action-row,
.mini-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.1rem;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 180ms ease, background-color 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
  background: #f6f3ee;
}

.text-link,
.mini-links a,
.site-footer a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.plain-list,
.meta-list {
  margin: 0;
  padding-left: 1.1rem;
}

.plain-list li + li,
.meta-list li + li {
  margin-top: 0.55rem;
}

.timeline-list {
  display: grid;
  gap: 1rem;
}

.timeline-list article {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.timeline-list article:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.timeline-list p,
.timeline-meta p {
  margin: 0;
  color: var(--muted);
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.92rem;
}

.timeline-copy p {
  margin: 0;
}

.hero h1,
.content-main h1 {
  max-width: none;
}

.hero h1 {
  max-width: 14ch;
}

.content-main h1 {
  font-size: clamp(1.7rem, 2.6vw, 2.3rem);
  line-height: 1.2;
}

.margin-note {
  padding-left: 1rem;
  border-left: 3px solid var(--accent-soft);
  color: var(--muted);
  font-size: 0.96rem;
}

.flow > * + * {
  margin-top: 1rem;
}

.site-footer {
  margin-top: 2rem;
  padding: 1rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  border-top: 1px solid var(--line);
}

.hero,
.section-card,
.sidebar-card,
.content-main,
.timeline-block {
  animation: rise 560ms ease both;
}

.sidebar-card {
  animation-delay: 80ms;
}

.section-card:nth-of-type(1) {
  animation-delay: 120ms;
}

.section-card:nth-of-type(2) {
  animation-delay: 180ms;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .home-grid,
  .content-grid,
  .about-intro {
    grid-template-columns: 1fr;
  }

  .hero,
  .sidebar-card,
  .section-card,
  .stretch,
  .timeline-block {
    grid-column: auto;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .book-row {
    grid-template-columns: 1fr;
  }

  .book-meta-row {
    justify-content: flex-start;
  }

  h1 {
    max-width: none;
  }

  .content-main {
    max-width: none;
  }

  .portrait-block {
    max-width: 18rem;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(calc(100% - 1rem), var(--max-width));
    padding-top: 1rem;
  }

  .site-header,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero,
  .section-card,
  .sidebar-card,
  .content-main {
    padding: 1.2rem;
  }

  p,
  li {
    font-size: 0.98rem;
  }
}
