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

:root {
  --bg: #FAF7F2;
  --bg-alt: #F0EDE5;
  --text: #1A2744;
  --text-muted: #6B6560;
  --accent: #C89B3C;
  --accent-light: #D4B06A;
  --accent-pale: #F5EDD8;
  --navy: #1A2744;
  --burgundy: #7A1F2E;
  --border: rgba(26,39,68,0.10);
  --border-accent: rgba(200,155,60,0.30);
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 12px rgba(26,39,68,0.06);
  --shadow-md: 0 8px 40px rgba(26,39,68,0.10);
  --shadow-lg: 0 20px 80px rgba(26,39,68,0.14);
  --trans: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --trans-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
a { text-decoration: none; color: inherit; }

/* ─── Typography ────────────────────────────────────── */
h1, h2, h3 { font-family: 'Cormorant Garamond', serif; line-height: 1.12; }
h1 { font-size: clamp(3rem, 7vw, 6rem); font-weight: 400; }
h2 { font-size: clamp(2rem, 4.5vw, 3.5rem); font-weight: 400; }
h3 { font-size: 1.5rem; font-weight: 400; }
em { font-style: italic; }

.section-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

/* ─── Scroll Reveal ─────────────────────────────────── */
.reveal-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--trans), transform 0.8s var(--trans);
}
.reveal-up.visible { opacity: 1; transform: translateY(0); }

/* ─── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 100px;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: none;
  transition: all 0.3s var(--trans);
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary {
  background: var(--text);
  color: var(--bg);
}
.btn-primary:hover {
  background: #0F1A30;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(26,39,68,0.35);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
  transform: translateY(-2px);
}
.btn-full { width: 100%; justify-content: center; }
.btn-large { padding: 18px 40px; font-size: 1rem; }

/* ─── Navigation ─────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 2rem;
  transition: background 0.4s var(--trans), box-shadow 0.4s var(--trans), transform 0.4s var(--trans);
}
.nav.scrolled {
  background: rgba(249,247,242,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--border), 0 4px 24px rgba(26,22,20,0.05);
}
.nav.hidden { transform: translateY(-100%); }

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text);
  flex-shrink: 0;
}
.logo-mark { flex-shrink: 0; }

.nav-links {
  display: flex;
  list-style: none;
  gap: 0;
  margin-left: auto;
}
.nav-links a {
  display: block;
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 2px; left: 1.25rem; right: 1.25rem;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s var(--trans);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-auth { display: flex; align-items: center; }
.nav-sign-in {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 4px 0;
  transition: color 0.2s;
}
.nav-sign-in:hover { color: var(--text); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.3s var(--trans);
  flex-shrink: 0;
}
.nav-cta:hover { background: var(--text); color: var(--bg); border-color: var(--text); }

.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  margin-left: auto;
  padding: 4px;
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: all 0.3s var(--trans);
}

/* ─── Hero ───────────────────────────────────────────── */
.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
  padding: 100px 8vw 6rem;
  position: relative;
  overflow: hidden;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.6;
}

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

.hero-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.hero-headline {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.75rem;
}
.hl-1 {
  transition-delay: 0.1s;
  color: var(--text);
}
.hl-2 {
  transition-delay: 0.2s;
  color: var(--accent);
  font-size: clamp(3.2rem, 7.5vw, 6.5rem);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 440px;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  transition-delay: 0.3s;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  transition-delay: 0.4s;
}

.hero-scroll {
  position: absolute;
  bottom: 3rem;
  left: 8vw;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 1s 1.5s;
}
.hero-scroll.visible { opacity: 1; }
.scroll-line {
  width: 40px;
  height: 1px;
  background: var(--accent);
  transform-origin: left;
  animation: scrollPulse 2s var(--trans) infinite;
}
@keyframes scrollPulse {
  0%, 100% { transform: scaleX(1); opacity: 1; }
  50% { transform: scaleX(0.5); opacity: 0.4; }
}

/* Floating book */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
}
.floating-book {
  width: min(480px, 90%);
  animation: float 7s ease-in-out infinite;
  filter: drop-shadow(0 30px 60px rgba(26,22,20,0.18));
  transform-origin: center;
  opacity: 0;
  transition: opacity 0.8s 0.6s;
}
.floating-book.visible { opacity: 1; }
.book-svg { width: 100%; height: auto; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-24px) rotate(1.5deg); }
}

/* Magnetic button effect */
.magnetic { display: inline-flex; position: relative; }

/* ─── Verse Strip ───────────────────────────────────── */
.verse-strip {
  background: var(--navy);
  padding: 1.75rem 8vw;
  text-align: center;
}
.verse-strip-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.verse-quote {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.1rem;
  color: rgba(255,255,255,0.82);
  line-height: 1.65;
}
.verse-ref {
  font-family: 'Inter', sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ─── Proof Bar ─────────────────────────────────────── */
.proof-bar {
  background: var(--text);
  color: var(--bg);
  padding: 2rem 8vw;
}
.proof-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
}
.proof-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.proof-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 300;
  color: var(--accent-light);
  line-height: 1;
}
.proof-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(249,247,242,0.5);
}
.proof-divider {
  width: 1px;
  height: 32px;
  background: rgba(249,247,242,0.15);
}

/* ─── Section Header ────────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}
.section-header h2 { margin-bottom: 1rem; }
.section-header p {
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
  font-size: 1rem;
}

/* ─── Stories Grid ──────────────────────────────────── */
.stories-section {
  padding: 8rem 8vw;
  max-width: 1400px;
  margin: 0 auto;
}

.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.story-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg);
  border: 1.5px solid var(--border);
  transition: transform 0.4s var(--trans), box-shadow 0.4s var(--trans), border-color 0.3s;
  cursor: pointer;
}
.story-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-accent);
}

.card-art {
  height: 200px;
  overflow: hidden;
  transition: transform 0.5s var(--trans);
}
.card-art svg { width: 100%; height: 100%; object-fit: cover; }
.story-card:hover .card-art { transform: scale(1.03); }

.card-body { padding: 1.5rem; }

.card-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--border-accent);
  border-radius: 100px;
  padding: 3px 10px;
  margin-bottom: 0.75rem;
}

.card-body h3 {
  font-size: 1.4rem;
  margin-bottom: 0.6rem;
}
.card-body p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.card-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.card-tag {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-alt);
  border-radius: 100px;
  padding: 3px 10px;
}
.card-cta {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  transition: color 0.2s;
}
.card-cta:hover { color: var(--text); }

/* ─── How It Works ──────────────────────────────────── */
.how-section {
  padding: 8rem 8vw;
  background: var(--text);
  color: var(--bg);
}
.how-section .section-header { color: var(--bg); }
.how-section .section-label { color: var(--accent-light); }
.how-section .section-header p { color: rgba(249,247,242,0.6); }
.how-section h2 { color: var(--bg); }

.steps {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.step {
  flex: 1;
  text-align: center;
  padding: 2rem 1.5rem;
}
.step-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3rem;
  font-weight: 300;
  color: var(--accent);
  opacity: 0.4;
  line-height: 1;
  margin-bottom: 1rem;
}
.step-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.step h3 {
  font-size: 1.3rem;
  color: var(--bg);
  margin-bottom: 0.75rem;
}
.step p { font-size: 0.875rem; color: rgba(249,247,242,0.55); line-height: 1.7; }

.step-connector {
  flex-shrink: 0;
  opacity: 0.3;
}

/* ─── Creator ────────────────────────────────────────── */
.creator-section {
  padding: 8rem 8vw;
  max-width: 1400px;
  margin: 0 auto;
}
.creator-header {
  text-align: center;
  margin-bottom: 4rem;
}
.creator-header p { color: var(--text-muted); margin-top: 0.75rem; }

/* ─── Wizard Progress Bar ─────────────────────────────── */
.wiz-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 480px;
  margin: 0 auto 3rem;
}
.wiz-ind {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.wiz-ind span {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.3s;
  white-space: nowrap;
}
.wiz-dot {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.3s;
}
.wiz-ind.wiz-ind-active .wiz-dot {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.wiz-ind.wiz-ind-active span { color: var(--text); }
.wiz-ind.wiz-ind-done .wiz-dot {
  border-color: var(--accent);
  background: var(--accent-pale);
  color: var(--accent);
}
.wiz-line {
  flex: 1;
  height: 1.5px;
  background: var(--border);
  margin: 0 0.75rem;
  margin-bottom: 1.5rem;
  min-width: 40px;
  transition: background 0.3s;
}
.wiz-line.wiz-line-done { background: var(--accent); }

/* ─── Wizard Panels ───────────────────────────────────── */
.wiz-panel { display: none; }
.wiz-panel.wiz-active { display: block; }

/* ─── Story Picker Grid ───────────────────────────────── */
.story-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
@media (max-width: 860px) {
  .story-picker-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .story-picker-grid { grid-template-columns: repeat(2, 1fr); }
}
.story-pick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.4rem 0.75rem 1.1rem;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.2s var(--trans);
  text-align: center;
}
.story-pick-card:hover {
  border-color: var(--border-accent);
  background: var(--accent-pale);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(200,155,60,0.12);
}
.story-pick-card.selected {
  border-color: var(--accent);
  background: var(--accent-pale);
  box-shadow: 0 0 0 3px rgba(200,155,60,0.18);
}
.pick-emoji { font-size: 2.2rem; line-height: 1; }
.pick-title {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}
.pick-virtue {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 0.15rem;
}

/* ─── Personalize Panel ───────────────────────────────── */
.selected-story-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--accent-pale);
  border: 1.5px solid var(--border-accent);
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
}
.ssb-emoji { font-size: 1.75rem; flex-shrink: 0; }
.ssb-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-style: italic;
  color: var(--text);
  line-height: 1.2;
}
.ssb-virtue {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 0.2rem;
}
.ssb-change {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  flex-shrink: 0;
  padding: 0;
}
.ssb-change:hover { color: var(--accent); }

.personalize-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2rem;
  align-items: start;
}
@media (max-width: 640px) {
  .personalize-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}
.personalize-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.label-opt {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.68rem;
}

/* ─── Wizard Footer ───────────────────────────────────── */
.wiz-panel-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
}
.wiz-footer-between { justify-content: space-between; }
.wiz-cta-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}
.wiz-book-footer { margin-top: 1.5rem; }

/* ─── Outline Button ──────────────────────────────────── */
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
  padding: 12px 22px;
  border-radius: 100px;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s var(--trans);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.text-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg-alt);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.text-input::placeholder { color: var(--text-muted); }
.text-input:focus { border-color: var(--accent); }

/* Story tabs */
.story-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.story-tab {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: transparent;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  text-align: left;
  transition: all 0.2s var(--trans);
}
.story-tab:hover { border-color: var(--border-accent); color: var(--text); background: var(--accent-pale); }
.story-tab.active { border-color: var(--accent); background: var(--accent-pale); color: var(--text); }
.tab-icon { font-size: 1rem; }

/* Upload zone */
.upload-zone {
  border: 1.5px dashed var(--border-accent);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  transition: all 0.3s var(--trans);
  background: var(--bg-alt);
  position: relative;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-pale);
  transform: scale(1.01);
}
.upload-icon { margin-bottom: 0.75rem; }
.upload-text { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.upload-link {
  color: var(--accent);
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.upload-hint { font-size: 0.75rem; color: var(--text-muted); opacity: 0.7; }

.upload-preview {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}
.upload-preview img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--accent);
  box-shadow: 0 4px 20px rgba(184,146,74,0.3);
}
.remove-photo {
  position: absolute;
  top: -6px; right: calc(50% - 72px);
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s var(--trans-spring);
}
.remove-photo:hover { transform: scale(1.15); }

.cta-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* ─── Book Preview Area ──────────────────────────────── */
.book-preview-area {
  min-height: 560px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
}

/* Empty state */
.preview-empty {
  text-align: center;
  padding: 3rem;
  max-width: 320px;
}
.empty-illustration { display: flex; justify-content: center; margin-bottom: 1.5rem; opacity: 0.5; }
.preview-empty h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.preview-empty p { font-size: 0.875rem; color: var(--text-muted); }

/* Loading state */
.preview-loading {
  text-align: center;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
.loading-orb {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), transparent, var(--accent));
  animation: spin 1.2s linear infinite;
  position: relative;
}
.loading-orb::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--bg-alt);
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-text h3 { font-size: 1.3rem; margin-bottom: 0.25rem; }
.loading-text p { font-size: 0.875rem; color: var(--text-muted); }

.loading-progress {
  width: 200px;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.3s var(--trans);
  border-radius: 2px;
}

/* Book display */
.book-display {
  width: 100%;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.book-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.book-title-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--text-muted);
}
.page-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.page-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--trans);
  color: var(--text);
}
.page-btn:hover { border-color: var(--accent); background: var(--accent-pale); }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.page-indicator { font-size: 0.78rem; color: var(--text-muted); }

/* 3D Book */
.book-3d-wrapper {
  perspective: 1200px;
  display: flex;
  justify-content: center;
}
.book-3d {
  transform: rotateX(5deg) rotateY(-4deg);
  transform-style: preserve-3d;
  width: 100%;
  max-width: 860px;
  border-radius: var(--radius);
  box-shadow:
    -6px 6px 0 #E8E0D0,
    -12px 12px 0 #DDD4C0,
    0 30px 80px rgba(26,22,20,0.25);
  animation: bookFloat 6s ease-in-out infinite;
  transition: transform 0.8s var(--trans);
}
@keyframes bookFloat {
  0%, 100% { transform: rotateX(5deg) rotateY(-4deg) translateY(0); }
  50% { transform: rotateX(3deg) rotateY(-2deg) translateY(-8px); }
}

.book-spread {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  min-height: 460px;
  border-radius: var(--radius);
  overflow: hidden;
  display: none;
}
.book-spread.active { display: grid; }

.page {
  position: relative;
  overflow: hidden;
}
.page-left {
  background: #FAF7F0;
  padding: 2.5rem 2rem 2rem 2.5rem;
  border-right: 2px solid rgba(184,146,74,0.25);
  position: relative;
}
.page-left::before {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 8px;
  background: linear-gradient(to right, transparent, rgba(0,0,0,0.04));
}
.page-right { overflow: hidden; }
.page-right svg { width: 100%; height: 100%; }

/* Left page content */
.page-deco-border {
  position: absolute;
  inset: 12px;
  border: 0.75px solid rgba(184,146,74,0.3);
  border-radius: 4px;
  pointer-events: none;
}
.page-chapter {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.page-story-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text);
}
.page-child-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--accent);
  margin-bottom: 1.25rem;
}
.page-text {
  font-size: 0.78rem;
  line-height: 1.85;
  color: var(--text-muted);
}
.page-ornament {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--accent);
  opacity: 0.4;
  font-size: 0.8rem;
}
.page-num {
  position: absolute;
  bottom: 0.75rem;
  right: 1.25rem;
  font-size: 0.68rem;
  color: var(--text-muted);
  opacity: 0.5;
}

/* Book order bar */
.book-order {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.order-format { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.format-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
}
.format-option input { accent-color: var(--accent); }
.format-option em { color: var(--accent); font-style: normal; font-weight: 500; margin-left: 4px; }

/* ─── Quality Section ────────────────────────────────── */
.quality-section {
  padding: 8rem 8vw;
  background: var(--text);
  color: var(--bg);
  overflow: hidden;
}
.quality-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: center;
}
.quality-section .section-label { color: var(--accent-light); }
.quality-content h2 { color: var(--bg); margin-bottom: 2rem; }

.quality-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.quality-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  font-size: 0.9rem;
  color: rgba(249,247,242,0.75);
  line-height: 1.6;
}
.quality-list svg { flex-shrink: 0; margin-top: 2px; }

/* 3D book mockup */
.quality-visual { display: flex; justify-content: center; }
.quality-book-mockup {
  position: relative;
  width: 220px;
  animation: float 7s ease-in-out infinite;
}
.qbook-shadow {
  position: absolute;
  bottom: -20px; left: 10%; right: 10%;
  height: 20px;
  background: rgba(0,0,0,0.3);
  border-radius: 50%;
  filter: blur(10px);
}
.qbook-cover {
  position: relative;
  border-radius: 4px 12px 12px 4px;
  box-shadow: -6px 0 0 #8B6914, -12px 2px 0 #6B4A10, 0 20px 50px rgba(0,0,0,0.4);
  overflow: hidden;
  width: 100%;
  aspect-ratio: 3/4;
}
.qbook-spine {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 20px;
  background: linear-gradient(to right, #8B6914, #C9A35A);
}
.qbook-front {
  position: absolute;
  inset: 0;
  left: 20px;
  background: linear-gradient(135deg, #1A3A5C 0%, #0D1F35 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem;
}
.qbook-ornament {
  color: var(--accent-light);
  font-size: 1.25rem;
}
.qbook-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--accent-light);
  text-transform: uppercase;
}
.qbook-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.9rem;
  font-style: italic;
  color: rgba(249,247,242,0.6);
}
.qbook-child-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  color: rgba(249,247,242,0.85);
  font-style: italic;
}
.qbook-face {
  margin-top: 0.5rem;
}
.qbook-pages {
  position: absolute;
  right: -8px;
  top: 5px; bottom: 5px;
  width: 12px;
  background: repeating-linear-gradient(
    to right,
    #F5F0E8 0px,
    #F5F0E8 1px,
    #E8E0D0 1px,
    #E8E0D0 2px
  );
  border-radius: 0 2px 2px 0;
}

/* ─── Testimonials ──────────────────────────────────── */
.testimonials-section {
  padding: 8rem 8vw;
  max-width: 1400px;
  margin: 0 auto;
}
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.testimonial {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: transform 0.3s var(--trans), box-shadow 0.3s var(--trans);
}
.testimonial:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.testimonial-stars {
  color: var(--accent);
  font-size: 0.9rem;
  letter-spacing: 2px;
  margin-bottom: 1.25rem;
}
.testimonial blockquote {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 1.5rem;
}
.testimonial-author {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}
.author-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}
.testimonial-author strong { display: block; font-size: 0.875rem; margin-bottom: 2px; }
.testimonial-author span { font-size: 0.75rem; color: var(--text-muted); }

/* ─── Pricing ────────────────────────────────────────── */
.pricing-section {
  padding: 8rem 8vw;
  background: var(--bg-alt);
}
.pricing-cards {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  align-items: start;
}
.pricing-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
  transition: transform 0.3s var(--trans), box-shadow 0.3s var(--trans);
}
.pricing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.pricing-card-featured {
  border-color: var(--accent);
  background: var(--text);
  color: var(--bg);
  transform: scale(1.02);
}
.pricing-card-featured:hover { transform: scale(1.02) translateY(-4px); }
.pricing-badge {
  position: absolute;
  top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent);
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 100px;
  white-space: nowrap;
}
.pricing-tier {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.pricing-card-featured .pricing-tier { color: var(--accent-light); }
.pricing-amount {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3rem;
  font-weight: 300;
  line-height: 1;
  margin-bottom: 0.75rem;
}
.pricing-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.65;
}
.pricing-card-featured .pricing-desc { color: rgba(249,247,242,0.55); }
.pricing-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.75rem;
}
.pricing-features li {
  font-size: 0.85rem;
  padding-left: 1.25rem;
  position: relative;
  color: var(--text-muted);
}
.pricing-card-featured .pricing-features li { color: rgba(249,247,242,0.65); }
.pricing-features li::before {
  content: '✦';
  position: absolute;
  left: 0;
  font-size: 0.5rem;
  top: 5px;
  color: var(--accent);
}
.pricing-card-featured .btn-ghost {
  border-color: rgba(249,247,242,0.25);
  color: var(--bg);
}
.pricing-card-featured .btn-ghost:hover {
  background: var(--bg);
  color: var(--text);
}

/* ─── Final CTA ──────────────────────────────────────── */
.final-cta {
  padding: 10rem 8vw;
  text-align: center;
}
.final-cta-inner { max-width: 640px; margin: 0 auto; }
.final-cta-ornament {
  font-size: 1.5rem;
  color: var(--accent);
  display: block;
  margin-bottom: 2rem;
  animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.95); }
}
.final-cta h2 { margin-bottom: 1rem; }
.final-cta p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}
.final-verse {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin-bottom: 2.5rem;
  opacity: 0.85;
}

/* ─── Footer ─────────────────────────────────────────── */
.footer {
  background: var(--text);
  color: var(--bg);
  padding: 4rem 8vw 2rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(249,247,242,0.1);
  margin-bottom: 1.5rem;
}
.footer-brand .logo { margin-bottom: 1rem; }
.footer-brand .logo span { color: var(--bg); }
.footer-brand p { font-size: 0.85rem; color: rgba(249,247,242,0.45); line-height: 1.7; }
.footer-links { display: flex; gap: 3rem; }
.footer-col { display: flex; flex-direction: column; gap: 0.75rem; }
.footer-col h4 {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(249,247,242,0.4);
  margin-bottom: 0.25rem;
}
.footer-col a {
  font-size: 0.85rem;
  color: rgba(249,247,242,0.6);
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--accent-light); }
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: rgba(249,247,242,0.3);
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 1024px) {
  .creator-wrapper { grid-template-columns: 1fr; }
  .quality-inner { grid-template-columns: 1fr; gap: 4rem; }
  .quality-visual { order: -1; }
}

@media (max-width: 768px) {
  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: flex; }

  .hero {
    grid-template-columns: 1fr;
    padding: 90px 6vw 5rem;
    text-align: center;
    gap: 3rem;
  }
  .hero-actions { justify-content: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-scroll { left: 50%; transform: translateX(-50%); }
  .floating-book { width: min(340px, 90%); }

  .steps {
    flex-direction: column;
    gap: 1rem;
  }
  .step-connector { display: none; }

  .stories-grid { grid-template-columns: 1fr; }
  .book-spread { grid-template-columns: 1fr; min-height: auto; }
  .page-left { padding: 1.5rem; }
  .page-right { min-height: 280px; }
  .book-order { flex-direction: column; }

  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { flex-wrap: wrap; gap: 2rem; }
}

@media (max-width: 480px) {
  .proof-inner { gap: 1.5rem; }
  .proof-divider { display: none; }
  .pricing-cards { grid-template-columns: 1fr; }
  .pricing-card-featured { transform: none; }
}

/* ─── Custom Cursor (desktop only) ──────────────────── */
@media (pointer: fine) {
  body { cursor: none; }
  .cursor {
    position: fixed;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.1s, width 0.3s var(--trans-spring), height 0.3s var(--trans-spring), opacity 0.3s;
    mix-blend-mode: multiply;
  }
  .cursor-ring {
    position: fixed;
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 1.5px solid rgba(184,146,74,0.5);
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: transform 0.15s var(--trans), width 0.4s var(--trans-spring), height 0.4s var(--trans-spring), opacity 0.3s;
  }
  .cursor.hovering { width: 14px; height: 14px; }
  .cursor-ring.hovering { width: 48px; height: 48px; opacity: 0.6; }
  a, button { cursor: none; }
}

/* ─── Modal Shared ────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26,39,68,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ─── Photo Crop Modal ────────────────────────────────── */
.crop-modal { position: fixed; inset: 0; z-index: 201; display: flex; align-items: center; justify-content: center; }
.crop-modal[hidden] { display: none; }
.crop-inner {
  position: relative;
  z-index: 202;
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: min(460px, 92vw);
  box-shadow: 0 40px 100px rgba(26,39,68,0.35);
  animation: slideUp 0.25s var(--trans);
}
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.crop-header { text-align: center; margin-bottom: 1.25rem; }
.crop-header h3 { font-size: 1.2rem; margin-bottom: 0.25rem; }
.crop-header p { font-size: 0.78rem; color: var(--text-muted); }
.crop-canvas-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
  border-radius: var(--radius);
  overflow: hidden;
  background: #111;
}
#cropCanvas { display: block; cursor: grab; border-radius: var(--radius); }
#cropCanvas:active { cursor: grabbing; }
.crop-zoom-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 0 0.25rem;
}
.crop-zoom-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.crop-zoom-btn:hover { border-color: var(--accent); color: var(--accent); }
.zoom-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}
.zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.crop-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* ─── Auth Interstitial Modal ─────────────────────────── */
.auth-modal { position: fixed; inset: 0; z-index: 201; display: flex; align-items: center; justify-content: center; }
.auth-modal[hidden] { display: none; }
.auth-modal-inner {
  position: relative;
  z-index: 202;
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: min(400px, 90vw);
  text-align: center;
  box-shadow: 0 40px 100px rgba(26,39,68,0.35);
  animation: slideUp 0.25s var(--trans);
}
.auth-modal-star { margin-bottom: 1.25rem; }
.auth-modal-inner h3 { font-size: 1.6rem; margin-bottom: 0.5rem; }
.auth-modal-inner p { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 1.5rem; line-height: 1.6; }
.auth-modal-btns { display: flex; flex-direction: column; gap: 0.65rem; margin-bottom: 1.25rem; }
.auth-guest-btn {
  background: none;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
  transition: color 0.2s;
}
.auth-guest-btn:hover { color: var(--text); }
.auth-modal-note {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  opacity: 0.7;
  line-height: 1.5;
}

/* ─── Toast ───────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: var(--text);
  color: var(--bg);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  padding: 0.75rem 1.5rem;
  border-radius: 100px;
  box-shadow: 0 8px 30px rgba(26,39,68,0.3);
  z-index: 300;
  white-space: nowrap;
  animation: toastIn 0.3s var(--trans);
}
.toast[hidden] { display: none; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
