/* Second Opinion Series: Archival Museum & Swiss Editorial Stylesheet */

:root {
  --ground: #F7F4ED;
  --surface: #FFFFFF;
  --surface-soft: #FAF8F3;
  --surface-alt: #EFECE3;
  --ink: #15171A;
  --ink-secondary: #50555E;
  --rule: #DDD7CA;
  --rule-strong: #C6BFB1;

  /* Harmonized 9-Volume Museum Book-Cloth Accents (Concentric Rings Order) */
  --vol-1: #542E48; /* Self-Command: Deep Aubergine */
  --vol-2: #495E32; /* Nutrition & Fitness: Olive Botanical */
  --vol-3: #1E4D3B; /* Personal Finance: Deep Forest Pine */
  --vol-4: #782628; /* Marriage: Venetian Oxblood */
  --vol-5: #965028; /* Running a Household: Warm Terracotta */
  --vol-6: #394652; /* Household Software: Graphite Steel */
  --vol-7: #2C3B6E; /* Education & Self-Education: Indigo Cobalt */
  --vol-8: #7C5A2B; /* Community & Friendship: Burnished Umber */
  --vol-9: #254463; /* Organizing People: Prussian Slate */

  --accent-primary: #542E48;
  --accent-hover: #3F2236;

  --font-serif: "Newsreader", "P052", "Noto Serif", "Liberation Serif", Georgia, serif;
  --font-sans: "IBM Plex Sans", "Nimbus Sans", "Adwaita Sans", "Noto Sans", "Liberation Sans", sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrainsMono NF", "iA Writer Mono S", "Liberation Mono", monospace;

  --max-w: 1180px;
  --radius: 3px;
  --shadow-book: 0 10px 26px rgba(21, 23, 26, 0.08), 0 2px 6px rgba(21, 23, 26, 0.05);
  --shadow-book-hover: 0 18px 36px rgba(21, 23, 26, 0.13), 0 4px 10px rgba(21, 23, 26, 0.07);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--ground);
  color: var(--ink);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.62;
  background: var(--ground);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

img, svg {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--vol-2);
  outline-offset: 2px;
}

.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
}

/* Top Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 244, 237, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 10px;
  height: 30px;
  background: linear-gradient(
    to bottom,
    var(--vol-1) 0% 33%,
    var(--vol-4) 33% 66%,
    var(--vol-9) 66% 100%
  );
  border-radius: 1px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.12;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.site-nav a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-secondary);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 1.5px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.site-nav a.nav-cta,
.site-nav a.nav-active {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--vol-1);
}

/* Typography Helpers */
.eyebrow {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

h1, h2, h3 {
  margin: 0;
  color: var(--ink);
  font-weight: 500;
}

h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.35rem, 4.4vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  max-width: 18ch;
}

h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 2.7vw, 2.35rem);
  line-height: 1.16;
  letter-spacing: -0.02em;
}

h3 {
  font-family: var(--font-serif);
  font-size: 1.32rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.btn-primary {
  background: var(--ink);
  color: var(--ground);
}

.btn-primary:hover {
  background: #272B30;
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--rule-strong);
}

.btn-secondary:hover {
  border-color: var(--ink);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-secondary);
  border-color: transparent;
  padding-left: 10px;
  padding-right: 10px;
}

.btn-ghost:hover {
  color: var(--ink);
}

.btn-inline {
  background: var(--ink);
  color: var(--ground);
  padding: 9px 16px;
  font-size: 0.84rem;
  white-space: nowrap;
}

.btn-inline:hover {
  background: #2B3036;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.84rem;
}

/* Hero Section */
.hero {
  padding: 58px 0 64px;
  border-bottom: 1px solid var(--rule);
}

.hero-copy {
  max-width: 760px;
}

.hero-lead {
  margin: 18px 0 28px;
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--ink-secondary);
  max-width: 64ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* Verified Series Metrics Strip */
.series-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 40px 0 38px;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  gap: 16px;
}

.series-metrics div {
  display: flex;
  flex-direction: column-reverse;
  gap: 3px;
}

.series-metrics dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.series-metrics dd {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

/* Interactive Transformer Spine Bookshelf */
.shelf-panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 26px 28px 24px;
}

.shelf-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.shelf-kicker {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.shelf-title {
  font-size: 1.38rem;
}

.shelf-hint {
  margin: 0;
  font-size: 0.84rem;
  color: var(--ink-secondary);
}

.shelf-svg-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0 4px;
}

.transformer-svg {
  width: 100%;
  min-width: 680px;
  max-width: 980px;
  height: auto;
  margin: 0 auto;
}

.spine-group {
  cursor: pointer;
  transition: opacity 0.16s ease;
}

.spine-group .spine-active-bar {
  opacity: 0;
  transition: opacity 0.16s ease;
}

.spine-group:hover .spine-active-bar,
.spine-group.is-active .spine-active-bar {
  opacity: 1;
}

.spine-group .spine-hover-sheen {
  opacity: 0;
  transition: opacity 0.16s ease;
}

.spine-group:hover .spine-hover-sheen,
.spine-group.is-active .spine-hover-sheen {
  opacity: 0.08;
}

.spine-group:focus-visible {
  outline: none;
}

.spine-group:focus-visible .spine-outline {
  stroke: var(--ink);
  stroke-width: 2;
}

.shelf-readout {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 24px;
  align-items: center;
}

.readout-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
}

.readout-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 2px;
  color: #F7F4ED;
  background: var(--vol-1);
}

.readout-title {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 600;
}

.readout-math {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-secondary);
  background: var(--surface-soft);
  border: 1px solid var(--rule);
  padding: 2px 7px;
  border-radius: 2px;
}

.readout-desc {
  margin: 0;
  grid-column: 1;
  font-size: 0.9rem;
  color: var(--ink-secondary);
  max-width: 72ch;
}

#readout-inspect-btn {
  grid-column: 2;
  grid-row: 1 / span 2;
}

/* Sections */
.section {
  padding: 76px 0;
  border-bottom: 1px solid var(--rule);
}

.section-alt {
  background: var(--surface-soft);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 24px 48px;
  align-items: end;
  margin-bottom: 42px;
}

.section-intro {
  margin: 0;
  font-size: 0.96rem;
  color: var(--ink-secondary);
  line-height: 1.65;
}

/* 9-Volume Catalog Grid (3x3 desktop, 2-col tablet, 1-col phone) */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 34px 28px;
}

.book-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 20px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.book-card:hover {
  border-color: var(--rule-strong);
  box-shadow: 0 8px 22px rgba(21, 23, 26, 0.05);
}

.book-cover-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  margin-bottom: 18px;
}

.book-cover-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid rgba(21, 23, 26, 0.12);
  box-shadow: var(--shadow-book);
  background: var(--ground);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease;
}

.book-cover-btn:hover .book-cover-frame {
  transform: translateY(-4px);
  box-shadow: var(--shadow-book-hover);
}

.book-cover-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.book-vol-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.swatch-dot {
  width: 9px;
  height: 9px;
  border-radius: 1px;
  display: inline-block;
  flex-shrink: 0;
}

.book-stage-chip {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--ink-secondary);
  background: var(--surface-soft);
  border: 1px solid var(--rule);
  padding: 2px 6px;
  border-radius: 2px;
}

.book-card h3 {
  font-size: 1.26rem;
  margin-bottom: 7px;
}

.book-tagline {
  margin: 0 0 14px;
  font-size: 0.89rem;
  line-height: 1.55;
  color: var(--ink-secondary);
  flex-grow: 1;
}

.book-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 12px;
  padding: 11px 0;
  margin: 0 0 14px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-secondary);
}

.book-stats strong {
  color: var(--ink);
  font-weight: 600;
}

.book-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.book-inspect-btn {
  width: 100%;
  justify-content: space-between;
  background: var(--surface-soft);
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  padding: 9px 13px;
  font-size: 0.84rem;
  font-weight: 500;
}

.book-inspect-btn:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ground);
}

/* Method & Evidence Scale */
.method-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.85fr);
  gap: 28px;
  align-items: start;
}

.grade-table-wrap,
.bench-table-wrap {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow-x: auto;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.spec-table th,
.spec-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.spec-table tbody tr:last-child td {
  border-bottom: none;
}

.spec-table th {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-secondary);
  background: var(--surface-soft);
}

.spec-table td.num,
.spec-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.col-grade {
  width: 72px;
}

.grade-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 600;
}

.grade-a { background: #1E4D3B; color: #F7F4ED; }
.grade-b { background: #254463; color: #F7F4ED; }
.grade-c { background: #7C5A2B; color: #F7F4ED; }
.grade-d { background: #782628; color: #F7F4ED; }
.grade-t { background: #EFECE3; color: #15171A; border: 1px solid #15171A; }

.method-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.rule-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 22px 24px;
}

.rule-card h3 {
  margin-bottom: 12px;
}

.rule-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-secondary);
}

.measures-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 0.89rem;
  color: var(--ink-secondary);
}

.measures-list strong {
  color: var(--ink);
}

/* Dual Edition */
.dual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.edition-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 28px 30px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.edition-card-agent {
  border-top: 3px solid var(--vol-2);
}

.edition-card h3 {
  font-size: 1.45rem;
  margin-bottom: 12px;
}

.edition-card > p {
  margin: 0 0 18px;
  color: var(--ink-secondary);
  font-size: 0.94rem;
}

.edition-card code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  background: var(--surface-soft);
  border: 1px solid var(--rule);
  padding: 1px 5px;
  border-radius: 2px;
  color: var(--ink);
}

.check-list {
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.9rem;
}

.check-list li {
  position: relative;
  padding-left: 20px;
  color: var(--ink);
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 7px;
  height: 7px;
  background: var(--ink);
  border-radius: 1px;
}

.release-note {
  margin: auto 0 0 !important;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.76rem !important;
  color: var(--ink-secondary);
}

.handback-callout {
  margin-top: auto;
  padding: 16px 18px;
  background: var(--surface-soft);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--vol-1);
  border-radius: 2px;
}

.handback-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--vol-1);
  margin-bottom: 6px;
}

.handback-callout p {
  margin: 0;
  font-size: 0.87rem;
  line-height: 1.55;
  color: var(--ink-secondary);
}

.handback-callout strong {
  color: var(--ink);
}

/* Benchmarks Table + Tufte Bullet Bars */
.bench-vol-cell {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 500;
  white-space: nowrap;
}

.col-bar {
  min-width: 210px;
}

.bullet-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.bullet-track {
  position: relative;
  height: 10px;
  background: var(--surface-alt);
  border-radius: 1px;
  overflow: hidden;
}

.bullet-with {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 1px;
}

.bullet-base-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--ink);
}

.bullet-caption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  color: var(--ink-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.status-queued {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-secondary);
  background: var(--surface-soft);
  border: 1px solid var(--rule);
  padding: 3px 8px;
  border-radius: 2px;
}

.bench-footnote {
  margin: 18px 0 0;
  font-size: 0.85rem;
  color: var(--ink-secondary);
  max-width: 86ch;
}

/* Footer */
.site-footer {
  padding: 40px 0 56px;
  background: var(--ground);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px 40px;
}

.footer-brand {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
}

.footer-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-secondary);
  max-width: 58ch;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 0.85rem;
  color: var(--ink-secondary);
}

.footer-links a {
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* Volume Inspector Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(21, 23, 26, 0.44);
  backdrop-filter: blur(2px);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  width: min(720px, 100vw);
  background: var(--ground);
  border-left: 1px solid var(--rule-strong);
  box-shadow: -16px 0 42px rgba(21, 23, 26, 0.16);
  display: flex;
  flex-direction: column;
}

.drawer[hidden],
.drawer-backdrop[hidden] {
  display: none;
}

.drawer-accent-bar {
  height: 6px;
  width: 100%;
  background: var(--vol-1);
  flex-shrink: 0;
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 26px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
}

.drawer-eyebrow {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.drawer-title {
  font-size: 1.7rem;
}

.drawer-close {
  width: 38px;
  height: 38px;
  border-radius: 3px;
  border: 1px solid var(--rule);
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.drawer-close:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--ground);
}

.drawer-body {
  padding: 24px 26px 32px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.drawer-overview {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 22px;
  align-items: start;
}

.drawer-cover {
  width: 148px;
  aspect-ratio: 2 / 3;
  border-radius: 2px;
  border: 1px solid rgba(21, 23, 26, 0.14);
  box-shadow: var(--shadow-book);
  overflow: hidden;
  background: var(--ground);
}

.drawer-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drawer-lead {
  margin: 0 0 12px;
  font-size: 0.96rem;
  color: var(--ink);
}

.drawer-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin: 0;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 3px;
  font-size: 0.82rem;
}

.drawer-facts dt {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.drawer-facts dd {
  margin: 2px 0 0;
  font-weight: 500;
  color: var(--ink);
}

.drawer-section {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 18px 20px;
}

.drawer-section h3 {
  font-size: 1.12rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}

.toc-part {
  margin-bottom: 12px;
}

.toc-part:last-child {
  margin-bottom: 0;
}

.toc-part-title {
  margin: 0 0 5px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.toc-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.88rem;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.decision-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}

.decision-item:first-of-type {
  padding-top: 2px;
}

.decision-item:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.decision-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.decision-q {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
}

.decision-setting {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-secondary);
  margin: 0 0 6px;
}

.decision-verdict {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-secondary);
  line-height: 1.55;
}

.skill-box {
  background: var(--surface-soft);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 14px 16px;
}

.skill-head {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 9px;
}

.skill-steps {
  margin: 0;
  padding-left: 18px;
  font-size: 0.86rem;
  color: var(--ink-secondary);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.mp-route {
  margin: 8px 0;
  padding: 9px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--rule);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink);
  line-height: 1.55;
}

.drawer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 26px;
  background: var(--surface);
  border-top: 1px solid var(--rule);
}

.drawer-ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

/* Inside-Cover AI On-Ramp Page (ai.html) */
.ai-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.95fr);
  gap: 36px 44px;
  align-items: center;
}

.ai-hero-copy code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 1px 6px;
  border-radius: 2px;
  color: var(--ink);
}

.qr-colophon-card {
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: var(--shadow-book);
}

.qr-colophon-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--ink);
  background: var(--ground);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  color: var(--ink);
}

.qr-colophon-body {
  display: grid;
  grid-template-columns: 164px 1fr;
  gap: 20px;
  padding: 20px;
  align-items: center;
}

.qr-frame {
  width: 164px;
  height: 164px;
  background: var(--ground);
  border: 1px solid var(--rule-strong);
  padding: 6px;
  border-radius: 2px;
}

.qr-frame img {
  width: 100%;
  height: 100%;
}

.qr-eyebrow {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 0.69rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.qr-copy h2 {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.qr-copy p {
  margin: 0 0 10px;
  font-size: 0.85rem;
  line-height: 1.52;
  color: var(--ink-secondary);
}

.qr-licence {
  margin: 0 !important;
  font-family: var(--font-mono);
  font-size: 0.7rem !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink) !important;
}

.vol-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.vol-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  font-size: 0.84rem;
  color: var(--ink);
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.vol-pill:hover {
  border-color: var(--ink);
}

.vol-pill.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ground);
}

.vol-pill-num {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  opacity: 0.78;
}

.starter-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 28px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 26px;
}

.starter-vol-head {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
}

.starter-cover-thumb {
  width: 84px;
  aspect-ratio: 2 / 3;
  border: 1px solid rgba(21, 23, 26, 0.15);
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(21, 23, 26, 0.08);
}

.starter-cover-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.starter-stats {
  margin: 6px 0 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-secondary);
}

.starter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.copy-status {
  min-height: 1.4em;
  margin: 10px 0 14px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--vol-3);
}

.quick-steps {
  margin: 0;
  padding: 16px 0 0 18px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.89rem;
  color: var(--ink-secondary);
}

.quick-steps strong {
  color: var(--ink);
}

.quick-steps code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  background: var(--surface-soft);
  border: 1px solid var(--rule);
  padding: 1px 4px;
  border-radius: 2px;
  color: var(--ink);
}

.starter-preview-col {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
  background: var(--surface-soft);
}

.code-box-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-secondary);
}

.pack-preview {
  margin: 0;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.56;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 410px;
  overflow-y: auto;
}

.ai-hero-grid > *,
.starter-workbench > * {
  min-width: 0;
}

.cmd-block {
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 14px;
  background: var(--surface-soft);
  max-width: 100%;
}

.cmd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface-alt);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-secondary);
}

.btn-copy-mini {
  padding: 3px 9px;
  border-radius: 2px;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.69rem;
}

.btn-copy-mini:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--ground);
}

.cmd-block pre {
  margin: 0;
  padding: 11px 12px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink);
}

.endpoint-list {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.endpoint-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
  font-size: 0.87rem;
}

.endpoint-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.endpoint-list a {
  text-decoration: none;
}

.endpoint-list a:hover code {
  border-color: var(--ink);
}

.endpoint-list span {
  color: var(--ink-secondary);
  font-size: 0.83rem;
}

.fallback-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--vol-1);
  border-radius: 4px;
  padding: 28px 30px;
}

.fallback-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.fallback-intro {
  margin: 0 0 16px;
  color: var(--ink-secondary);
  font-size: 0.94rem;
  max-width: 74ch;
}

.fallback-prompt {
  margin: 0;
  padding: 18px 20px;
  background: var(--surface-soft);
  border: 1px solid var(--rule);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.68;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.drawer-pos {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-secondary);
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .section-head,
  .method-layout,
  .dual-grid,
  .ai-hero-grid,
  .starter-workbench {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .wrap {
    padding: 0 16px;
  }
  .site-header {
    position: static;
  }
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 0 10px;
    gap: 8px;
  }
  .site-nav {
    flex-wrap: wrap;
    justify-content: flex-start;
    overflow-x: visible;
    gap: 2px 14px;
    padding-top: 6px;
    border-top: 1px solid var(--rule);
  }
  .site-nav a {
    font-size: 0.78rem;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    padding: 4px 0;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .hero {
    padding: 36px 0 44px;
  }
  .series-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
  }
  .shelf-panel {
    padding: 18px 16px;
  }
  .shelf-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .shelf-readout {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  #readout-inspect-btn {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
  }
  .section {
    padding: 52px 0;
  }
  .catalog-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .edition-card {
    padding: 22px 20px;
  }
  .drawer-header,
  .drawer-body,
  .drawer-footer {
    padding-left: 18px;
    padding-right: 18px;
  }
  .drawer-overview {
    grid-template-columns: 1fr;
  }
  .drawer-cover {
    width: 132px;
  }
  .qr-colophon-body {
    grid-template-columns: 1fr;
  }
  .starter-workbench,
  .fallback-card {
    padding: 18px 16px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #141517;
    --surface: #1C1E22;
    --surface-soft: #23262B;
    --surface-alt: #2A2D33;
    --ink: #EFECE5;
    --ink-secondary: #B4B8C0;
    --rule: #343840;
    --rule-strong: #4B505A;
    --accent-primary: #C493B5;
    --accent-hover: #D6AECB;
    --shadow-book: 0 10px 26px rgba(0, 0, 0, 0.42), 0 2px 6px rgba(0, 0, 0, 0.28);
    --shadow-book-hover: 0 18px 36px rgba(0, 0, 0, 0.56), 0 4px 10px rgba(0, 0, 0, 0.36);
  }
  .site-header {
    background: rgba(20, 21, 23, 0.94);
  }
  .btn-primary {
    background: #EFECE5;
    color: #141517;
    border-color: #EFECE5;
  }
  .btn-primary:hover {
    background: #FFFFFF;
    color: #141517;
  }
  .btn-secondary {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--rule-strong);
  }
  .qr-frame {
    background: #FFFFFF;
    padding: 8px;
    border-radius: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
