@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Newsreader:opsz,wght@6..72,400;6..72,500&display=swap');

:root {
  --paper: #f3efe5;
  --paper-light: #faf8f1;
  --ink: #171611;
  --muted: #777369;
  --line: rgba(23, 22, 17, 0.16);
  --purple: #635bff;
  --sans: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  --serif: 'Newsreader', Georgia, serif;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input { font: inherit; }

.shell { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.eyebrow { margin: 0 0 24px; font-size: 0.71rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.eyebrow.light { color: rgba(255,255,255,.72); }

.site-header { height: 78px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.wordmark { display: flex; align-items: center; gap: 12px; font-size: .92rem; font-weight: 600; text-decoration: none; letter-spacing: -.015em; }
.wordmark-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 2px 8px 2px 8px; color: white; background: var(--purple); font-family: var(--serif); font-size: 1.2rem; font-style: italic; }
.header-actions { display: flex; align-items: center; gap: 24px; font-size: .76rem; }
.unofficial { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.text-link { text-underline-offset: 3px; }

.latest { min-height: 510px; display: grid; grid-template-columns: .8fr 1.2fr; margin-top: 20px; overflow: hidden; background: var(--paper-light); border: 1px solid var(--line); }
.latest-art { min-width: 0; padding: 28px 32px 32px; display: flex; flex-direction: column; background: var(--book-color); color: white; }
.cover-stage { position: relative; flex: 1; display: grid; place-items: center; padding: 16px; isolation: isolate; }
.cover-stage::before, .cover-stage::after { content: ''; position: absolute; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; z-index: -1; }
.cover-stage::before { width: 340px; height: 340px; }
.cover-stage::after { width: 250px; height: 250px; }
.cover-stage img { width: min(52%, 230px); max-height: 340px; object-fit: contain; box-shadow: 0 26px 48px rgba(0,0,0,.35), -7px 7px 0 rgba(255,255,255,.1); transform: rotate(-2deg); }
.cover-shadow { position: absolute; width: 42%; height: 24px; bottom: 10%; border-radius: 50%; background: rgba(0,0,0,.4); filter: blur(18px); z-index: -1; }
.latest-copy { padding: clamp(34px, 4vw, 52px); display: flex; flex-direction: column; justify-content: center; }
.latest-copy .eyebrow { margin-bottom: 16px; }
.latest-copy h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(2.35rem, 3.35vw, 3.45rem); line-height: .98; letter-spacing: -.038em; }
.author { margin: 14px 0 20px; font-family: var(--serif); font-size: 1.18rem; color: var(--muted); }
.description { max-width: 620px; display: -webkit-box; overflow: hidden; font-family: var(--serif); font-size: 1.03rem; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.description a { text-decoration-color: var(--purple); text-underline-offset: 4px; }
.latest-links { margin-top: 22px; display: flex; align-items: center; gap: 22px; font-size: .8rem; font-weight: 600; }
.primary-link { padding: 12px 16px; text-decoration: none; background: var(--ink); color: white; transition: transform .2s ease, background .2s ease; }
.primary-link:hover { transform: translateY(-2px); background: var(--purple); }
.secondary-link { text-underline-offset: 4px; }

.empty-archive { padding: 120px 0; }
.empty-archive h1 { font-family: var(--serif); font-size: clamp(3rem, 8vw, 7rem); font-weight: 400; }
.archive { padding-block: 64px 72px; }
.archive-heading { display: grid; grid-template-columns: 1fr 1fr; align-items: end; padding-bottom: 34px; border-bottom: 1px solid var(--line); }
.archive-heading .eyebrow { margin-bottom: 12px; }
.archive-heading h2 { margin: 0; font-family: var(--serif); font-size: clamp(2.8rem, 4.5vw, 4.5rem); font-weight: 400; letter-spacing: -.04em; line-height: .95; }
.archive-intro { max-width: 400px; margin: 0 0 6px auto; color: var(--muted); line-height: 1.6; }
.archive-toolbar { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.archive-toolbar > p { color: var(--muted); font-size: .78rem; }
.archive-controls { width: min(620px, 100%); display: flex; align-items: flex-end; gap: 24px; }
.search { width: min(460px, 100%); display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--ink); }
.search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: .9rem; }
.search input::placeholder { color: var(--muted); }
.search kbd { padding: 3px 6px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; font-size: .66rem; }
.year-filter { display: flex; align-items: center; gap: 8px; padding: 12px 0; color: var(--muted); border-bottom: 1px solid var(--line); font-size: .78rem; }
.year-filter select { border: 0; outline: 0; color: var(--ink); background: transparent; font: inherit; }
.book-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 48px 22px; }
.book-card[hidden] { display: none; }
.book-card a { display: block; text-decoration: none; }
.card-art { position: relative; aspect-ratio: 1 / 1; display: grid; place-items: center; overflow: hidden; background: var(--card-color); }
.card-art::after { content: 'View source ↗'; position: absolute; right: 16px; bottom: 16px; padding: 8px 10px; opacity: 0; transform: translateY(6px); background: white; font-size: .68rem; transition: opacity .2s ease, transform .2s ease; }
.card-number { position: absolute; top: 17px; left: 18px; color: rgba(255,255,255,.66); font-size: .65rem; letter-spacing: .12em; }
.card-art img { width: min(56%, 170px); height: auto; max-height: 72%; object-fit: contain; box-shadow: 0 18px 30px rgba(0,0,0,.3); transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.book-card a:hover .card-art img, .book-card a:focus-visible .card-art img { transform: translateY(-7px) rotate(-1deg); }
.book-card a:hover .card-art::after, .book-card a:focus-visible .card-art::after { opacity: 1; transform: translateY(0); }
.card-copy { padding-top: 16px; }
.card-date { margin: 0 0 9px; color: var(--muted); font-size: .64rem; text-transform: uppercase; letter-spacing: .1em; }
.card-copy h3 { margin: 0 0 7px; font-family: var(--serif); font-size: 1.22rem; font-weight: 500; line-height: 1.12; }
.card-copy > p:last-child { margin: 0; color: var(--muted); font-family: var(--serif); font-size: 1rem; }
.no-results { padding: 80px 0; font-family: var(--serif); font-size: 2rem; text-align: center; }
.archive-more { display: flex; justify-content: center; padding-top: 56px; }
.archive-more:has(button[hidden]) { display: none; }
.archive-more button { padding: 13px 20px; border: 1px solid var(--ink); color: var(--ink); background: transparent; font-weight: 600; cursor: pointer; transition: color .2s ease, background .2s ease; }
.archive-more button:hover, .archive-more button:focus-visible { color: white; background: var(--ink); }
.site-footer { min-height: 150px; display: flex; align-items: center; justify-content: space-between; gap: 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: .73rem; line-height: 1.5; }
.site-footer p { max-width: 590px; }
.site-footer div { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.site-footer a { text-underline-offset: 3px; }

@media (max-width: 900px) {
  .latest { grid-template-columns: 1fr; }
  .latest-art { min-height: 420px; }
  .latest-copy { padding: 48px; }
  .archive-heading { grid-template-columns: 1fr; gap: 28px; }
  .archive-intro { margin-left: 0; }
  .book-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 28px, 1180px); }
  .site-header { height: 76px; }
  .wordmark > span:last-child { max-width: 150px; line-height: 1.15; }
  .unofficial, .header-actions .text-link { display: none; }
  .latest { margin-top: 14px; }
  .latest-art { min-height: 300px; padding: 22px 20px; }
  .cover-stage::before { width: 230px; height: 230px; }
  .cover-stage::after { width: 165px; height: 165px; }
  .cover-stage img { width: min(52%, 165px); max-height: 220px; }
  .latest-copy { padding: 28px 22px 34px; }
  .latest-copy h1 { font-size: clamp(2.2rem, 9vw, 2.75rem); }
  .author { margin: 16px 0 24px; font-size: 1.12rem; }
  .description { font-size: 1rem; -webkit-line-clamp: 3; }
  .latest-links { margin-top: 24px; flex-wrap: wrap; gap: 18px; }
  .archive { padding-block: 64px 56px; }
  .archive-heading { padding-bottom: 28px; gap: 18px; }
  .archive-heading h2 { font-size: 3.1rem; }
  .archive-toolbar { min-height: 0; padding-block: 22px 28px; align-items: flex-start; flex-direction: column; gap: 12px; }
  .archive-toolbar > p { margin: 0; }
  .archive-controls { align-items: stretch; flex-direction: column; gap: 10px; }
  .year-filter { justify-content: space-between; }
  .book-grid { grid-template-columns: repeat(2, 1fr); gap: 38px 14px; }
  .card-art img { width: 58%; max-height: 70%; }
  .card-art::after { display: none; }
  .card-number { top: 12px; left: 12px; }
  .card-copy { padding-top: 13px; }
  .card-copy h3 { font-size: 1.08rem; }
  .card-copy > p:last-child { font-size: .9rem; }
  .archive-more { padding-top: 40px; }
  .site-footer { padding-block: 38px; align-items: flex-start; flex-direction: column; gap: 18px; }
}

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