/* ============================================
   Friends Illuminated - Apple-Style CSS
   ============================================ */

/* Font-face declarations with font-display: swap
   Prevents invisible text during font loading (FOIT).
   Google Fonts CDN delivers these via its stylesheet;
   local declarations provide a defense-in-depth fallback. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: local('Inter');
}

@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: local('Playfair Display');
}

@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: local('Playfair Display Italic');
}

/* CSS Custom Properties */
:root {
  /* Colors - Light Mode */
  --color-bg: #F8F6F2;
  --color-bg-secondary: #F0EDE6;
  --color-bg-tertiary: #FFFFFF;
  --color-text: #1D1D1F;
  --color-text-secondary: #6E6E73; /* WCAG 2.5: darkened from #86868B (3.4:1) to ~5.0:1 on #F8F6F2 */
  --color-text-muted: #6E6E73;
  --color-accent: #C9A84C;
  --color-accent-light: #DDC87A;
  --color-accent-dark: #A68A3E;
  --color-link: #0066CC;
  --color-border: rgba(0, 0, 0, 0.1);
  --color-card-bg: rgba(255, 255, 255, 0.8);
  
  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-mono: 'SF Mono', Monaco, monospace;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  --space-xxl: 10rem;
  
  /* Transitions */
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --duration-slow: 500ms;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
  --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.15);
  
  /* Nav height */
  --nav-height: 64px;

  /* Launch announcement bar height */
  --announce-h: 46px;
}

/* Hide announce bar when dismissed */
body.announce-closed { --announce-h: 0px; }
body.announce-closed .announce-bar { display: none; }

/* Dark Mode */
[data-theme="dark"] {
  --color-bg: #000000;
  --color-bg-secondary: #1C1C1E;
  --color-bg-tertiary: #1C1C1E;
  --color-text: #F5F5F7;
  --color-text-secondary: #A1A1A6;
  --color-text-muted: #8E8E93;
  --color-accent: #C9A84C;
  --color-accent-light: #DDC87A;
  --color-accent-dark: #A68A3E;
  --color-border: rgba(255, 255, 255, 0.1);
  --color-card-bg: rgba(28, 28, 30, 0.8);
  
  --glass-bg: rgba(28, 28, 30, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: fixed;
  top: var(--announce-h);
  left: 0;
  right: 0;
  z-index: 2100;
  height: var(--nav-height);
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  transition: all var(--duration-normal) var(--transition-smooth);
}

.nav--scrolled {
  background: rgba(250, 250, 250, 0.95);
}

[data-theme="dark"] .nav--scrolled {
  background: rgba(0, 0, 0, 0.95);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-md);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.nav-logo-img {
  height: 40px;
  width: auto;
}

.nav-logo-text {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Desktop: menu is a sibling of .nav (not a child) so it is
   positioned as a fixed horizontal bar inside the header area. */
.nav-menu {
  display: flex;
  gap: var(--space-md);
  position: fixed;
  top: var(--announce-h);
  left: 50%;
  transform: translateX(-50%);
  height: var(--nav-height);
  align-items: center;
  z-index: 2101;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}

.nav-menu .nav-item,
.nav-menu .nav-link {
  pointer-events: auto;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  padding: 0.5rem 0;
  position: relative;
  transition: color var(--duration-fast);
}

.nav-link:hover,
.nav-link--active {
  color: var(--color-text);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--duration-normal) var(--transition-smooth);
}

.nav-link:hover::after,
.nav-link--active::after {
  width: 100%;
}

/* Theme Toggle */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  transition: background var(--duration-fast);
}

.theme-toggle:hover {
  background: var(--color-bg-secondary);
}

.theme-icon {
  width: 20px;
  height: 20px;
}

.theme-icon--dark {
  display: none;
}

.theme-icon--light {
  display: block;
}

[data-theme="dark"] .theme-icon--dark {
  display: block;
}

[data-theme="dark"] .theme-icon--light {
  display: none;
}

/* Mobile Menu Toggle — hidden on desktop */
.nav-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}

.nav-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: all var(--duration-normal);
}

/* Drawer-only chrome — never show on desktop horizontal nav */
.nav-backdrop,
.nav-menu-label,
.nav-menu-footer {
  display: none;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-height) + var(--space-lg)) var(--space-md) var(--space-xl);
  overflow: hidden;
}

.hero-background {
  position: absolute;
  inset: 0;
  z-index: -1;
}

/* Hero: single-row marquee, warmer overlay */
.hero--covers {
  background: #1A1D1C;
}

.hero-marquee-container {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
  overflow: hidden;
  opacity: 1;
}

.hero-marquee-row {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  animation: marqueeScrollLeft 45s linear infinite;
}

@keyframes marqueeScrollLeft {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Warm vignette overlay */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(20, 22, 21, 0.10) 0%, rgba(20, 22, 21, 0.42) 85%);
  z-index: 1;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 20%, rgba(201, 168, 76, 0.06) 0%, transparent 60%);
  z-index: 1;
  pointer-events: none;
}

/* Hero badge — brass wordmark framed as a mounted plaque */
.hero-badge {
  position: relative;
  z-index: 2;
  margin: 0 auto var(--space-md);
  width: min(86vw, 440px);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(201, 168, 76, 0.35);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  animation: heroLogoFade 1.2s ease-out 0.3s both;
}

/* faint gold inner ring for a framed-sign feel */
.hero-badge::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(201, 168, 76, 0.22);
  border-radius: 9px;
  pointer-events: none;
}

.hero-badge-img {
  display: block;
  width: 100%;
  height: auto;
}

/* Nav logo — brass wordmark plaque (reads on light + dark nav) */
.nav-logo .nav-logo-img {
  height: 56px;
  width: auto;
  border-radius: 8px;
  border: 1px solid rgba(201, 168, 76, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

@keyframes heroLogoFade {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to   { opacity: 1; transform: scale(1)     translateY(0); }
}

/* Hero text group */
.hero-text-group {
  position: relative;
  z-index: 2;
}

.hero-cover {
  flex-shrink: 0;
  width: 200px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.hero-cover img {
  display: block;
  width: 100%;
  height: auto;
}

.hero--covers .hero-content {
  position: relative;
  z-index: 2;
}

.hero--covers .hero-title-main {
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85), 0 2px 30px rgba(0, 0, 0, 0.6);
}

.hero--covers .hero-title-sub {
  color: var(--color-accent-light);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9), 0 1px 12px rgba(0, 0, 0, 0.5);
}

.hero--covers .hero-description {
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85), 0 1px 10px rgba(0, 0, 0, 0.4);
}

.hero--covers .hero-scroll-indicator .scroll-mouse {
  border-color: rgba(255, 255, 255, 0.3);
}

.hero--covers .hero-scroll-indicator .scroll-wheel {
  background: rgba(255, 255, 255, 0.3);
}

.button--secondary-light {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.button--secondary-light:hover {
  background: rgba(255, 255, 255, 0.2);
}

.hero-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  margin-bottom: var(--space-sm);
}

.hero-title-main {
  display: block;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--space-xs);
}

.hero-title-sub {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 400;
  font-style: italic;
  color: var(--color-accent);
  letter-spacing: -0.01em;
}

.hero-description {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-md);
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

/* In-hero research portal CTA ("Ask the Library") */
.hero-research {
  position: relative;
  z-index: 2;
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}

.hero-research::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(280px, 60%);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.55), transparent);
}

.hero-research-eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent-light);
  background: rgba(201, 168, 76, 0.10);
  border: 1px solid rgba(201, 168, 76, 0.32);
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.hero-research-button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.9rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: #1A1D1C;
  background: linear-gradient(135deg, var(--color-accent-light) 0%, var(--color-accent) 55%, var(--color-accent-dark) 100%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  box-shadow:
    0 8px 28px rgba(201, 168, 76, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform var(--duration-normal) var(--transition-smooth),
              box-shadow var(--duration-normal) var(--transition-smooth);
  animation: heroResearchPulse 3.2s ease-in-out infinite;
}

.hero-research-button:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 40px rgba(201, 168, 76, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.hero-research-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

@keyframes heroResearchPulse {
  0%, 100% { box-shadow: 0 8px 28px rgba(201, 168, 76, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
  50%      { box-shadow: 0 10px 36px rgba(201, 168, 76, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
}

.hero-research-note {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

@media (prefers-reduced-motion: reduce) {
  .hero-research-button { animation: none; }
}

.hero-scroll-indicator {
  position: absolute;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
}

.scroll-mouse {
  width: 24px;
  height: 40px;
  border: 2px solid var(--color-text-secondary);
  border-radius: 12px;
  position: relative;
}

.scroll-wheel {
  width: 4px;
  height: 8px;
  background: var(--color-text-secondary);
  border-radius: 2px;
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollWheel 2s ease-in-out infinite;
}

@keyframes scrollWheel {
  0%, 100% { opacity: 1; transform: translateX(-50%) translateY(0); }
  50% { opacity: 0.5; transform: translateX(-50%) translateY(8px); }
}

/* ============================================
   BUTTONS
   ============================================ */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 2rem;
  transition: all var(--duration-fast);
  white-space: nowrap;
}

.button--primary {
  background: var(--color-accent);
  color: #000;
}

.button--primary:hover {
  background: var(--color-accent-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
}

.button--secondary {
  background: rgba(0, 0, 0, 0.05);
  color: var(--color-text);
}

[data-theme="dark"] .button--secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text);
}

.button--secondary:hover {
  background: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .button--secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.button--ghost {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.button--ghost:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.button--large {
  padding: 1rem 2rem;
  font-size: 1rem;
}

.button--small {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

.button--glow {
  position: relative;
  overflow: visible;
}

.button--glow::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(45deg, var(--color-accent), transparent, var(--color-accent));
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity var(--duration-normal);
  filter: blur(8px);
}

.button--glow:hover::before {
  opacity: 0.5;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
  padding: var(--space-xl) var(--space-md);
}

.section--dark {
  background: var(--color-bg-secondary);
}

.section--gradient {
  background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-secondary) 100%);
}

.section-container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.section-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xs);
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
}

.section-cta {
  text-align: center;
  margin-top: var(--space-lg);
}

/* ============================================
   FEATURED AUTHORS CAROUSEL
   ============================================ */
.featured-authors {
  padding: var(--space-xxl) var(--space-md);
}

.featured-carousel {
  position: relative;
}

.featured-track {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: var(--space-md);
}

.featured-track::-webkit-scrollbar {
  display: none;
}

.featured-card {
  flex: 0 0 100%;
  max-width: 900px;
  margin: 0 auto;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  scroll-snap-align: center;
}

.featured-card-visual {
  position: relative;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.featured-card-image-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.featured-card-image {
  max-height: 350px;
  width: auto;
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

.featured-card-image--book {
  max-height: 380px;
}

.featured-glass {
  position: absolute;
  bottom: var(--space-sm);
  left: var(--space-sm);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  border: 1px solid var(--glass-border);
}

.featured-glass-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text);
}

.featured-card-content {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-card-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.featured-card-years {
  font-size: 0.875rem;
  color: var(--color-accent);
  font-weight: 500;
  margin-bottom: var(--space-sm);
}

.featured-card-bio {
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-md);
}

.featured-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-link);
  font-weight: 500;
  transition: gap var(--duration-fast);
}

.featured-card-link:hover {
  gap: 0.75rem;
}

.featured-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.featured-nav-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast);
}

.featured-nav-btn:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #000;
}

.featured-nav-btn svg {
  width: 20px;
  height: 20px;
}

.featured-dots {
  display: flex;
  gap: 0.5rem;
}

.featured-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-border);
  transition: all var(--duration-fast);
  cursor: pointer;
  position: relative;
}

.featured-dot::before {
  content: '';
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  min-width: 24px;
  min-height: 24px;
}

.featured-dot--active {
  background: var(--color-accent);
  width: 28px;
  border-radius: 6px;
}

/* ============================================
   BOOKS GRID
   ============================================ */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.book-card {
  background: var(--color-bg-tertiary);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--duration-normal), box-shadow var(--duration-normal);
}

.book-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-card);
}

.book-card--featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1.5fr;
}

.book-card-cover {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.book-card-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.book-card--featured .book-card-cover {
  aspect-ratio: auto;
  min-height: 400px;
}

.book-card-badge {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  background: var(--color-accent);
  color: #000;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
}

.book-card-content {
  padding: var(--space-md);
}

.book-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.book-card-author {
  font-size: 0.875rem;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}

.book-card-description {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-sm);
}

.book-card-meta {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.book-card-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
}

.book-card-actions {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

/* Quality Promise Section */
.quality-promise {
  padding: var(--space-xxl) var(--space-md);
}

.quality-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: center;
}

.quality-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
  display: block;
}

.quality-title {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: var(--space-sm);
  line-height: 1.2;
}

.quality-description {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
  line-height: 1.7;
}

.quality-features {
  margin-bottom: var(--space-md);
}

.quality-feature {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
  font-size: 0.95rem;
}

.quality-feature-icon {
  color: var(--color-accent);
  font-weight: 700;
}

.quality-visual {
  perspective: 1000px;
}

.quality-book-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border-radius: 12px;
  display: flex;
  padding: var(--space-sm);
  gap: var(--space-xs);
  transform-style: preserve-3d;
  transform: rotateY(-15deg);
  transition: transform var(--duration-slow);
}

.quality-book-preview:hover {
  transform: rotateY(0deg);
}

.quality-book-spine {
  width: 8px;
  background: linear-gradient(90deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
  border-radius: 4px 0 0 4px;
}

.quality-page {
  flex: 1;
  background: #f5f0e6;
  border-radius: 0 4px 4px 0;
  padding: var(--space-sm);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.quality-page-original,
.quality-page-modern {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.quality-page-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--color-accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
  flex-shrink: 0;
}

.quality-page-text {
  flex: 1;
  overflow: hidden;
  font-family: var(--font-serif);
  font-size: 0.8rem;
  line-height: 1.6;
  color: #333;
}

.quality-page-text--old {
  font-size: 0.75rem;
  letter-spacing: -0.02em;
}

.quality-page-text--new {
  font-size: 0.8rem;
}

.quality-page-cite {
  display: block;
  font-size: 0.65rem;
  color: var(--color-accent-dark);
  font-style: normal;
  padding-top: 0.35rem;
  margin-top: auto;
  flex-shrink: 0;
  border-top: 1px solid rgba(0,0,0,0.08);
}

/* ============================================
   FOOTER
   ============================================ */
/* Book texture always shows in light AND dark. Old lighten blend mode
   washed the dark plate photo out in light theme. Stacked gradients
   keep books visible while preserving contrast for cream text. */
.footer {
  position: relative;
  overflow: hidden;
  color: #F5F3EE;
  padding: var(--space-xl) var(--space-md) var(--space-md);
  background-color: #0a1628;
  background-image:
    linear-gradient(180deg, rgba(10, 22, 40, 0.62) 0%, rgba(10, 22, 40, 0.82) 100%),
    url('/images/branding/footer-bg.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

html[data-theme="dark"] .footer {
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.42) 0%, rgba(0, 0, 0, 0.72) 100%),
    url('/images/branding/footer-bg.webp');
}

.footer-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: var(--space-lg);
  align-items: start;
  margin-bottom: var(--space-lg);
}

.footer-brand {
  max-width: 300px;
}

.footer-logo {
  width: 200px;
  height: auto;
  margin-bottom: var(--space-sm);
  border-radius: 10px;
  border: 1px solid rgba(201, 168, 76, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.footer-tagline {
  color: rgba(245, 243, 238, 0.72);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
  justify-content: flex-end;
  grid-column: -2 / -1;
}

.footer-heading {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--space-sm);
  color: #C9A84C;
}

.footer-column ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-column li {
  margin-bottom: 0.45rem;
}

.footer-column a {
  color: rgba(245, 243, 238, 0.86);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--duration-fast), border-color var(--duration-fast), background var(--duration-fast);
}

.footer-column a:hover,
.footer-column a:focus-visible {
  color: #C9A84C;
  border-bottom-color: rgba(201, 168, 76, 0.55);
  outline: none;
}

.footer-creator {
  color: rgba(245, 243, 238, 0.9);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.footer-creator-detail {
  color: rgba(245, 243, 238, 0.62);
  font-size: 0.825rem;
  margin-bottom: 0.25rem;
}

.footer-creator-detail a {
  color: rgba(245, 243, 238, 0.78);
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 168, 76, 0.35);
  transition: color var(--duration-fast), border-color var(--duration-fast);
}

.footer-creator-detail a:hover,
.footer-creator-detail a:focus-visible {
  color: #C9A84C;
  border-bottom-color: #C9A84C;
  outline: none;
}

/* Footer Subscribe — middle column between logo and links */
.footer-subscribe {
  align-self: center;
  position: relative;
  z-index: 1;
}

.footer-subscribe-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(245, 243, 238, 0.7);
  margin-bottom: 0.5rem;
}

.footer-subscribe-form {
  margin: 0;
}

.footer-subscribe-group {
  display: flex;
  gap: 0.5rem;
  max-width: 400px;
}

.footer-subscribe-input {
  flex: 1;
  padding: 0.55rem 1rem;
  border: 1px solid rgba(201, 168, 76, 0.28);
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.08);
  color: #F5F3EE;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--duration-fast), background var(--duration-fast);
}

.footer-subscribe-input:focus {
  border-color: #C9A84C;
  background: rgba(255, 255, 255, 0.12);
}

.footer-subscribe-input::placeholder {
  color: rgba(245, 243, 238, 0.5);
}

.footer-subscribe-btn {
  border-radius: 50px;
  padding: 0.55rem 1.2rem;
  white-space: nowrap;
  font-size: 0.85rem;
}

.footer-subscribe-disclaimer {
  font-size: 0.75rem;
  color: rgba(245, 243, 238, 0.55);
  margin-top: 0.35rem;
}

@media (max-width: 480px) {
  .footer-subscribe-group {
    flex-direction: column;
  }
  .footer-subscribe-btn {
    width: 100%;
  }
}

.footer-bottom {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding-top: var(--space-md);
  border-top: 1px solid rgba(201, 168, 76, 0.22);
  text-align: center;
  color: rgba(245, 243, 238, 0.55);
  font-size: 0.8rem;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  justify-content: center;
  align-items: center;
  margin-top: 0.65rem;
}

.footer-legal a {
  color: rgba(245, 243, 238, 0.78);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 168, 76, 0.28);
  transition: color var(--duration-fast), border-color var(--duration-fast);
}

.footer-legal a:hover,
.footer-legal a:focus-visible {
  color: #C9A84C;
  border-bottom-color: #C9A84C;
  outline: none;
}

/* Mobile footer: make Explore/Learn links look tappable (chips) */
@media (max-width: 768px) {
  .footer {
    padding: 2.5rem 1rem 1.5rem;
  }

  .footer-container {
    gap: 1.75rem;
  }

  .footer-logo {
    width: 168px;
    margin-left: auto;
    margin-right: auto;
  }

  .footer-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.35rem;
    width: 100%;
    justify-content: stretch;
  }

  .footer-column {
    text-align: left;
  }

  .footer-heading {
    margin-bottom: 0.7rem;
    padding-left: 0.15rem;
  }

  .footer-column ul {
    display: grid;
    gap: 0.45rem;
  }

  .footer-column li {
    margin: 0;
  }

  .footer-column a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 0.75rem 0.95rem;
    border-radius: 12px;
    border: 1px solid rgba(201, 168, 76, 0.28);
    border-bottom: 1px solid rgba(201, 168, 76, 0.28);
    background: rgba(255, 255, 255, 0.06);
    color: #F5F3EE;
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  }

  .footer-column a::after {
    content: '→';
    color: #C9A84C;
    font-weight: 600;
    opacity: 0.9;
  }

  .footer-column a:hover,
  .footer-column a:focus-visible,
  .footer-column a:active {
    background: rgba(201, 168, 76, 0.16);
    border-color: rgba(201, 168, 76, 0.55);
    color: #FFFFFF;
  }

  /* Created By column stays text-like, not navigation chips */
  .footer-column:last-child {
    text-align: center;
    padding: 0.85rem 0.75rem 0.25rem;
    border-top: 1px solid rgba(201, 168, 76, 0.18);
  }

  .footer-column:last-child .footer-heading {
    text-align: center;
    padding-left: 0;
  }

  .footer-column:last-child a {
    display: inline;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    border-bottom: 1px solid rgba(201, 168, 76, 0.4);
    background: transparent;
    box-shadow: none;
    color: rgba(245, 243, 238, 0.86);
    font-size: 0.9rem;
    font-weight: 500;
  }

  .footer-column:last-child a::after {
    content: none;
  }

  .footer-column:last-child a:hover,
  .footer-column:last-child a:focus-visible,
  .footer-column:last-child a:active {
    background: transparent;
    border-color: transparent;
    border-bottom-color: #C9A84C;
    color: #C9A84C;
  }

  .footer-legal {
    gap: 0.55rem 0.75rem;
  }

  .footer-legal a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(201, 168, 76, 0.28);
    border-bottom: 1px solid rgba(201, 168, 76, 0.28);
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
  }
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */
[data-scroll-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-slow) var(--transition-smooth),
              transform var(--duration-slow) var(--transition-smooth);
}

[data-scroll-animate].animate-in {
  opacity: 1;
  transform: translateY(0);
}

[data-scroll-animate].animate-out {
  opacity: 0;
  transform: translateY(-20px);
}

/* Stagger delays */
[data-scroll-animate]:nth-child(1) { transition-delay: 0ms; }
[data-scroll-animate]:nth-child(2) { transition-delay: 100ms; }
[data-scroll-animate]:nth-child(3) { transition-delay: 200ms; }
[data-scroll-animate]:nth-child(4) { transition-delay: 300ms; }
[data-scroll-animate]:nth-child(5) { transition-delay: 400ms; }

/* ============================================
   PAGE HERO
   ============================================ */
.page-hero {
  padding: calc(var(--nav-height) + var(--space-xl)) var(--space-md) var(--space-xl);
  text-align: center;
  background: var(--color-bg);
}

/* Video hero variant — full-bleed background */
.page-hero.page-hero--video {
  position: relative;
  overflow: hidden;
  min-height: 50vh;
  padding: calc(var(--nav-height) + var(--space-xl)) var(--space-md) var(--space-xl);
  background: #0c0c0c;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-hero--video .page-hero-poster,
.page-hero--video .page-hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* Poster is the base layer (LCP element + mobile hero); the video, when it
   loads on desktop, sits on top of it. */
.page-hero--video .page-hero-poster {
  z-index: 0;
}

.page-hero--video .page-hero-video {
  z-index: 0;
}

.page-hero--video .page-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.7) 100%);
  z-index: 1;
}

.page-hero--video .page-hero-content {
  position: relative;
  z-index: 2;
}

.page-hero--video .page-hero-title {
  color: #fff;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.6);
}

.page-hero--video .page-hero-description {
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}

.page-hero--books {
  background: linear-gradient(180deg, var(--color-bg-secondary) 0%, var(--color-bg) 100%);
}

.shop-coming-soon-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: linear-gradient(90deg, #c9a84c 0%, #b8932e 100%);
  color: #1a1410;
  padding: 0.9rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.shop-coming-soon-banner svg { flex-shrink: 0; }
.shop-coming-soon-banner strong { font-weight: 700; }
@media (max-width: 640px) {
  .shop-coming-soon-banner { font-size: 0.85rem; padding: 0.75rem 1rem; }
}

.page-hero--authors {
  background: linear-gradient(180deg, var(--color-bg-secondary) 0%, var(--color-bg) 100%);
}

.page-hero--timeline {
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.1) 0%, var(--color-bg) 100%);
}

.page-hero--relationships {
  background: linear-gradient(180deg, var(--color-bg-secondary) 0%, var(--color-bg) 100%);
}

.page-hero--history {
  background: linear-gradient(180deg, rgba(139, 115, 85, 0.1) 0%, var(--color-bg) 100%);
}

.page-hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}

.page-hero-description {
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  max-width: 700px;
  margin: 0 auto;
}

/* ============================================
   TIMELINE MINI
   ============================================ */
.timeline-mini {
  position: relative;
  padding: var(--space-md) 0;
}

.timeline-mini-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--color-accent) 30%, var(--color-accent) 70%, transparent 100%);
}

.timeline-mini-events {
  display: flex;
  justify-content: space-between;
  position: relative;
}

.timeline-mini-event {
  text-align: center;
  background: var(--color-bg);
  padding: 0 var(--space-xs);
}

.timeline-mini-year {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 0.25rem;
}

.timeline-mini-label {
  display: block;
  font-size: 0.875rem;
  color: var(--color-text);
}

/* ============================================
   NEWSLETTER
   ============================================ */
.newsletter {
  text-align: center;
  padding: var(--space-xxl) var(--space-md);
}

.newsletter-content {
  max-width: 500px;
  margin: 0 auto;
}

.newsletter-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.newsletter-description {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

.newsletter-input-group {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-xs);
}

.newsletter-input {
  flex: 1;
  padding: 1rem 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: 2rem;
  background: var(--color-bg-tertiary);
  color: var(--color-text);
  font-size: 1rem;
  transition: border-color var(--duration-fast);
}

.newsletter-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.newsletter-disclaimer {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .featured-card {
    grid-template-columns: 1fr;
  }
  
  .featured-card-content {
    padding: var(--space-md);
  }
  
  .quality-grid {
    grid-template-columns: 1fr;
  }
  
  .quality-visual {
    order: -1;
  }
  
  .book-card--featured {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  /* Kill the dead full-height void; let the hero size to its content */
  .hero {
    min-height: auto;
    padding-top: calc(var(--nav-height) + 2rem);
    padding-bottom: 3rem;
  }

  .hero-badge {
    width: min(82vw, 360px);
    margin-bottom: var(--space-sm);
  }

  .hero-cover {
    width: 140px;
  }

  .hero-marquee-container {
    gap: 1rem;
  }

  .hero-marquee-row {
    gap: 1rem;
  }

  /* ---- Mobile nav drawer (FI branded) ----
     Drawer/backdrop are siblings of .nav (not descendants), so they cannot be
     clipped by .nav's height. Also kill backdrop-filter on mobile: it creates a
     containing block that traps fixed descendants on iOS/Safari. */
  .nav {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    overflow: visible;
    z-index: 2100;
  }

  body.nav-open {
    overflow: hidden;
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    top: calc(var(--announce-h) + var(--nav-height));
    z-index: 1990;
    background: rgba(10, 16, 28, 0.55);
    opacity: 0;
    transition: opacity var(--duration-normal) var(--transition-smooth);
    -webkit-tap-highlight-color: transparent;
  }

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

  .nav-backdrop--visible {
    opacity: 1;
  }

  .nav-menu {
    display: flex;
    position: fixed;
    top: calc(var(--announce-h) + var(--nav-height));
    right: 0;
    bottom: 0;
    left: auto;
    width: min(86vw, 340px);
    max-width: 340px;
    max-height: none;
    height: auto;
    margin: 0;
    padding: 1.25rem 1.25rem 2rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    background: #0a1628; /* FI navy */
    background-image:
      linear-gradient(180deg, rgba(201, 168, 76, 0.08) 0%, transparent 28%),
      radial-gradient(ellipse at top right, rgba(201, 168, 76, 0.12), transparent 55%);
    border-left: 1px solid rgba(201, 168, 76, 0.28);
    box-shadow: -16px 0 48px rgba(0, 0, 0, 0.45);
    z-index: 2000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(105%);
    visibility: hidden;
    pointer-events: auto;
    transition:
      transform var(--duration-normal) var(--transition-smooth),
      visibility 0s linear var(--duration-normal);
  }

  .nav-menu--open {
    transform: translateX(0);
    visibility: visible;
    transition:
      transform var(--duration-normal) var(--transition-smooth),
      visibility 0s linear 0s;
  }

  .nav-menu-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #C9A84C;
    padding: 0.25rem 0.85rem 0.75rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid rgba(201, 168, 76, 0.22);
  }

  .nav-item {
    list-style: none;
  }

  .nav-menu .nav-link {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0.7rem 0.85rem;
    margin: 0;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: #F5F3EE;
    background: transparent;
    transition: background var(--duration-fast), color var(--duration-fast);
  }

  .nav-menu .nav-link::after {
    display: none; /* underline accent is desktop-only */
  }

  .nav-menu .nav-link:hover,
  .nav-menu .nav-link:focus-visible {
    background: rgba(201, 168, 76, 0.14);
    color: #FFFFFF;
    outline: none;
  }

  .nav-menu .nav-link--active {
    background: rgba(201, 168, 76, 0.18);
    color: #C9A84C;
    font-weight: 600;
  }

  .nav-menu-footer {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    list-style: none;
    margin-top: auto;
    padding: 1.25rem 0.85rem 0.25rem;
    border-top: 1px solid rgba(201, 168, 76, 0.22);
  }

  .nav-menu-footer-mark {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #C9A84C;
  }

  .nav-menu-footer-tag {
    font-size: 0.75rem;
    color: rgba(245, 243, 238, 0.62);
  }

  .nav-menu-toggle {
    display: flex;
    position: relative;
    z-index: 2102;
  }

  /* Hamburger → X when open */
  .nav-menu-toggle span {
    background: var(--color-text);
    transition: transform var(--duration-normal) var(--transition-smooth),
                opacity var(--duration-fast);
  }

  .nav-menu-toggle--open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .nav-menu-toggle--open span:nth-child(2) {
    opacity: 0;
  }

  .nav-menu-toggle--open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
  
  .nav-container {
    padding: 0 var(--space-sm);
  }
  
  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  /* footer-links layout is owned by the mobile chip block above */

  .footer-subscribe-group {
    max-width: 100%;
  }
  
  .hero-cta {
    flex-direction: column;
    align-items: center;
  }
  
  .books-grid {
    grid-template-columns: 1fr;
  }
  
  .newsletter-input-group {
    flex-direction: column;
  }
}

/* ============================================
   FOR WHOM (NEW: audience anchor section)
   ============================================ */
.for-whom {
  background: var(--color-bg);
  padding: var(--space-xl) 0;
}

.for-whom-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.for-whom-card {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: var(--space-md);
  text-align: center;
  transition: transform var(--duration-normal) var(--transition-smooth),
              box-shadow var(--duration-normal) var(--transition-smooth);
}

.for-whom-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(201, 168, 76, 0.08), var(--shadow-lg);
}

.for-whom-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-sm);
  color: var(--color-accent);
}

.for-whom-icon svg {
  width: 100%;
  height: 100%;
}

.for-whom-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.for-whom-text {
  font-size: 0.925rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

@media (max-width: 768px) {
  .for-whom-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   COLLECTION DEPTH (NEW: mosaic + stats)
   ============================================ */
.collection-depth {
  background: linear-gradient(180deg, #161918 0%, #1A1D1C 100%);
  padding: var(--space-xl) 0;
}

.collection-mosaic {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: var(--space-lg) 0;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}

.collection-mosaic-row {
  display: flex;
  gap: 0.75rem;
  width: max-content;
  animation: mosaicScroll 50s linear infinite;
}

.collection-mosaic-row--2 {
  animation-direction: reverse;
  animation-duration: 55s;
}

.collection-mosaic-row img {
  width: 120px;
  height: 168px;
  object-fit: cover;
  border-radius: 6px;
  opacity: 0.7;
  transition: opacity var(--duration-normal);
}

.collection-mosaic-row img:hover {
  opacity: 1;
}

@keyframes mosaicScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.collection-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  margin: var(--space-lg) 0;
}

.collection-stat {
  text-align: center;
}

.collection-stat-number {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
}

.collection-stat-label {
  display: block;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: var(--space-xs);
}

@media (max-width: 600px) {
  .collection-stats {
    flex-direction: column;
    gap: var(--space-md);
  }
  .collection-mosaic-row img {
    width: 90px;
    height: 126px;
  }
}

/* ============================================
   RESEARCH PORTAL INVITATION (home page)
   ============================================ */
.research-invite {
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(201, 168, 76, 0.10) 0%, transparent 60%),
    var(--color-bg-secondary);
}
.research-invite-card {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
  padding: var(--space-md) var(--space-sm);
  border: 1px solid rgba(201, 168, 76, 0.28);
  border-radius: 20px;
  background: var(--color-card-bg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  position: relative;
  overflow: hidden;
}
.research-invite-card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 20px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(221,200,122,0.5), rgba(201,168,76,0) 45%, rgba(201,168,76,0.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.research-invite-eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}
.research-invite-title {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-sm);
  color: var(--color-text);
}
.research-invite-lead {
  font-size: 1.06rem;
  line-height: 1.65;
  color: var(--color-text-secondary);
  max-width: 60ch;
  margin: 0 auto var(--space-md);
}
.research-invite-examples {
  list-style: none;
  padding: 0;
  margin: 0 auto var(--space-md);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  max-width: 640px;
}
.research-invite-examples li {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--color-text-muted);
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}
.research-invite-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.research-invite-note {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}
@media (max-width: 768px) {
  .research-invite-card { padding: var(--space-md) 1.1rem; border-radius: 16px; }
  .research-invite-examples li { font-size: 0.85rem; }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== SHOP PAGE ===== */
.shop-section { padding-top: var(--space-xl); }

.shop-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xxl);
}
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg-tertiary);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
  box-shadow: var(--shadow-md);
}
.trust-badge svg { color: var(--color-accent); flex-shrink: 0; }

.shop-category { margin-bottom: var(--space-xxl); }
.shop-category-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}
.shop-category-title {
  font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}
.shop-category-title::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin: 0.75rem auto 0;
  background: var(--color-accent);
  border-radius: 2px;
}
.shop-category-desc {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

/* Make book cards equal-height with the footer pinned to the bottom */
.shop-category .book-card { display: flex; flex-direction: column; }
.shop-category .book-card-content { display: flex; flex-direction: column; flex: 1; }
.book-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-top: auto;
  padding-top: var(--space-sm);
}
.book-card-footer .book-card-price { font-size: 1.15rem; }
/* Shop-card pills — mirror the product-page look (Download Sample + Free Original) */
.book-card-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}
.book-card-sample-pill {
  display: inline-block;
  padding: 0.5rem 1.1rem;
  border: 1.5px solid var(--color-border, #d2d2d7);
  color: var(--color-text, #1d1d1f);
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 980px;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}
.book-card-sample-pill:hover {
  background: var(--color-bg-secondary, #f5f5f7);
  border-color: var(--color-text-secondary, #6e6e73);
}
.book-card-free-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1.1rem;
  border: 1.5px solid var(--color-accent, #c9a84c);
  border-radius: 980px;
  text-decoration: none;
  line-height: 1;
  transition: background 0.2s, transform 0.2s;
}
.book-card-free-pill:hover {
  background: rgba(201, 168, 76, 0.12);
  transform: scale(1.02);
}
.book-card-free-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-accent, #c9a84c);
}
.book-card-free-src {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--color-text-secondary, #6e6e73);
  padding-left: 0.45rem;
  border-left: 1px solid var(--color-border, rgba(0, 0, 0, 0.14));
}
.book-card-title a { color: inherit; text-decoration: none; }
.book-card-title a:hover { color: var(--color-accent); }

/* ── Reading time on a book card ──────────────────────────────────────────
   Sits beneath the pill row above, and uses only tokens already defined in
   this file: no new colours, no new fonts, no new spacing values.

   Deliberately quiet. This is a browse surface, so the line is the smallest
   type on the card, in the muted text token, with no border, no background and
   no interaction. It must lose every contest with the price and the Buy button.

   tabular-nums is the one non-obvious property and it is the point of the
   feature: it makes the digits align down a column so a shopper can compare
   card against card by eye. Proportional figures would defeat that. Do not
   drop it. */
.book-card-readtime {
  display: flex;
  align-items: center;
  gap: 0.34rem;
  margin-top: var(--space-sm);
  font-size: 0.78rem;
  line-height: 1.2;
  color: var(--color-text-muted, #8e8e93);
  font-variant-numeric: tabular-nums;
}
.book-card-readtime-icon {
  flex: 0 0 auto;
  width: 0.92em;
  height: 0.92em;
  opacity: 0.75;
}

/* FAQ */
.shop-faq {
  max-width: 900px;
  margin: var(--space-xxl) auto 0;
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
}
.shop-faq-title {
  font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600;
  text-align: center;
  margin-bottom: var(--space-lg);
  color: var(--color-text);
}
.shop-faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-md);
}
.shop-faq-item {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: var(--space-md);
}
.shop-faq-item h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--color-text);
}
.shop-faq-item p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

@media (max-width: 640px) {
  .shop-trust { gap: var(--space-sm); }
  .trust-badge { font-size: 0.78rem; padding: 0.5rem 0.85rem; }
}

/* ============================================
   LAUNCH ANNOUNCEMENT — "Now Available"
   ============================================ */

/* Site-wide top ribbon */
.announce-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* Must sit ABOVE .nav (2100) — mobile-menu fix raised nav and was covering this ribbon */
  z-index: 2200;
  height: var(--announce-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0 2.6rem 0 1rem;
  background: linear-gradient(100deg, #0a1628 0%, #16243f 45%, #0a1628 100%);
  border-bottom: 1px solid rgba(201, 168, 76, 0.55);
  overflow: hidden;
  box-sizing: border-box;
}
/* Moving gold shine */
.announce-bar::before {
  content: "";
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(221, 200, 122, 0.22), transparent);
  animation: announceShine 5.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes announceShine {
  0% { left: -45%; }
  55%, 100% { left: 130%; }
}
.announce-bar-text {
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #F4ECD6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.announce-bar-text strong {
  color: var(--color-accent-light);
  font-weight: 700;
}
.announce-bar-spark { color: var(--color-accent-light); font-size: 0.9rem; }
.announce-bar-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #0a1628;
  background: linear-gradient(180deg, var(--color-accent-light), var(--color-accent));
  padding: 0.28rem 0.85rem;
  border-radius: 100px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.announce-bar-cta:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(201, 168, 76, 0.4); }
.announce-bar-close {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: rgba(244, 236, 214, 0.65);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: color 0.15s ease, background 0.15s ease;
}
.announce-bar-close:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
@media (max-width: 640px) {
  /* Fixed height must match --announce-h exactly so .nav (top: announce-h) never overlaps */
  :root { --announce-h: 52px; }
  .announce-bar {
    padding: 0 2.2rem 0 0.55rem;
    gap: 0.35rem;
    flex-wrap: nowrap;
    height: var(--announce-h);
    min-height: var(--announce-h);
    max-height: var(--announce-h);
    align-items: center;
  }
  .announce-bar-spark { font-size: 0.75rem; flex-shrink: 0; }
  .announce-bar-text {
    font-size: 0.68rem;
    line-height: 1.25;
    white-space: normal;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1 1 auto;
    min-width: 0;
  }
  /* CTA is full-width in drawer; keep ribbon one clean band on phones */
  .announce-bar-cta { display: none; }
  .announce-bar-close {
    right: 0.4rem;
    width: 28px;
    height: 28px;
    font-size: 1.2rem;
  }
}

/* Big celebratory launch banner (home + shop) */
.launch-banner {
  position: relative;
  overflow: hidden;
  background: linear-gradient(125deg, #0a1628 0%, #1a2c4d 50%, #0a1628 100%);
  border-top: 1px solid rgba(201, 168, 76, 0.4);
  border-bottom: 1px solid rgba(201, 168, 76, 0.4);
  padding: clamp(2.4rem, 6vw, 4rem) var(--space-md);
  text-align: center;
}
.launch-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 50% 0%, rgba(201, 168, 76, 0.16), transparent 70%),
    radial-gradient(circle at 15% 120%, rgba(221, 200, 122, 0.12), transparent 45%);
  pointer-events: none;
}
.launch-banner-inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }
.launch-banner-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #0a1628;
  background: linear-gradient(180deg, var(--color-accent-light), var(--color-accent));
  padding: 0.4rem 1.1rem;
  border-radius: 100px;
  margin-bottom: 1.25rem;
  box-shadow: 0 6px 20px rgba(201, 168, 76, 0.32);
}
.launch-banner-eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #0a1628;
  box-shadow: 0 0 0 0 rgba(10, 22, 40, 0.6);
  animation: launchPulse 1.8s ease-out infinite;
}
@keyframes launchPulse {
  0% { box-shadow: 0 0 0 0 rgba(10, 22, 40, 0.55); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(10, 22, 40, 0); }
}
.launch-banner-title {
  font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 600;
  line-height: 1.12;
  color: #FBF7EC;
  margin: 0 0 0.9rem;
}
.launch-banner-title .gold {
  background: linear-gradient(180deg, var(--color-accent-light), var(--color-accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.launch-banner-desc {
  font-size: clamp(1rem, 2.2vw, 1.18rem);
  line-height: 1.6;
  color: rgba(244, 236, 214, 0.82);
  margin: 0 auto 1.8rem;
  max-width: 600px;
}
.launch-banner-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  justify-content: center;
}
.launch-banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.85rem 1.9rem;
  border-radius: 100px;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.launch-banner-btn--primary {
  color: #0a1628;
  background: linear-gradient(180deg, var(--color-accent-light), var(--color-accent));
  box-shadow: 0 10px 30px rgba(201, 168, 76, 0.35);
}
.launch-banner-btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 38px rgba(201, 168, 76, 0.5); }
.launch-banner-btn--ghost {
  color: #F4ECD6;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(201, 168, 76, 0.5);
}
.launch-banner-btn--ghost:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.12); }
.launch-banner-note {
  margin-top: 1.4rem;
  font-size: 0.84rem;
  color: rgba(244, 236, 214, 0.6);
  letter-spacing: 0.02em;
}
@media (prefers-reduced-motion: reduce) {
  .announce-bar::before, .launch-banner-eyebrow .dot { animation: none; }
}

/* ============================================
   TOUCH TARGETS (WCAG 2.5.8 — min 44x44px)
   Flagged in July 2026 Fable 5 audit (item 9):
   hamburger toggle + carousel dots + small controls.
   Kept scoped so desktop visual layout is unchanged.
   ============================================ */
.nav-menu-toggle {
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.theme-toggle {
  min-width: 44px;
  min-height: 44px;
}
.announce-bar-close {
  min-width: 44px;
  min-height: 44px;
}
/* Nav links, footer links, legal links, buttons: ensure a full 44px
   tap height on touch/coarse-pointer devices without altering the
   desktop look. */
@media (pointer: coarse) {
  .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .button {
    min-height: 44px;
  }
  .footer-links a,
  .footer-legal a,
  .footer-creator-detail a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  /* Carousel dots: keep the 12px visual but guarantee a 44px hit area. */
  .featured-dot::before {
    top: -16px;
    left: -16px;
    right: -16px;
    bottom: -16px;
    min-width: 44px;
    min-height: 44px;
  }
}

/* ===== MOBILE NAV DRAWER FIX (Jul 11 2026) =====
   backdrop-filter on .nav traps position:fixed children into the 64px bar.
   Kill filter on mobile + force full-viewport fixed drawer with high z-index. */
@media (max-width: 768px) {
  body.nav-open {
    overflow: hidden !important;
    touch-action: none;
  }

  .nav {
    z-index: 2100 !important;
    overflow: visible !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(248, 246, 242, 0.98) !important;
  }

  [data-theme="dark"] .nav {
    background: rgba(0, 0, 0, 0.96) !important;
  }

  .nav-backdrop {
    display: block !important;
    position: fixed !important;
    top: calc(var(--announce-h) + var(--nav-height)) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 1990 !important;
    background: rgba(10, 16, 28, 0.62) !important;
    opacity: 0;
    transition: opacity 0.25s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .nav-backdrop[hidden] {
    display: none !important;
  }

  .nav-backdrop.nav-backdrop--visible {
    opacity: 1 !important;
  }

  .nav-menu {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    top: calc(var(--announce-h) + var(--nav-height)) !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: min(88vw, 340px) !important;
    max-width: 340px !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 1.1rem 1.1rem 2rem !important;
    gap: 0.1rem !important;
    background: #0a1628 !important;
    background-image:
      linear-gradient(180deg, rgba(201, 168, 76, 0.10) 0%, transparent 30%),
      radial-gradient(ellipse at top right, rgba(201, 168, 76, 0.14), transparent 55%) !important;
    border-left: 1px solid rgba(201, 168, 76, 0.30) !important;
    box-shadow: -18px 0 50px rgba(0, 0, 0, 0.5) !important;
    z-index: 2000 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    transform: translateX(105%) !important;
    visibility: hidden !important;
    pointer-events: auto !important;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.28s !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .nav-menu.nav-menu--open {
    transform: translateX(0) !important;
    visibility: visible !important;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s !important;
  }

  .nav-menu-label {
    display: block !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.14em !important;
    text-transform: uppercase !important;
    color: #C9A84C !important;
    padding: 0.2rem 0.85rem 0.75rem !important;
    margin-bottom: 0.25rem !important;
    border-bottom: 1px solid rgba(201, 168, 76, 0.22) !important;
  }

  .nav-menu .nav-link {
    display: flex !important;
    align-items: center !important;
    min-height: 48px !important;
    padding: 0.7rem 0.85rem !important;
    border-radius: 10px !important;
    font-size: 1.05rem !important;
    font-weight: 500 !important;
    color: #F5F3EE !important;
  }

  .nav-menu .nav-link::after {
    display: none !important;
  }

  .nav-menu .nav-link--active {
    background: rgba(201, 168, 76, 0.18) !important;
    color: #C9A84C !important;
    font-weight: 600 !important;
  }

  .nav-menu-footer {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.25rem !important;
    margin-top: auto !important;
    padding: 1.25rem 0.85rem 0.25rem !important;
    border-top: 1px solid rgba(201, 168, 76, 0.22) !important;
  }

  .nav-menu-footer-mark {
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    color: #C9A84C !important;
  }

  .nav-menu-footer-tag {
    font-size: 0.75rem !important;
    color: rgba(245, 243, 238, 0.62) !important;
  }

  .nav-menu-toggle {
    display: flex !important;
    z-index: 2102 !important;
    position: relative !important;
  }

  .nav-menu-toggle--open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg) !important;
  }
  .nav-menu-toggle--open span:nth-child(2) {
    opacity: 0 !important;
  }
  .nav-menu-toggle--open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg) !important;
  }
}

/* Desktop: hide mobile-only chrome; keep horizontal menu in header band */
@media (min-width: 769px) {
  .nav-backdrop,
  .nav-menu-label,
  .nav-menu-footer {
    display: none !important;
  }

  .nav-menu {
    display: flex !important;
    flex-direction: row !important;
    position: fixed !important;
    top: var(--announce-h) !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    width: auto !important;
    max-width: none !important;
    height: var(--nav-height) !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: center !important;
    gap: var(--space-md) !important;
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    transform: translateX(-50%) !important;
    visibility: visible !important;
    overflow: visible !important;
    z-index: 2101 !important;
    pointer-events: none !important;
  }

  .nav-menu .nav-item,
  .nav-menu .nav-link {
    pointer-events: auto !important;
  }

  .nav-menu .nav-link {
    color: var(--color-text-secondary) !important;
    background: transparent !important;
    min-height: auto !important;
    padding: 0.5rem 0 !important;
    border-radius: 0 !important;
    font-size: 0.875rem !important;
  }

  .nav-menu .nav-link::after {
    display: block !important;
  }

  .nav-menu .nav-link:hover,
  .nav-menu .nav-link--active {
    color: var(--color-text) !important;
    background: transparent !important;
  }
}


/* ── Homepage: what modernization changes ─────────────────────────────────
   The evidence block inside the "Faithful to the Original" section. Approved
   as built in the sandbox (_sandbox/length-indicator-mock/homepage-explainer.html)
   — Earl, 2026-07-26: "I love the homepage version." Do not redesign it.

   Ported verbatim except that every selector is scoped under .ev. The mock
   was a standalone page and could afford bare .card / .row / .stat / .s
   globals; this file cannot. Nothing visual changed in the scoping.

   --old-tint / --new-tint were mock-local tokens and are defined on the block
   rather than added to :root, so they cannot leak into anything else. */
.ev {
  margin-top: var(--space-lg);
  --old-tint: rgba(0, 0, 0, .035);
  --new-tint: rgba(201, 168, 76, .09);
}
[data-theme="dark"] .ev {
  --old-tint: rgba(255, 255, 255, .045);
  --new-tint: rgba(201, 168, 76, .13);
}
.ev-head { display: flex; justify-content: space-between; align-items: baseline;
  gap: var(--space-sm); flex-wrap: wrap; margin-bottom: var(--space-sm) }
.ev-h { font-family: var(--font-serif); font-size: 1.35rem; font-weight: 600 }
.ev-cite { font-size: .8rem; color: var(--color-text-muted) }

/* paired passage */
.ev .pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm);
  align-items: stretch }
.ev .side { border: 1px solid var(--color-border); border-radius: 12px;
  padding: 1.25rem 1.35rem; display: flex; flex-direction: column }
.ev .side--old { background: var(--old-tint) }
.ev .side--new { background: var(--new-tint); border-color: rgba(201, 168, 76, .42) }
.ev .side-label { font-size: .7rem; font-weight: 600; letter-spacing: .11em;
  text-transform: uppercase; color: var(--color-text-muted); margin-bottom: .7rem;
  display: block }
.ev .side--new .side-label { color: var(--color-accent-dark) }
[data-theme="dark"] .ev .side--new .side-label { color: var(--color-accent-light) }
.ev .side-text { font-family: var(--font-serif); font-size: .98rem;
  line-height: 1.72; flex: 1 }
/* every sentence is a visible unit — this is the whole argument */
.ev .s { display: inline;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
  padding: .06em .12em; margin: 0 -.02em; border-radius: 3px }
.ev .side--old .s:nth-child(odd) { background: rgba(0, 0, 0, .10) }
.ev .side--new .s:nth-child(odd) { background: rgba(201, 168, 76, .20) }
[data-theme="dark"] .ev .side--old .s:nth-child(odd) { background: rgba(255, 255, 255, .14) }
[data-theme="dark"] .ev .side--new .s:nth-child(odd) { background: rgba(201, 168, 76, .24) }

.ev .side-foot { margin-top: 1rem; padding-top: .75rem;
  border-top: 1px solid var(--color-border); display: flex; gap: 1.2rem;
  flex-wrap: wrap }
.ev .stat { display: flex; flex-direction: column; gap: .1rem }
.ev .stat-n { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 600;
  line-height: 1; font-variant-numeric: tabular-nums }
.ev .side--new .stat-n { color: var(--color-accent-dark) }
[data-theme="dark"] .ev .side--new .stat-n { color: var(--color-accent-light) }
.ev .stat-l { font-size: .7rem; color: var(--color-text-muted); letter-spacing: .02em }

.ev-read { margin-top: var(--space-sm); font-size: .9rem;
  color: var(--color-text-secondary); line-height: 1.65; max-width: 78ch }
.ev-read b { color: var(--color-text); font-weight: 600 }

/* catalog-wide table */
.ev .tbl { margin-top: var(--space-md); border: 1px solid var(--color-border);
  border-radius: 12px; overflow: hidden; background: var(--color-card-bg) }
.ev .tbl-h { display: grid; grid-template-columns: 1.7fr .85fr .85fr .95fr;
  padding: .7rem 1.1rem; background: var(--old-tint);
  font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--color-text-muted) }
.ev .tbl-h span:not(:first-child), .ev .row span:not(:first-child) { text-align: right }
.ev .row { display: grid; grid-template-columns: 1.7fr .85fr .85fr .95fr;
  padding: .72rem 1.1rem; border-top: 1px solid var(--color-border);
  font-size: .9rem; align-items: baseline; font-variant-numeric: tabular-nums }
.ev .row-m { color: var(--color-text) }
.ev .row .o { color: var(--color-text-secondary) }
.ev .row .f { font-weight: 600 }
.ev .row .d { color: var(--color-accent-dark); font-weight: 600; font-size: .85rem }
[data-theme="dark"] .ev .row .d { color: var(--color-accent-light) }
.ev .row-sub { font-size: .76rem; color: var(--color-text-muted); font-weight: 400 }
.ev .tbl-foot { padding: .7rem 1.1rem; border-top: 1px solid var(--color-border);
  font-size: .76rem; color: var(--color-text-muted); line-height: 1.55 }

/* the honest caveat panel */
.ev .caveat { margin-top: var(--space-md); display: grid;
  grid-template-columns: 1fr 1fr; gap: var(--space-sm) }
.ev .caveat .card { border: 1px solid var(--color-border); border-radius: 12px;
  padding: 1.15rem 1.3rem; background: var(--color-card-bg) }
.ev .caveat .card h4 { font-family: var(--font-serif); font-size: 1.05rem;
  font-weight: 600; margin-bottom: .4rem }
.ev .caveat .card p { font-size: .87rem; color: var(--color-text-secondary);
  line-height: 1.62 }
.ev .caveat .card p b { color: var(--color-text); font-weight: 600 }

.ev .method { margin-top: var(--space-md); font-size: .76rem; line-height: 1.65;
  color: var(--color-text-muted); max-width: 88ch }
.ev .method a { color: inherit; text-decoration: underline; text-underline-offset: 2px;
  text-decoration-color: var(--color-border) }
.ev .method b { color: var(--color-text-secondary); font-weight: 600 }

@media (max-width: 900px) {
  .ev .pair { grid-template-columns: 1fr }
  .ev .caveat { grid-template-columns: 1fr }
  .ev .tbl-h { display: none }
  .ev .row { grid-template-columns: 1fr auto; gap: .15rem .7rem; padding: .85rem 1rem }
  .ev .row .o::before { content: "original "; color: var(--color-text-muted); font-size: .72rem }
  .ev .row .f::before { content: "FI "; color: var(--color-text-muted); font-size: .72rem;
    font-weight: 400 }
  .ev .row-m { grid-column: 1 / -1; font-weight: 600; font-size: .86rem }
  .ev .row .o, .ev .row .f, .ev .row .d { text-align: left }
  .ev .row .d { grid-column: 1 / -1 }
  .ev .stat-n { font-size: 1.3rem }
}
