:root {
  --paper: #ffffff;
  --ink: #171714;
  --muted: #6f6d66;
  --line: #e2e1dc;
  --accent: #1c3d32;
  --accent-soft: #e8efec;
  --serif: "Libre Baskerville", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Source Sans 3", "Gill Sans", "Helvetica Neue", ui-sans-serif, sans-serif;
  --pad: clamp(1.25rem, 4vw, 1.75rem);
  --max: 70rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent-soft);
}

a {
  color: inherit;
  text-decoration: none;
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--pad);
  z-index: 40;
  padding: 0.65rem 0.9rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.875rem;
}

.skip-link:focus {
  top: 1rem;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: var(--max);
  min-height: 4.75rem;
  margin: 0 auto;
  padding: 0 var(--pad);
}

.wordmark {
  font-family: var(--serif);
  font-size: clamp(1.45rem, 2.4vw, 1.95rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  color: var(--ink);
  width: max-content;
}

.wordmark:hover {
  color: var(--ink);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 1.35rem;
}

.site-nav a {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
}

/* —— Home layout —— */
.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17.5rem;
  align-items: start;
  gap: clamp(2.5rem, 6vw, 4.5rem);
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vh, 5.5rem) var(--pad) clamp(4.5rem, 10vh, 6.5rem);
  opacity: 0;
  animation: rise 0.75s var(--ease) 0.05s forwards;
}

.archive-intro {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  line-height: 1.45;
  color: var(--muted);
  max-width: 36rem;
  margin: 0 0 3.5rem;
}

.archive-intro em {
  font-style: italic;
  color: var(--ink);
}

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

.essay-row {
  display: block;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s var(--ease);
}

.essay-row h2 {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--ink);
}

.essay-row:hover h2 {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.essay-row p {
  margin-top: 0.4rem;
  max-width: 36rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.essay-meta {
  display: block;
  margin-top: 0.55rem;
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* —— Bio / newsletter aside —— */
.bio-card {
  position: sticky;
  top: 7rem;
  padding: 0.25rem 0 0.25rem 1.75rem;
  border-left: 1px solid var(--line);
  opacity: 0;
  animation: rise 0.75s var(--ease) 0.2s forwards;
}

.bio-mark {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 1.6rem;
  border: 1px solid var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.bio-card h2 {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.9rem;
}

.bio-card > p {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.bio-card > p a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.newsletter-block {
  margin-top: 1.75rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

.newsletter-block h3 {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 400;
  margin-bottom: 0.65rem;
}

.newsletter-block p {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
  margin-bottom: 1.1rem;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}

.cta:hover {
  background: var(--accent);
  color: var(--paper);
  transform: translateY(-1px);
}

.cta-arrow {
  transition: transform 0.3s var(--ease);
}

.cta:hover .cta-arrow {
  transform: translateX(3px);
}

.newsletter-note {
  display: block;
  margin-top: 0.65rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.bio-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
  font-size: 0.82rem;
}

.bio-links a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bio-links a:hover {
  color: var(--accent);
}

/* —— Inner pages —— */
.page-shell {
  max-width: 42rem;
  margin: 0 auto;
  padding: clamp(3rem, 7vh, 4.5rem) var(--pad) clamp(4rem, 10vh, 6rem);
  min-height: 60vh;
  opacity: 0;
  animation: rise 0.7s var(--ease) 0.05s forwards;
}

.back {
  display: inline-flex;
  margin-bottom: 2.75rem;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.back:hover {
  color: var(--accent);
}

.page-shell h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5.5vw, 3.75rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 1.25rem;
}

.page-shell .lede {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--muted);
  margin-bottom: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
}

.page-shell p {
  color: var(--muted);
  margin-bottom: 1rem;
  font-size: 1.02rem;
}

.page-shell p a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-shell .essay-list {
  margin-top: 0.5rem;
}

.page-cta {
  margin-top: 2.5rem;
}

.page-cta .cta {
  width: auto;
}

/* —— Footer —— */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.25rem var(--pad) 3.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer strong {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--ink);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.35rem;
}

.footer-links a:hover {
  color: var(--accent);
}

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

@media (max-width: 900px) {
  .home-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .bio-card {
    position: static;
    order: -1;
    padding: 0 0 2rem;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .cta {
    width: auto;
  }
}

@media (max-width: 560px) {
  .header-inner {
    min-height: 4rem;
    align-items: flex-start;
    padding-top: 1rem;
    padding-bottom: 1rem;
    flex-direction: column;
    gap: 0.85rem;
  }

  .site-nav {
    gap: 1rem;
    justify-content: flex-start;
  }

  .archive-intro {
    margin-bottom: 2.5rem;
  }
}

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

  .home-layout,
  .bio-card,
  .page-shell {
    opacity: 1;
    animation: none;
  }

  .cta,
  .cta-arrow {
    transition: none;
  }

  .cta:hover {
    transform: none;
  }
}
