/* ================================================================
   DESIGN TOKENS
   ================================================================ */
:root {
  --color-primary: #7C3AED;
  --color-primary-light: #A78BFA;
  --color-primary-dark: #5B21B6;
  --color-secondary: #F472B6;
  --color-secondary-light: #FBCFE8;
  --color-accent: #F59E0B;
  --color-accent-light: #FCD34D;
  --color-bg: #FFFAF5;
  --color-bg-alt: #FEF3EC;
  --color-surface: rgba(255, 255, 255, 0.82);
  --color-surface-solid: #FFFFFF;
  --color-text: #1E1B4B;
  --color-text-secondary: #64618B;
  --color-text-muted: #9CA3AF;
  --color-success: #10B981;
  --color-error: #EF4444;
  --color-border: rgba(124, 58, 237, 0.08);

  --font-display: 'Comfortaa', 'Segoe UI', sans-serif;
  --font-body: 'Nunito', 'Segoe UI', sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 2px rgba(30, 27, 75, 0.04);
  --shadow-sm: 0 2px 6px rgba(30, 27, 75, 0.06);
  --shadow-md: 0 4px 16px rgba(30, 27, 75, 0.08);
  --shadow-lg: 0 8px 30px rgba(30, 27, 75, 0.10);
  --shadow-xl: 0 20px 50px rgba(30, 27, 75, 0.14);
  --shadow-glow: 0 0 40px rgba(124, 58, 237, 0.15);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition: 0.3s var(--ease);
  --transition-slow: 0.5s var(--ease);

  --header-h: 68px;
  --announcement-h: 34px;
  --container-w: 1140px;
  --container-narrow: 800px;
}

/* ================================================================
   RESET & BASE
   ================================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Subtle warm radial background */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(251, 207, 232, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 10%, rgba(196, 181, 253, 0.25) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 100%, rgba(254, 243, 199, 0.3) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-primary-dark); }

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

button { font-family: var(--font-body); cursor: pointer; border: none; background: none; }

input, textarea, select { font-family: var(--font-body); }

/* ================================================================
   LAYOUT
   ================================================================ */
.container {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow { max-width: var(--container-narrow); }

#app {
  padding-top: calc(var(--header-h) + var(--announcement-h));
  min-height: calc(100vh - var(--header-h) - var(--announcement-h));
}

/* ================================================================
   PAGE TRANSITIONS
   ================================================================ */
.page-enter {
  animation: pageIn 0.4s var(--ease) both;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   SKELETON LOADING
   ================================================================ */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-img,
.skeleton-line {
  background: linear-gradient(90deg, #f0ecf7 25%, #e8e3f0 50%, #f0ecf7 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-img {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-md);
}

.skeleton-line {
  height: 14px;
  margin-bottom: 10px;
}

.skeleton-line--title {
  height: 20px;
  width: 70%;
  margin-bottom: 12px;
}

.skeleton-line--short {
  width: 40%;
}

.story-card--skeleton {
  pointer-events: none;
}

.story-card--skeleton .story-card-body {
  padding: 16px 18px;
}

/* ================================================================
   GLOBAL FOCUS STYLES (Issue #25 — replace outline:none globally)
   ================================================================ */
:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ================================================================
   SITE HEADER
   ================================================================ */
.site-header {
  position: fixed; top: var(--announcement-h); left: 0; right: 0;
  height: var(--header-h);
  background: rgba(255, 250, 245, 0.75);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
  transition: box-shadow var(--transition);
}

.site-header.scrolled {
  box-shadow: 0 2px 20px rgba(30, 27, 75, 0.06);
}

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

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-text);
  text-decoration: none;
}

.header-brand-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 2px 4px rgba(124, 58, 237, 0.2));
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-nav a {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  transition: all var(--transition);
  min-height: 44px;
  display: flex;
  align-items: center;
}

.header-nav a:hover {
  color: var(--color-primary);
  background: rgba(124, 58, 237, 0.06);
}

.header-nav a.active {
  color: var(--color-primary);
  background: rgba(124, 58, 237, 0.1);
}

/* ================================================================
   HEADER — Hamburger button (mobile only)
   ================================================================ */
.header-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  flex-shrink: 0;
}

.header-hamburger:hover {
  background: rgba(124, 58, 237, 0.08);
}

.header-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease), width 0.3s var(--ease);
  transform-origin: center;
}

/* X animation when open */
.header-hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.header-hamburger.active span:nth-child(2) {
  opacity: 0;
  width: 0;
}
.header-hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-lg);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
  min-height: 44px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.4);
  color: #fff;
}

.btn-secondary {
  background: var(--color-surface-solid);
  color: var(--color-primary);
  border: 2px solid var(--color-primary-light);
}
.btn-secondary:hover {
  background: rgba(124, 58, 237, 0.06);
  border-color: var(--color-primary);
}

.btn-danger {
  background: var(--color-error);
  color: #fff;
}
.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-2px);
  color: #fff;
}

.btn-ghost {
  color: var(--color-primary);
  background: transparent;
}
.btn-ghost:hover { background: rgba(124, 58, 237, 0.06); }

.btn-lg { padding: 16px 36px; font-size: 1.05rem; border-radius: var(--radius-xl); }
.btn-sm { padding: 8px 18px; font-size: 0.85rem; min-height: 44px; }
.btn-icon { padding: 10px; border-radius: var(--radius-md); }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ================================================================
   CARDS
   ================================================================ */
.card {
  background: var(--color-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  overflow: hidden;
}

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

.card-body { padding: 20px; }

/* ================================================================
   FORM ELEMENTS
   ================================================================ */
.form-input {
  width: 100%;
  padding: 14px 18px;
  background: var(--color-surface);
  border: 2px solid rgba(124, 58, 237, 0.12);
  border-radius: var(--radius-md);
  font-size: 1rem;
  color: var(--color-text);
  transition: all var(--transition);
  outline: none;
  min-height: 44px;
}

.form-input:focus {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.08);
}

.form-input:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.form-input::placeholder { color: var(--color-text-muted); }

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

/* ================================================================
   BADGES & PILLS
   ================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-primary { background: rgba(124, 58, 237, 0.1); color: var(--color-primary); }
.badge-accent { background: rgba(245, 158, 11, 0.12); color: #B45309; }

/* ================================================================
   HOMEPAGE — HERO
   ================================================================ */
.hero {
  padding: 80px 0 60px;
  position: relative;
  overflow: hidden;
}

.hero-inner {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

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

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 18px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 50%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  margin-bottom: 32px;
  line-height: 1.65;
  max-width: 480px;
}

.hero-price-callout {
  margin-top: 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary);
  background: rgba(var(--color-primary-rgb, 99,102,241), 0.08);
  padding: 8px 16px;
  border-radius: 8px;
  display: inline-block;
}

.hero-social-proof {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.hero-social-proof .stars { color: var(--color-accent); letter-spacing: 2px; }

/* Hero visual — floating book collage */
.hero-visual {
  position: relative;
  height: 400px;
  perspective: 800px;
}

.hero-collage {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-collage-img {
  position: absolute;
  width: 220px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transition: transform 0.6s var(--ease);
  animation: float 6s ease-in-out infinite;
}

.hero-collage-img:nth-child(1) {
  top: 10%; left: 5%;
  transform: rotate(-6deg);
  animation-delay: 0s;
}
.hero-collage-img:nth-child(2) {
  top: 5%; right: 10%;
  transform: rotate(4deg);
  animation-delay: -2s;
  width: 200px;
}
.hero-collage-img:nth-child(3) {
  bottom: 5%; left: 20%;
  transform: rotate(3deg);
  animation-delay: -4s;
  width: 190px;
}
.hero-collage-img:nth-child(4) {
  bottom: 15%; right: 5%;
  transform: rotate(-5deg);
  animation-delay: -1s;
  width: 180px;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(var(--rot, -6deg)); }
  50%      { transform: translateY(-12px) rotate(var(--rot, -6deg)); }
}

/* Decorative floating elements */
.hero-decor {
  position: absolute;
  pointer-events: none;
  opacity: 0.5;
  animation: floatSlow 8s ease-in-out infinite;
  font-size: 1.5rem;
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-18px) rotate(10deg); }
}

/* ================================================================
   HOMEPAGE — HOW IT WORKS
   ================================================================ */
.how-it-works {
  padding: 60px 0;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
  color: var(--color-text);
}

.section-subtitle {
  text-align: center;
  color: var(--color-text-secondary);
  margin-bottom: 48px;
  font-size: 1rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  position: relative;
}

/* Connecting line between steps */
.steps-grid::before {
  content: '';
  position: absolute;
  top: 52px;
  left: 16%;
  right: 16%;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--color-primary-light) 0, var(--color-primary-light) 8px, transparent 8px, transparent 16px);
  opacity: 0.4;
}

.step-card {
  text-align: center;
  position: relative;
  z-index: 1;
}

.step-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(244, 114, 182, 0.08));
  border-radius: 50%;
  border: 2px solid rgba(124, 58, 237, 0.1);
  position: relative;
}

.step-number {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-display);
}

.step-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 6px;
  color: var(--color-text);
}

.step-desc {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* ================================================================
   HOMEPAGE — FEATURED STORIES
   ================================================================ */
.featured-section {
  padding: 40px 0 80px;
}

.featured-scroll {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 8px 0 20px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.featured-scroll::-webkit-scrollbar { display: none; }

.featured-card {
  flex: 0 0 300px;
  scroll-snap-align: start;
  background: var(--color-surface-solid);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
}

.featured-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-xl);
  color: inherit;
}

.featured-card-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.featured-card-img-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, #f3e8ff, #fce7f3);
}

.featured-card-body {
  padding: 16px;
}

.featured-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.featured-card-desc {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.section-link {
  display: block;
  text-align: center;
  margin-top: 24px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-primary);
}

.section-link:hover { text-decoration: underline; }

/* ================================================================
   CATALOG PAGE — Modern Card Grid
   ================================================================ */
.catalog-page { padding: 40px 0 80px; }

.page-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 32px;
  color: var(--color-text);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

/* Story card — cover-first design */
.story-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface-solid);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
  position: relative;
}

.story-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  color: inherit;
}

.story-card:hover .story-card-cover img {
  transform: scale(1.05);
}

.story-card:hover .story-card-quick-look {
  opacity: 1;
  transform: translateY(0);
}

/* Cover image area — landscape to match 2560×1440 preview images */
.story-card-cover {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #f3f0fa;
}

.story-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}

/* Placeholder for stories without previews */
.story-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

/* Page count badge — frosted pill */
.story-card-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.02em;
}

/* Quick Look button — eye icon on hover */
.story-card-quick-look {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  border: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.story-card-quick-look:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: var(--shadow-md);
}

/* Card body */
.story-card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.story-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  color: var(--color-text);
}

.story-card-desc {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.story-card-body .btn {
  align-self: flex-start;
  margin-top: 4px;
}

/* ================================================================
   CATALOG — Header, Search, Filters, Card Enhancements
   ================================================================ */
.catalog-header {
  text-align: center;
  margin-bottom: 28px;
}

.catalog-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
}

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

/* Search bar */
.catalog-search-bar {
  max-width: 480px;
  margin: 0 auto 20px;
}

.catalog-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.catalog-search-icon {
  position: absolute;
  left: 16px;
  color: var(--color-text-muted);
  pointer-events: none;
}

.catalog-search-input {
  width: 100%;
  padding: 13px 18px 13px 44px;
  background: var(--color-surface-solid);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  color: var(--color-text);
  outline: none;
  transition: all var(--transition);
  min-height: 44px;
}

.catalog-search-input:focus {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.08);
}

.catalog-search-input:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.catalog-search-input::placeholder { color: var(--color-text-muted); }

/* Filters bar */
.catalog-filters {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 16px 24px;
  background: var(--color-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.catalog-filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.catalog-filter-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.catalog-filter-tabs,
.catalog-filter-chips {
  display: flex;
  gap: 6px;
}

/* Gender pill tabs */
.filter-tab {
  padding: 7px 18px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: transparent;
  border: 1.5px solid var(--color-border);
  cursor: pointer;
  transition: all var(--transition);
  min-height: 36px;
}

.filter-tab:hover {
  border-color: var(--color-primary-light);
  color: var(--color-primary);
}

.filter-tab.active {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  border-color: transparent;
}

/* Age chips */
.filter-chip {
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: transparent;
  border: 1.5px solid var(--color-border);
  cursor: pointer;
  transition: all var(--transition);
  min-height: 36px;
}

.filter-chip:hover {
  border-color: var(--color-primary-light);
  color: var(--color-primary);
}

.filter-chip.active {
  background: rgba(124, 58, 237, 0.1);
  color: var(--color-primary);
  border-color: var(--color-primary-light);
}

/* Results bar */
.catalog-results-bar {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-bottom: 16px;
  font-weight: 600;
}

/* Age badge on cover */
.story-card-age-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.02em;
}

/* Gender dot indicator */
.story-card-gender-dot {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.story-card-gender-dot--boys { background: #42a5f5; }
.story-card-gender-dot--girls { background: #f06292; }

/* Coming Soon ribbon */
.story-card-ribbon {
  position: absolute;
  top: 16px;
  right: -30px;
  width: 130px;
  text-align: center;
  padding: 5px 0;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transform: rotate(35deg);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
}

/* Coming soon card style */
.story-card--coming-soon {
  cursor: default;
}

.story-card--coming-soon .story-card-cover img,
.story-card--coming-soon .story-card-placeholder {
  filter: saturate(0.6);
}

.story-card--coming-soon:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.story-card--coming-soon:hover .story-card-cover img {
  transform: scale(1.02);
}

/* Tags in card body */
.story-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.story-card-tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--color-primary);
  background: rgba(124, 58, 237, 0.07);
  letter-spacing: 0.01em;
}

/* Disabled button for coming soon */
.btn-disabled {
  background: rgba(156, 163, 175, 0.15);
  color: var(--color-text-muted);
  cursor: default;
  pointer-events: none;
}

/* Card entrance animation */
.story-card {
  animation: cardFadeIn 0.4s var(--ease) both;
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Catalog empty state */
.catalog-empty .empty-state {
  padding: 60px 24px;
}

/* --- Filters responsive --- */
@media (max-width: 768px) {
  .catalog-filters {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 18px;
  }

  .catalog-filter-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
  }

  .catalog-filter-tabs,
  .catalog-filter-chips {
    flex-wrap: wrap;
  }
}

/* ================================================================
   CREATE PAGE
   ================================================================ */
.create-page { padding: 40px 0 80px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  margin-bottom: 24px;
  color: var(--color-text-muted);
}

.breadcrumb a { color: var(--color-primary); font-weight: 600; }

.story-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  background: rgba(124, 58, 237, 0.05);
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
}

.story-summary-emoji { font-size: 2rem; }
.story-summary-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}
.story-summary-desc {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 520px;
  margin: 0 auto;
}

.upload-zone {
  border: 3px dashed rgba(124, 58, 237, 0.2);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: rgba(124, 58, 237, 0.02);
  min-height: 44px;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--color-primary-light);
  background: rgba(124, 58, 237, 0.06);
  transform: scale(1.01);
}

.upload-zone-icon { font-size: 3rem; margin-bottom: 12px; display: block; }
.upload-zone-text { font-weight: 600; color: var(--color-primary); margin-bottom: 4px; }
.upload-zone-hint { font-size: 0.85rem; color: var(--color-text-muted); }
.upload-zone input[type="file"] { display: none; }

.photo-preview {
  text-align: center;
}

.photo-preview img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin: 0 auto 12px;
}

.photo-remove {
  color: var(--color-error);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  min-height: 44px;
  padding: 8px 16px;
}

.format-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.format-option {
  flex: 1;
  min-width: 130px;
  padding: 16px;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  min-height: 44px;
}

.format-option:hover { border-color: var(--color-primary-light); }

.format-option.selected {
  border-color: var(--color-primary);
  background: rgba(124, 58, 237, 0.06);
}

.format-option-label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-primary-dark);
}

.error-msg {
  background: rgba(239, 68, 68, 0.08);
  color: var(--color-error);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 0.9rem;
  display: none;
}

.error-msg.visible { display: block; }

/* ================================================================
   PROGRESS PAGE
   ================================================================ */
.progress-page {
  padding: 80px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--header-h));
}

.progress-card {
  background: var(--color-surface-solid);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  max-width: 440px;
  width: 100%;
}

.spinner {
  width: 56px;
  height: 56px;
  border: 4px solid rgba(124, 58, 237, 0.12);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 24px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.progress-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-primary-dark);
  margin-bottom: 20px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(124, 58, 237, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  border-radius: 4px;
  transition: width 0.5s var(--ease);
}

.progress-detail {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.progress-quality {
  margin-top: 20px;
  padding: 10px 16px;
  background: var(--color-bg-secondary);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  min-height: 1.5em;
}

/* ================================================================
   BOOK VIEWER PAGE — vertical scroll layout
   ================================================================ */

.pv-scroll-layout {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 16px 80px;
}

.pv-header {
  text-align: center;
  margin-bottom: 28px;
}

.pv-header h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 4px;
}

.pv-header-sub {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

/* Page cards container */
.pv-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* Individual page card */
.pv-card {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.pv-card-img {
  position: relative;
  width: 100%;
  background: #0a0a0a;
  overflow: hidden;
}

/* Spread pages — landscape 2:1 */
.pv-card--spread .pv-card-img {
  aspect-ratio: 2/1;
}

/* Single pages (cover, back) — square, centered narrower */
.pv-card--single {
  max-width: 520px;
}

.pv-card--single .pv-card-img {
  aspect-ratio: 1/1;
}

.pv-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Blur locked page images behind paywall */
.pv-card--locked img {
  filter: blur(18px) saturate(0.6);
  transform: scale(1.05); /* hide blur edges */
}

/* Lock overlay on card */
.pv-card-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  padding: 24px;
}

.pv-lock-text {
  max-width: 360px;
  margin-top: 16px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
  font-style: italic;
}

/* Regen button (top-right corner of card) */
.pv-regen {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  border: none;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  transition: all var(--transition);
}

.pv-regen:hover { background: rgba(255, 255, 255, 0.3); }
.pv-regen:disabled { opacity: 0.4; cursor: not-allowed; }

/* Actions row */
.pv-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 36px;
  flex-wrap: wrap;
}

/* --- Mobile --- */
@media (max-width: 768px) {
  .pv-scroll-layout {
    padding: 20px 10px 60px;
  }

  .pv-pages {
    gap: 16px;
  }

  .pv-card--single {
    max-width: 100%;
  }
}

/* ================================================================
   LIBRARY PAGE
   ================================================================ */
.library-page { padding: 40px 0 80px; }

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.library-card {
  background: var(--color-surface-solid);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.library-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  color: inherit;
}

.library-card-cover {
  aspect-ratio: 1/1;
  background: #1a1a2e;
  overflow: hidden;
}

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

.library-card-body { padding: 16px; }

.library-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.library-card-name {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.library-card-date {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 24px;
}

.empty-state-icon { font-size: 4rem; margin-bottom: 16px; opacity: 0.6; }

.empty-state-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--color-text);
}

.empty-state-desc {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

/* ================================================================
   LIGHTBOX
   ================================================================ */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(10, 10, 30, 0.88);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.lightbox-overlay.open { display: flex; }

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-md);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
  opacity: 0.7;
  transition: opacity var(--transition);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-close:hover { opacity: 1; }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  min-height: 44px;
  min-width: 44px;
}

.lightbox-nav:hover { background: rgba(255, 255, 255, 0.2); }
.lightbox-nav--prev { left: 12px; }
.lightbox-nav--next { right: 12px; }

/* ================================================================
   AUTH PAGE
   ================================================================ */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--header-h) - 100px);
  padding: 40px 16px;
}

.auth-card {
  background: var(--color-surface-solid);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  box-shadow: var(--shadow-lg);
  max-width: 420px;
  width: 100%;
}

.auth-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 4px;
}

.auth-subtitle {
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 28px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field { display: flex; flex-direction: column; gap: 4px; }

.auth-submit { width: 100%; margin-top: 4px; }

.auth-toggle {
  text-align: center;
  margin-top: 20px;
  font-size: 0.88rem;
  color: var(--color-text-secondary);
}

.auth-toggle a { font-weight: 600; }

/* ================================================================
   CART PAGE
   ================================================================ */
.cart-page { padding: 40px 0 80px; }

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--color-surface-solid);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.cart-item-link {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.cart-item-link:hover .cart-item-title { text-decoration: underline; }

.cart-item-cover {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #1a1a2e;
  flex-shrink: 0;
}

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

.cart-item-info { flex: 1; min-width: 0; }

.cart-item-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-child {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
}

.cart-item-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-primary);
  white-space: nowrap;
}

.cart-item-remove {
  width: 36px;
  height: 36px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.3rem;
  color: var(--color-text-muted);
  transition: all var(--transition);
  cursor: pointer;
  background: none;
  border: none;
}

.cart-item-remove:hover {
  color: var(--color-error);
  background: rgba(239, 68, 68, 0.08);
}

.cart-summary {
  background: var(--color-surface-solid);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.cart-total-amount {
  font-size: 1.3rem;
  color: var(--color-primary);
}

.cart-error {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.08);
  color: var(--color-error);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  text-align: center;
}

/* Recipient form */
.cart-recipient {
  background: var(--color-surface-solid);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.cart-recipient-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.cart-recipient-desc {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
}

.cart-form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
}

.cart-form-field {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cart-form-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.cart-form-field input,
.cart-form-field select {
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color var(--transition);
}

.cart-form-field input:focus,
.cart-form-field select:focus {
  outline: none;
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.cart-form-field input:focus-visible,
.cart-form-field select:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.cart-form-field input::placeholder {
  color: var(--color-text-muted);
}

/* ================================================================
   HEADER — Cart badge & user name
   ================================================================ */
.header-cart-link {
  position: relative;
}

.header-cart-badge {
  position: absolute;
  top: 2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--color-secondary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.header-user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  padding: 0 8px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-logout-link {
  font-size: 0.82rem;
  color: var(--color-text-muted) !important;
  padding: 8px 12px;
}

.header-logout-link:hover {
  color: var(--color-error) !important;
}

/* ================================================================
   LIBRARY — Section titles & badges
   ================================================================ */
.library-section {
  margin-bottom: 40px;
}

.library-section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-text);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-border);
}

.library-card-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.library-card-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 18px;
  line-height: 28px;
  text-align: center;
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transition: opacity .2s;
}
.library-card-wrap:hover .library-card-remove,
.library-card-remove:focus {
  opacity: 1;
}

.library-card-wrap .library-add-cart {
  align-self: stretch;
}

.library-card-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.library-card-badge--purchased {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
}

.library-card-badge--generating {
  background: rgba(124, 58, 237, 0.1);
  color: var(--color-primary);
}

.library-card-badge--preview {
  background: rgba(245, 158, 11, 0.12);
  color: #B45309;
}

/* ================================================================
   CHECKOUT SUCCESS
   ================================================================ */
.checkout-success-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--header-h) - 100px);
  padding: 40px 16px;
}

.checkout-success-card {
  text-align: center;
  background: var(--color-surface-solid);
  border-radius: var(--radius-xl);
  padding: 56px 40px;
  box-shadow: var(--shadow-lg);
  max-width: 480px;
  width: 100%;
}

.checkout-success-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.checkout-success-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.checkout-success-text {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
}

/* ================================================================
   FOOTER
   ================================================================ */
.site-footer {
  padding: 32px 24px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
}
.footer-links {
  margin-top: 8px;
  display: flex;
  justify-content: center;
  gap: 20px;
}
.footer-links a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-links a:hover {
  color: var(--color-primary);
}

/* Legal pages (privacy, terms) */
.legal-page {
  padding: 60px 24px 80px;
  max-width: var(--container-narrow);
  margin: 0 auto;
  line-height: 1.7;
}
.legal-page h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 4px;
}
.legal-updated {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-bottom: 32px;
}
.legal-page h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-top: 28px;
  margin-bottom: 8px;
}
.legal-page ul {
  padding-left: 24px;
  margin: 8px 0;
}
.legal-page li {
  margin-bottom: 4px;
}
.legal-page a {
  color: var(--color-primary);
}

/* Cookie consent banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-surface-solid);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 9999;
  font-size: 0.88rem;
}
.cookie-banner p { margin: 0; }
.cookie-banner a { color: var(--color-primary); }
.cookie-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.btn-outline:hover {
  border-color: var(--color-primary-light);
  color: var(--color-primary);
}
@media (max-width: 600px) {
  .cookie-banner {
    flex-direction: column;
    text-align: center;
  }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
  :root { --header-h: 56px; }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }

  .hero-subtitle { margin-left: auto; margin-right: auto; }

  .hero-visual { height: 280px; }

  .hero-collage-img { width: 140px !important; }
  .hero-collage-img:nth-child(4) { display: none; }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .steps-grid::before { display: none; }

  .featured-card { flex: 0 0 220px; }

  .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

  /* Show Quick Look on mobile (always visible) */
  .story-card-quick-look {
    opacity: 1;
    transform: translateY(0);
  }

  .viewer { border-radius: var(--radius-md); }

  .viewer-actions { gap: 8px; }
  .viewer-actions .btn { padding: 10px 18px; font-size: 0.85rem; }

  .header-brand span:last-child { display: none; }
  .header-user-name { display: none; }

  /* Show hamburger, hide normal inline nav */
  .header-hamburger { display: flex; }

  .header-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(255, 250, 245, 0.97);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 8px 24px rgba(30, 27, 75, 0.1);
    padding: 12px 16px 16px;
    gap: 4px;
    /* Animate open */
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
    pointer-events: none;
  }

  .header-nav.open {
    display: flex;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .header-nav a {
    padding: 13px 16px;
    font-size: 1rem;
    border-radius: var(--radius-md);
    width: 100%;
  }

  /* Keep site-header position:fixed so the dropdown positions correctly */
  .site-header { position: fixed; }

  .auth-card { padding: 32px 24px; }

  .cart-item { gap: 10px; padding: 12px; }
  .cart-item-cover { width: 56px; height: 56px; }
  .cart-form-row { flex-direction: column; gap: 10px; }
  .cart-recipient { padding: 18px; }
  .cart-options { padding: 18px; }
  .cart-option-cards { flex-direction: column; gap: 8px; }
  .cart-option-card { padding: 12px 10px; }

  .library-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

@media (max-width: 480px) {
  .catalog-grid { grid-template-columns: 1fr; }
  .library-grid { grid-template-columns: 1fr; }
  .format-grid { flex-direction: column; }
}

/* ================================================================
   ORDERS PAGE
   ================================================================ */
.orders-page { padding-top: 40px; padding-bottom: 60px; }
.orders-list { display: flex; flex-direction: column; gap: 20px; max-width: 700px; margin: 0 auto; }

.order-card {
  background: var(--color-surface-solid);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.order-card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 4px;
}

.order-card-date {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.order-card-price {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
}

/* Timeline */
.order-timeline {
  display: flex;
  align-items: center;
  margin: 16px 0 20px;
  gap: 0;
}

.order-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.order-step-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-border);
  border: 2px solid var(--color-text-muted);
  transition: all 0.2s;
}

.order-step--done .order-step-dot {
  background: var(--color-success);
  border-color: var(--color-success);
}

.order-step--active .order-step-dot {
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

.order-step-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.order-step--done .order-step-label {
  color: var(--color-text);
  font-weight: 600;
}

.order-step-line {
  flex: 1;
  height: 2px;
  background: var(--color-border);
  min-width: 24px;
  margin: 0 4px;
  align-self: flex-start;
  margin-top: 6px;
}

.order-card-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.order-shipping {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.order-lulu-status {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--color-bg-alt);
  color: var(--color-text-secondary);
}

.btn-small {
  font-size: 0.8rem;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: white;
  text-decoration: none;
  font-weight: 600;
  margin-left: auto;
}

.btn-small:hover { background: var(--color-primary-dark); }

/* ================================================================
   SKIP NAV (#71 — Accessibility)
   ================================================================ */
.skip-nav {
  position: fixed;
  top: -100%;
  left: 16px;
  z-index: 10000;
  padding: 12px 24px;
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-nav:focus {
  top: 16px;
}

/* ================================================================
   UPLOAD PROGRESS (#67)
   ================================================================ */
.upload-progress {
  margin-top: 12px;
  text-align: center;
}
.upload-progress-bar {
  height: 8px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.upload-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  border-radius: var(--radius-full);
  transition: width 0.3s var(--ease);
}
.upload-progress-label {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

/* ================================================================
   DARK MODE (#69)
   ================================================================ */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --color-primary: #A78BFA;
    --color-primary-light: #C4B5FD;
    --color-primary-dark: #7C3AED;
    --color-secondary: #F9A8D4;
    --color-secondary-light: #FBCFE8;
    --color-accent: #FBBF24;
    --color-accent-light: #FDE68A;
    --color-bg: #0F0D1A;
    --color-bg-alt: #1A1726;
    --color-surface: rgba(26, 23, 38, 0.92);
    --color-surface-solid: #1A1726;
    --color-text: #E8E5F0;
    --color-text-secondary: #A09BB5;
    --color-text-muted: #6B6780;
    --color-success: #34D399;
    --color-error: #F87171;
    --color-border: rgba(167, 139, 250, 0.12);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.35);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(167, 139, 250, 0.2);
  }

  body { background-color: #0F0D1A; }

  .site-header {
    background: rgba(15, 13, 26, 0.95);
    border-bottom-color: var(--color-border);
  }

  .skeleton {
    background: linear-gradient(90deg, #1A1726 25%, #252236 50%, #1A1726 75%);
    background-size: 200% 100%;
  }

  .upload-zone {
    background: var(--color-bg-alt);
    border-color: var(--color-border);
  }

  .lightbox-overlay {
    background: rgba(0, 0, 0, 0.92);
  }

  .cookie-banner {
    background: #1A1726;
    border-color: var(--color-border);
  }

  .form-input, .form-select {
    background: var(--color-bg-alt);
    border-color: var(--color-border);
    color: var(--color-text);
  }

  .auth-card, .progress-card {
    background: var(--color-surface-solid);
    border-color: var(--color-border);
  }

  .story-card {
    background: var(--color-surface-solid);
  }

  /* Conversion widgets — dark mode */
  .announcement-bar {
    background: linear-gradient(135deg, #4C1D95, var(--color-primary-dark));
  }
  .home-review-card {
    background: var(--color-surface-solid);
    border-color: var(--color-border);
  }
  .home-review-avatar {
    background: var(--color-primary-dark);
    color: var(--color-primary-light);
  }
  .pv-payment-badges svg {
    fill: var(--color-text-secondary);
  }
  .pv-sticky-bar {
    background: rgba(15, 13, 26, 0.95);
    border-top-color: var(--color-border);
  }
  .social-ticker {
    background: var(--color-surface-solid);
    border-color: var(--color-border);
  }
  .cart-upsell {
    background: var(--color-surface-solid);
    border-color: var(--color-border);
  }
  .cart-options {
    background: var(--color-surface-solid);
  }
  .cart-option-card {
    border-color: var(--color-border);
  }
  .cart-option-card.active {
    background: var(--color-surface);
  }
}

@media (prefers-color-scheme: dark) and (max-width: 768px) {
  .mobile-nav {
    background: #0F0D1A;
    border-top-color: var(--color-border);
  }
}

/* ================================================================
   PRINT STYLES (#70)
   ================================================================ */
@media print {
  .site-header,
  .site-footer,
  .skip-nav,
  .btn,
  .cookie-banner,
  .mobile-nav,
  .lightbox-overlay {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  * {
    box-shadow: none !important;
  }

  .story-card,
  .auth-card,
  .progress-card {
    break-inside: avoid;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}

/* ================================================================
   STORY DETAIL PAGE
   ================================================================ */

.story-detail { padding-bottom: 60px; }

.story-detail-breadcrumb {
  padding: 20px 0 12px;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}
.story-detail-breadcrumb a { color: var(--color-primary); text-decoration: none; }
.story-detail-breadcrumb a:hover { text-decoration: underline; }
.story-detail-breadcrumb-sep { margin: 0 8px; opacity: 0.5; }

.story-detail-hero { padding: 0 0 48px; }

.story-detail-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.story-detail-hero-image { border-radius: 12px; overflow: hidden; }
.story-detail-cover-img {
  width: 100%;
  display: block;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.story-detail-cover-placeholder {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  border-radius: 12px;
}

.story-detail-title {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 0 0 16px;
  line-height: 1.2;
}

.story-detail-synopsis {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.story-detail-price-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.story-detail-price {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--color-text);
}

.story-detail-shipping-badge {
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}

.story-detail-specs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.story-detail-spec {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--color-text-secondary);
}
.story-detail-spec svg { color: var(--color-primary); flex-shrink: 0; }

.story-detail-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.story-detail-tag {
  background: var(--color-bg-secondary);
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.story-detail-cta {
  width: 100%;
  text-align: center;
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.story-detail-guarantee {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}
.story-detail-guarantee svg { color: #2e7d32; }

/* Gallery */
.story-detail-gallery { padding: 48px 0; }

.story-detail-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.story-detail-gallery-item {
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
}
.story-detail-gallery-item:hover { transform: scale(1.03); }
.story-detail-gallery-item img { width: 100%; display: block; }

/* What's Inside */
.story-detail-whats-inside { padding: 48px 0; }

.story-detail-features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.story-detail-feature {
  text-align: center;
  padding: 24px 16px;
  background: var(--color-bg-secondary);
  border-radius: 12px;
}

.story-detail-feature-icon { font-size: 2rem; margin-bottom: 12px; }
.story-detail-feature h3 { font-size: 1rem; margin: 0 0 8px; }
.story-detail-feature p { font-size: 0.85rem; color: var(--color-text-secondary); margin: 0; line-height: 1.5; }

/* FAQ */
.story-detail-faq { padding: 48px 0; }
.story-detail-faq-list { max-width: 700px; margin: 24px auto 0; }

.faq-item { border-bottom: 1px solid var(--color-border); }
.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 16px 0;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--color-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-question::after { content: "+"; font-size: 1.3rem; opacity: 0.5; transition: transform 0.2s; }
.faq-item--open .faq-question::after { content: "\2212"; }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.faq-item--open .faq-answer { max-height: 200px; }
.faq-answer p {
  padding: 0 0 16px;
  margin: 0;
  color: var(--color-text-secondary);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Bottom CTA */
.story-detail-bottom-cta {
  padding: 48px 0;
  background: var(--color-bg-secondary);
  border-radius: 16px;
  margin: 0 auto;
  max-width: 800px;
}
.story-detail-bottom-cta h2 { font-family: var(--font-display); }

/* Book Viewer: Quality badges & promo code */
.pv-quality-badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 16px 0;
}

.pv-quality-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--color-bg-secondary);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.pv-pricing {
  text-align: center;
  margin: 20px 0 16px;
}

.pv-price {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-display);
}

.pv-price-original {
  font-size: 1.2rem;
  text-decoration: line-through;
  color: var(--color-text-secondary);
  margin-right: 8px;
}

.pv-shipping-badge {
  display: inline-block;
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  margin-left: 8px;
}

.pv-promo-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin: 12px 0;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.pv-promo-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.9rem;
  text-transform: uppercase;
}
.pv-promo-input:focus { border-color: var(--color-primary); outline: none; }

.pv-promo-apply {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: var(--color-text);
  color: var(--color-bg);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.pv-promo-apply:hover { opacity: 0.85; }
.pv-promo-apply:disabled { opacity: 0.5; cursor: default; }

.pv-promo-msg {
  text-align: center;
  font-size: 0.85rem;
  min-height: 1.2em;
  margin: 4px 0;
}
.pv-promo-msg--success { color: #2e7d32; }
.pv-promo-msg--error { color: var(--color-error); }

.pv-guarantee {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  margin-top: 12px;
}
.pv-guarantee svg { color: #2e7d32; }

/* Purchase section in book viewer */
.pv-purchase-section {
  max-width: 520px;
  margin: 24px auto;
  padding: 0 16px;
}

.pv-lock-story-text {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  font-style: italic;
  max-width: 280px;
  line-height: 1.5;
  margin-top: 8px;
  opacity: 0.8;
}

/* Frosted lock overlay (softer than full opaque) */
.pv-card-lock-overlay {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.6);
}
.pv-lock-text {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  max-width: 280px;
  line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
  .story-detail-hero-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .story-detail-features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .story-detail-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .story-detail-title { font-size: 1.6rem; }
}

/* ================================================================
   CONVERSION WIDGETS
   ================================================================ */

/* --- Announcement Bar --- */
.announcement-bar {
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  color: #fff;
  overflow: hidden;
  white-space: nowrap;
  padding: 8px 0;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--announcement-h);
  z-index: 101;
}
.announcement-track {
  display: flex;
  gap: 48px;
  animation: marquee 30s linear infinite;
  width: max-content;
}
.announcement-track span {
  flex-shrink: 0;
}
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- Star Rating Badge --- */
.pv-star-rating {
  text-align: center;
  margin: 12px 0 8px;
  font-size: 0.95rem;
  color: var(--color-accent);
  font-weight: 600;
}
.pv-star-rating .pv-star-text {
  color: var(--color-text-secondary);
  font-weight: 400;
  margin-left: 4px;
}

/* --- Trust Badges Row --- */
.pv-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 12px 0 16px;
}
.pv-trust-row .pv-quality-badge {
  font-size: 0.8rem;
  gap: 4px;
}

/* --- FAQ Accordion --- */
.pv-faq {
  margin: 20px 0 8px;
  border-top: 1px solid var(--color-border);
}
.pv-faq-item {
  border-bottom: 1px solid var(--color-border);
}
.pv-faq-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
  text-align: left;
  font-family: inherit;
}
.pv-faq-btn::after {
  content: '+';
  font-size: 1.2rem;
  font-weight: 300;
  transition: transform 0.25s ease;
  color: var(--color-text-secondary);
  flex-shrink: 0;
  margin-left: 12px;
}
.pv-faq-btn[aria-expanded="true"]::after {
  content: '\2212';
}
.pv-faq-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 4px;
}
.pv-faq-panel[aria-hidden="false"] {
  max-height: 200px;
}
.pv-faq-panel p {
  margin: 0 0 14px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

/* --- Payment Badges --- */
.pv-payment-badges {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 12px 0 0;
  opacity: 0.5;
}
.pv-payment-badges svg {
  height: 20px;
  width: auto;
}

/* --- Home Reviews --- */
.home-reviews {
  overflow: hidden;
  padding: 60px 0;
}
.home-reviews-heading {
  text-align: center;
  margin-bottom: 32px;
}
.home-reviews-track {
  display: flex;
  gap: 20px;
  width: max-content;
  animation: reviewScroll 40s linear infinite;
}
.home-reviews-track.reverse {
  animation-name: reviewScrollReverse;
  margin-top: 20px;
}
@keyframes reviewScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes reviewScrollReverse {
  0%   { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}
.home-review-card {
  min-width: 280px;
  max-width: 320px;
  background: var(--color-surface-solid, #fff);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}
.home-review-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.home-review-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.home-review-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
}
.home-review-stars {
  color: var(--color-accent);
  font-size: 0.85rem;
}
.home-review-quote {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--color-text-secondary);
  margin: 0;
}

/* --- Story Card Rating --- */
.story-card-rating {
  color: var(--color-accent);
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 2px;
}

/* --- Sticky Buy Bar (book page) --- */
.pv-sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 20px;
  background: var(--color-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -2px 16px rgba(0,0,0,0.08);
  transform: translateY(100%);
  transition: transform 0.3s var(--ease);
}
.pv-sticky-bar.visible { transform: translateY(0); }
.pv-sticky-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pv-sticky-price {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 0.95rem;
}
.pv-sticky-btn { white-space: nowrap; }

@media (max-width: 600px) {
  .pv-sticky-bar { gap: 8px; padding: 8px 12px; }
  .pv-sticky-title { max-width: 120px; font-size: 0.82rem; }
}

/* --- Social Proof Ticker --- */
.social-ticker {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 90;
  max-width: 320px;
  padding: 12px 36px 12px 14px;
  background: var(--color-surface-solid);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  pointer-events: none;
}
.social-ticker.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.social-ticker-text {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--color-text);
}
.social-ticker-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}
.social-ticker-close:hover { color: var(--color-text); }

@media (max-width: 600px) {
  .social-ticker {
    left: 12px;
    right: 12px;
    max-width: none;
    bottom: 16px;
  }
}

/* --- Cart Trust Strip --- */
.cart-trust-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.cart-trust-strip svg {
  color: var(--color-success);
  flex-shrink: 0;
}
.cart-trust-sep {
  opacity: 0.4;
}

/* --- Cart Savings Badge --- */
.cart-savings {
  text-align: center;
  color: var(--color-success);
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 14px;
}

/* --- Cart Product Options --- */
.cart-options {
  background: var(--color-surface-solid);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.cart-options-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 20px;
}
.cart-option-group {
  margin-bottom: 16px;
}
.cart-option-group:last-child {
  margin-bottom: 0;
}
.cart-option-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.cart-option-cards {
  display: flex;
  gap: 10px;
}
.cart-option-card {
  flex: 1;
  position: relative;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-align: center;
}
.cart-option-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.cart-option-card:hover {
  border-color: var(--color-primary-light, #a78bfa);
}
.cart-option-card.active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary);
  background: var(--color-surface);
}
.cart-option-card-badge {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cart-option-card-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 2px;
}
.cart-option-card-desc {
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
  line-height: 1.3;
}
.cart-option-card-price {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-primary);
}

/* --- Cart Delivery Estimate --- */
.cart-delivery-estimate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--color-surface-solid);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  margin-bottom: 20px;
  font-size: 0.88rem;
  color: var(--color-text-secondary);
}
.cart-delivery-estimate svg {
  color: var(--color-primary);
  flex-shrink: 0;
}

/* --- Story Detail: Why Kids Love This --- */
.story-detail-why-love {
  padding: 48px 0 0;
}
.story-detail-benefits-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 24px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.story-detail-benefit {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--color-surface-solid);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  font-size: 0.95rem;
  font-weight: 500;
}
.story-detail-benefit-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .story-detail-benefits-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Cart Bundle Upsell --- */
.cart-upsell {
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  background: var(--color-surface);
}
.cart-upsell-header {
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  margin-bottom: 16px;
  color: var(--color-text);
}
.cart-upsell-grid {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.cart-upsell-card {
  min-width: 140px;
  flex: 1;
  text-align: center;
}
.cart-upsell-card img {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  margin-bottom: 8px;
}
.cart-upsell-card-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 8px;
}
.cart-upsell-card-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
  line-height: 1.3;
}
.cart-upsell-add {
  font-size: 0.78rem;
  white-space: nowrap;
}

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

  .story-card:hover {
    transform: none;
  }

  .spinner {
    animation: none;
    border-top-color: var(--color-primary);
  }

  .announcement-track {
    animation: none;
    justify-content: center;
    gap: 24px;
  }
  .home-reviews-track,
  .home-reviews-track.reverse {
    animation: none;
  }
  .pv-sticky-bar {
    transition: none;
  }
  .social-ticker {
    transition: none;
  }
}
