/* skipto.page — base + book page. Plain CSS, no build step. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: var(--text-md)/var(--leading-normal) var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--text); text-decoration-color: var(--border); text-underline-offset: 3px; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
button, a, .status, .btn { transition: background-color var(--duration), border-color var(--duration), color var(--duration); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.icon { width: 1rem; height: 1rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 0.875rem; height: 0.875rem; }
.icon--lg { width: 1.25rem; height: 1.25rem; }
.muted { color: var(--text-muted); }
.mono { font-family: var(--font-mono); font-size: var(--text-xs); }
.wrap { max-width: var(--page-max); margin-inline: auto; padding-inline: var(--space-6); }
@media (max-width: 480px) { .wrap { padding-inline: var(--space-4); } }

/* ---------- header ---------- */
.site-header { border-bottom: 1px solid var(--border); }
.site-header__inner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-6); padding-block: var(--space-3); }
.wordmark { display: flex; margin-right: auto; color: var(--text); text-decoration: none; }
.wordmark svg { height: 1.75rem; width: auto; }
.wordmark:hover { color: var(--text); }
.search {
  flex: 1 1 12.5rem; max-width: 32.5rem; min-height: 2.5rem;
  display: flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-2) 0 var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-2); background: var(--surface); color: var(--text-muted);
}
.search:focus-within { border-color: var(--text); }
.search input { flex: 1; min-width: 0; border: 0; background: none; padding: var(--space-2) 0; font-size: var(--text-sm); color: var(--text); outline: none; }
.search input::placeholder { color: var(--text-muted); }
.search kbd { font: var(--text-xs) var(--font-sans); padding: 1px 6px; border: 1px solid var(--border); border-radius: 4px; }
.avatar {
  width: 2.25rem; height: 2.25rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text); font-size: var(--text-xs); font-weight: 600; text-decoration: none;
}
.site-header__signin { font-weight: 500; text-decoration: none; padding: var(--space-2) var(--space-1); }

/* ---------- page ---------- */
.book { display: flex; flex-direction: column; gap: var(--space-14); padding-block: var(--space-8) var(--space-18); }
.book__hero { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-8) var(--space-12); }
.book__cover { flex: none; width: min(14.5rem, 44vw); }
.book__main { flex: 1 1 25rem; min-width: 0; display: flex; flex-direction: column; gap: var(--space-6); }
.book__identity { display: flex; flex-direction: column; gap: var(--space-2); }
.book__series-link { align-self: flex-start; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); text-decoration: none; }
.book__title {
  font-size: var(--text-display); font-weight: 620; letter-spacing: -0.015em; line-height: var(--leading-tight);
  text-wrap: balance; overflow-wrap: anywhere;
}
.book__byline { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); font-size: var(--text-lg); }
.book__byline .mono { font-size: var(--text-sm); align-self: center; }
.book__body { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-12) var(--space-14); }
.book__public { flex: 1 1 32.5rem; min-width: 0; display: flex; flex-direction: column; gap: var(--space-10); }

/* ---------- cover: fixed 2:3 frame, image contained, never cropped ---------- */
.cover {
  position: relative; aspect-ratio: 2 / 3; overflow: hidden;
  border-radius: var(--radius-1); background: var(--surface-2); box-shadow: 0 0 0 1px var(--border);
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cover__fallback {
  position: absolute; inset: 0; padding: 14% 12%;
  display: flex; flex-direction: column; gap: 0.6em; font-size: clamp(0.6875rem, 2.2vw, 1.375rem);
}
.cover__fallback::before { content: ""; width: 1.4em; height: 3px; background: var(--accent); }
.cover__title { font-weight: 620; line-height: 1.15; overflow-wrap: anywhere; }
.cover__author { margin-top: auto; font-size: 0.62em; color: var(--text-muted); }

/* ---------- private layer ---------- */
.private {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-3);
  padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-5);
}
.private__label { display: flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--text-muted); }
.private__label--lead { align-items: flex-start; gap: var(--space-2); font-size: var(--text-sm); color: var(--text); line-height: var(--leading-normal); }
.private__label--lead .icon { margin-top: 3px; }
.private hr { margin: 0; border: 0; border-top: 1px solid var(--border); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2); padding: 0.5625rem var(--space-4);
  border-radius: var(--radius-2); border: 1px solid var(--text); background: transparent; color: var(--text);
  font-size: var(--text-sm); font-weight: 500; line-height: 1.3; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn--primary { border-color: var(--accent); background: var(--accent); color: var(--on-accent); font-size: var(--text-md); font-weight: 600; padding: 0.75rem var(--space-5); }
.btn--primary:hover { background: var(--accent-pressed); border-color: var(--accent-pressed); color: var(--on-accent); }
.btn--read { display: flex; gap: var(--space-3); padding: 0.9375rem var(--space-5); font-size: 1.125rem; font-weight: 650; }
.btn--quiet { border-color: transparent; color: var(--text-muted); padding-inline: var(--space-2); }

.continue { display: flex; flex-direction: column; gap: var(--space-3); }
.progress { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); }
.continue__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-4); color: var(--text-muted); }

.notice {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--space-3);
  padding: var(--space-3); border-radius: var(--radius-2); background: var(--surface-2); font-size: var(--text-sm);
}
.notice > span { flex: 1 1 11rem; }

/* ---------- status + rating ---------- */
.field-label { font-size: var(--text-xs); color: var(--text-muted); }
.statuses { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.statuses__list { display: flex; flex-wrap: wrap; gap: 6px; }
.status {
  --c: var(--text-muted);
  display: inline-flex; align-items: center; gap: 7px; min-height: 2.25rem; padding: 6px var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-pill); background: transparent;
  font-size: var(--text-sm); cursor: pointer;
}
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.status:hover { border-color: var(--c); }
.status[aria-pressed="true"] { border-color: var(--c); background: color-mix(in oklab, var(--c) 14%, transparent); font-weight: 600; }
.status--want { --c: var(--st-want); }
.status--reading { --c: var(--st-reading); }
.status--read { --c: var(--st-read); }
.status--paused { --c: var(--st-paused); }
.status--dnf { --c: var(--st-dnf); }
.status--rereading { --c: var(--st-rereading); }

.rating { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.rating__stars { display: flex; gap: 2px; color: var(--text-muted); }
.rating__stars button { width: 2rem; height: 2rem; display: grid; place-items: center; border: 0; background: none; border-radius: var(--radius-2); color: inherit; cursor: pointer; }
.rating__stars button:hover { color: var(--st-reading); }
.rating__stars .icon { width: 1.25rem; height: 1.25rem; stroke-width: 1.75; }

/* ---------- guest call to action ---------- */
.guest-cta { display: flex; flex-direction: column; gap: var(--space-3); max-width: 32.5rem; }
.guest-cta p { font-size: var(--text-lg); }
.guest-cta__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); }
.guest-cta__row span { font-size: var(--text-sm); color: var(--text-muted); }

/* ---------- match candidate ---------- */
.match { display: flex; flex-direction: column; gap: var(--space-3); }
.match__title { font-size: var(--text-sm); font-weight: 600; }
.match__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); }
.match__row .cover { width: 2.5rem; flex: none; }
.match__row .cover__fallback { font-size: 0.4rem; padding: 12%; }
.match__book { flex: 1 1 11rem; display: flex; flex-direction: column; }
.match__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ---------- public sections ---------- */
.section { display: flex; flex-direction: column; gap: var(--space-3); }
.section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-1) var(--space-4); }
.section__title { font-size: 0.9375rem; font-weight: 600; color: var(--text-muted); }
.prose { max-width: var(--measure); font-size: var(--text-lg); line-height: var(--leading-body); text-wrap: pretty; }

.rows { border-top: 1px solid var(--border); }
.rows > li { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-4); padding-block: 0.6875rem; border-bottom: 1px solid var(--border); }
.series__n { width: 1.6em; font-family: var(--font-mono); font-size: var(--text-sm); color: var(--text-muted); }
.series__title { flex: 1 1 12.5rem; min-width: 0; text-decoration: none; }
.series__title[aria-current] { font-weight: 600; }
.series__mark { margin-left: auto; font-size: var(--text-xs); font-weight: 500; color: var(--text-muted); }
.series__mark--reading { color: var(--st-reading); }
.series__mark--want { color: var(--st-want); }
.edition__name { flex: 1 1 13.75rem; min-width: 0; font-size: 0.9375rem; }
.edition__name b { font-weight: 500; }

.chips { display: flex; flex-wrap: wrap; gap: 6px var(--space-2); }
.chip { padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius-pill); font-size: var(--text-sm); text-decoration: none; }
.chip:hover { border-color: var(--text); color: var(--text); }
.chip--private { border-color: transparent; background: var(--surface-2); font-size: var(--text-xs); padding: 4px 10px; }
.chip--add { border-style: dashed; background: none; color: var(--text-muted); font-size: var(--text-xs); padding: 4px 10px; cursor: pointer; }

/* ---------- tabs: links, rendered by the server, no script ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-8); border-bottom: 1px solid var(--border); margin-bottom: calc(var(--space-6) * -1); }
.tabs a {
  display: flex; align-items: baseline; gap: 6px; padding: 10px 0 12px; margin-bottom: -1px;
  border-bottom: 2px solid transparent; color: var(--text-muted); font-weight: 500; text-decoration: none;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); font-weight: 600; border-bottom-color: var(--text); }
.tabs .mono { font-weight: 400; color: var(--text-muted); }

/* ---------- messages ---------- */
.public-label { display: flex; align-items: center; gap: 5px; font-size: var(--text-xs); color: var(--text-muted); }
.empty { padding-block: var(--space-5); border-block: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.empty p:first-child { font-size: var(--text-lg); }
.composer { display: flex; flex-direction: column; gap: var(--space-3); }
.composer__label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-3); font-size: var(--text-sm); }
.composer textarea {
  width: 100%; min-height: 5.5rem; resize: vertical; padding: 10px var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-2); background: var(--ground); line-height: var(--leading-normal);
}
.composer textarea:focus { outline: none; border-color: var(--text); }
.composer__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px var(--space-5); }
.composer__foot label { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); }
.composer__foot input { width: 1rem; height: 1rem; accent-color: var(--accent); margin: 0; }
.composer__limit { flex: 1 1 12.5rem; font-size: var(--text-xs); color: var(--text-muted); }

/* ---------- private rail ---------- */
.rail { flex: 1 1 18.75rem; min-width: 0; max-width: 100%; }
.rail h3 { font-size: var(--text-sm); font-weight: 600; }
.rail__group { display: flex; flex-direction: column; gap: 10px; }
.file { display: flex; align-items: flex-start; gap: 10px; font-size: var(--text-sm); }
.file .icon { margin-top: 2px; color: var(--text-muted); }
.file span { display: flex; flex-direction: column; min-width: 0; }
.file b { font-weight: 500; }
.file .mono { color: var(--text-muted); overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: var(--space-2) var(--space-4); font-size: var(--text-sm); }
.facts dt { color: var(--text-muted); }
.facts--lg { gap: 10px var(--space-6); font-size: 0.9375rem; }

/* ---------- similar ---------- */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.75rem, 1fr)); gap: var(--space-8) var(--space-5); }
@media (max-width: 480px) { .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.shelf li { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.shelf .cover__fallback { font-size: 0.875rem; padding: 14% 11%; }
.shelf__title { font-size: var(--text-sm); font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; text-decoration: none; }
.shelf__meta { font-size: var(--text-xs); color: var(--text-muted); line-height: 1.3; }
.shelf__mark { font-size: var(--text-xs); font-weight: 500; }
.shelf__mark--read { color: var(--st-read); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); padding-block: var(--space-5); font-size: var(--text-xs); color: var(--text-muted); }
.site-footer a { color: var(--text-muted); }

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

/* ---------- shared primitives (every surface loads book.css) ---------- */
.crumb { font-size: var(--text-sm); color: var(--text-muted); }
.mini { flex: none; width: 2.75rem; }
.mini .cover__fallback { font-size: 0.5rem; padding: 12%; }
.mini--sm { width: 2.25rem; }
.mini--lg { width: 3.5rem; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: var(--text-sm); font-weight: 500; }
.field input, .field textarea, .input {
  min-height: 2.75rem; padding: 0 var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-2);
  background: var(--ground); color: var(--text); font-size: var(--text-md); font-weight: 400;
}
.field input:focus, .input:focus { outline: none; border-color: var(--text); }
.field__hint { font-weight: 400; font-size: var(--text-xs); color: var(--text-muted); }
.meter { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); }
.note { padding: var(--space-3); border-radius: var(--radius-2); background: var(--surface-2); font-size: var(--text-sm); line-height: 1.5; }

.wordmark__ribbon { fill: var(--accent); }
