/* Edgeistry — the art of the edge */

@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-latin-full-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-latin-full-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --bg: #f7f4ee;
  --bg-2: #efe9df;
  --ink: #1d1a16;
  --ink-2: #4a443c;
  --muted: #7a7166;
  --line: #e3dbcd;
  --card: #fffdf9;
  --plate: #ffffff;
  --header: rgba(247, 244, 238, .78);
  --shadow: 0 1px 2px rgba(40, 30, 20, .06), 0 8px 24px -12px rgba(40, 30, 20, .18);
  --edge: linear-gradient(90deg, #e0457b, #f08a3c 30%, #e9c46a 52%, #2a9d8f 76%, #5b5bd6);
  --edge-v: linear-gradient(180deg, #e0457b, #f08a3c 30%, #e9c46a 52%, #2a9d8f 76%, #5b5bd6);
  --accent: #c2410c;
  --focus: #5b5bd6;
  --radius: 14px;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1320px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131115; --bg-2: #1b181d; --ink: #f3eee6; --ink-2: #cfc7bb; --muted: #988f84; --line: #2e2a31;
    --card: #1c191e; --plate: #f4f1ec; --header: rgba(19, 17, 21, .74); --accent: #fb923c; --focus: #a5a5ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 28px -14px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131115; --bg-2: #1b181d; --ink: #f3eee6; --ink-2: #cfc7bb; --muted: #988f84; --line: #2e2a31;
  --card: #1c191e; --plate: #f4f1ec; --header: rgba(19, 17, 21, .74); --accent: #fb923c; --focus: #a5a5ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 28px -14px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 140px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--sans); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: .18em; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
button, input, select { font: inherit; color: inherit; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden, [hidden] { display: none !important; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }

/* ------------------------------------------------------------------ header */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--header); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.site-header::after { content: ""; position: absolute; inset: auto 0 -1px; height: 2px; background: var(--edge); opacity: .85; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 1.45rem/1 var(--serif); letter-spacing: -.02em; font-variation-settings: "opsz" 72, "SOFT" 50; }
.logo em { font-style: italic; font-weight: 400; color: var(--accent); }
.logo-mark { width: 30px; height: 30px; color: var(--ink); }
.logo-small { font-size: 1.6rem; }
.header-nav { display: flex; gap: 6px; align-items: center; font-size: .92rem; }
.header-nav a { text-decoration: none; padding: 8px 12px; border-radius: 999px; color: var(--ink-2); }
.header-nav a:hover { background: var(--bg-2); color: var(--ink); }
@media (max-width: 560px) { .header-nav a { padding-inline: 10px; } .logo { font-size: 1.3rem; } }

/* ------------------------------------------------------------------ hero */
.hero { position: relative; padding: clamp(48px, 9vw, 112px) 0 0; overflow: hidden; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: -20% -10% auto; height: 120%; z-index: -1;
  background: radial-gradient(40% 50% at 15% 20%, color-mix(in srgb, #e0457b 16%, transparent), transparent 70%),
              radial-gradient(35% 45% at 85% 10%, color-mix(in srgb, #2a9d8f 16%, transparent), transparent 70%),
              radial-gradient(30% 40% at 60% 70%, color-mix(in srgb, #e9c46a 18%, transparent), transparent 70%); filter: blur(10px); }
.hero-inner { max-width: 980px; text-align: center; }
.eyebrow { display: inline-block; margin: 0 0 18px; font: 600 .78rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.eyebrow .dot { display: inline-block; vertical-align: .05em; margin-right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--edge); box-shadow: 0 0 0 4px color-mix(in srgb, #f08a3c 18%, transparent); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, #f08a3c 0%, transparent); } }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -.02em; line-height: 1.05; margin: 0; }
.hero h1 { font-size: clamp(2.7rem, 8.2vw, 6.4rem); font-weight: 420; font-variation-settings: "opsz" 144, "SOFT" 30; letter-spacing: -.035em; }
.hero h1 em { font-style: italic; font-weight: 380; background: var(--edge); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; background-size: 200% 100%; animation: sheen 9s ease-in-out infinite alternate; }
@keyframes sheen { to { background-position: 100% 0; } }
.hero .h1 { margin: 0; font: 420 clamp(2.7rem, 8.2vw, 6.4rem)/1.05 var(--serif); font-variation-settings: "opsz" 144, "SOFT" 30; letter-spacing: -.035em; }
.hero .h1 em { font-style: italic; font-weight: 380; background: var(--edge); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; }
.hero-landing { padding-bottom: 8px; }
.hero-landing h1 { font-size: clamp(2.3rem, 6vw, 4.6rem); }
.crumbs-center { justify-content: center; margin-bottom: 18px; }
.lede { max-width: 640px; margin: 22px auto 34px; font-size: clamp(1.02rem, 1.6vw, 1.18rem); color: var(--ink-2); text-wrap: pretty; }

.search { position: relative; display: flex; align-items: center; max-width: 680px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow), 0 0 0 0 transparent; transition: box-shadow .25s, border-color .25s; }
.search:focus-within { border-color: transparent; box-shadow: var(--shadow), 0 0 0 2px var(--bg), 0 0 0 4px #f08a3c80; }
.search-icon { position: absolute; left: 20px; width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; height: 60px; padding: 0 12px 0 54px; border: 0; background: transparent; font-size: 1.05rem; outline: none; }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { filter: grayscale(1); }
.search-kbd { font: 500 .78rem var(--sans); color: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; margin-right: 8px; }
.search-go { height: 46px; margin-right: 7px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; cursor: pointer; transition: transform .15s; }
.search-go:hover { transform: translateY(-1px); }
@media (hover: none), (max-width: 640px) { .search-kbd { display: none; } }
@media (max-width: 480px) { .search-go { display: none; } .search input { height: 54px; } }

/* the spectrum: one bar per book, a shelf of fore-edges */
.spectrum { position: relative; display: flex; align-items: flex-end; gap: 2px; height: clamp(110px, 16vw, 190px); margin: clamp(48px, 7vw, 84px) auto 0; padding: 0 var(--gutter); max-width: 1600px; }
.spectrum .bar { flex: 1 1 0; min-width: 2px; height: var(--h, 60%); border-radius: 3px 3px 0 0; background: var(--g); transform-origin: bottom; transition: transform .35s cubic-bezier(.2, .8, .2, 1), filter .2s; cursor: pointer; animation: rise .9s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0s); }
.spectrum .bar:hover, .spectrum .bar.near { transform: scaleY(1.18); filter: saturate(1.25) brightness(1.06); }
.spectrum .bar:hover { transform: scaleY(1.32); }
@keyframes rise { from { transform: scaleY(0); } }
.spectrum::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); }
.spectrum-caption { margin: 14px auto 0; text-align: center; font-size: .82rem; color: var(--muted); }
.peek { position: fixed; z-index: 60; pointer-events: none; width: 150px; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .35); opacity: 0; transform: translate(-50%, -100%) translateY(-10px) scale(.96); transition: opacity .15s, transform .15s; }
.peek.on { opacity: 1; transform: translate(-50%, -100%) translateY(-16px) scale(1); }
.peek img { width: 100%; aspect-ratio: 3/4; object-fit: contain; background: var(--plate); border-radius: 6px; }
.peek p { margin: 6px 2px 0; font: 500 .78rem/1.3 var(--sans); }

/* ------------------------------------------------------------------ toolbar */
.catalog { padding-top: clamp(40px, 6vw, 72px); }
.toolbar { position: sticky; top: 64px; z-index: 30; background: var(--header); backdrop-filter: saturate(1.5) blur(14px); -webkit-backdrop-filter: saturate(1.5) blur(14px); border-block: 1px solid color-mix(in srgb, var(--line) 75%, transparent); }
.toolbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px 24px; padding-block: 12px; flex-wrap: wrap; }
.swatches { display: flex; gap: 6px; margin: 0; padding: 0; border: 0; flex-wrap: wrap; }
.swatch { position: relative; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--sw, var(--bg-2)); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); transition: transform .15s; }
.swatch:hover { transform: scale(1.12); }
.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatch:has(input:checked) { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
.swatch:has(input:focus-visible) { outline: 2.5px solid var(--focus); outline-offset: 4px; }
.swatch[data-count="0"] { opacity: .28; }
.swatch-all { width: auto; padding: 0 11px; border-radius: 999px; font: 600 .78rem var(--sans); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.selects { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.select select { appearance: none; height: 38px; padding: 0 34px 0 14px; max-width: 220px; border: 1px solid var(--line); border-radius: 999px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a7166' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 14px; font-size: .88rem; cursor: pointer; text-overflow: ellipsis; }
.select select:hover { border-color: var(--muted); }
.toggle { display: inline-flex; align-items: center; gap: 9px; font-size: .88rem; cursor: pointer; user-select: none; white-space: nowrap; }
.toggle input { position: absolute; opacity: 0; }
.toggle-track { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--line); transition: background .2s; }
.toggle-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); }
.toggle input:checked + .toggle-track { background: var(--edge); }
.toggle input:checked + .toggle-track::after { transform: translateX(16px); }
.toggle input:focus-visible + .toggle-track { outline: 2.5px solid var(--focus); outline-offset: 3px; }
.toggle-count { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .toolbar-inner { gap: 10px; padding-block: 10px; }
  .swatches { flex-wrap: nowrap; overflow-x: auto; width: calc(100% + 2 * var(--gutter)); margin-inline: calc(-1 * var(--gutter)); padding: 4px var(--gutter); scrollbar-width: none; }
  .swatches::-webkit-scrollbar { display: none; }
  .swatch { flex: none; }
  .selects { flex-wrap: nowrap; overflow-x: auto; width: calc(100% + 2 * var(--gutter)); margin-inline: calc(-1 * var(--gutter)); padding: 2px var(--gutter); scrollbar-width: none; }
  .selects::-webkit-scrollbar { display: none; }
  .select select { max-width: 170px; }
}

/* ------------------------------------------------------------------ grid */
.results-head { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 0 22px; }
.count { margin: 0; color: var(--muted); font-size: .92rem; }
.count strong { color: var(--ink); font: 500 1.35rem var(--serif); margin-right: 2px; font-variant-numeric: tabular-nums; }
.clear { font-size: .88rem; color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: clamp(28px, 3vw, 40px) clamp(18px, 2.2vw, 30px); }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 14px; } }
.grid.loading { opacity: .5; transition: opacity .2s .1s; }
.card { --c: #888; animation: cardIn .6s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 35ms); }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px); } }
.card-link { display: block; text-decoration: none; outline-offset: 6px; }
.plate { position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius); background: var(--plate) var(--lqip, none) center / cover no-repeat; overflow: hidden; box-shadow: var(--shadow); transition: transform .45s cubic-bezier(.2, .8, .2, 1), box-shadow .45s; }
.plate::before { content: ""; position: absolute; inset: 0; background: var(--plate); opacity: .7; transition: opacity .6s; }
.plate:has(img.loaded)::before { opacity: 1; }
.plate::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); pointer-events: none; }
.plate img { position: relative; width: 100%; height: 100%; object-fit: contain; padding: 8%; opacity: 0; transform: scale(.97); transition: opacity .5s, transform .6s cubic-bezier(.2, .8, .2, 1); }
.plate img.loaded { opacity: 1; transform: none; }
.card-link:hover .plate, .card-link:focus-visible .plate { transform: translateY(-8px); box-shadow: 0 2px 4px rgba(0, 0, 0, .06), 0 26px 44px -18px color-mix(in srgb, var(--c) 70%, transparent); }
.card-link:hover .plate img { transform: scale(1.045); }
.edge { height: 4px; margin: 14px 18% 0 0; border-radius: 4px; background: var(--pg, var(--edge)); transform-origin: left; transition: transform .45s cubic-bezier(.2, .8, .2, 1), margin .45s; }
.card-link:hover .edge { margin-right: 0; }
.card-title { margin: 12px 0 3px; font: 500 1.08rem/1.22 var(--serif); letter-spacing: -.01em; font-variation-settings: "opsz" 24; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-wrap: balance; }
.card-author { margin: 0; font-size: .88rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { margin: 2px 0 0; font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { position: absolute; top: 10px; left: 10px; z-index: 1; padding: 4px 9px 4px 8px; border-radius: 999px; font: 650 .66rem/1.2 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: #fff; background: linear-gradient(135deg, #e0457b, #f08a3c); box-shadow: 0 4px 12px -4px #e0457b99; }
.badge-lg { position: static; display: inline-block; margin-bottom: 14px; font-size: .7rem; padding: 6px 12px; }

.empty { text-align: center; padding: 64px 16px; color: var(--ink-2); }
.empty-title { font: 500 1.6rem var(--serif); color: var(--ink); margin: 0 0 6px; }
.pager { display: flex; justify-content: center; gap: 12px; padding: 48px 0 24px; min-height: 40px; }
.js .pager .button:not(.more-btn) { display: none; }
.more-btn { height: 50px; padding: 0 28px; font-size: .95rem; }
.sentinel { height: 1px; }
.loader { display: flex; justify-content: center; gap: 6px; padding: 30px 0; }
.loader i { width: 6px; height: 26px; border-radius: 3px; background: var(--edge-v); animation: bounce 1s ease-in-out infinite; }
.loader i:nth-child(2) { animation-delay: .1s; } .loader i:nth-child(3) { animation-delay: .2s; } .loader i:nth-child(4) { animation-delay: .3s; }
@keyframes bounce { 50% { transform: scaleY(.4); opacity: .5; } }

/* ------------------------------------------------------------------ buttons & chips */
.button { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 600 .9rem var(--sans); text-decoration: none; cursor: pointer; transition: transform .15s, border-color .15s, background .15s; white-space: nowrap; }
.button:hover { transform: translateY(-1px); border-color: var(--muted); }
.button-dark { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.button-dark:hover { border-color: var(--ink); }
.button-edge { position: relative; height: 52px; padding: 0 26px; border: 0; background: var(--ink); color: var(--bg); font-size: 1rem; }
.button-edge::before { content: ""; position: absolute; inset: -2px; z-index: -1; border-radius: inherit; background: var(--edge); filter: blur(10px); opacity: .55; transition: opacity .2s; }
.button-edge:hover::before { opacity: .9; }
.link-btn { padding: 0; border: 0; background: none; color: var(--accent); font: 600 .88rem var(--sans); cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); font-size: .8rem; text-decoration: none; transition: background .15s, color .15s; }
.chip:hover { background: var(--ink); color: var(--bg); }
.chip-strong { background: var(--ink); color: var(--bg); }
.chip-color { height: 26px; font-size: .75rem; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background .15s, transform .15s; }
.icon-btn:hover { background: rgba(255, 255, 255, .26); transform: scale(1.06); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------ details (viewer + book page) */
.detail { --c: #888; }
.detail-title { font-size: clamp(1.9rem, 3.4vw, 2.7rem); font-weight: 450; font-variation-settings: "opsz" 96, "SOFT" 20; text-wrap: balance; }
.detail-subtitle { margin: 8px 0 0; font: italic 400 1.2rem/1.35 var(--serif); color: var(--ink-2); }
.detail-byline { margin: 14px 0 0; font-size: 1.02rem; font-weight: 500; }
.detail-contrib { margin: 4px 0 0; font-size: .86rem; color: var(--muted); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 26px; }
.affiliate-note { margin: -14px 0 24px; font-size: .74rem; color: var(--muted); }
.edge-note { position: relative; margin: 0 0 24px; padding: 16px 18px 16px 22px; border-radius: 12px; background: var(--bg-2); overflow: hidden; }
.edge-note::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--edge-v); }
.edge-note-label { margin: 0 0 6px !important; font: 650 .7rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.edge-note p { margin: 0; font: italic 400 1.05rem/1.45 var(--serif); }
.detail-palette { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; }
.detail-palette span { width: 26px; height: 26px; border-radius: 8px; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.detail-palette span:nth-of-type(1) { width: 52px; }
.detail-palette .chip:first-of-type { margin-left: 8px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 0 0 22px; border-top: 1px solid var(--line); }
.facts div { padding: 11px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.facts dt { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-size: .95rem; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.summary { position: relative; color: var(--ink-2); font-size: .98rem; line-height: 1.65; }
.summary p { margin: 0; }
.summary.clamped { max-height: 9.9em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.summary-more { margin-top: 8px; }

/* viewer (lightbox) */
.viewer { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: var(--ink); display: grid; grid-template-columns: minmax(0, 1fr) min(460px, 40vw); overflow: hidden; }
.viewer:not([open]) { display: none; }
.viewer::backdrop { background: rgba(10, 8, 12, .6); }
.viewer-backdrop { position: absolute; inset: 0; z-index: -1; background: radial-gradient(70% 80% at 35% 50%, color-mix(in srgb, var(--c, #444) 55%, #0b0a0d), #0b0a0d); transition: background .5s; }
.viewer[open] { animation: viewerIn .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes viewerIn { from { opacity: 0; } }
.viewer-stage { --pad: clamp(20px, 5vh, 56px); position: relative; display: grid; place-items: center; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; padding: var(--pad) calc(var(--pad) + 48px); cursor: zoom-in; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.viewer-stage img { max-width: 100%; max-height: calc(100dvh - 2 * var(--pad)); width: auto; height: auto; object-fit: contain; border-radius: 6px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8); transition: transform .45s cubic-bezier(.2, .8, .2, 1), opacity .3s; transform-origin: var(--ox, 50%) var(--oy, 50%); will-change: transform; }
.viewer-stage.zoomed { cursor: zoom-out; touch-action: none; }
.viewer-stage.zoomed img { transform: scale(var(--z, 2.4)); transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.viewer-stage.panning img { transition: none; }
.viewer-stage.swapping img { opacity: 0; transform: translateX(var(--sx, 0)) scale(.97); }
.viewer-loading { position: absolute; width: 42px; height: 42px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .2); border-top-color: #fff; animation: spin .8s linear infinite; opacity: 0; transition: opacity .2s; pointer-events: none; }
.viewer-stage.busy .viewer-loading { opacity: 1; }
@keyframes spin { to { transform: rotate(1turn); } }
.viewer-hint { position: absolute; bottom: 16px; left: 0; right: 0; margin: 0; text-align: center; font-size: .78rem; color: rgba(255, 255, 255, .6); pointer-events: none; transition: opacity .3s; }
.viewer-stage.zoomed .viewer-hint { opacity: 0; }
.viewer-info { position: relative; overflow-y: auto; overscroll-behavior: contain; background: var(--bg); padding: 64px clamp(22px, 3vw, 40px) 40px; box-shadow: -30px 0 60px -30px rgba(0, 0, 0, .5); animation: slideIn .45s cubic-bezier(.2, .8, .2, 1); outline: none; }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }
.viewer-info .detail { animation: fadeUp .4s cubic-bezier(.2, .8, .2, 1); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }
.viewer-close { position: absolute; top: 14px; right: 14px; z-index: 3; background: var(--bg-2); color: var(--ink); }
.viewer-close:hover { background: var(--line); }
.viewer-prev, .viewer-next { position: absolute; top: 50%; z-index: 2; translate: 0 -50%; }
.viewer-prev { left: 18px; }
.viewer-next { right: calc(min(460px, 40vw) + 18px); }
@media (max-width: 900px) {
  .viewer { grid-template-columns: 1fr; grid-template-rows: 56vh auto; overflow-y: auto; overscroll-behavior: contain; }
  .viewer-stage { --pad: 20px; padding: 56px 16px 20px; position: sticky; top: 0; height: 56vh; }
  .viewer-stage img { max-height: calc(56vh - 76px); }
  .viewer-info { overflow: visible; min-height: 44vh; border-radius: 22px 22px 0 0; padding: 30px var(--gutter) calc(40px + env(safe-area-inset-bottom)); box-shadow: 0 -20px 40px -20px rgba(0, 0, 0, .5); animation: sheetIn .45s cubic-bezier(.2, .8, .2, 1); z-index: 1; }
  @keyframes sheetIn { from { transform: translateY(60px); opacity: 0; } }
  .viewer-info::before { content: ""; position: absolute; top: 10px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line); }
  .viewer-close { position: fixed; background: rgba(255, 255, 255, .16); color: #fff; }
  .viewer-prev, .viewer-next { position: fixed; top: 28vh; width: 40px; height: 40px; }
  .viewer-prev { left: 8px; } .viewer-next { right: 8px; }
  .viewer-hint { display: none; }
  .facts { grid-template-columns: 1fr 1fr; }
}

/* book page */
.book-page { padding: 28px 0 40px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .84rem; color: var(--muted); margin-bottom: 28px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.book-figure { position: sticky; top: 92px; margin: 0; padding: clamp(18px, 3vw, 40px); border-radius: 24px; background: radial-gradient(80% 80% at 50% 40%, color-mix(in srgb, var(--c, #888) 22%, var(--plate)), var(--plate)); box-shadow: var(--shadow); }
.book-figure img { width: 100%; height: auto; max-height: 78vh; object-fit: contain; }
.zoomable { display: block; cursor: zoom-in; }
@media (max-width: 860px) { .book-layout { grid-template-columns: 1fr; } .book-figure { position: static; } }
.related { margin-top: clamp(56px, 8vw, 96px); }
.related h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 24px; }
.notfound { padding: 100px var(--gutter); text-align: center; }
.notfound h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin-bottom: 14px; }

/* ------------------------------------------------------------------ submit band & footer */
.submit-band { margin-top: clamp(64px, 9vw, 120px); padding: clamp(40px, 6vw, 72px) 0; background: var(--ink); color: var(--bg); position: relative; overflow: hidden; }
.submit-band::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: var(--edge); }
.submit-band::after { content: ""; position: absolute; right: -10%; top: -50%; width: 60%; height: 200%; background: radial-gradient(closest-side, color-mix(in srgb, #f08a3c 22%, transparent), transparent); pointer-events: none; }
.submit-inner { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 28px 56px; flex-wrap: wrap; }
.submit-inner > div { max-width: 720px; }
.submit-band .eyebrow { color: color-mix(in srgb, var(--bg) 60%, transparent); }
.submit-band h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); font-weight: 420; margin-bottom: 14px; }
.submit-band p { color: color-mix(in srgb, var(--bg) 78%, transparent); margin: 0; }
.submit-band .button-edge { background: var(--bg); color: var(--ink); }
.site-footer { padding: 56px 0 calc(40px + env(safe-area-inset-bottom)); background: var(--bg-2); font-size: .9rem; color: var(--ink-2); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 36px; }
.footer-links { list-style: none; margin: 0 0 12px; padding: 0; columns: 2; column-gap: 16px; }
.footer-links li { margin: 0 0 6px; break-inside: avoid; }
.footer-links a, .site-footer a { text-decoration: none; }
.footer-links a:hover, .site-footer p a:hover { text-decoration: underline; }
.footer-colors { display: flex; flex-wrap: wrap; gap: 6px; }
.footer-colors a { width: 20px; height: 20px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14); transition: transform .15s; }
.footer-colors a:hover { transform: scale(1.18); }
@media (max-width: 1000px) and (min-width: 761px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.site-footer h3 { font: 650 .74rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.site-footer p { margin: 0 0 8px; }
.footer-about p { max-width: 36ch; margin-top: 12px; }
.fine { font-size: .8rem; color: var(--muted); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 26px; } }

/* about page */
.about-page { padding-bottom: clamp(48px, 7vw, 96px); }
.about-hero { max-width: 900px; padding-top: clamp(48px, 8vw, 104px); text-align: center; }
.about-hero h1 { font-size: clamp(2.6rem, 7vw, 5.2rem); font-weight: 420; font-variation-settings: "opsz" 144, "SOFT" 30; letter-spacing: -.035em; }
.about-hero h1 em { font-style: italic; font-weight: 380; background: var(--edge); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; }
.about-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: clamp(32px, 5vw, 56px); }
.about-card { position: relative; padding: 28px 26px 26px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.about-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--edge); }
.about-num { margin: 0 0 10px; font: 450 2.6rem/1 var(--serif); letter-spacing: -.03em; font-variation-settings: "opsz" 144; }
.about-card h2 { font-size: 1.25rem; margin-bottom: 8px; }
.about-card p:last-child { margin: 0; color: var(--ink-2); }
.about-add { margin-top: clamp(40px, 6vw, 72px); }
.about-add-inner { position: relative; padding: clamp(28px, 5vw, 56px); border-radius: 26px; background: var(--ink); color: var(--bg); overflow: hidden; }
.about-add-inner::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: var(--edge); }
.about-add .eyebrow { color: color-mix(in srgb, var(--bg) 60%, transparent); }
.about-add h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); font-weight: 420; margin-bottom: 22px; }
.about-add .button-edge { background: var(--bg); color: var(--ink); margin-top: 8px; }
.steps { margin: 0 0 28px; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 16px; max-width: 760px; }
.steps li { position: relative; padding-left: 48px; color: color-mix(in srgb, var(--bg) 80%, transparent); counter-increment: s; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--bg); color: var(--ink); box-shadow: 0 0 0 2px #f08a3c; font: 700 .9rem var(--sans); }
.steps strong { color: var(--bg); }
.about-credit { margin-top: 28px; text-align: center; color: var(--muted); font-size: .92rem; }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 100; padding: 10px 18px; border-radius: 999px; background: var(--ink); color: var(--bg); font: 600 .88rem var(--sans); box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .5); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s cubic-bezier(.2, .8, .2, 1); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
