/* HONDANA public site. Served from S3 + CloudFront with a content-hashed name. */
:root {
  --bg: #faf8f4;
  --panel: #ffffff;
  --ink: #23201c;
  --muted: #7a736a;
  --line: #e6e0d6;
  --accent: #b5502e;
  --accent-ink: #ffffff;
  --shadow: 0 1px 2px rgba(35, 32, 28, .06), 0 8px 24px rgba(35, 32, 28, .06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; line-height: 1.3; }
h2 { font-size: 1.05rem; margin: 2rem 0 .75rem; letter-spacing: .02em; }
p { margin: .25rem 0; }
.muted { color: var(--muted); font-size: .9rem; }
button { font: inherit; }
input, select { font: inherit; }

.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 1rem; border-bottom: 1px solid var(--line); background: var(--panel);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; letter-spacing: .08em; }
.site-header nav { display: flex; gap: 1rem; font-size: .9rem; color: var(--muted); }
.page { max-width: 960px; margin: 0 auto; padding: 1.25rem 1rem 4rem; }
.site-footer { padding: 2rem 1rem; color: var(--muted); font-size: .8rem; text-align: center; border-top: 1px solid var(--line); }

.hero { padding: 1.5rem 0 .5rem; }
.hero h1 { font-size: 1.6rem; }

.account-panel { margin: 1.5rem 0 2.5rem; padding: 1.25rem; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.account-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.account-heading h2 { margin-top: 0; }
.auth-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: 1rem; }
.form-card { padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.form-card h3 { margin: 0 0 .75rem; font-size: 1rem; }
.form-card label { display: grid; gap: .25rem; margin: .65rem 0; font-size: .85rem; font-weight: 600; }
.form-card input, .form-card select { width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--ink); }
.form-card .button { border: 0; cursor: pointer; }
.form-card .button:disabled { opacity: .55; cursor: wait; }
.upload-card, #web-progress, #web-review { margin-top: 1rem; }
#web-progress progress { width: 100%; height: 1rem; }
.web-message { min-height: 1.5rem; margin-top: .75rem; color: var(--accent); font-weight: 600; }
.web-message.error { color: #a52620; }
.spine-review { display: grid; gap: .6rem; max-height: 32rem; overflow: auto; }
.spine-choice { display: grid; grid-template-columns: auto 1fr; gap: .6rem; align-items: start; padding: .65rem; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.spine-choice select { margin-top: .35rem; }
.spine-tier { color: var(--muted); font-size: .75rem; }
.register-options { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }

.profile { display: flex; gap: 1rem; align-items: flex-start; }
.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.handle { color: var(--muted); }
.stats strong { font-size: 1.2rem; }

.shelf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem; }
.shelf-card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.shelf-card img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.shelf-name { display: block; padding: .5rem .6rem 0; font-weight: 600; font-size: .9rem; }
.shelf-count { display: block; padding: 0 .6rem .5rem; color: var(--muted); font-size: .8rem; }

.book-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .75rem; }
.book-list.ranked { counter-reset: rank; }
.book-list li a { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .5rem; height: 100%; position: relative; }
.book-list.ranked li a::before { counter-increment: rank; content: counter(rank); position: absolute; top: .35rem; left: .35rem; background: var(--ink); color: #fff; font-size: .7rem; padding: 0 .4rem; border-radius: 4px; }
.book-list img, .no-cover { width: 100%; aspect-ratio: 2 / 3; object-fit: contain; background: #efe9df; border-radius: 4px; }
.no-cover { display: block; }
.no-cover.large { width: 160px; }
.book-title { display: block; margin-top: .4rem; font-size: .85rem; font-weight: 600; line-height: 1.3; }
.book-author { display: block; color: var(--muted); font-size: .75rem; margin-top: .15rem; }

.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.tag { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: .2rem .7rem; font-size: .85rem; }
.tag span { color: var(--muted); margin-left: .3rem; }
.tag-series::before { content: "📚 "; }

.user-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.user-list li a { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; }
.user-name { font-weight: 600; }
.user-handle, .user-score { color: var(--muted); font-size: .8rem; }

.book { display: flex; gap: 1.25rem; align-items: flex-start; }
.book-cover img { width: 160px; border-radius: 6px; box-shadow: var(--shadow); }
.subtitle { color: var(--muted); }
.authors { margin-top: .5rem; }
.button { display: inline-block; padding: .6rem 1.2rem; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 600; margin-top: .75rem; }
.button.amazon::after { content: " ↗"; }
.edition-list { list-style: none; padding: 0; margin: 0; }
.edition-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.edition-list a { color: var(--accent); }

.link-button { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; font-weight: 600; }
.common { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; margin-top: 1.5rem; }
.common h2 { margin-top: 0; }
.common input { font: inherit; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 6px; }

.shelf-viewer { width: min(96vw, 1100px); max-height: 92vh; border: none; border-radius: 12px; padding: 1rem; box-shadow: var(--shadow); }
.shelf-viewer::backdrop { background: rgba(35, 32, 28, .55); }
.shelf-viewer .close { float: right; border: none; background: none; font-size: 1.4rem; cursor: pointer; }
.shelf-stage { position: relative; }
.shelf-stage img { width: 100%; border-radius: 8px; }
.shelf-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.shelf-stage polygon { fill: rgba(181, 80, 46, .12); stroke: rgba(181, 80, 46, .8); stroke-width: 2; cursor: pointer; transition: fill .15s; }
.shelf-stage polygon:hover, .shelf-stage polygon.active { fill: rgba(181, 80, 46, .4); }
.shelf-stage polygon.unknown { fill: rgba(120, 120, 120, .05); stroke: rgba(120, 120, 120, .4); cursor: default; }

@media (max-width: 600px) {
  .book { flex-direction: column; }
  .book-cover img { width: 120px; }
  .site-header nav { gap: .6rem; }
  .register-options { grid-template-columns: 1fr; }
}

/* Legal pages (/terms, /privacy). */
.legal { max-width: 720px; }
.legal p, .legal li { margin: .5rem 0; }
.legal ol, .legal ul { padding-left: 1.4rem; }
.legal-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: .5rem 0; }
.legal-table th, .legal-table td { border: 1px solid var(--line); padding: .45rem .55rem; text-align: left; vertical-align: top; }
.legal-table th { background: var(--panel); font-weight: 600; }
