/* ===================================================================
   LumaBook.ai — Landing Page Stylesheet (Featured Hero + Library Grid)
   Pure Minimalist Parchment Aesthetic — Matching Book Reader
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@700;900&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500;1,600&family=IM+Fell+English+SC&family=Inter:wght@400;500;600&family=MedievalSharp&family=Pirata+One&family=UnifrakturMaguntia&display=swap');

@font-face {
  font-family: 'Bookerly';
  src: local('Bookerly'),
    url('../fonts/Bookerly-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Same Fine Press Cotton & Lampblack palette as the reading page (--bg-primary /
     --paper-texture in s1.css); the paper picker's choice (localStorage lb_paper_v2)
     overrides both, applied by the head script in landing.html. */
  --bg-primary: #F4F0E8;
  --bg-surface: color-mix(in srgb, var(--bg-primary) 95%, transparent);
  --paper-texture: 0;
  --border-color: rgba(28, 25, 22, 0.11);
  /* Warm printer's lampblack ink #1C1916, matching the illustration ink at 96% */
  --text-primary: #1C1916;
  --text-secondary: #5C564E;
  --accent-green: #1A382B;
  --accent-green-pill: #244D3B;
  --accent-green-hover: #2E604A;
  --accent-gold: #DFBA73;
  --accent-gold-light: #F4E2B8;
  --accent-gold-dark: #B8934A;
  --btn-bg: #EAE4D7;
  --btn-hover: #E1DACB;
  --header-height: 108px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-reading: 'Bookerly', 'EB Garamond', Georgia, serif;
  --ink-color: #1C1916;
  --ink-filter: none;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  user-select: none !important;
}

html {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* The same sheet of paper as the reading page (colour, grain, fibres and edge
   toning; see "PAPER" in s1.css), so moving from the landing page into a book
   doesn't change the page. */
body {
  position: relative;
  background: transparent;
  color: var(--text-primary);
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--paper-texture, 0);
  background:
    radial-gradient(62% 70% at 50% 50%,
      transparent 55%,
      rgba(28, 25, 22, 0.02) 75%,
      rgba(28, 25, 22, 0.05) 95%,
      rgba(28, 25, 22, 0.11) 120%),
    url('../images/paper-grain.webp') 0 0 / 256px 256px repeat,
    url('../images/paper-mottle.webp') 0 0 / 900px 900px repeat;
}

@media (prefers-contrast: more), (forced-colors: active) {
  body::before {
    display: none;
  }
}

/* ===== APP HEADER ===== */
.app-header {
  position: relative;
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  z-index: 10;
  background: transparent;
  border-bottom: none;
}

.header-left,
.header-right {
  flex: 1;
  display: flex;
  align-items: center;
}

.header-right {
  justify-content: flex-end;
}

.header-center {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.header-logo-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  margin-top: 6px;
}

.header-logo-img {
  height: 62px;
  width: auto;
  object-fit: contain;
  display: block;
}

.header-tagline {
  margin-top: 5px;
  font-family: 'EB Garamond', Georgia, serif;
  font-style: normal;
  font-size: 17.5px;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: var(--text-primary);
  white-space: nowrap;
}

/* ===== MAIN LANDING CONTAINER ===== */
.landing-stage {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 4px clamp(20px, 4vw, 48px) 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ===== FEATURED HERO CAROUSEL (4 DYNAMIC SPOTLIGHTS) ===== */
.hero-carousel {
  position: relative;
  width: 100%;
  max-width: 820px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-viewport {
  position: relative;
  z-index: 2;
  width: 100%;
  overflow-x: clip;
  overflow-y: visible;
  touch-action: pan-y;
}

.hero-track {
  display: flex;
  width: 100%;
  transition: transform 0.8s cubic-bezier(0.65, 0, 0.35, 1);
  will-change: transform;
}

.featured-hero {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  padding: 44px 56px 34px;
}

.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(28, 25, 22, 0.14);
  background: color-mix(in srgb, var(--bg-primary) 92%, transparent);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.18s ease;
  box-shadow: 0 2px 8px -2px rgba(28, 25, 22, 0.12);
}

.hero-nav-prev {
  left: 6px;
}

.hero-nav-next {
  right: 6px;
}

.hero-nav:hover {
  background: color-mix(in srgb, var(--bg-primary), #1C1916 6%);
  border-color: rgba(28, 25, 22, 0.26);
}

.hero-nav:active {
  transform: translateY(-50%) scale(0.94);
}

.hero-nav:focus-visible {
  outline: 2px solid var(--accent-green);
  outline-offset: 2px;
}

/* Dot indicators (matching earlier landing page) */
.cf-dots {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: -16px;
  margin-bottom: 10px;
  background: transparent;
}

.cf-dot {
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  background: transparent;
  background-color: transparent;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cf-dot:hover,
.cf-dot:active {
  background: transparent;
  background-color: transparent;
}

.cf-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(43, 43, 43, 0.28);
  transition: width 0.25s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.25s ease;
}

.cf-dot.is-active::before {
  width: 20px;
  background: var(--accent-green);
}

.cf-dot:focus-visible {
  outline: 2px solid var(--accent-green);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Overhead reading lamp behind the featured book */
.lamp {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.lamp-beam {
  position: absolute;
  top: -16px;
  left: 50%;
  width: min(460px, 92vw);
  height: 360px;
  transform: translateX(-50%);
  filter: blur(18px);
}

.lamp-beam::before {
  content: '';
  position: absolute;
  inset: 0 0 34% 0;
  clip-path: polygon(39% 0, 61% 0, 100% 100%, 0 100%);
  background: linear-gradient(to bottom,
    rgba(255, 255, 253, 0) 0%,
    rgba(255, 255, 253, 0.85) 32%,
    rgba(255, 255, 253, 0.65) 75%,
    rgba(255, 255, 253, 0) 100%);
}

.lamp-beam::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 42% at 50% 54%,
    rgba(255, 255, 253, 0.8) 0%,
    rgba(255, 255, 253, 0.45) 55%,
    rgba(255, 255, 253, 0) 100%);
}

.featured-cover-link {
  position: relative;
  z-index: 2;
  display: block;
  flex-shrink: 0;
  text-decoration: none;
  border-radius: 4px;
  outline: none;
}

.featured-cover-link:focus-visible {
  outline: 2px solid var(--accent-green);
  outline-offset: 4px;
}

/* Square card holding the 1:1 poster + live .lbv title animation */
.video-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  position: relative;
  background-color: #161616 !important;
  border-radius: 4px;
  border: none !important;
  box-shadow:
    inset 0 0 0 1px rgba(223, 186, 115, 0.24),
    0 1px 3px rgba(35, 25, 18, 0.08),
    0 12px 28px -6px rgba(35, 25, 18, 0.22),
    0 4px 10px -2px rgba(35, 25, 18, 0.10);
  overflow: hidden;
  -webkit-user-drag: none;
  transition: box-shadow 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.featured-video-container {
  width: 196px;
  height: 196px;
  box-shadow:
    inset 0 0 0 1px rgba(223, 186, 115, 0.34),
    0 24px 44px -14px rgba(32, 25, 19, 0.38),
    0 8px 18px -6px rgba(32, 25, 19, 0.20);
}

@media (hover: hover) {
  .featured-cover-link:hover .featured-video-container {
    transform: translateY(-2px);
    box-shadow:
      inset 0 0 0 1px rgba(223, 186, 115, 0.44),
      0 28px 48px -12px rgba(32, 25, 19, 0.42),
      0 10px 22px -6px rgba(32, 25, 19, 0.22);
  }
}

.title-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}

.title-anim-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: transparent;
  border: none !important;
  outline: none !important;
  image-rendering: auto;
  pointer-events: none;
  -webkit-user-drag: none;
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.2, 0, 0.2, 1);
}

.title-anim-canvas.anim-playing {
  opacity: 1;
}

.featured-info {
  position: relative;
  z-index: 2;
  max-width: 390px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px 4px;
  border-radius: 999px;
  background: rgba(36, 77, 59, 0.10);
  -webkit-backdrop-filter: blur(8px) saturate(1.1);
  backdrop-filter: blur(8px) saturate(1.1);
  color: var(--accent-green);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.16em;
  margin-bottom: 8px;
}

.featured-badge span {
  font-size: 7px;
  line-height: 1;
}

.featured-text-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  outline: none;
}

.featured-text-link:focus-visible .read-cta {
  outline: 2px solid var(--accent-green);
  outline-offset: 3px;
}

.title-heading {
  line-height: 1.25;
  color: var(--text-primary);
  transition: color 0.2s ease;
}

.featured-info .title-heading {
  font-size: 24px;
  text-align: left;
}

.title-author {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 15px;
  font-weight: 500;
  font-style: normal;
  font-variant-caps: all-small-caps;
  color: var(--text-secondary);
  margin-top: 5px;
  letter-spacing: 0.16em;
}

.featured-info .title-author {
  text-align: left;
}

.title-hook {
  margin-top: 8px;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 16px;
  font-style: normal;
  line-height: 1.38;
  max-width: 375px;
  text-wrap: pretty;
  color: #3D3D3A;
  letter-spacing: 0.015em;
}

/* "Start reading" pill with pale-gold small caps and diagonal shine sweep */
.read-cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 15px;
  padding: 9px 36px 12px calc(37px + 0.20em);
  border: 0;
  border-radius: 999px;
  background: var(--accent-green-pill);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 16px;
  font-weight: 600;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.20em;
  line-height: 1;
  white-space: nowrap;
  color: var(--accent-gold-light);
}

.read-cta::after {
  content: '';
  position: absolute;
  z-index: -1;
  top: -50%;
  left: -60px;
  width: 34px;
  height: 200%;
  background: #3F6F58;
  transform: skewX(-24deg);
  transition: none;
}

.read-cta-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  margin-top: 1px;
  display: inline-block;
  width: 13px;
  height: 8px;
  transform: translateY(-50%);
  font-size: 0;
  color: inherit;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.read-cta-arrow::before {
  content: '';
  position: absolute;
  left: 0;
  right: 1px;
  top: 50%;
  height: 1px;
  background: currentColor;
  transform: translateY(-50%);
}

.read-cta-arrow::after {
  content: '';
  position: absolute;
  right: 1px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}

@media (hover: hover) {
  .featured-text-link:hover .read-cta::after {
    left: calc(100% + 30px);
    transition: left 0.7s cubic-bezier(0.45, 0, 0.25, 1);
  }

  .featured-text-link:hover .read-cta-arrow {
    transform: translate(2px, -50%);
  }

  .featured-text-link:hover .title-heading {
    color: #000;
  }
}

/* ===== LIBRARY CATALOG SECTION (TOOLBAR + GRID) ===== */
.library-section {
  position: relative;
  z-index: 4;
  width: 100%;
  margin-top: 6px;
}

.shelf-toolbar {
  width: 100%;
  padding: 12px 0 14px;
  border-top: 1px solid rgba(28, 25, 22, 0.12);
  border-bottom: 1px solid rgba(28, 25, 22, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.shelf-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.shelf-tabs::-webkit-scrollbar {
  display: none;
}

.shelf-tab {
  border: 0;
  background: transparent;
  padding: 5px 14px 6px;
  border-radius: 999px;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.shelf-tab:hover {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--bg-primary), #1C1916 5%);
}

.shelf-tab.is-active {
  background: var(--accent-green-pill);
  color: var(--accent-gold-light);
  font-weight: 500;
}

.shelf-tab:focus-visible {
  outline: 2px solid var(--accent-green);
  outline-offset: 2px;
}

.shelf-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-primary), #1C1916 5.5%);
  width: 220px;
  flex-shrink: 0;
  transition: background-color 0.2s ease, width 0.2s ease;
}

.shelf-search:focus-within {
  background: color-mix(in srgb, var(--bg-primary), #1C1916 8.5%);
}

.shelf-search-icon {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.shelf-search-input {
  border: 0;
  outline: none;
  background: transparent;
  width: 100%;
  min-width: 0;
  height: 100%;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 15.5px;
  color: var(--text-primary);
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  user-select: text !important;
}

.shelf-search-input::placeholder {
  color: var(--text-secondary);
  font-style: italic;
  opacity: 1;
}

/* 4-Column Fine-Press Cover Grid */
.library-grid {
  width: 100%;
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 30px 26px;
}

@media (max-width: 940px) and (min-width: 641px) {
  .library-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px 22px;
  }
}

.title-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  outline: none;
  -webkit-user-drag: none;
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.title-column[hidden] {
  display: none !important;
}

.title-column .video-container {
  max-width: 224px;
}

@media (hover: hover) {
  .title-column:hover {
    transform: translateY(-4px);
  }

  .title-column:hover .video-container {
    box-shadow:
      inset 0 0 0 1px rgba(223, 186, 115, 0.38),
      0 2px 6px rgba(35, 25, 18, 0.10),
      0 18px 34px -6px rgba(35, 25, 18, 0.28),
      0 5px 12px -2px rgba(35, 25, 18, 0.14);
  }

  .title-column:hover .title-heading {
    color: #000;
  }
}

.title-column:focus-visible .video-container {
  outline: 2px solid var(--accent-green);
  outline-offset: 4px;
}

.title-info-block {
  margin-top: 12px;
  width: 100%;
  max-width: 236px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.title-column .title-heading {
  text-align: center;
  text-wrap: balance;
}

.title-column .title-author {
  margin-top: 4px;
  font-size: 13.5px;
  text-align: center;
}

/* Stored in the card DOM for Featured Hero swaps; hidden inside the grid */
.title-column .title-hook {
  display: none;
}

/* Bespoke book display fonts */
.font-sherlock {
  font-family: 'Pirata One', 'UnifrakturMaguntia', Georgia, serif;
  font-size: 18.5px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.font-alice {
  font-family: 'MedievalSharp', cursive;
  font-size: 16.5px;
  font-weight: 400;
}

.font-odyssey {
  font-family: 'Cinzel Decorative', Georgia, serif;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.font-usher {
  font-family: 'IM Fell English SC', Georgia, serif;
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.font-ramayana {
  font-family: 'Cinzel Decorative', Georgia, serif;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.font-junglebook {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.font-metamorphosis {
  font-family: 'UnifrakturMaguntia', Georgia, serif;
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.font-romeo {
  font-family: 'IM Fell English SC', Georgia, serif;
  font-size: 17.5px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* Empty search state */
.library-empty {
  padding: 40px 16px 20px;
  text-align: center;
}

.library-empty-text {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 18px;
  font-style: italic;
  color: var(--text-secondary);
}

.library-empty-reset {
  margin-top: 12px;
  border: 0;
  background: rgba(36, 77, 59, 0.10);
  color: var(--accent-green);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 14.5px;
  font-weight: 600;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.14em;
  padding: 6px 16px 8px;
  border-radius: 999px;
  cursor: pointer;
}

.library-empty-reset:hover {
  background: rgba(36, 77, 59, 0.16);
}

/* ===== READER MESSAGE BAR (book requests + feedback) ===== */
.lb-feedback {
  position: relative;
  z-index: 4;
  width: min(100%, 440px);
  margin: 44px auto 0;
}

.lb-feedback-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 6px 0 22px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-primary), #1C1916 5.5%);
  border: 0;
  box-shadow: none;
  transition: background-color 0.25s ease;
}

.lb-feedback-bar:focus-within {
  background: color-mix(in srgb, var(--bg-primary), #1C1916 8.5%);
}

.lb-feedback-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 17px;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  user-select: text !important;
  touch-action: manipulation;
  text-overflow: ellipsis;
}

.lb-feedback-input::placeholder {
  color: #5C564E;
  font-style: italic;
  font-size: clamp(13px, calc((100vw - 112px) / 17.3), 17px);
  opacity: 1;
  transition: color 0.35s ease;
}

.lb-feedback-send {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-green-pill);
  color: var(--accent-gold-light);
  cursor: pointer;
  touch-action: manipulation;
  box-shadow:
    inset 0 0 0 1px rgba(223, 186, 115, 0.35),
    0 2px 6px -2px rgba(18, 40, 30, 0.4);
  transition: background-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.lb-feedback-send:hover {
  background: var(--accent-green-hover);
}

.lb-feedback-send:active {
  transform: scale(0.94);
}

.lb-feedback-send:focus-visible {
  outline: 2px solid var(--accent-green);
  outline-offset: 3px;
}

.lb-feedback-send:disabled {
  cursor: default;
  opacity: 0.7;
}

.lb-feedback.is-sending .lb-feedback-send svg {
  animation: lb-pulse 1s ease-in-out infinite;
}

.lb-feedback-status {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 8px;
  text-align: center;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 15px;
  font-style: italic;
  color: var(--accent-green);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.lb-feedback-status.is-visible {
  opacity: 1;
}

.lb-feedback-status.is-error {
  color: #8A3B2E;
}

.lb-feedback.is-inline-status .lb-feedback-status {
  top: 0;
  bottom: 0;
  left: 0;
  right: 50px;
  margin-top: 0;
  display: flex;
  align-items: center;
  padding: 0 8px 0 22px;
  text-align: left;
  font-size: 14px;
  line-height: 1.2;
}

.lb-feedback.is-inline-status.has-status .lb-feedback-input,
.lb-feedback.is-inline-status.has-status .lb-feedback-input::placeholder {
  color: transparent;
}

.lb-feedback-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@keyframes lb-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ===== READING DEMO (behind the Featured Hero) ===== */
.lb-demo {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 394px;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
  opacity: 0;
  --demo-art-top: 64px;
  --demo-art-h: 248px;
}

.lb-demo.is-live {
  opacity: 1;
}

.lb-demo-art,
.lb-demo-frost-art {
  position: absolute;
  top: var(--demo-art-top);
  left: 50%;
  width: calc(var(--demo-art-h) * 16 / 9);
  height: var(--demo-art-h);
  aspect-ratio: 16 / 9;
  transform: translateX(-50%);
  -webkit-mask-image: radial-gradient(ellipse 48% 48% at 50% 50%,
    #000 18%,
    rgba(0, 0, 0, 0.72) 45%,
    rgba(0, 0, 0, 0.32) 68%,
    rgba(0, 0, 0, 0.08) 86%,
    transparent 98%);
  mask-image: radial-gradient(ellipse 48% 48% at 50% 50%,
    #000 18%,
    rgba(0, 0, 0, 0.72) 45%,
    rgba(0, 0, 0, 0.32) 68%,
    rgba(0, 0, 0, 0.08) 86%,
    transparent 98%);
}

.lb-demo-art {
  opacity: 0.8;
}

.lb-demo-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.lb-demo.has-shown .lb-demo-canvas {
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity;
}

.lb-demo-canvas.is-shown {
  opacity: 1;
}

.lb-demo-text,
.lb-demo-frost-text {
  position: absolute;
  top: calc(var(--demo-art-top) + 10px);
  height: calc(var(--demo-art-h) + 28px);
  left: calc(50% + (var(--demo-art-h) * 8 / 9) - 24px);
  width: min(34vw, 410px);
  transform: none;
  -webkit-mask-image: radial-gradient(ellipse 50% 49% at 50% 50%,
    #000 28%,
    rgba(0, 0, 0, 0.72) 54%,
    rgba(0, 0, 0, 0.30) 76%,
    rgba(0, 0, 0, 0.07) 90%,
    transparent 99%);
  mask-image: radial-gradient(ellipse 50% 49% at 50% 50%,
    #000 28%,
    rgba(0, 0, 0, 0.72) 54%,
    rgba(0, 0, 0, 0.30) 76%,
    rgba(0, 0, 0, 0.07) 90%,
    transparent 99%);
}

.lb-demo-text {
  overflow: hidden;
  opacity: 0.82;
}

.lb-demo-frost {
  pointer-events: none;
  -webkit-backdrop-filter: blur(3px) saturate(1.05);
  backdrop-filter: blur(3px) saturate(1.05);
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    linear-gradient(135deg, rgba(255, 255, 255, 0.054), rgba(255, 255, 255, 0.009) 45%, rgba(255, 255, 255, 0.036));
  background-size: 180px 180px, 100% 100%;
}

.lb-demo-frost-text {
  -webkit-backdrop-filter: blur(2.4px) saturate(1.05);
  backdrop-filter: blur(2.4px) saturate(1.05);
}

.lb-demo-scroll {
  font-family: 'EB Garamond', Georgia, serif;
  font-weight: 500;
  font-size: clamp(13px, 1.05vw, 16px);
  line-height: 1.72;
  color: var(--ink-color);
  text-wrap: pretty;
  will-change: transform;
}

.lb-demo-scroll.is-ghost {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.lb-demo-scene {
  padding-bottom: 2.6em;
}

.lb-demo-heading {
  margin-bottom: 0.9em;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  text-align: center;
}

.lb-demo-scene p {
  text-indent: 1.75em;
}

.lb-demo-scene p + p {
  margin-top: 0.75em;
}

.lb-demo-scene p.is-first {
  text-indent: 0;
}

.lb-demo-scene p.has-drop-cap::first-letter {
  float: left;
  margin: 0.06em 0.08em 0 0;
  font-size: 3.4em;
  line-height: 0.82;
}

/* Smooth fade into clean paper right above the library shelf */
.lb-demo-fog {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--bg-primary) 26%, transparent) 0%,
    color-mix(in srgb, var(--bg-primary) 62%, transparent) 62%,
    color-mix(in srgb, var(--bg-primary) 95%, transparent) 86%,
    var(--bg-primary) 98%);
}

/* ===== MOBILE RESPONSIVE (<= 640px) ===== */
@media (max-width: 640px) {
  :root {
    --header-height: 88px;
  }

  .header-logo-img {
    height: 50px;
  }

  .header-tagline {
    margin-top: 3px;
    font-size: 14.5px;
  }

  .landing-stage {
    padding: 2px 16px 52px;
  }

  .featured-hero {
    gap: 14px;
    padding: 30px 30px 26px;
  }

  .hero-nav {
    width: 28px;
    height: 28px;
  }

  .hero-nav-prev {
    left: -2px;
  }

  .hero-nav-next {
    right: -2px;
  }

  .cf-dots {
    margin-top: -14px;
    margin-bottom: 8px;
  }

  .featured-video-container {
    width: 116px;
    height: 116px;
  }

  .featured-badge {
    font-size: 11.5px;
    padding: 2.5px 9px 3.5px;
    margin-bottom: 5px;
  }

  .featured-info .title-heading {
    font-size: 18px;
  }

  .featured-info .title-author {
    font-size: 12.5px;
    margin-top: 3px;
  }

  .featured-info .title-hook {
    font-size: 13.5px;
    line-height: 1.32;
    margin-top: 4px;
    text-wrap: wrap;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .featured-info .read-cta {
    margin-top: 9px;
    font-size: 13.5px;
    padding: 7px 32px 9px calc(20px + 0.18em);
  }

  .shelf-toolbar {
    padding: 9px 0 11px;
    gap: 10px;
  }

  .shelf-tab {
    font-size: 14px;
    padding: 4px 12px 5px;
  }

  /* Compact expandable search pill on narrow phones so genre tabs keep priority */
  .shelf-search {
    width: 34px;
    padding: 0 10px;
    justify-content: center;
    cursor: pointer;
  }

  .shelf-search:focus-within,
  .shelf-search.has-value {
    width: 156px;
    padding: 0 12px;
    justify-content: flex-start;
  }

  .shelf-search:not(:focus-within):not(.has-value) .shelf-search-input {
    width: 0;
    opacity: 0;
    pointer-events: none;
  }

  .library-grid {
    margin-top: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 14px;
  }

  .title-info-block {
    margin-top: 9px;
  }

  .font-sherlock,
  .font-junglebook,
  .font-metamorphosis {
    font-size: 15.5px;
  }

  .font-alice,
  .font-usher,
  .font-ramayana,
  .font-romeo {
    font-size: 14.5px;
  }

  .font-odyssey {
    font-size: 14px;
  }

  .title-column .title-author {
    font-size: 12px;
  }

  .lb-feedback {
    margin-top: 32px;
  }

  .lb-feedback-bar {
    height: 44px;
  }

  .lb-demo {
    height: 316px;
    --demo-art-top: 40px;
    --demo-art-h: min(176px, calc(90vw * 9 / 16));
  }

  .lb-demo-art,
  .lb-demo-frost-art {
    left: 50%;
  }

  .lb-demo-text,
  .lb-demo-frost-text {
    top: calc(var(--demo-art-top) + 6px);
    height: calc(var(--demo-art-h) + 20px);
    left: calc(50% + (var(--demo-art-h) * 8 / 9) - 12px);
    width: 220px;
  }

  .lb-demo-scroll {
    font-size: 12.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .title-column,
  .video-container,
  .read-cta::after,
  .read-cta-arrow {
    transition: none !important;
  }
}
