/* Layout: a quiet museum catalogue that matches the books themselves — ivory paper, engraved line work, spaced small caps, real covers shelved in numbered order. */
:root {
  --paper: #f8f6f1;
  --paper-2: #efebe2;
  --card: #fdfcf9;
  --ink: #23221f;
  --muted: #615e57;
  --line: #d8d2c4;
  --accent: #34514b;
  --accent-ink: #f8f6f1;
  --brass: #876636;
  --shadow: rgba(40, 32, 20, 0.22);
  --plate-filter: none;
  --plate-blend: multiply;
  --f-display: "Cormorant Garamond", "Garamond", Georgia, "Times New Roman", serif;
  --f-caps: "Cormorant SC", "Cormorant Garamond", Georgia, serif;
  --f-body: "Spectral", Georgia, "Times New Roman", serif;
  --f-mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --step--1: 0.84rem;
  --step-0: 1.06rem;
  --step-1: 1.3rem;
  --step-2: 1.85rem;
  --step-3: clamp(2.1rem, 4.6vw, 3.2rem);
  --step-4: clamp(2.6rem, 6.4vw, 4.6rem);
  --wrap: 72rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1b1a17; --paper-2: #22211d; --card: #262520; --ink: #ece7dc; --muted: #aaa498; --line: #3a3832;
    --accent: #9cc2b8; --accent-ink: #1b1a17; --brass: #d0ad73; --shadow: rgba(0, 0, 0, 0.5); --plate-filter: invert(1) sepia(0.12); --plate-blend: screen;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1b1a17; --paper-2: #22211d; --card: #262520; --ink: #ece7dc; --muted: #aaa498; --line: #3a3832;
  --accent: #9cc2b8; --accent-ink: #1b1a17; --brass: #d0ad73; --shadow: rgba(0, 0, 0, 0.5); --plate-filter: invert(1) sepia(0.12); --plate-blend: screen;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--f-body); font-size: var(--step-0); line-height: 1.65; text-rendering: optimizeLegibility; }
img { max-width: 100%; display: block; }
figure { margin: 0; }
a { color: inherit; text-decoration-color: var(--brass); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 500; line-height: 1.08; text-wrap: balance; margin: 0; }
p { margin: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.eyebrow { font-family: var(--f-caps); font-size: 1.02rem; letter-spacing: 0.2em; color: var(--brass); }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--muted); max-width: 36rem; font-weight: 300; }

/* header */
.site-head { border-bottom: 1px solid var(--line); background: var(--paper); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.9rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); }
.brand svg { width: 42px; height: 42px; color: var(--brass); flex: none; }
.brand-name { font-family: var(--f-caps); font-size: 1.5rem; letter-spacing: 0.16em; }
.nav { display: flex; gap: 1.4rem; align-items: center; flex-wrap: wrap; font-size: 0.98rem; }
.nav a { text-decoration: none; }
.nav a[aria-current="page"] { text-decoration: underline; }
.lang { font-family: var(--f-mono); font-size: var(--step--1); letter-spacing: 0.08em; border: 1px solid var(--line); padding: 0.15rem 0.5rem; border-radius: 2px; }

/* ornament rule */
.rule { display: flex; align-items: center; gap: 0.9rem; color: var(--brass); }
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.rule svg { width: 14px; height: 14px; }

/* hero */
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; padding-block: clamp(2.5rem, 7vw, 5.5rem); }
.hero h1 { font-size: var(--step-4); margin-block: 0.7rem 1.1rem; letter-spacing: -0.005em; }
.hero h1 em { font-style: italic; color: var(--brass); }
.hero .actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.8rem; }
.btn { display: inline-block; font-family: var(--f-body); font-size: 1rem; padding: 0.7rem 1.2rem; border: 1px solid var(--accent); border-radius: 2px; text-decoration: none; transition: background-color .18s, color .18s; cursor: pointer; }
.btn-solid { background: var(--accent); color: var(--accent-ink); }
.btn-solid:hover { background: transparent; color: var(--accent); }
.btn-ghost { color: var(--accent); }
.btn-ghost:hover { background: var(--accent); color: var(--accent-ink); }


/* hero plate */
.hero .wrap { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
.plate-frame { position: relative; padding: clamp(1rem, 2.5vw, 1.6rem); border: 1px solid var(--line); outline: 1px solid var(--line); outline-offset: -8px; background: var(--card); }
.plate-stage { position: relative; aspect-ratio: 4 / 4.6; }
.plate-stage .plate-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transform: scale(1.03); transition: opacity 1.1s ease, transform 4.5s ease-out; }
.plate-stage .plate-img.on { opacity: 1; transform: scale(1); }
.plate-img.mono { filter: var(--plate-filter); mix-blend-mode: var(--plate-blend); }
.plate-frame figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-top: 0.9rem; padding-top: 0.7rem; border-top: 1px solid var(--line); transition: opacity .5s; }
.plate-frame figcaption.fade { opacity: 0; }
.pc-name { font-family: var(--f-display); font-style: italic; font-size: 1.35rem; }
.pc-from { font-family: var(--f-caps); letter-spacing: 0.12em; font-size: 0.95rem; color: var(--brass); }
.rise { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
.rise-2 { animation-delay: .15s; }
@keyframes rise { from { transform: translateY(18px); } to { transform: none; } }

/* shelf: same height for every cover */
.shelf-band { padding-block: clamp(2.4rem, 5vw, 3.6rem); }
.shelf-head { display: grid; gap: 0.5rem; margin-bottom: 1.8rem; }
.shelf-head h2 { font-size: var(--step-2); }
.shelf { --shelf-h: clamp(150px, 22vw, 250px); display: flex; gap: clamp(0.8rem, 2vw, 1.6rem); align-items: flex-end; overflow-x: auto; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.shelf-item { flex: none; display: block; }
.shelf .cover img { height: var(--shelf-h); width: auto; }
.shelf .cover.tall img { aspect-ratio: 5.5 / 8.5; object-fit: cover; }
.shelf-item:hover .cover { transform: perspective(700px) rotateY(-9deg) translateY(-6px); }
.shelf-item:nth-child(1) .cover { animation: rise .8s .05s both; } .shelf-item:nth-child(2) .cover { animation: rise .8s .12s both; }
.shelf-item:nth-child(3) .cover { animation: rise .8s .19s both; } .shelf-item:nth-child(4) .cover { animation: rise .8s .26s both; } .shelf-item:nth-child(5) .cover { animation: rise .8s .33s both; }

/* minis under each volume */
.minis { display: grid; grid-template-columns: repeat(3, minmax(0, 7rem)); gap: 0.9rem; margin-top: 1.4rem; }
.mini { display: grid; gap: 0.35rem; }
.mini-box { display: block; aspect-ratio: 1; background: var(--card); border: 1px solid var(--line); padding: 0.45rem; overflow: hidden; }
.mini-box img { width: 100%; height: 100%; object-fit: contain; transition: transform .3s; }
.mini-box img.color { object-fit: cover; }
.mini-box:has(img.color) { padding: 0; }
.mini:hover img { transform: scale(1.07) rotate(-1deg); }
.mini figcaption { font-family: var(--f-display); font-style: italic; font-size: 0.98rem; color: var(--muted); line-height: 1.2; }

/* marquee of plates */
.marquee { padding-block: clamp(2.6rem, 6vw, 4rem) clamp(2.6rem, 6vw, 4rem); overflow: hidden; }
.marquee .eyebrow { margin-bottom: 1.4rem; }
.mq-track { display: flex; width: max-content; animation: drift 80s linear infinite; }
.marquee:hover .mq-track { animation-play-state: paused; }
.mq-row { display: flex; gap: 2.4rem; padding-right: 2.4rem; }
.mq-item { display: grid; gap: 0.5rem; justify-items: center; }
.mq-item img { height: 150px; width: auto; max-width: none; transition: transform .4s; }
.mq-item:hover img { transform: translateY(-6px) scale(1.04); }
.mq-item figcaption { font-family: var(--f-display); font-style: italic; color: var(--muted); font-size: 1rem; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* covers (real images) */
.cover { position: relative; max-width: 100%; transition: transform .35s ease; transform-origin: left center; }
.vol .cover.tall img { aspect-ratio: 5.5 / 8.5; object-fit: cover; }
.vol .cover.wide img, .grid-books .cover img { aspect-ratio: 387 / 500; object-fit: cover; }
.cover img { width: 100%; height: auto; border: 1px solid var(--line); box-shadow: 0 1px 0 var(--line), 0 14px 26px -16px var(--shadow); background: var(--card); }
.cover.color img { border-color: transparent; }

/* sections */
.section { padding-block: clamp(3rem, 7vw, 5rem); }
.section-head { display: grid; gap: 0.7rem; margin-bottom: 2.4rem; max-width: 44rem; }
.section-head h2 { font-size: var(--step-3); }
.page-title { font-size: var(--step-4); }
.band { background: var(--paper-2); border-block: 1px solid var(--line); }

/* volume list */
.volumes { display: grid; gap: 2.8rem; }
.vol { display: grid; grid-template-columns: minmax(0, 11.5rem) minmax(0, 1fr); gap: clamp(1.2rem, 3.5vw, 2.8rem); align-items: start; padding-top: 2.8rem; border-top: 1px solid var(--line); }
.volumes > .vol:first-child { border-top: 0; padding-top: 0; }
.vol:hover .cover { transform: perspective(700px) rotateY(-8deg) translateY(-4px); }
.vol-no { font-family: var(--f-caps); font-size: 1rem; letter-spacing: 0.2em; color: var(--brass); }
.vol h3 { font-size: var(--step-2); margin-top: 0.3rem; }
.vol-sub { font-family: var(--f-display); font-style: italic; color: var(--muted); margin-top: 0.35rem; font-size: 1.2rem; line-height: 1.35; }
.vol-desc { margin-top: 0.9rem; max-width: 40rem; }
.buy { list-style: none; padding: 0; margin: 1.15rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.buy a { display: inline-flex; align-items: baseline; gap: 0.45rem; font-size: 0.95rem; padding: 0.42rem 0.85rem; border: 1px solid var(--line); border-radius: 2px; text-decoration: none; background: var(--card); }
.buy a:hover { border-color: var(--accent); color: var(--accent); }
.buy a span { font-family: var(--f-mono); font-size: 0.72rem; color: var(--muted); letter-spacing: 0.04em; }
.also { margin-top: 0.9rem; font-size: 0.95rem; color: var(--muted); }

/* imprints on home */
.imprints { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.8rem, 5vw, 4rem); align-items: start; }
.imprint { display: grid; gap: 0.8rem; align-content: start; }
.imprint h3 { font-size: var(--step-2); }
.imprint .who { font-family: var(--f-caps); font-size: 1rem; letter-spacing: 0.2em; color: var(--brass); }
.imprint-covers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; align-items: end; margin-bottom: 0.6rem; }
.index { list-style: none; margin: 0 0 0.6rem; display: grid; gap: 0.6rem; border-block: 1px solid var(--line); padding: 1.1rem 0; }
.index li { display: grid; grid-template-columns: 2.4rem auto minmax(1rem, 1fr) auto; align-items: baseline; gap: 0.6rem; }
.ix-num { font-family: var(--f-display); color: var(--brass); font-size: 1.3rem; }
.index a { font-family: var(--f-display); font-size: 1.3rem; text-decoration: none; min-width: 0; }
.ix-dots { border-bottom: 1px dotted var(--line); transform: translateY(-0.3em); }
.ix-fmt { font-family: var(--f-mono); font-size: 0.72rem; color: var(--muted); letter-spacing: 0.04em; white-space: nowrap; }

/* coloring grid */
.grid-books { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr)); gap: 2.4rem 1.4rem; }
.book { display: grid; gap: 0.75rem; align-content: start; }
.book h3 { font-size: 1.5rem; }
.book p { font-size: 0.95rem; color: var(--muted); }
.lang-group + .lang-group { margin-top: 3.4rem; }
.lang-group h3.group { font-family: var(--f-caps); font-weight: 500; font-size: 1.05rem; letter-spacing: 0.2em; color: var(--brass); margin-bottom: 1.4rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--line); }

/* newsletter */
.letter .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.letter h2 { font-size: var(--step-3); margin-top: 0.6rem; }
.letter p.lede { margin-top: 0.9rem; }
.signup { display: grid; gap: 0.9rem; padding: clamp(1.2rem, 3vw, 2rem); border: 1px solid var(--line); background: var(--card); }
.signup label { font-size: 0.95rem; }
.field { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.field input[type="email"] { flex: 1 1 14rem; min-width: 0; font: inherit; font-size: 1rem; padding: 0.65rem 0.8rem; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 2px; }
.consent { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.88rem; color: var(--muted); line-height: 1.45; }
.consent input { margin-top: 0.25rem; accent-color: var(--accent); }
.form-msg { font-size: 0.92rem; min-height: 1.4em; color: var(--accent); }

/* about */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.about p + p { margin-top: 1rem; }
.principles { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.1rem; }
.principles li { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: 0.6rem; }
.principles svg { width: 14px; height: 14px; color: var(--brass); margin-top: 0.45rem; }

/* prose page */
.prose { max-width: 42rem; }
.prose h1 { font-size: var(--step-3); margin-bottom: 1.4rem; }
.prose h2 { font-size: var(--step-1); margin: 2rem 0 0.6rem; font-family: var(--f-body); font-weight: 600; }
.prose p + p { margin-top: 0.8rem; }
.todo { background: color-mix(in srgb, var(--brass) 20%, transparent); padding: 0 0.25rem; }

/* footer */
.site-foot { border-top: 1px solid var(--line); }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: 1.8rem; font-size: 0.9rem; color: var(--muted); }
.site-foot nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }

@media (max-width: 760px) {
  .mq-item img { height: 110px; }
  .minis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero .wrap, .letter .wrap, .about, .imprints { grid-template-columns: minmax(0, 1fr); }
  .vol { grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr); }
  .shelf .cover:nth-child(even) { transform: translateY(-8px); }
}
@media (max-width: 440px) {
  .vol { grid-template-columns: minmax(0, 1fr); }
  .vol .cover { max-width: 9.5rem; }
  .nav { gap: 0.9rem; font-size: 0.92rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .mq-track { width: auto; overflow-x: auto; }
  .mq-row[aria-hidden] { display: none; }
  .vol:hover .cover { transform: none; }
}
