:root {
  --paper: #f6f1e7;
  --surface: #fffaf0;
  --ink: #1c1a17;
  --muted: #655e53;
  --line: #d9d0bf;
  --accent: #a8321f;
  --on-accent: #ffffff;
  --band: #1f2e2a;
  --on-band: #f6f1e7;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #15130f;
  --surface: #1f1c17;
  --ink: #f0e9db;
  --muted: #aaa193;
  --line: #37322a;
  --accent: #ec7a5f;
  --on-accent: #15130f;
  --band: #22332e;
  --on-band: #f0e9db;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.125rem/1.65 var(--body);
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.12;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.6rem, 7vw, 4.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.25rem); letter-spacing: -0.01em; }
h3 { font-size: 1.3rem; }
h2 a, h3 a { color: inherit; text-decoration: none; }
h2 a:hover, h3 a:hover { color: var(--accent); }
p { margin: 0 0 1em; }

.wrap { width: min(1160px, 100% - 2rem); margin-inline: auto; }
.narrow { width: min(720px, 100% - 2rem); margin-inline: auto; }
.muted { color: var(--muted); }
.section { padding-block: clamp(3rem, 7vw, 5rem); }
.sr {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--ink); color: var(--paper);
  padding: 0.5rem 1rem; font-family: var(--ui);
}
.skip:focus { top: 0.5rem; }

.eyebrow {
  font: 600 0.78rem/1.4 var(--ui);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}
.lede { font-size: clamp(1.2rem, 2.4vw, 1.45rem); line-height: 1.45; }

.badge {
  display: inline-block;
  font: 600 0.66rem/1 var(--ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.28em 0.45em;
  vertical-align: middle;
}

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.4rem; }
.button {
  display: inline-block;
  background: var(--accent);
  color: var(--on-accent);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 0.72rem 1.25rem;
  font: 600 0.92rem/1.2 var(--ui);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.button:hover { transform: translateY(-1px); }
.button.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.button:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
  background: var(--paper);
}
.bar { display: flex; align-items: center; gap: 1.5rem; min-height: 4.5rem; }
.mark {
  font: 500 1.45rem/1 var(--display);
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.nav { display: flex; gap: 1.5rem; margin-left: auto; }
.nav a {
  font: 500 0.92rem/1 var(--ui);
  color: var(--ink);
  text-decoration: none;
  padding-block: 0.4rem;
  border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--accent); }
.tools { display: flex; gap: 0.5rem; }
.tool {
  background: none;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink);
  font: 500 0.78rem/1 var(--ui);
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  white-space: nowrap;
}
.menu-toggle { display: none; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: end;
  padding-block: clamp(3rem, 8vw, 6.5rem);
}
.hero h1 {
  font-size: clamp(3.5rem, 12.5vw, 10rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-weight: 400;
  margin-bottom: 1.5rem;
}
.hero-book {
  display: grid;
  grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: end;
  border-top: 1px solid var(--ink);
  padding-top: 1.25rem;
}
.hero-book h2 { font-size: 1.5rem; }
.hero-book .eyebrow { margin-bottom: 0.6rem; }
.hero-book p:last-child { margin-bottom: 0; font-size: 1rem; }
.hero-book a { text-decoration: none; }

/* Covers */
.cover { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; box-shadow: 0 10px 24px -12px rgb(0 0 0 / 0.55); }
.cover.drawn {
  background: var(--cover);
  color: #f6f1e7;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10% 9%;
  container-type: inline-size;
}
.cover-title { font: 500 15cqw/1.08 var(--display); overflow-wrap: anywhere; }
.cover-author { font: 600 6.5cqw/1.2 var(--ui); letter-spacing: 0.1em; text-transform: uppercase; }

/* Start strip */
.start-strip { background: var(--band); color: var(--on-band); padding-block: clamp(2.5rem, 6vw, 4rem); }
.start-strip .eyebrow { color: inherit; opacity: 0.8; }
.start-strip p:last-child { margin-bottom: 0; }
.start-strip .button { background: var(--on-band); border-color: var(--on-band); color: var(--band); }
.start-strip .button.ghost { background: transparent; color: var(--on-band); }
.start-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
}
.start-inner .actions { justify-content: flex-end; margin-top: 0; }

/* Lists */
.section-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 1.75rem;
}
.section-head a { font: 500 0.88rem/1 var(--ui); white-space: nowrap; }
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr));
  gap: 2.5rem 2rem;
}
.book-link { color: inherit; text-decoration: none; display: block; }
.book-link .cover { transition: transform 0.2s ease; margin-bottom: 1rem; }
.book-link:hover .cover { transform: translateY(-4px); }
.book-link:hover h3 { color: var(--accent); }
.book-card h3 { margin-bottom: 0.2rem; }
.book-card p { margin-bottom: 0.4rem; font-size: 0.98rem; }

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2.5rem, 6vw, 5rem);
  padding-top: 0;
}
.row { padding-bottom: 1.4rem; margin-bottom: 1.4rem; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; margin-bottom: 0; }
.row time { font: 500 0.82rem/1.4 var(--ui); display: block; margin-bottom: 0.4rem; }
.row h3 { margin-bottom: 0.35rem; }
.row p { margin-bottom: 0.3rem; }

/* Newsletter */
.newsletter {
  background: var(--surface);
  border-block: 1px solid var(--line);
  padding-block: clamp(2.5rem, 6vw, 4rem);
  margin-top: clamp(2rem, 5vw, 4rem);
}
.newsletter-inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  align-items: center;
}
.newsletter p { margin-bottom: 0; }
.signup { display: flex; gap: 0.6rem; }
.signup input {
  flex: 1; min-width: 0;
  font: 400 1rem/1.2 var(--ui);
  padding: 0.72rem 0.9rem;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--muted);
  border-radius: 3px;
}
.signup .button { white-space: nowrap; }

/* Inner pages */
.page-head { padding-block: clamp(3rem, 7vw, 5rem) clamp(2rem, 4vw, 3rem); }
.page-head .lede { max-width: 38rem; }
.small-head { font-size: 1.35rem; margin-top: 2rem; }
.past-head { margin-top: 3rem; }
.prose p:last-child { margin-bottom: 0; }

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2.25rem; }
.chip {
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font: 500 0.86rem/1 var(--ui);
  padding: 0.55rem 0.95rem;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.book-detail {
  display: grid;
  grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  padding-block: clamp(3rem, 7vw, 5rem);
  align-items: start;
}
.book-cover-col { position: sticky; top: 6rem; }
.subtitle { font: 500 1rem/1.4 var(--ui); color: var(--muted); margin-top: -0.4rem; }
.highlights { margin: 0; padding-left: 1.2rem; }
.highlights li { margin-bottom: 0.35rem; }
img.cover { height: auto; aspect-ratio: auto; object-fit: fill; }
blockquote {
  margin: 2rem 0 0;
  padding-left: 1.2rem;
  border-left: 2px solid var(--accent);
  font-family: var(--display);
  font-size: 1.2rem;
  line-height: 1.4;
}
blockquote p { margin-bottom: 0.4rem; }
blockquote.plain { font: inherit; margin-top: 0; }
cite { font: 500 0.85rem/1.4 var(--ui); color: var(--muted); }

.excerpt { background: var(--surface); border-block: 1px solid var(--line); padding-block: clamp(3rem, 6vw, 4.5rem); }

.path { padding-bottom: 2.5rem; margin-bottom: 2.5rem; border-bottom: 1px solid var(--line); }
.path:last-child { border-bottom: 0; margin-bottom: 0; }
.path-list { padding-left: 1.4rem; margin: 0; }
.path-list li { margin-bottom: 0.8rem; }
.path-list li::marker { font-family: var(--display); color: var(--accent); }
.path-list a { display: block; font: 500 1.2rem/1.3 var(--display); }

.post { padding-block: clamp(3rem, 7vw, 5rem) 1rem; }

.about {
  display: grid;
  grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  padding-block: clamp(3rem, 7vw, 5rem) 0;
  align-items: start;
}
.portrait { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.monogram {
  display: grid; place-items: center;
  background: var(--band); color: var(--on-band);
  font: 400 clamp(5rem, 12vw, 8rem)/1 var(--display);
}

.works { padding-bottom: 0; }
.work { padding-block: 1.5rem; border-top: 1px solid var(--line); }
.work .eyebrow { margin-bottom: 0.4rem; }
.work p:last-child { margin-bottom: 0; }
.work ul { list-style: none; margin: 0; padding: 0; }
.work li { margin-top: 1rem; }
.work li a { display: block; font: 500 1.08rem/1.3 var(--display); }

.faq { border-bottom: 1px solid var(--line); padding-block: 1.1rem; }
.faq summary { font: 500 1.2rem/1.35 var(--display); cursor: pointer; }
.faq p { margin: 0.8rem 0 0; }
.faq-more { margin-top: 2rem; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
}
.contact-card { background: var(--surface); border: 1px solid var(--line); padding: 1.5rem; }
.contact-card h2 { font-size: 1.4rem; }
.contact-card p:last-child { margin-bottom: 0; }
.contact-card a { overflow-wrap: anywhere; }

/* Footer */
.site-footer { padding-block: 3rem 2rem; }
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
  gap: 2rem;
}
.footer-grid .muted { margin-top: 0.7rem; font-size: 1rem; }
.footer-grid nav { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-grid nav a { font: 400 0.92rem/1.3 var(--ui); color: var(--ink); text-decoration: none; }
.footer-grid nav a:hover { color: var(--accent); }
.copyright { font: 400 0.8rem/1.4 var(--ui); margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }

@media (max-width: 860px) {
  .menu-toggle { display: inline-block; }
  .tools { margin-left: auto; }
  .nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1rem 1rem;
  }
  .nav.open { display: flex; }
  .nav a { padding-block: 0.8rem; font-size: 1rem; border-bottom: 1px solid var(--line); }
  .nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--line); }
  .hero, .start-inner, .two-col, .newsletter-inner, .book-detail, .about, .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .start-inner .actions { justify-content: flex-start; }
  .book-cover-col { position: static; max-width: 15rem; }
  .about > div:first-child { max-width: 18rem; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1.25rem; }
}

@media (max-width: 420px) {
  .signup { flex-direction: column; }
}

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