:root {
  --paper: #F4F7F6;
  --surface: #FFFFFF;
  --ink: #17212B;
  --muted: #56636E;
  --line: #D8DFDC;
  --green: #1F4B3F;
  --brass: #B08A3E;
  --oxblood: #8E2F2A;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 var(--sans); }
a { color: var(--green); text-underline-offset: 3px; }
a:focus-visible, input:focus-visible, button:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

/* header */
header.site { background: var(--surface); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.brand { font: 600 24px/1 var(--serif); color: var(--ink); text-decoration: none; }
nav.top a { margin-left: 20px; color: var(--muted); text-decoration: none; font-size: 15px; }
nav.top a:hover { color: var(--ink); text-decoration: underline; }
nav.sems { border-top: 1px solid var(--line); background: var(--paper); }
nav.sems .wrap { display: flex; gap: 8px; overflow-x: auto; padding-top: 9px; padding-bottom: 9px; }
nav.sems a { flex: none; padding: 4px 14px; border-radius: 999px; font-size: 14px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: var(--surface); }
nav.sems a:hover { border-color: var(--green); }
nav.sems a[aria-current] { background: var(--green); color: #fff; border-color: var(--green); }

main { padding-bottom: 56px; }

/* home */
.hero { padding: 56px 0 32px; }
.hero h1 { font: 600 clamp(36px, 5.6vw, 60px)/1.06 var(--serif); letter-spacing: -0.01em; max-width: 15ch; margin: 0 0 18px; }
.hero p { max-width: 54ch; color: var(--muted); font-size: 19px; margin: 0; }

.shelf { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; align-items: end; padding-top: 12px; border-bottom: 12px solid #C9D1CD; }
.spine {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: center;
  height: clamp(250px, 32vw, 330px); padding: 44px 0 18px;
  background: var(--spine); color: #fff; text-decoration: none;
  border-radius: 3px 3px 0 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease;
}
.spine::before, .spine::after { content: ""; position: absolute; left: 0; right: 0; height: 5px; background: var(--brass); }
.spine::before { top: 16px; }
.spine::after { top: 26px; height: 2px; }
.spine:hover { transform: translateY(-8px); }
.spine-sem { writing-mode: vertical-rl; font: 600 26px/1 var(--serif); letter-spacing: 0.02em; }
.spine-count { font-size: 13px; opacity: 0.9; }

.block { margin-top: 48px; }
.block h2 { font: 600 24px/1.2 var(--serif); margin: 0 0 14px; }
.search input { width: 100%; max-width: 520px; font: inherit; padding: 12px 14px; border: 1px solid #AEB9B4; border-radius: 6px; background: var(--surface); }
.search .rows { margin-top: 12px; max-width: 720px; }

/* lists */
.page-title { font: 600 clamp(30px, 4.5vw, 42px)/1.12 var(--serif); margin: 8px 0 8px; }
.lede { color: var(--muted); margin: 0 0 20px; max-width: 60ch; }
.crumbs { font-size: 14px; color: var(--muted); padding: 22px 0 6px; }
.crumbs a { color: var(--muted); }
.crumbs span { color: var(--ink); }
.rows { list-style: none; margin: 20px 0 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.rows li + li { border-top: 1px solid var(--line); }
.rows a, .rows .row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px 20px; color: var(--ink); text-decoration: none; }
.rows a:hover { background: #EEF3F1; }
.rows.tick a, .rows.tick .row { box-shadow: inset 5px 0 0 var(--spine); padding-left: 24px; }
.row-title { font: 600 19px/1.3 var(--serif); }
.row-note { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }
.row-meta { color: var(--muted); font-size: 14px; white-space: nowrap; }
.soon { color: var(--muted); }

/* unit page */
.unit-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 8px; }
.unit-nav { position: sticky; top: 16px; padding: 4px 0 4px 16px; border-left: 5px solid var(--spine); }
.unit-nav-title { font: 600 18px/1.3 var(--serif); margin: 0 0 8px; }
.unit-nav-title a { color: var(--ink); text-decoration: none; }
.unit-nav ol { list-style: none; margin: 0; padding: 0; font-size: 15px; }
.unit-nav li { padding: 5px 0; }
.unit-nav a { color: var(--ink); text-decoration: none; }
.unit-nav a:hover { text-decoration: underline; }
.unit-nav a[aria-current] { font-weight: 600; color: var(--green); }
.notes { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 32px clamp(18px, 4vw, 48px) 36px; }
.notes h1 { font: 600 clamp(28px, 4vw, 38px)/1.15 var(--serif); margin: 0 0 8px; }
.meta { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.banner { background: #FFF4D6; border: 1px solid #E3CB86; border-radius: 6px; padding: 10px 14px; font-size: 15px; margin: 14px 0 6px; }
.content { font: 19px/1.75 var(--serif); max-width: 68ch; margin-top: 18px; }
.content p { margin: 0 0 1em; }
.content h2 { font: 600 26px/1.25 var(--serif); margin: 1.9em 0 0.5em; }
.content h3 { font: 600 21px/1.3 var(--serif); margin: 1.6em 0 0.4em; }
.content ul, .content ol { padding-left: 1.3em; margin: 0 0 1em; }
.content li { margin: 0.3em 0; }
.content blockquote { margin: 1.2em 0; padding: 0.3em 1.2em; border-left: 4px solid var(--brass); background: #FAF7EF; }
.content blockquote p { margin: 0.5em 0; }
.content code { font-size: 0.9em; background: #EEF2F0; padding: 1px 5px; border-radius: 3px; }
.table-wrap { overflow-x: auto; margin: 1.2em 0; }
.content table { border-collapse: collapse; width: 100%; font: 16px/1.5 var(--sans); }
.content th, .content td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; }
.content th { background: #EEF3F1; }
.prevnext { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 16px; }
.prevnext .next { margin-left: auto; text-align: right; }

/* buy panel */
.buy { margin-top: 36px; background: #FBF7EC; border: 1px solid #E3D3A6; border-left: 6px solid var(--brass); border-radius: 6px; padding: 22px 26px; max-width: 720px; }
.buy h2 { font: 600 22px/1.25 var(--serif); margin: 0 0 6px; }
.buy p { margin: 0 0 14px; color: var(--muted); }
.price { color: var(--oxblood); }
.btn { display: inline-block; background: var(--oxblood); color: #fff; padding: 11px 22px; border-radius: 6px; font-weight: 600; text-decoration: none; }
.btn:hover { background: #752420; }

/* static pages */
.prose { max-width: 62ch; font: 19px/1.7 var(--serif); }
.prose p { margin: 0 0 1em; }

/* footer */
footer.site { border-top: 1px solid var(--line); background: var(--surface); padding: 22px 0; font-size: 14px; color: var(--muted); }
footer.site p { margin: 4px 0; }
footer.site a { color: var(--muted); }

@media (max-width: 760px) {
  .unit-layout { grid-template-columns: 1fr; gap: 14px; }
  .unit-nav { position: static; }
  .shelf { grid-template-columns: 1fr; border-bottom: 0; gap: 8px; }
  .spine { flex-direction: row; height: auto; padding: 16px 20px 16px 24px; border-radius: 3px; border-left: 6px solid var(--brass); }
  .spine::before, .spine::after { display: none; }
  .spine:hover { transform: none; }
  .spine-sem { writing-mode: horizontal-tb; font-size: 20px; }
  .rows a, .rows .row { flex-direction: column; gap: 2px; }
  .hero { padding-top: 36px; }
  .content { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { .spine { transition: none; } }
@media print {
  header.site, footer.site, .unit-nav, .prevnext, .buy { display: none; }
  body { background: #fff; }
  .notes { border: 0; padding: 0; }
}
