/*
 * Shared structure for both sites. Copied into ledger/css and uncanny/css by `node tools/gen.mjs`.
 * Edit tools/site.css, not the copies. Colours, fonts and decoration live in each site's theme.css.
 */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.65;
}
img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--bg); padding: 0.6rem 1rem; z-index: 50; }
.skip:focus { left: 8px; top: 8px; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .wrap { padding: 0 28px; } }

/* header */
.site-head { border-bottom: 1px solid var(--rule); background: var(--bg); position: sticky; top: 0; z-index: 20; }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; padding-top: 0.7rem; padding-bottom: 0.7rem; }
.brand { font-family: var(--font-head); font-size: 1.2rem; text-decoration: none; color: var(--ink); letter-spacing: var(--brand-track); text-transform: var(--brand-case); font-weight: 600; margin-right: auto; }
.brand:hover { color: var(--accent); }
.nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: center; }
.nav a { color: var(--muted); text-decoration: none; padding: 0.35rem 0.1rem; border-bottom: 2px solid transparent; font-size: 0.98rem; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current=page] { color: var(--ink); border-bottom-color: var(--accent); }
.theme-btn { font: inherit; font-size: 0.85rem; color: var(--muted); background: none; border: 1px solid var(--rule); border-radius: 999px; padding: 0.25rem 0.8rem; cursor: pointer; }
.theme-btn:hover { color: var(--ink); border-color: var(--muted); }

/* type */
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; font-weight: 600; letter-spacing: var(--head-track); }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); margin: 0 0 0.5em; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); margin: 0 0 0.6em; }
h3 { font-size: 1.2rem; margin: 0 0 0.4em; }
.kicker { font-family: var(--font-head); text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.78rem; color: var(--accent); margin: 0 0 1rem; }
.lead { font-size: 1.25rem; color: var(--ink); max-width: 36em; }
.muted { color: var(--muted); }
section { padding: 3rem 0; }
section + section { border-top: 1px solid var(--rule); }

/* buttons */
.btn { display: inline-block; font: inherit; font-weight: 600; font-size: 1rem; padding: 0.7rem 1.3rem; border-radius: var(--radius); background: var(--accent); color: var(--on-accent); border: 2px solid var(--accent); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-quiet { background: none; border: 1px solid var(--rule); color: var(--muted); font-weight: 400; padding: 0.4rem 0.9rem; font-size: 0.92rem; margin-top: 0.75rem; }
.btn-quiet:hover { background: none; color: var(--ink); border-color: var(--muted); }
.btn[aria-disabled=true] { background: transparent; color: var(--muted); border: 1px dashed var(--rule); cursor: default; font-weight: 400; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* hero */
.hero { padding: 3.5rem 0 3rem; }
.hero .wrap { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 860px) { .hero .wrap { grid-template-columns: 1.3fr 1fr; } }
.release-banner { display: inline-block; margin-top: 1.5rem; padding: 0.45rem 0.9rem; border: 1px solid var(--rule); border-radius: 999px; color: var(--muted); font-size: 0.92rem; }
.ornament { width: 100%; max-width: 380px; justify-self: center; color: var(--accent); }

/* book shelf */
.shelf { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1.75rem 1.25rem; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
.shelf li { display: flex; flex-direction: column; gap: 0.6rem; }
.plate { aspect-ratio: 2 / 3; width: 100%; border: 1px solid var(--plate-edge); background: var(--plate-bg); border-radius: var(--radius); display: flex; flex-direction: column; justify-content: space-between; padding: 1rem 0.9rem; position: relative; overflow: hidden; color: var(--plate-ink); box-shadow: var(--plate-shadow); }
.plate img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.plate-n { font-family: var(--font-head); font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.8; }
.plate-t { font-family: var(--font-head); font-size: clamp(1.15rem, 2.2vw, 1.45rem); line-height: 1.12; font-weight: 600; text-align: center; margin: auto 0; }
.plate-a { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; text-align: center; opacity: 0.85; }
.shelf h3 { font-size: 1.05rem; margin: 0; }
.shelf a, .shelf a:hover { text-decoration: none; }
.shelf h3 a { color: var(--ink); }
.shelf h3 a:hover { color: var(--accent); }
.rel { font-size: 0.85rem; color: var(--muted); }
.rel.is-out { color: var(--accent2); font-weight: 600; }

/* release list */
.releases { list-style: none; margin: 1.5rem 0 0; padding: 0; border-top: 1px solid var(--rule); }
.releases li { display: grid; grid-template-columns: 2.2rem 1fr; gap: 0.2rem 1rem; padding: 0.9rem 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.releases .n { font-family: var(--font-head); color: var(--accent); font-size: 1.2rem; }
.releases .t { font-weight: 600; }
.releases .rel { grid-column: 2; }

/* books page */
.book-full { display: grid; gap: 1.75rem; padding: 2.5rem 0; border-top: 1px solid var(--rule); }
.book-full:first-of-type { border-top: 0; }
@media (min-width: 760px) { .book-full { grid-template-columns: 200px 1fr; gap: 2.5rem; } }
.book-full .plate { max-width: 220px; }
.book-full .tag-line { font-family: var(--font-head); font-size: 1.15rem; color: var(--accent); margin: 0 0 1rem; }
.first-line { margin: 1.5rem 0 0; padding: 0.2rem 0 0.2rem 1.1rem; border-left: 3px solid var(--accent); font-style: italic; color: var(--ink); }
.first-line cite { display: block; font-style: normal; font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.3rem; }
.note-draft { font-size: 0.85rem; color: var(--muted); border: 1px dashed var(--rule); padding: 0.4rem 0.7rem; display: inline-block; margin-top: 0.8rem; }

/* atlas */
.gate { border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem 1.1rem 0.9rem; margin: 0 0 1.5rem; background: var(--card); }
.gate legend { font-family: var(--font-head); font-weight: 600; padding: 0 0.4rem; }
.gate-opts { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.gate-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.gate-opt label { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.8rem; border: 1px solid var(--rule); border-radius: 999px; cursor: pointer; font-size: 0.95rem; background: var(--bg); }
.gate-opt label:hover { border-color: var(--muted); }
.gate-opt input:checked + label { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.gate-opt input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.gate-opt.is-off label { opacity: 0.5; cursor: not-allowed; border-style: dashed; }
.gate-n { font-family: var(--font-head); font-weight: 700; }
.gate-note { margin: 0.8rem 0 0; font-size: 0.92rem; color: var(--muted); }

.atlas-bar { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; justify-content: space-between; align-items: end; border-bottom: 1px solid var(--rule); margin-bottom: 1.25rem; }
.tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.tabs button { font: inherit; background: none; border: 0; border-bottom: 3px solid transparent; padding: 0.6rem 0.9rem; color: var(--muted); cursor: pointer; }
.tabs button:hover { color: var(--ink); }
.tabs button.is-on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.search input { font: inherit; padding: 0.45rem 0.8rem; margin-bottom: 0.5rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--card); color: var(--ink); min-width: 12rem; }
.no-search .search { display: none; }

.atlas-layout { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .atlas-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } .detail { position: sticky; top: 4.5rem; } }
.mapscroll { overflow: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--map-bg); }
.mapbox { min-width: 680px; }
.map { display: block; width: 100%; height: auto; }
.map-note { font-size: 0.85rem; color: var(--muted); margin: 0.6rem 0 0; }
.pin { cursor: pointer; }
.pin-ring { fill: none; stroke: var(--pin); stroke-width: 2; opacity: 0.45; }
.pin-dot { fill: var(--pin); stroke: var(--map-bg); stroke-width: 2; }
.pin text { font-family: var(--font-head); font-size: 24px; fill: var(--ink); paint-order: stroke; stroke: var(--map-bg); stroke-width: 6px; stroke-linejoin: round; }
.pin:hover .pin-ring, .pin:focus-visible .pin-ring, .pin.is-sel .pin-ring { opacity: 1; stroke-width: 3; }
.pin:focus-visible { outline: none; }
.pin:focus-visible .pin-ring { stroke: var(--focus); stroke-width: 4; }
.pin.is-new .pin-ring { animation: pulse 2.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pulse { 0% { transform: scale(1); opacity: 0.9; } 100% { transform: scale(1.9); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pin.is-new .pin-ring { animation: none; opacity: 1; } html { scroll-behavior: auto; } }

.cards { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.card { text-align: left; font: inherit; color: inherit; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.8rem 0.95rem; cursor: pointer; display: flex; flex-direction: column; gap: 0.15rem; }
.card:hover { border-color: var(--accent); }
.card.is-sel { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.card-name { font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; }
.card-role { font-size: 0.88rem; color: var(--muted); }
.badge { align-self: flex-start; margin-top: 0.35rem; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-accent); background: var(--accent2); padding: 0.1rem 0.5rem; border-radius: 999px; }
.empty { color: var(--muted); font-style: italic; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 1.3rem; border-left: 2px solid var(--rule); }
.timeline li { position: relative; padding: 0 0 1.3rem 1rem; }
.timeline li::before { content: ''; position: absolute; left: -1.3rem; top: 0.55rem; width: 10px; height: 10px; margin-left: -6px; border-radius: 50%; background: var(--accent); }
.tl-year { display: block; font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tl-name { font: inherit; font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; background: none; border: 0; padding: 0; color: var(--ink); cursor: pointer; text-align: left; }
.tl-name:hover { color: var(--accent); }
.timeline li.is-sel .tl-name { color: var(--accent); }

.detail { border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.25rem 1.3rem; background: var(--card); min-height: 8rem; }
.detail h2 { font-size: 1.5rem; margin-bottom: 0.2em; }
.detail-kind { font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin: 0 0 0.4rem; }
.detail-role { color: var(--muted); font-style: italic; margin: 0 0 1rem; }
.detail-empty { color: var(--muted); font-style: italic; margin: 0; }
.layer { margin: 0 0 0.9rem; font-size: 1rem; line-height: 1.55; }
.layer .tag { display: inline-block; margin-right: 0.55rem; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; border: 1px solid var(--rule); color: var(--muted); border-radius: 3px; padding: 0 0.4rem; vertical-align: 0.12em; }
.layer.is-fresh .tag { border-color: var(--accent2); color: var(--accent2); }

/* forms and footer */
.signup { display: grid; gap: 0.75rem; max-width: 30rem; margin-top: 1.25rem; }
.signup label { font-size: 0.92rem; color: var(--muted); }
.signup input[type=email] { font: inherit; width: 100%; padding: 0.7rem 0.9rem; border: 1px solid var(--muted); border-radius: var(--radius); background: var(--card); color: var(--ink); }
.signup .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; }
.site-foot { border-top: 1px solid var(--rule); padding: 2rem 0 3rem; color: var(--muted); font-size: 0.92rem; }
.site-foot .wrap { display: grid; gap: 0.5rem; }
.prose { max-width: 38em; }
.prose p { margin: 0 0 1.1em; }
.two-up { display: grid; gap: 2rem; }
@media (min-width: 860px) { .two-up { grid-template-columns: 1fr 1fr; gap: 3rem; } }
.err-page { padding: 6rem 0; text-align: center; }
@media print { .site-head, .theme-btn, .signup, .btn-row { display: none; } body { background: #fff; color: #000; } }

/* map artwork (classes used by the SVG written in tools/gen.mjs) */
.map .m-rule { stroke: var(--rule); stroke-width: 1; opacity: 0.55; fill: none; }
.map .m-margin { stroke: var(--accent); stroke-width: 2; opacity: 0.5; }
.map .m-water { fill: none; stroke: var(--water); stroke-width: 26; stroke-linecap: round; opacity: 0.4; }
.map .m-water-edge { fill: none; stroke: var(--water); stroke-width: 2; opacity: 0.9; }
.map .m-road { fill: none; stroke: var(--rule); stroke-width: 7; stroke-linecap: round; opacity: 0.9; }
.map .m-hatch { stroke: var(--water); stroke-width: 2; opacity: 0.4; }
.map .m-label { font-family: var(--font-head); font-style: italic; font-size: 20px; fill: var(--muted); letter-spacing: 0.06em; }
.map .m-needle { fill: var(--accent); opacity: 0.8; }
