/* Soulverse Website — Brand CSS
 * Brand: Open Sans, Indigo #2C2EBC, White, Black, Gray
 * Indigo used for concept/info emphasis in headers only
 * Not for full-line coloring or decorative blocks
 */

/* ─── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --indigo:       #2C2EBC;
  --indigo-dark:  #1e20a0;
  --indigo-light: #4547d4;
  --white:        #ffffff;
  --black:        #0a0a0a;
  --gray-900:     #111111;
  --gray-800:     #1f1f1f;
  --gray-700:     #2d2d2d;
  --gray-600:     #4a4a4a;
  --gray-400:     #9a9a9a;
  --gray-200:     #d4d4d4;
  --gray-100:     #f0f0f0;
  --gray-50:      #f9f9f9;
  --font:         'Open Sans', system-ui, -apple-system, sans-serif;
  --radius:       8px;
  --radius-lg:    16px;
  --shadow:       0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg:    0 8px 40px rgba(0,0,0,0.12);
  --transition:   0.2s ease;
}

html { scroll-behavior: smooth; font-size: 16px; overflow-x: hidden; }
body { overflow-x: hidden; }

body {
  font-family: var(--font);
  color: var(--gray-900);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Typography ────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font);
  line-height: 1.25;
  font-weight: 700;
  color: var(--black);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.2rem; }

/* Indigo accent: for key concept/info words within headers only */
.accent { color: var(--indigo); }

p { color: var(--gray-700); line-height: 1.7; }
a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--indigo); outline-offset: 3px; border-radius: 2px; }

/* ─── Layout Utilities ──────────────────────────────── */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
@media (max-width: 760px) {
  .grid-2 { grid-template-columns: 1fr; gap: 24px; }
}
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.section-lg { padding: 120px 0; }
@media (max-width: 640px) {
  .section { padding: 56px 0; }
  .section-sm { padding: 36px 0; }
  .section-lg { padding: 80px 0; }
}

/* ─── Skip Link (Accessibility) ─────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--indigo);
  color: var(--white);
  padding: 8px 16px;
  z-index: 1000;
  font-weight: 600;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { top: 0; }

/* ─── Navigation ────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.97);
  border-bottom: 1px solid var(--gray-200);
  backdrop-filter: blur(8px);
}

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

.nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--black);
  text-decoration: none;
  flex-shrink: 0;
}

.nav__brand-logo {
  height: 36px;
  width: auto;
  /* display is controlled by inline style + JS load/error handlers */
}

.nav__brand-placeholder {
  /* Text wordmark fallback — visible until real logo PNG is supplied.
     Shown by default. Hidden by JS when real logo image loads.
     DO NOT style this as a designed logo — it is a development placeholder. */
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--black);
  text-transform: uppercase;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav__links a {
  color: var(--gray-700);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.nav__links a:hover { color: var(--indigo); background: var(--gray-50); text-decoration: none; }
.nav__links a.active { color: var(--indigo); font-weight: 600; }

.nav__cta {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.nav__hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--gray-700);
}

@media (max-width: 900px) {
  .nav__links {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    flex-direction: column;
    padding: 12px 16px 20px;
    gap: 2px;
    align-items: stretch;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    z-index: 99;
  }
  .nav__links.open { display: flex; }
  .nav__links a { padding: 10px 12px; font-size: 0.95rem; }
  .nav__hamburger { display: block; }
  .nav__cta { display: none; }
}

/* ─── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--indigo); outline-offset: 3px; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--indigo);
  color: var(--white);
  border-color: var(--indigo);
}
.btn-primary:hover { background: var(--indigo-dark); border-color: var(--indigo-dark); text-decoration: none; }

.btn-secondary {
  background: transparent;
  color: var(--indigo);
  border-color: var(--indigo);
}
.btn-secondary:hover { background: var(--indigo); color: var(--white); text-decoration: none; }

.btn-outline-white {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}
.btn-outline-white:hover { background: var(--white); color: var(--indigo); text-decoration: none; }

.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; }

/* ─── Hero ──────────────────────────────────────────── */
.hero {
  background: var(--black);
  color: var(--white);
  padding: 80px 0 72px;
  position: relative;
  overflow: hidden;
}
@media (max-width: 640px) {
  .hero { padding: 60px 0 56px; }
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(44,46,188,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(44,46,188,0.08) 0%, transparent 50%);
  pointer-events: none;
}

.hero__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--indigo-light);
  margin-bottom: 20px;
  padding: 4px 12px;
  border: 1px solid rgba(68,71,212,0.4);
  border-radius: 100px;
}

.hero__heading { color: var(--white); margin-bottom: 24px; }
.hero__heading .accent { color: var(--indigo-light); }

.hero__sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: rgba(255,255,255,0.75);
  max-width: 580px;
  margin-bottom: 40px;
}

.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero__trust {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.hero__trust-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 16px;
}

/* ─── Audience Cards ────────────────────────────────── */
.audience-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1000px) { .audience-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px)  { .audience-grid { grid-template-columns: 1fr; } }

.audience-card {
  display: block;
  padding: 28px 24px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  background: var(--white);
  text-decoration: none;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
}
.audience-card:hover { border-color: var(--indigo); box-shadow: var(--shadow-lg); transform: translateY(-2px); text-decoration: none; }
.audience-card:focus-visible { outline: 2px solid var(--indigo); outline-offset: 3px; }

.audience-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.audience-card__tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.audience-card__title { font-size: 1.1rem; margin-bottom: 8px; color: var(--black); }
.audience-card__desc { font-size: 0.88rem; color: var(--gray-600); line-height: 1.5; margin-bottom: 16px; }
.audience-card__action { font-size: 0.85rem; font-weight: 600; color: var(--indigo); display: flex; align-items: center; gap: 4px; }

/* Audience color themes */
.audience-card--individuals .audience-card__icon { background: #eff0fd; }
.audience-card--enterprises .audience-card__icon { background: #f0fdf4; }
.audience-card--financial .audience-card__icon  { background: #fff7ed; }
.audience-card--national .audience-card__icon   { background: #fdf4ff; }

.audience-card--individuals .audience-card__tag { background: #eff0fd; color: var(--indigo); }
.audience-card--enterprises .audience-card__tag { background: #dcfce7; color: #166534; }
.audience-card--financial .audience-card__tag   { background: #ffedd5; color: #c2410c; }
.audience-card--national .audience-card__tag    { background: #f5d0fe; color: #86198f; }

/* ─── Cards ─────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}

.card-dark {
  background: var(--gray-900);
  border-color: var(--gray-700);
  color: var(--white);
}
.card-dark p { color: var(--gray-400); }
.card-dark h3, .card-dark h4 { color: var(--white); }

/* ─── Status Pills ──────────────────────────────────── */
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
}
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; display: block; }

.status-live    { background: #dcfce7; color: #166534; }
.status-live::before { background: #16a34a; }

.status-pilot   { background: #fef9c3; color: #854d0e; }
.status-pilot::before { background: #ca8a04; }

.status-dev     { background: #dbeafe; color: #1e40af; }
.status-dev::before { background: #2563eb; }

.status-arch    { background: #f3e8ff; color: #6b21a8; }
.status-arch::before { background: #9333ea; }

/* ─── Step / Process List ───────────────────────────── */
.step-list { list-style: none; display: flex; flex-direction: column; gap: 24px; }

.step-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--indigo);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.step-content h4 { color: var(--black); margin-bottom: 4px; font-size: 1rem; }
.step-content p  { font-size: 0.9rem; color: var(--gray-600); }

/* ─── Hero (Audience Page) ──────────────────────────── */
.page-hero {
  background: var(--black);
  padding: 72px 0 56px;
  color: var(--white);
  position: relative;
  overflow: hidden;
}
@media (max-width: 640px) {
  .page-hero { padding: 48px 0 40px; }
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 60%, rgba(44,46,188,0.18) 0%, transparent 55%);
  pointer-events: none;
}

.page-hero__eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--indigo-light);
  margin-bottom: 16px;
}
.page-hero__title { color: var(--white); margin-bottom: 20px; }
.page-hero__title .accent { color: var(--indigo-light); }
.page-hero__sub { color: rgba(255,255,255,0.72); max-width: 600px; font-size: 1.05rem; margin-bottom: 36px; }
.page-hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ─── Feature / Capability Block ───────────────────── */
.capability {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 0;
  border-bottom: 1px solid var(--gray-100);
}
.capability:last-child { border-bottom: none; }

.capability__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.capability__body h4 { font-size: 0.95rem; margin-bottom: 4px; }
.capability__body p  { font-size: 0.85rem; color: var(--gray-600); }

/* ─── Trust/stats bar ───────────────────────────────── */
.stat-bar {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.stat-item__value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.1;
}
.stat-item__label {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
  margin-top: 4px;
}

/* ─── Banner / Alert ────────────────────────────────── */
.banner {
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.banner-info   { background: #eff0fd; color: var(--indigo-dark); border: 1px solid rgba(44,46,188,0.15); }
.banner-warn   { background: #fffbeb; color: #92400e; border: 1px solid rgba(217,119,6,0.2); }
.banner-notice { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); }

/* ─── Accordion / FAQ ───────────────────────────────── */
details.faq { border-bottom: 1px solid var(--gray-200); }
details.faq summary {
  padding: 18px 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--black);
  user-select: none;
}
details.faq summary::after { content: '+'; font-size: 1.2rem; color: var(--indigo); flex-shrink: 0; }
details.faq[open] summary::after { content: '−'; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::marker { display: none; }
details.faq .faq-body { padding: 0 0 18px; color: var(--gray-600); font-size: 0.9rem; line-height: 1.7; }

/* ─── Footer ────────────────────────────────────────── */
footer {
  background: var(--gray-900);
  color: rgba(255,255,255,0.6);
  padding: 64px 0 40px;
}
@media (max-width: 640px) { footer { padding: 48px 0 32px; } }

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

@media (max-width: 900px)  { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 580px)  { .footer__grid { grid-template-columns: 1fr; } }

.footer__brand { color: var(--white); font-weight: 700; font-size: 1.1rem; margin-bottom: 12px; }
.footer__tagline { font-size: 0.85rem; line-height: 1.6; }

.footer__col-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.35); margin-bottom: 14px; }
.footer__links { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer__links a { color: rgba(255,255,255,0.6); font-size: 0.88rem; }
.footer__links a:hover { color: var(--white); }

.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
}

.footer__legal { display: flex; gap: 20px; flex-wrap: wrap; }
.footer__legal a { color: rgba(255,255,255,0.4); }
.footer__legal a:hover { color: rgba(255,255,255,0.7); }

/* ─── img defaults ─────────────────────────────────── */
img { max-width: 100%; height: auto; display: block; }

/* ─── Contact Form ──────────────────────────────────── */
.contact-form { display: flex; flex-direction: column; gap: 16px; max-width: 520px; }

label { font-size: 0.85rem; font-weight: 600; color: var(--gray-800); display: block; margin-bottom: 6px; }

input[type="text"], input[type="email"], textarea, select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--black);
  transition: border-color var(--transition);
  background: var(--white);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--indigo); }
textarea { min-height: 100px; resize: vertical; }

/* ─── Section headers ───────────────────────────────── */
.section-header { text-align: center; max-width: 640px; margin: 0 auto 52px; }
.section-header h2 { margin-bottom: 12px; }
.section-header p { color: var(--gray-600); font-size: 1rem; }

/* ─── Divider ───────────────────────────────────────── */
.divider { height: 1px; background: var(--gray-200); margin: 48px 0; }

/* ─── Brand-pending notice (must be removed on logo addition) ─ */
.brand-pending {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gray-400);
  background: var(--gray-100);
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px dashed var(--gray-200);
  letter-spacing: 0.04em;
}

/* ─── Focus ring for interactive elements without focus-visible ─ */
button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 3px;
}

/* ─── Reduced motion ────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .audience-card:hover { transform: none; }
}

/* ─── Print ─────────────────────────────────────────── */
@media print {
  .nav, footer, .nav__cta { display: none; }
  .hero, .page-hero { background: none !important; color: var(--black) !important; }
  .hero__heading, .page-hero__title { color: var(--black) !important; }
  .hero__sub, .page-hero__sub { color: var(--gray-600) !important; }
}

/* ─── Utility ───────────────────────────────────────── */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-48 { margin-bottom: 48px; }
.hidden { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ═══════════════════════════════════════════════════════════════════════════
   LIBRARY — LIB-002A
   v0.1.1 reader CSS: aspect-ratio:612/792 (no max-height letterbox)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── library index ── */
.lib-intro { padding: 105px 0 0; }
.lib-intro h1 { font-size: clamp(3rem,5.5vw,5.5rem); line-height: 1.08; letter-spacing: -.062em; font-weight: 750; margin: 22px 0 28px; max-width: 900px; }
.lib-lead { font-size: 1.08rem; line-height: 1.78; color: #4c4c4c; max-width: 760px; margin: 0; }
.lib-index { padding: 55px 0 90px; border-top: 1px solid #e7e7e7; margin-top: 60px; }
.lib-entry { display: grid; grid-template-columns: 1fr auto; gap: 28px; padding: 38px 0; border-top: 1px solid #e7e7e7; align-items: start; }
.lib-entry:first-of-type { border-top: none; }
.lib-entry-title { font-size: clamp(1.6rem,2.8vw,2.2rem); letter-spacing: -.04em; font-weight: 750; margin: 10px 0 8px; }
.lib-entry-edition { font-size: .8rem; color: #686868; margin: 0 0 12px; }
.lib-entry-desc { font-size: .98rem; line-height: 1.75; color: #555; max-width: 660px; margin: 0; }
.lib-entry-actions { display: flex; flex-direction: column; gap: 14px; align-items: flex-end; white-space: nowrap; padding-top: 34px; }
.lib-read-link { font-size: .9rem; font-weight: 750; color: #2C2EBC; text-decoration: none; }
.lib-read-link:hover { text-decoration: underline; }
.lib-pdf-link { font-size: .82rem; color: #2C2EBC; text-decoration: none; }
.lib-pdf-link:hover { text-decoration: underline; }
.lib-empty { color: #686868; padding: 40px 0; }

/* access tier badges */
.lib-badge { display: inline-block; font-size: .68rem; letter-spacing: .1em; font-weight: 750; text-transform: uppercase; padding: 4px 10px; border-radius: 2px; }
.lib-badge--public-open { background: #e8f5e9; color: #256029; }
.lib-badge--public-ssw { background: #e8eaf6; color: #2C2EBC; }
.lib-badge--team-vc { background: #fff3e0; color: #7b4f00; }

/* forthcoming tiers */
.lib-forthcoming { padding: 0 0 90px; border-top: 1px solid #e7e7e7; }
.lib-ft-heading { font-size: clamp(1.8rem,3.2vw,2.8rem); letter-spacing: -.04em; margin: 55px 0 18px; }
.lib-ft-desc { font-size: .97rem; line-height: 1.73; color: #555; max-width: 680px; margin: 0 0 36px; }
.lib-tiers { margin: 0; padding: 0; display: flex; flex-direction: column; gap: 28px; list-style: none; }
.lib-tier { border-top: 1px solid #e7e7e7; padding-top: 24px; }
.lib-tier-label { display: block; margin: 0 0 10px; }
.lib-tier-desc { font-size: .94rem; line-height: 1.73; color: #555; max-width: 680px; margin: 0; }

/* ── library responsive ── */
@media (max-width: 820px) {
  .lib-entry { grid-template-columns: 1fr; gap: 20px; }
  .lib-entry-actions { align-items: flex-start; flex-direction: row; padding-top: 0; }
  .lib-intro { padding: 80px 0 0; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   VISION READER — LIB-002A-R2 Phase B
   Namespace: vr-* (Vision Reader)
   Approved design baseline: Phase A.2 prototype at commit 17f30c8
   These styles apply ONLY to the /library/vision-human-first reader page,
   which renders a standalone <html> document (no site nav).
   They do NOT affect any other page on the site.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Custom properties (scoped to reader body) ── */
.vr-body {
  --vr-indigo:  #2C2EBC;
  --vr-black:   #151515;
  --vr-gray-6:  #686868;
  --vr-gray-e:  #e8e8e8;
  --vr-canvas:  #f0eeeb;
  --vr-white:   #ffffff;
  --vr-bar-h:   48px;
  --vr-ctrl-h:  52px;
  --vr-gap-btm: 20px;
}

/* ── Reader body: full-viewport fixed layout, no body scroll ── */
.vr-body {
  height: 100%;
  font-family: 'Open Sans', system-ui, sans-serif;
  background: var(--vr-canvas);
  color: var(--vr-black);
  -webkit-font-smoothing: antialiased;
  overflow: hidden; /* scroll lives inside reading-field */
  margin: 0;
  padding: 0;
}
html:has(.vr-body) {
  height: 100%;
  overflow: hidden;
}

/* ── Keyboard focus indication ── */
.vr-body :focus-visible {
  outline: 2px solid var(--vr-indigo);
  outline-offset: 2px;
}
.vr-body :focus:not(:focus-visible) { outline: none; }

/* ══════════════════════════════════════════════════════════════════════════
   TOP BAR — fixed 48px translucent bar
   Layout: [← Library] [title centred] [↓ Download PDF]
   Mobile: bar shrinks to 44px; Download PDF hidden (available in info panel)
   ══════════════════════════════════════════════════════════════════════════ */
.vr-top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--vr-bar-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,.07);
  display: flex;
  align-items: center;
  padding: 0 28px;
  z-index: 100;
}

.vr-top-bar__back {
  display: flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 600;
  color: var(--vr-indigo); text-decoration: none;
  letter-spacing: .01em; flex: 0 0 auto; white-space: nowrap;
  border-radius: 3px; padding: 3px 4px; margin-left: -4px;
}
.vr-top-bar__back:hover { opacity: .75; }

.vr-top-bar__title {
  flex: 1 1 auto; text-align: center;
  font-size: .78rem; font-weight: 600; color: var(--vr-gray-6);
  letter-spacing: .01em; overflow: hidden; white-space: nowrap;
  text-overflow: ellipsis; padding: 0 20px;
}

.vr-top-bar__dl {
  flex: 0 0 auto; display: flex; align-items: center; gap: 5px;
  font-size: .76rem; font-weight: 700; color: var(--vr-black);
  text-decoration: none; border: 1px solid #c8c8c8;
  padding: 5px 13px; white-space: nowrap;
  letter-spacing: .01em; border-radius: 3px;
}
.vr-top-bar__dl:hover { border-color: var(--vr-indigo); color: var(--vr-indigo); }

/* ══════════════════════════════════════════════════════════════════════════
   READING FIELD — full-viewport warm canvas below top bar
   Desktop: fixed, fills below top bar, centres content vertically.
   Mobile fit mode: fixed, overflow hidden, aligns content to TOP so page
     appears just under the bar with a small margin — no dead zone (A1-01).
   Mobile zoom mode: overflow auto for two-axis pan (A1-02).
   ══════════════════════════════════════════════════════════════════════════ */
.vr-reading-field {
  position: fixed;
  top: var(--vr-bar-h);
  left: 0; right: 0; bottom: 0;
  background: var(--vr-canvas);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* BQA3: desktop zoom-active — physical expansion + two-axis scroll */
.vr-reading-field.zoom-active {
  overflow: auto;
  align-items: flex-start;
  justify-content: flex-start;
  /* Ensure page footer is reachable past the fixed toolbar */
  scroll-padding-bottom: calc(var(--vr-ctrl-h) + var(--vr-gap-btm) + 8px);
}

/* A1-01 FIX — mobile fit mode: top-align, no vertical dead zone */
@media (max-width: 750px) {
  .vr-reading-field {
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
  }
  /* A1-02 + BQA3 — zoom mode: two-axis scroll for pan to all four corners */
  .vr-reading-field.zoom-active {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    align-items: flex-start;
    justify-content: flex-start;
    scroll-padding-bottom: calc(var(--vr-ctrl-h) + var(--vr-gap-btm) + 8px);
  }
}

/* ── Spread container ── */
.spread {
  display: flex;
  align-items: stretch;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  /* Desktop: reserve space for controls at bottom, breathing at top */
  padding-bottom: calc(var(--vr-ctrl-h) + var(--vr-gap-btm) + 12px);
  padding-top: 20px;
}

/* ── Page images: height-first sizing on desktop ── */
.spread__page {
  display: block;
  height: min(
    calc(100vh - var(--vr-bar-h) - var(--vr-ctrl-h) - var(--vr-gap-btm) - 52px),
    820px
  );
  width: auto;
  aspect-ratio: 612 / 792;
  object-fit: contain;
  background: var(--vr-white);
  flex: 0 0 auto;
}

/* BQA5: Page shadows — use explicit left/right classes set by JS render()
   so selectors reliably target the visible pair, not DOM first/last-child.
   :first-child/:last-child are unreliable because all 9 imgs share one container. */
.spread__page--left  { box-shadow:  4px 0 18px rgba(0,0,0,.11); }
.spread__page--right { box-shadow: -4px 0 18px rgba(0,0,0,.11); }
.spread--single .spread__page { box-shadow: 0 4px 28px rgba(0,0,0,.14); }

/* BQA5-R1: Magazine gutter — recessed fold shadow overlaid on the real
   page joint. position:absolute removes the spine from flex layout entirely
   so the two page imgs abut with zero gap. The gradient is centered on the
   actual joint (left:50%; transform:translateX(-50%)) and fades gracefully
   into each inner page edge. z-index:1 keeps it above the page imgs.
   pointer-events:none so click-to-select-page passes through. */
.spread__spine {
  /* BQA5-R1: out-of-flow overlay — zero flex layout contribution */
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  height: 100%;
  width: 28px;
  z-index: 1;
  display: none;
  pointer-events: none;
  /* horizontal gradient: transparent at outer edges → shadow at fold center */
  background: linear-gradient(90deg,
    rgba(0,0,0,.00)  0%,
    rgba(0,0,0,.08) 25%,
    rgba(0,0,0,.13) 50%,
    rgba(0,0,0,.08) 75%,
    rgba(0,0,0,.00) 100%);
  /* Vertical fade: avoids hard line at top/bottom of pages */
  -webkit-mask-image: linear-gradient(180deg,
    transparent 0%, rgba(0,0,0,1) 6%, rgba(0,0,0,1) 94%, transparent 100%);
  mask-image: linear-gradient(180deg,
    transparent 0%, rgba(0,0,0,1) 6%, rgba(0,0,0,1) 94%, transparent 100%);
}
.spread--double .spread__spine { display: block; }

/* ══════════════════════════════════════════════════════════════════════════
   MOBILE page sizing
   FIT (default): page fills comfortable reading width, top-aligned under bar.
   ZOOM (JS class .zoom-active on reading-field): spread is physically enlarged;
     reading-field overflow:auto provides pan to all four corners.
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 750px) {
  /* A1-01: top-align padding replaces vertical centring */
  .spread {
    padding-top: 14px;
    padding-bottom: 0; /* controls float fixed — no padding needed */
    padding-left: 12px;
    padding-right: 12px;
  }

  /* FIT mode: width-driven so page fills horizontally without overlapping controls */
  .spread__page {
    height: auto;
    width: min(calc(100vw - 24px), 400px);
    max-height: calc(100vh - var(--vr-bar-h) - var(--vr-ctrl-h) - var(--vr-gap-btm) - 42px);
    object-fit: contain;
  }

  /* BQA3 ZOOM mode: JS drives all sizing; remove CSS constraints */
  .vr-reading-field.zoom-active .spread {
    padding: 14px 12px 0;
  }
  .vr-reading-field.zoom-active .spread__page {
    max-height: none;
    max-width: none;
    height: auto;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   CONTROLS — single floating pill, fixed bottom-centre
   ══════════════════════════════════════════════════════════════════════════ */
.vr-controls {
  position: fixed;
  bottom: var(--vr-gap-btm);
  left: 50%;
  transform: translateX(-50%);
  height: var(--vr-ctrl-h);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0,0,0,.09);
  box-shadow: 0 2px 16px rgba(0,0,0,.10);
  display: flex; align-items: center;
  padding: 0 6px;
  z-index: 100;
  max-width: calc(100vw - 32px);
  border-radius: 4px;
}

.vr-ctrl-btn {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: none; background: none; cursor: pointer;
  color: var(--vr-black); border-radius: 3px;
  font-family: inherit; flex-shrink: 0;
}
.vr-ctrl-btn:hover { background: rgba(0,0,0,.05); }
.vr-ctrl-btn:disabled { opacity: .3; cursor: default; }
.vr-ctrl-btn svg { pointer-events: none; }

.vr-ctrl-divider {
  width: 1px; height: 24px; background: var(--vr-gray-e);
  flex-shrink: 0; margin: 0 2px;
}

.vr-ctrl-position {
  font-size: .75rem; font-weight: 600; color: var(--vr-gray-6);
  white-space: nowrap; padding: 0 12px;
  letter-spacing: .01em; min-width: 108px; text-align: center;
}

/* Go-to-page jump — desktop only */
.vr-ctrl-jump {
  display: flex; align-items: center; gap: 5px;
  padding: 0 8px 0 4px;
}
.vr-ctrl-jump label {
  font-size: .72rem; color: var(--vr-gray-6); white-space: nowrap;
}
.vr-ctrl-jump input {
  width: 42px; padding: 5px 4px;
  border: 1px solid #ccc; font: inherit; font-size: .75rem;
  text-align: center; border-radius: 2px; background: var(--vr-white);
}
.vr-ctrl-jump input:focus-visible {
  outline: 2px solid var(--vr-indigo); outline-offset: 0; border-color: var(--vr-indigo);
}
.vr-go-btn {
  font-size: .72rem; font-weight: 700; color: var(--vr-indigo);
  background: none; border: none; cursor: pointer;
  padding: 4px; font-family: inherit; border-radius: 2px;
}
.vr-go-btn:hover { text-decoration: underline; }

/* Zoom out / Zoom in buttons — BQA2: two bounded controls */
.vr-ctrl-zoom-out,
.vr-ctrl-zoom-in {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 40px;
  border: none; background: none; cursor: pointer;
  color: var(--vr-gray-6); border-radius: 3px; font-family: inherit;
  flex-shrink: 0;
}
.vr-ctrl-zoom-out:hover:not(:disabled),
.vr-ctrl-zoom-in:hover:not(:disabled)  { color: var(--vr-black); background: rgba(0,0,0,.05); }
.vr-ctrl-zoom-out:disabled,
.vr-ctrl-zoom-in:disabled  { opacity: .3; cursor: default; }
.vr-ctrl-zoom-out svg,
.vr-ctrl-zoom-in svg       { pointer-events: none; flex-shrink: 0; }

/* Scale readout between the two zoom buttons */
.vr-zoom-label {
  font-size: .68rem; font-weight: 600; color: var(--vr-gray-6);
  white-space: nowrap; min-width: 30px; text-align: center;
  letter-spacing: .01em; flex-shrink: 0; line-height: 1;
  padding: 0 1px;
}

/* Info button */
.vr-ctrl-info-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: none; background: none; cursor: pointer;
  color: var(--vr-gray-6); border-radius: 3px;
  font-family: inherit; flex-shrink: 0;
}
.vr-ctrl-info-btn:hover { color: var(--vr-black); background: rgba(0,0,0,.05); }

/* ══════════════════════════════════════════════════════════════════════════
   INFO PANEL — fixed above controls, aria-modal dialog
   ══════════════════════════════════════════════════════════════════════════ */
.vr-info-panel {
  position: fixed;
  bottom: calc(var(--vr-ctrl-h) + var(--vr-gap-btm) + 12px);
  left: 50%; transform: translateX(-50%);
  background: var(--vr-white);
  border: 1px solid var(--vr-gray-e);
  box-shadow: 0 4px 24px rgba(0,0,0,.14);
  padding: 20px 24px;
  width: min(380px, calc(100vw - 32px));
  z-index: 101; /* above controls at z-index:100 */
  display: none;
  border-radius: 4px;
  position: fixed; /* ensure fixed even if parent context changes */
}
.vr-info-panel.open { display: block; }

.vr-info-panel__title {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--vr-gray-6); margin-bottom: 14px;
}
.vr-info-panel dl {
  display: grid; grid-template-columns: 100px 1fr;
  gap: 7px 12px; font-size: .78rem;
}
.vr-info-panel dt { color: var(--vr-gray-6); font-weight: 600; }
.vr-info-panel dd { color: var(--vr-black); word-break: break-word; margin: 0; }

.vr-sha {
  font-family: ui-monospace, 'Courier New', monospace;
  font-size: .65rem; color: var(--vr-gray-6);
  word-break: break-all; line-height: 1.5;
}
.vr-info-panel__dl-link {
  color: var(--vr-indigo); font-weight: 600; text-decoration: none;
}
.vr-info-panel__dl-link:hover { text-decoration: underline; }

.vr-info-panel__disclaimer {
  font-size: .66rem; color: #999; display: block;
  margin-top: 4px; line-height: 1.45;
}
.vr-info-panel__close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; cursor: pointer;
  color: var(--vr-gray-6); font-size: 1rem; line-height: 1;
  padding: 4px; font-family: inherit; border-radius: 2px;
}
.vr-info-panel__close:hover { color: var(--vr-black); }

/* ── Mobile overrides ── */
@media (max-width: 750px) {
  .vr-body {
    --vr-bar-h:   44px;
    --vr-ctrl-h:  48px;
    --vr-gap-btm: 20px;
  }

  .vr-top-bar { padding: 0 16px; }
  .vr-top-bar__title { font-size: .72rem; }
  .vr-top-bar__dl { display: none; } /* download available in info panel */

  .vr-ctrl-jump { display: none; }
  .vr-ctrl-position { min-width: 84px; padding: 0 8px; }

  /* BQA2: tighter zoom controls on 375px — maintain ≥30px tap targets */
  .vr-ctrl-zoom-out,
  .vr-ctrl-zoom-in  { width: 30px; }
  .vr-zoom-label    { min-width: 28px; font-size: .65rem; }

  /* Safe-area support for notched devices */
  .vr-controls {
    bottom: max(var(--vr-gap-btm), env(safe-area-inset-bottom, var(--vr-gap-btm)));
  }
  .vr-info-panel {
    bottom: calc(
      var(--vr-ctrl-h)
      + max(var(--vr-gap-btm), env(safe-area-inset-bottom, var(--vr-gap-btm)))
      + 12px
    );
    padding: 16px 18px;
  }
  .vr-info-panel dl { grid-template-columns: 84px 1fr; font-size: .74rem; }
  .vr-info-panel__disclaimer { font-size: .65rem; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .vr-body * { transition: none !important; animation: none !important; }
}
