@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/source-serif-4-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/source-serif-4-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/source-serif-4-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/inter-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter-latin-600-normal.woff2") format("woff2");
}

:root {
  --paper: #f6efe2;
  --card: #fffaf3;
  --ink: #1a2332;
  --muted: #5c5348;
  --line: #e2d3bc;
  --clay: #c4512c;
  --clay-ink: #9a3e22;
  --clay-soft: #fde7d8;
  --saffron: #e08a2f;
  --saffron-ink: #8a4b12;
  --header: #1a2332;
  --serif: "Source Serif 4", Palatino, Georgia, serif;
  --sans: Inter, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
}

:focus-visible {
  outline: 2px solid var(--saffron);
  outline-offset: 3px;
}

a { color: var(--clay-ink); }
a:hover { text-decoration: none; }

img { max-width: 100%; height: auto; }

.wrap {
  width: min(68rem, calc(100% - 2.5rem));
  margin-inline: auto;
}

.site-header {
  background: var(--header);
  color: var(--paper);
  border-bottom: 4px solid var(--saffron);
}

.header-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
  flex: 0 0 auto;
}

.brand img {
  width: 2.5rem;
  height: 2.5rem;
  display: block;
}

.brand-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1;
  color: #fffaf3;
}

.site-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem 1rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
}

.site-nav a,
.series-menu summary {
  color: #f6efe2;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"],
.series-menu summary:hover,
.series-menu[open] summary {
  color: var(--saffron);
}

.series-menu { position: relative; }

.series-menu summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
}

.series-menu summary::-webkit-details-marker { display: none; }

.series-panel {
  display: none;
  position: absolute;
  top: calc(100% + 0.7rem);
  right: 0;
  z-index: 5;
  min-width: 11rem;
  padding: 0.4rem;
  background: var(--card);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(26, 35, 50, 0.18);
}

.series-menu[open] .series-panel,
.series-menu:hover .series-panel,
.series-menu:focus-within .series-panel { display: grid; }

.series-panel a {
  color: var(--ink);
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
}

.series-panel a:hover,
.series-panel a[aria-current="page"] {
  background: var(--paper);
  color: var(--saffron-ink);
}

main { padding: 2.5rem 0 3.5rem; }

.prose { width: min(66ch, calc(100% - 2.5rem)); }

.page-head { margin-bottom: 1.5rem; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

h1 { font-size: 2.4rem; margin: 0.2rem 0 0.6rem; }
h2 { font-size: 1.45rem; margin: 2rem 0 0.6rem; }
h3 { font-size: 1.15rem; margin: 1.4rem 0 0.4rem; }

.lede, .kicker, .meta, .deck, .alias, .origin, .section-label, .filter-row, .year-label {
  font-family: var(--sans);
}

.lede, .deck { color: var(--muted); font-size: 1.05rem; }

.kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-ink, var(--clay-ink));
}

.kicker a { color: inherit; }

.meta { color: var(--muted); margin: 0; }

.hero {
  width: min(68rem, calc(100% - 2.5rem));
  margin: 0 auto 2rem;
}

.hero img {
  width: min(100%, 26rem);
  height: auto;
  display: block;
}

.hero h1 { font-size: 3.2rem; margin: 0.8rem 0 0.3rem; }

.alias { margin: 0.4rem 0 0; }
.alias a { font-weight: 600; }

.series-grid,
.post-list,
.work-list,
.latest-list {
  width: min(68rem, calc(100% - 2.5rem));
  margin: 1rem auto 0;
}

.series-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.series-card,
.post-card,
.work-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent, var(--saffron));
  padding: 0.9rem;
}

.series-card {
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.series-card h2,
.post-card h2,
.work-card h2 {
  font-size: 1.2rem;
  margin: 0;
}

.series-card p,
.post-card p,
.work-card p { margin: 0.3rem 0 0; }

.series-card img,
.illustration img {
  width: 100%;
  background: #fff4e8;
  border-radius: 8px;
}

.count {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
}

.caption, figcaption {
  font-family: var(--sans);
  color: var(--muted);
  font-size: 0.92rem;
}

.section-label {
  width: min(68rem, calc(100% - 2.5rem));
  margin: 2.4rem auto 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}

.latest-list { display: grid; }

.latest-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr auto;
  gap: 0.8rem;
  align-items: baseline;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.latest-row strong { font-weight: 700; }
.latest-row span { color: var(--muted); font-family: var(--sans); font-size: 0.92rem; }

.more-link {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--sans);
  font-weight: 600;
}

.post-list, .work-list { display: grid; gap: 0.8rem; }

.post-card a { text-decoration: none; }
.post-card a:hover { text-decoration: underline; }

.post-head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.post-head img {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  border-radius: 10px;
  background: #fff4e8;
  flex: 0 0 auto;
}

.illustration { margin: 0 0 1.4rem; }
.illustration img { max-width: 22rem; }

.origin {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.95rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  margin: 0 0 1.2rem;
  font-size: 0.92rem;
}

.year-label {
  margin: 1.6rem 0 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

blockquote {
  margin: 1.2rem 0;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 3px solid var(--clay);
  color: var(--ink);
}

pre, code {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", monospace;
  font-size: 0.86rem;
}

pre {
  background: var(--ink);
  color: #f6efe2;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  line-height: 1.45;
  border-radius: 8px;
}

code { background: var(--clay-soft); padding: 0.05rem 0.25rem; }
pre code { background: transparent; padding: 0; color: inherit; }

.site-footer {
  background: var(--header);
  padding: 1.4rem 0 2rem;
  color: #d9cfc0;
  font-family: var(--sans);
  font-size: 0.95rem;
}

.footer-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.footer-row img { width: 2rem; height: 2rem; }

.site-footer a { color: var(--saffron); }
.site-footer p { margin: 0.2rem 0; }

.visitors { font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .series-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 2.5rem; }
  .latest-row { grid-template-columns: 6.5rem 1fr; }
  .latest-row span:last-child { display: none; }
}

@media (max-width: 560px) {
  .series-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.85rem; }
  .brand-name { font-size: 1.05rem; }
  .site-nav, .series-menu summary { font-size: 0.78rem; gap: 0.55rem; }
  .header-row { gap: 0.5rem; }
  .brand img { width: 1.8rem; height: 1.8rem; }
  .latest-row { grid-template-columns: 1fr; }
}
