/* ============================================================
   Personal site — design system
   White, editorial, Apple-like pages. Serif display + sans body.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --bg: #ffffff;
  --paper: #fbfaf7;
  --ink: #1c1c1e;
  --ink-soft: #3d3d3f;
  --muted: #6e6e73;
  --faint: #a1a1a6;
  --line: #e8e6e1;
  --line-soft: #f0eeea;
  --accent: #bf5726;
  --accent-soft: #f5e3d6;
  --white: #ffffff;

  --font-display: "Fraunces", "Times New Roman", serif;
  --font-body: "Outfit", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --radius: 18px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fast: 0.3s;
  --slow: 0.7s;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

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

ul {
  list-style: none;
}

::selection {
  background: var(--accent);
  color: var(--white);
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 450;
  line-height: 1.06;
  letter-spacing: -0.015em;
}

.display {
  font-size: clamp(2.75rem, 8vw, 6.75rem);
  font-weight: 420;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.lede {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  line-height: 1.4;
  font-weight: 380;
  color: var(--ink-soft);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: currentColor;
}

em {
  font-style: italic;
}

a.link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.15rem;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}

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

.lang-badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  vertical-align: 0.2em;
}

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  padding-inline: var(--gutter);
  margin-inline: auto;
}

.section {
  padding-block: clamp(4rem, 9vw, 8rem);
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-head p {
  max-width: 36rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.section-title {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
}

@media (min-width: 960px) {
  .section-head {
    grid-template-columns: 1fr 1.4fr;
    align-items: end;
  }

  .section-head p {
    justify-self: end;
    text-align: right;
  }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.82);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand span {
  color: var(--accent);
}

.nav-links {
  display: none;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  position: relative;
  font-size: 0.95rem;
  color: var(--muted);
  transition: color var(--fast) var(--ease);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--fast) var(--ease);
}

.nav-links a:hover,
.nav-links a[aria-current="true"] {
  color: var(--ink);
}

.nav-links a[aria-current="true"]::after,
.nav-links a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.6rem;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 1.5px;
  background: var(--ink);
  transition: transform var(--fast) var(--ease), opacity var(--fast) var(--ease);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(3.25px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-3.25px) rotate(-45deg);
}

.mobile-menu {
  display: none;
  overflow: hidden;
  border-top: 1px solid var(--line-soft);
}

.mobile-menu.open {
  display: block;
}

.mobile-menu a {
  display: block;
  padding: 1rem var(--gutter);
  font-family: var(--font-display);
  font-size: 1.4rem;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-soft);
}

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

@media (min-width: 900px) {
  .nav-links {
    display: flex;
  }

  .nav-toggle {
    display: none;
  }

  .mobile-menu {
    display: none !important;
  }
}

/* ---------- Hero ---------- */
.hero {
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(4rem, 10vw, 8rem);
}

.hero .display {
  margin-block: 1.25rem 1.5rem;
}

.hero .lede {
  max-width: 46rem;
  margin-bottom: 2.5rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-meta li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-meta li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-meta li a {
  color: var(--ink);
  border-bottom: 1px solid transparent;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}

.hero-meta li a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

[id] {
  scroll-margin-top: 5.5rem;
}

/* ---------- Section index (home) ---------- */
.index-list {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--line);
}

.index-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.75rem;
  align-items: baseline;
  padding: clamp(1.75rem, 4vw, 2.75rem) 0;
  border-bottom: 1px solid var(--line);
  transition: transform var(--slow) var(--ease), background var(--fast) var(--ease);
}

.index-item:hover {
  transform: translateX(0.75rem);
  background: var(--paper);
}

.index-num {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.index-item h2 {
  font-size: clamp(1.75rem, 4vw, 3rem);
}

.index-item p {
  grid-column: 2;
  max-width: 42rem;
  color: var(--muted);
}

.index-item .arrow {
  grid-column: 2;
  justify-self: center;
  margin-top: 0.5rem;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  transform: translateX(-1em);
  transition: color var(--fast) var(--ease), transform var(--fast) var(--ease);
}

.index-item:hover .arrow {
  color: var(--accent);
  transform: translateX(calc(-1em + 6px));
}

@media (min-width: 900px) {
  .index-item {
    grid-template-columns: auto 1fr 3rem;
  }

  .index-item p {
    grid-column: 2;
  }

  .index-item .arrow {
    grid-column: 3;
    align-self: center;
  }
}

/* ---------- Page hero (sub pages) ---------- */
.page-hero {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
}

.page-hero h1 {
  font-size: clamp(2.5rem, 6.5vw, 5rem);
  margin: 1.25rem 0 1.25rem;
}

.page-hero .lede {
  max-width: 44rem;
  margin-bottom: 2.5rem;
}

.page-hero .crumb {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.page-hero .crumb a:hover {
  color: var(--accent);
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  transition: transform var(--slow) var(--ease), border-color var(--fast) var(--ease),
    box-shadow var(--slow) var(--ease);
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 24px 48px -28px rgba(28, 28, 30, 0.28);
}

.card h3 {
  font-size: 1.5rem;
}

.card h3 a {
  transition: color var(--fast) var(--ease);
}

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

.card p {
  color: var(--muted);
  font-size: 1rem;
}

.card .tags {
  margin-top: auto;
}

.card .foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.85rem;
  color: var(--faint);
}

.card .foot a {
  color: var(--ink);
  font-weight: 600;
  transition: color var(--fast) var(--ease);
}

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

@media (min-width: 700px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .card-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Tags ---------- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 999px;
  padding: 0.18rem 0.7rem;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}

a.tag:hover {
  background: var(--accent);
  color: var(--white);
}

.tag.filter {
  cursor: pointer;
  background: none;
  font-family: var(--font-body);
}

.tag.filter.is-active {
  background: var(--accent);
  color: var(--white);
}

/* ---------- Photography ---------- */
.collection + .collection {
  margin-top: clamp(3rem, 6vw, 5rem);
}

.collection-title {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  margin-bottom: 1.25rem;
}

.collection-title span {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem 1.25rem;
}

/* Album cards: a cover with a heap of photos peeking out below, opening the
   album on Flickr */
.album {
  position: relative;
  display: block;
  color: var(--ink);
  text-decoration: none;
}

.album-stack {
  position: relative;
  display: block;
  padding-bottom: 1.05rem;
  transition: transform var(--fast) var(--ease);
}

.album-stack::before,
.album-stack::after {
  content: "";
  position: absolute;
  left: 6%;
  width: 88%;
  bottom: 0.3rem;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  border: 1px solid var(--white);
  box-shadow: 0 10px 22px rgba(28, 28, 30, 0.14);
  z-index: 1;
}

.album-stack::before {
  transform: rotate(-3deg);
  background: linear-gradient(150deg, #3f3f42 0%, #1d1d1f 100%);
}

.album-stack::after {
  transform: rotate(2.5deg) translateY(-0.3rem);
  background: linear-gradient(150deg, #d9d3c5 0%, #b3a995 100%);
}

.album-cover {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 14px 30px rgba(28, 28, 30, 0.18);
  transition: transform 0.9s var(--ease), filter 0.6s var(--ease);
}

.album-arrow {
  position: absolute;
  inset: auto 0.9rem 1.45rem auto;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  color: var(--white);
  font-size: 0.95rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease);
}

.album:hover .album-stack {
  transform: translateY(-4px);
}

.album:hover .album-cover {
  transform: scale(1.02);
}

.album:hover .album-arrow {
  opacity: 1;
  transform: translateY(0);
}

.album-caption {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-top: 0.35rem;
}

.album-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.2;
}

.album-meta {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (min-width: 700px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .gallery {
    grid-template-columns: repeat(4, 1fr);
  }
}

.gallery-note {
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.gallery-note a {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

/* ---------- Publications / reading list ---------- */
.list-rows {
  border-top: 1px solid var(--line);
}

.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
  transition: padding var(--fast) var(--ease), background var(--fast) var(--ease);
}

.row:hover {
  padding-left: 0.75rem;
  background: var(--paper);
}

.row h4 {
  font-size: 1.3rem;
}

.row h4 a {
  transition: color var(--fast) var(--ease);
}

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

.row .meta {
  font-size: 0.85rem;
  color: var(--faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

.row .meta strong {
  color: var(--muted);
  font-weight: 600;
}

.row p {
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 46rem;
}

@media (min-width: 800px) {
  .row {
    grid-template-columns: 9rem 1fr;
  }

  .row .meta,
  .row h4 {
    grid-column: 2;
  }

  .row .when {
    grid-row: 1 / span 2;
  }

  .row .meta {
    grid-column: 2;
  }
}

/* ---------- Blog filter bar ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 1.25rem 0;
  margin-bottom: 2rem;
  border-block: 1px solid var(--line);
}

.filter-bar .label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--faint);
  margin-right: 0.4rem;
}

.blog-post {
  animation: postIn 0.5s var(--ease) both;
}

@keyframes postIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Prose ---------- */
.prose-block {
  max-width: 44rem;
  margin-bottom: 2.5rem;
}

.prose-block h3 {
  font-size: 1.7rem;
  margin-bottom: 0.75rem;
}

.prose-block .prose {
  font-family: var(--font-display);
  font-size: 1.22rem;
  line-height: 1.75;
  color: var(--ink-soft);
  white-space: pre-line;
}

.poem {
  border-left: 2px solid var(--accent);
  padding-left: 1.5rem;
}

.lang-note {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  margin-bottom: 2rem;
}

.lang-note strong {
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

/* ---------- Quote / pull ---------- */
.pull {
  max-width: 52rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  font-weight: 380;
  line-height: 1.3;
  padding-block: clamp(3rem, 7vw, 5rem);
  text-align: center;
  margin-inline: auto;
}

.pull footer {
  margin-top: 1.5rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--muted);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 4.5rem;
}

.footer-grid .brand {
  font-size: 1.5rem;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.socials a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  background: var(--bg);
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease),
    transform var(--fast) var(--ease);
}

.socials a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  font-size: 0.82rem;
  color: var(--faint);
}

.footer-meta .heart {
  color: var(--accent);
}

@media (min-width: 800px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr;
    align-items: start;
  }

  .footer-grid .socials {
    justify-self: end;
  }
}

/* ---------- Journal articles ---------- */
.article-hero {
  padding-block: clamp(3.5rem, 8vw, 6rem);
  border-bottom: 1px solid var(--line);
}

.article-hero .crumb {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.article-hero .crumb a:hover {
  color: var(--accent);
}

.article-hero h1 {
  font-size: clamp(2.25rem, 5.5vw, 4.25rem);
  max-width: 20em;
  margin-bottom: 1.5rem;
}

.article-dek {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 44rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.9rem;
  color: var(--muted);
}

.article-meta .tags {
  margin-left: auto;
}

.article-body {
  max-width: 44rem;
  margin-inline: auto;
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  font-size: 1.12rem;
  line-height: 1.85;
  color: var(--ink-soft);
}

.article-body p {
  margin-bottom: 1.5rem;
}

.article-body .lead {
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.6;
  color: var(--ink);
}

.article-body p:first-of-type::first-letter {
  font-family: var(--font-display);
  float: left;
  font-size: 3.4rem;
  line-height: 0.85;
  padding: 0.25rem 0.75rem 0 0;
  color: var(--accent);
}

.article-body h2 {
  font-size: 1.65rem;
  margin: 2.5rem 0 1rem;
}

.article-body h3 {
  font-size: 1.3rem;
  margin: 2rem 0 0.75rem;
}

.article-body blockquote {
  margin: 2.25rem 0;
  padding: 0.25rem 0 0.25rem 1.5rem;
  border-left: 3px solid var(--accent);
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.5;
  font-style: italic;
  color: var(--ink);
}

.article-body blockquote footer {
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.75rem;
}

.article-body ul {
  margin: 0 0 1.5rem 1.25rem;
  list-style: disc;
}

.article-body li {
  margin-bottom: 0.5rem;
}

.article-body pre {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--ink);
  color: #f4f2ed;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.6;
  overflow-x: auto;
}

.article-body code {
  font-family: "SF Mono", "Menlo", "Cascadia Mono", monospace;
  font-size: 0.9em;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
}

.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  border-radius: 0;
}

.article-body figure {
  margin: 2.5rem 0;
}

.article-body figure img {
  width: 100%;
  border-radius: 14px;
}

.article-body figcaption {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--faint);
  text-align: center;
}

.article-foot {
  max-width: 44rem;
  margin-inline: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.article-foot .back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--ink);
  transition: color var(--fast) var(--ease), gap var(--fast) var(--ease);
}

.article-foot .back:hover {
  color: var(--accent);
  gap: 0.85rem;
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 2rem;
  margin-bottom: 3rem;
}

.post-nav a {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}

.post-nav a:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.post-nav .dir {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.post-nav .ttl {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ink);
}

@media (min-width: 700px) {
  .post-nav {
    grid-template-columns: 1fr 1fr;
  }

  .post-nav .next {
    text-align: right;
  }
}

/* ---------- Papers & books (humanities) ---------- */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 0.7rem 1.4rem;
  background: var(--bg);
  color: var(--ink);
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease),
    background var(--fast) var(--ease), transform var(--fast) var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
  color: var(--accent);
  border-color: var(--accent);
}

.btn.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

.btn.accent:hover {
  background: color-mix(in srgb, var(--accent) 86%, #000);
  color: var(--white);
}

.cta {
  max-width: 44rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.cta p {
  flex: 1 1 16rem;
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0;
}

.cta .btn-row {
  margin-top: 0;
}

.book-cite {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.book-cite strong {
  color: var(--ink-soft);
  font-weight: 600;
}

.book-layout {
  max-width: 44rem;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.book-cover {
  justify-self: center;
  width: min(100%, 17rem);
  border-radius: 8px;
  box-shadow: 0 28px 56px -30px rgba(28, 28, 30, 0.45);
  transform: rotate(-1.5deg);
  transition: transform var(--slow) var(--ease);
}

.book-cover img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: inherit;
}

.book-cover:hover {
  transform: rotate(0deg) translateY(-4px);
}

.book-layout .article-body {
  padding-block: 0;
}

@media (min-width: 860px) {
  .book-layout {
    grid-template-columns: 18rem 1fr;
    align-items: start;
  }

  .book-cover {
    width: 100%;
    justify-self: start;
    position: sticky;
    top: 6rem;
  }
}

.toc {
  margin: 1.5rem 0;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.toc h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.toc ol {
  list-style: none;
  counter-reset: toc;
}

.toc li {
  counter-increment: toc;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--line-soft);
  font-family: var(--font-display);
  font-size: 1.08rem;
  color: var(--ink-soft);
}

.toc li:last-child {
  border-bottom: none;
}

.toc li::before {
  content: counter(toc, decimal-leading-zero);
  margin-right: 0.9rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.refs {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--muted);
}

.refs h3 {
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.refs ol {
  margin-left: 1.25rem;
  list-style: decimal;
}

.refs li {
  margin-bottom: 0.5rem;
  font-family: var(--font-body);
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(6px);
  will-change: opacity, transform, filter;
}

.reveal.in-view {
  animation: revealIn 1.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes revealIn {
  from {
    opacity: 0;
    transform: translateY(28px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

/* Article headers fade in as a sequence, then the body fades in on scroll */
.article-hero .reveal:nth-child(1) { animation-delay: 0s; }
.article-hero .reveal:nth-child(2) { animation-delay: 0.1s; }
.article-hero .reveal:nth-child(3) { animation-delay: 0.2s; }
.article-hero .reveal:nth-child(4) { animation-delay: 0.3s; }

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
