/* Julius Neumann, books. Layout idea: a quiet publisher's catalogue, books as ruled rows, text column ~65ch. */
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-style: italic; font-display: swap; src: url("fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/source-serif-4-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 400; font-style: italic; font-display: swap; src: url("fonts/source-serif-4-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); }

:root {
  --paper: #f6f6f3;
  --surface: #ffffff;
  --ink: #1b1f27;
  --muted: #596070;
  --rule: #d8d9d4;
  --accent: #7d1d2c;
  --accent-ink: #ffffff;
  --display: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --body: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
  --measure: 66ch;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.2rem;
  --step-4: 3rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14161b; --surface: #1b1e24; --ink: #e8e6e1; --muted: #a2a6af; --rule: #2d3038; --accent: #d77885; --accent-ink: #14161b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #14161b; --surface: #1b1e24; --ink: #e8e6e1; --muted: #a2a6af; --rule: #2d3038; --accent: #d77885; --accent-ink: #14161b;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: var(--step-0); line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 0.18em; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.12; text-wrap: balance; margin: 0; }
p { margin: 0; }

.wrap { width: min(1080px, 100% - 2.5rem); margin-inline: auto; }
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: var(--step-2); margin-top: 1.8em; }
.prose h3 { font-family: var(--body); font-size: var(--step-0); font-weight: 600; margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: 0.35em; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; padding-block: 1.4rem; }
.wordmark { font-family: var(--display); font-weight: 600; font-size: 1.7rem; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; }
.wordmark span { display: block; font-family: var(--body); font-size: 0.72rem; letter-spacing: 0.22em; color: var(--muted); font-weight: 400; margin-top: 0.1rem; }
.site-nav { display: flex; gap: 1.6rem; flex-wrap: wrap; font-size: 0.95rem; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }

/* Home */
.intro { padding-block: 3.5rem 2.5rem; display: grid; gap: 1rem; }
.intro h1 { font-size: var(--step-4); max-width: 18ch; }
.intro p { color: var(--muted); max-width: 52ch; font-size: var(--step-1); line-height: 1.5; }
.section-label { font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); padding-bottom: 0.8rem; border-bottom: 1px solid var(--ink); }

.catalogue { list-style: none; margin: 0; padding: 0; }
.book-row { display: grid; grid-template-columns: 170px 1fr; gap: 2.2rem; padding-block: 2.4rem; border-bottom: 1px solid var(--rule); }
.book-row .cover { width: 170px; }
.book-row h2 { font-size: var(--step-3); }
.book-row h2 a { text-decoration: none; }
.book-row .sub { font-family: var(--display); font-style: italic; font-weight: 500; font-size: var(--step-1); color: var(--muted); margin-top: 0.25rem; }
.book-row .blurb { margin-top: 0.9rem; max-width: 60ch; }
.kind { font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.5rem; }
.facts { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; font-size: 0.9rem; color: var(--muted); margin-top: 0.9rem; font-variant-numeric: tabular-nums; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.4rem; margin-top: 1.3rem; }

.btn { font: inherit; font-size: 0.98rem; font-weight: 600; cursor: pointer; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); padding: 0.62rem 1.2rem; border-radius: 2px; text-decoration: none; display: inline-flex; gap: 0.6rem; align-items: baseline; }
.btn:hover { filter: brightness(1.08); }
.btn .price { font-weight: 400; font-variant-numeric: tabular-nums; }
.link-more { font-size: 0.95rem; }
.buy-note { font-size: 0.82rem; color: var(--muted); }
.buy-msg { font-size: 0.9rem; color: var(--ink); background: var(--surface); border-left: 3px solid var(--accent); padding: 0.6rem 0.9rem; max-width: 52ch; }
.buy-msg[hidden] { display: none; }

.how { padding-block: 3.5rem; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; margin-top: 1.6rem; }
.how-grid h3 { font-size: var(--step-1); }
.how-grid p { color: var(--muted); font-size: 0.97rem; margin-top: 0.4rem; }

.about { padding-block: 0 3.5rem; }
.about .prose { margin-top: 1.4rem; }

/* Covers: typographic, replace with an <img> once real artwork exists */
.cover { aspect-ratio: 2 / 3; position: relative; color: #f2eee6; padding: 14% 13% 12%; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 1px 2px rgba(0,0,0,.18), 0 10px 24px -12px rgba(0,0,0,.45); container-type: inline-size; }
.cover::before { content: ""; position: absolute; inset: 5%; border: 1px solid currentColor; opacity: 0.35; pointer-events: none; }
.cover .c-title { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; line-height: 1.02; font-size: 15cqi; text-wrap: balance; }
.cover .c-sub { font-family: var(--display); font-style: italic; font-weight: 500; font-size: 7.5cqi; line-height: 1.2; margin-top: 6cqi; opacity: 0.85; }
.cover .c-mark { width: 22cqi; height: 2px; background: currentColor; margin-top: 7cqi; }
.cover .c-author { font-family: var(--body); font-size: 6.4cqi; letter-spacing: 0.22em; text-transform: uppercase; }
.cover--traitor { background: linear-gradient(160deg, #2a3746, #18212c); }
.cover--traitor .c-mark { background: #b23a48; }
.cover--traitor2 { background: linear-gradient(160deg, #5f1c25, #360f15); }
.cover--traitor2 .c-mark { background: #e7d6b4; }
.cover--hlr { background: #ebe7dd; color: #16181d; }
.cover--hlr::before { opacity: 0.5; }
.cover--hlr .c-title { font-size: 12.5cqi; }
.cover--hlr .c-mark { background: #7d1d2c; height: 4px; }

/* Book page */
.book-head { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: 3rem; padding-block: 3rem; align-items: start; }
.book-head h1 { font-size: var(--step-4); }
.book-head .sub { font-family: var(--display); font-style: italic; font-weight: 500; font-size: var(--step-2); color: var(--muted); margin-top: 0.4rem; line-height: 1.2; }
.book-head .lede { margin-top: 1.4rem; font-size: var(--step-1); line-height: 1.5; max-width: 54ch; }
.buybox { margin-top: 1.8rem; padding: 1.3rem 1.4rem; background: var(--surface); border: 1px solid var(--rule); display: grid; gap: 0.8rem; max-width: 34rem; }
.buybox .row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.buybox .amount { font-family: var(--display); font-weight: 600; font-size: var(--step-3); font-variant-numeric: tabular-nums; line-height: 1; }
.buybox .amount small { font-family: var(--body); font-size: 0.85rem; font-weight: 400; color: var(--muted); margin-left: 0.4rem; }

.book-body { display: grid; grid-template-columns: 1fr 260px; gap: 3.5rem; padding-block: 1rem 4rem; border-top: 1px solid var(--rule); padding-top: 2.5rem; }
.details { font-size: 0.93rem; }
.details dl { display: grid; grid-template-columns: auto 1fr; gap: 0.55rem 1rem; margin: 0.9rem 0 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-variant-numeric: tabular-nums; }
.excerpt { border-left: 2px solid var(--accent); padding-left: 1.3rem; font-style: italic; }
.contents { columns: 2 16rem; column-gap: 2rem; padding-left: 1.2em; font-size: 0.95rem; }
.contents li { break-inside: avoid; }

/* Legal pages */
.legal { padding-block: 3rem 4.5rem; }
.legal h1 { font-size: var(--step-4); margin-bottom: 0.4rem; }
.legal .updated { color: var(--muted); font-size: 0.9rem; margin-bottom: 2rem; }
.address { font-style: normal; line-height: 1.7; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding-block: 2.2rem 2.8rem; font-size: 0.88rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

@media (max-width: 760px) {
  .intro h1 { font-size: var(--step-3); }
  .book-row { grid-template-columns: 110px 1fr; gap: 1.2rem; }
  .book-row .cover { width: 110px; }
  .book-row h2 { font-size: var(--step-2); }
  .book-head { grid-template-columns: 1fr; gap: 2rem; }
  .book-head .cover { width: min(240px, 70%); }
  .book-head h1 { font-size: var(--step-3); }
  .book-body { grid-template-columns: 1fr; gap: 2.5rem; }
}
@media (max-width: 420px) {
  .book-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Cover images */
.cover-img { width: 100%; height: auto; box-shadow: 0 1px 2px rgba(0,0,0,.2), 0 12px 26px -12px rgba(0,0,0,.5); }
.book-row > a { display: block; width: 170px; align-self: start; }
.book-head > .cover-img { max-width: 300px; }
@media (max-width: 760px) {
  .book-row > a { width: 110px; }
  .book-head > .cover-img { width: min(240px, 70%); }
}
