@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500&family=Jost:wght@300;400;500&display=swap');

/* ── VARIABLES ── */
:root {
  --cream:      #FAF8F4;
  --cream-mid:  #F2EDE5;
  --beige:      #E8DDD0;
  --text:       #1C1713;
  --text-mid:   #5A4E44;
  --text-light: #9A8D82;
  --red:        #7A1C1C;
  --red-hover:  #9B2020;
  --gold:       #C4A46B;
  --border:     #DDD5C8;

  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans:  'Jost', sans-serif;
  --ease:       cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── RESET ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--cream);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--beige); border-radius: 2px; }

/* ── LAYOUT ── */
.container { max-width: 1080px; margin: 0 auto; padding: 0 28px; }

/* ── TYPOGRAPHY ── */
h1, h2, h3 { font-family: var(--font-serif); font-weight: 400; line-height: 1.15; }
h1 { font-size: clamp(3rem, 7vw, 5.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: 1.35rem; }
p  { color: var(--text-mid); font-size: 0.92rem; line-height: 1.8; }

.eyebrow {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1rem;
}

/* ── HEADER ── */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 0;
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: padding 0.3s var(--ease);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.35em;
}
.logo em {
  font-style: italic;
  color: var(--red);
}
.logo .logo-with {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
}
.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}
.nav-links a {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-mid);
  transition: color 0.25s;
}
.nav-links a:hover { color: var(--text); }

/* ── HERO ── */
.hero {
  padding: 160px 0 80px;
  text-align: center;
  background: linear-gradient(180deg, var(--cream) 60%, var(--cream-mid) 100%);
}
.hero-inner { max-width: 680px; margin: 0 auto; }
h1 { color: var(--text); margin-bottom: 0.3em; }
h1 em { font-style: italic; color: var(--red); }

.hero-sub {
  max-width: 520px;
  margin: 0 auto 2.5rem;
  font-size: 0.95rem;
  color: var(--text-mid);
}

/* ── DOWNLOAD BUTTONS ── */
.download-group {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 28px;
  border-radius: 10px;
  min-width: 195px;
  transition: all 0.25s var(--ease);
  position: relative;
  cursor: pointer;
  /* reset button defaults */
  font-family: inherit;
  text-align: left;
}
.dl-btn:hover { transform: translateY(-3px); }

.dl-ios {
  background: var(--text);
  color: var(--cream);
  box-shadow: 0 4px 20px rgba(28, 23, 19, 0.18);
}
.dl-ios:hover { 
  background: var(--red);
  box-shadow: 0 8px 30px rgba(162, 30, 36, 0.35); 
}

.dl-android {
  background: var(--cream);
  color: var(--text);
  border: 1.5px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.dl-android:hover { 
  box-shadow: 0 8px 30px rgba(162, 30, 36, 0.12); 
  border-color: var(--red); 
}

.store-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}
.dl-ios .store-icon { fill: var(--cream); }
.dl-android .store-icon { fill: var(--text); }

.dl-text { display: flex; flex-direction: column; align-items: flex-start; }
.dl-small {
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  opacity: 0.75;
  line-height: 1;
}
.dl-big {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.coming-pill {
  position: absolute;
  top: -9px;
  right: -9px;
  background: var(--gold);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
}

.platform-note {
  font-size: 0.72rem;
  color: var(--text-light);
  letter-spacing: 0.12em;
}

/* ── DECORATIVE DIVIDER ── */
.hero-divider {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 360px;
  margin: 70px auto 0;
  color: var(--gold);
}
.hero-divider span {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold));
}
.hero-divider span:last-child {
  background: linear-gradient(to left, transparent, var(--gold));
}
.hero-divider svg { flex-shrink: 0; opacity: 0.8; }

/* ── PRODUCTS SECTION ── */
.products {
  padding: 100px 0;
  background: var(--cream-mid);
}
.section-header {
  text-align: center;
  margin-bottom: 60px;
}
.section-header h2 { color: var(--text); margin-bottom: 0.6rem; }
.section-sub { max-width: 440px; margin: 0 auto; font-size: 0.9rem; }

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ── PRODUCT CARD ── */
.product-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
  position: relative;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.08);
  border-color: var(--beige);
}
.product-card.free { background: #fff; }

.product-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 20px;
  color: var(--red);
}
.product-icon svg { width: 100%; height: 100%; }

.product-badge {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
  width: fit-content;
  background: var(--cream-mid);
  color: var(--text-mid);
  border: 1px solid var(--border);
}
.free-badge {
  background: rgba(122, 28, 28, 0.08);
  color: var(--red);
  border-color: rgba(122, 28, 28, 0.2);
}
.coming-badge {
  background: rgba(196, 164, 107, 0.12);
  color: #8A6A2C;
  border-color: rgba(196, 164, 107, 0.35);
}

.product-card h3 {
  color: var(--text);
  margin-bottom: 10px;
  font-size: 1.25rem;
}
.product-card p {
  font-size: 0.85rem;
  color: var(--text-mid);
  margin-bottom: 24px;
  flex: 1;
  line-height: 1.75;
}

/* ── PRODUCT BUTTONS ── */
.product-btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  text-align: center;
  border: none;
  width: 100%;
}
.primary-btn {
  background: var(--red);
  color: var(--cream);
}
.primary-btn:hover { background: var(--red-hover); transform: translateY(-1px); }

.outline-btn {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.outline-btn:hover { border-color: var(--text-mid); }

/* ── NEWSLETTER ── */
.newsletter {
  padding: 100px 0;
  background: var(--cream);
  border-top: 1px solid var(--border);
}
.newsletter-inner {
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
}
.newsletter-inner h2 { color: var(--text); margin-bottom: 0.5rem; }
.newsletter-sub { margin-bottom: 2rem; }

.nl-form {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.25s;
  margin: 0 auto;
  max-width: 420px;
}
.nl-form:focus-within { border-color: var(--red); }

.nl-form input {
  flex: 1;
  padding: 14px 18px;
  background: var(--cream);
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--text);
}
.nl-form input::placeholder { color: var(--text-light); }

.nl-form button {
  padding: 14px 22px;
  background: var(--red);
  color: #fff;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}
.nl-form button:hover { background: var(--red-hover); }

.nl-success {
  display: none;
  margin-top: 18px;
  font-size: 0.85rem;
  color: var(--red);
  font-style: italic;
  font-family: var(--font-serif);
  font-size: 1rem;
}

/* ── FOOTER ── */
.footer {
  padding: 36px 0;
  background: var(--text);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-logo {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--cream);
  letter-spacing: 0.06em;
}
.footer-logo span { color: var(--gold); }
.footer-copy {
  font-size: 0.68rem;
  color: rgba(250,248,244,0.4);
  letter-spacing: 0.08em;
}

/* ── MODAL ── */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(28, 23, 19, 0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.modal-bg.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 40px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  position: relative;
  transform: translateY(16px);
  transition: transform 0.3s var(--ease);
}
.modal-bg.open .modal { transform: translateY(0); }

.modal-icon { font-size: 2.4rem; margin-bottom: 16px; }
.modal h3 { color: var(--text); margin-bottom: 10px; }
.modal p { margin-bottom: 24px; font-size: 0.88rem; }

.modal-x {
  position: absolute;
  top: 14px; right: 18px;
  background: none; border: none;
  font-size: 1.4rem; color: var(--text-light);
  cursor: pointer; line-height: 1;
  transition: color 0.2s;
}
.modal-x:hover { color: var(--text); }

.modal-form { display: flex; flex-direction: column; gap: 12px; }
.modal-form input {
  width: 100%;
  padding: 13px 16px;
  background: var(--cream-mid);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.modal-form input:focus { border-color: var(--red); }
.modal-form input::placeholder { color: var(--text-light); }

/* ── BOOK SHOWCASE ── */
.book-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 48px;
  margin-bottom: 80px;
  padding: 60px 40px;
  background: linear-gradient(135deg, #fff 0%, var(--cream-mid) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.book-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* Container that wraps the StPageFlip canvas */
.flipbook-wrap {
  position: relative;
  width: 100%;
  max-width: 800px;
  aspect-ratio: 800 / 478;
  transform: translateX(-25%);
  /* shadow effect around the open book */
  filter: drop-shadow(0 20px 50px rgba(0,0,0,0.22)) drop-shadow(0 6px 14px rgba(0,0,0,0.12));
  transition: transform 0.75s cubic-bezier(0.1, 0.9, 0.2, 1);
}

#flipbook {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Each page inside the flipbook */
#flipbook .page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fff;
  visibility: hidden;
}

#flipbook .page:first-child {
  visibility: visible;
}

/* Once StPageFlip is initialized, it handles page visibility via display properties */
#flipbook.is-initialized .page {
  visibility: visible;
}

#flipbook .page img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
}

/* Wiggle animation to indicate interactivity */
.book-wiggle {
  animation: bookWiggle 0.8s ease-in-out;
}
@keyframes bookWiggle {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25%      { transform: rotate(2deg) scale(1.02); }
  75%      { transform: rotate(-2deg) scale(1.02); }
}

/* Flip hint */
.flipbook-hint {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-light);
  font-weight: 400;
  animation: pulse-hint 2.8s ease-in-out infinite;
}
@keyframes pulse-hint {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}

/* Book info panel */
.book-info-panel { 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  gap: 0;
  max-width: 680px;
}

.book-info-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 400;
  color: var(--text);
  line-height: 1.1;
  margin: 10px 0 6px;
}
.book-info-title em { font-style: italic; color: var(--red); }

.book-info-author {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--text-light);
  font-size: 1rem;
  margin-bottom: 20px;
}

.book-info-desc {
  font-size: 0.88rem;
  line-height: 1.85;
  color: var(--text-mid);
  margin-bottom: 14px;
}

.book-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0 20px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.book-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-mid);
  letter-spacing: 0.02em;
}
.book-features svg { color: var(--red); flex-shrink: 0; }

.book-order-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 14px 28px;
  font-size: 0.75rem;
}

/* ── FEATURE STRIP ── */
.feature-strip {
  background: var(--cream-mid);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
  margin-top: 60px;
}
.feature-strip-inner {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-mid);
  letter-spacing: 0.04em;
}
.feature-pill svg { color: var(--red); flex-shrink: 0; }

/* ── FEATURED BOOK CARD ── */
.product-card.featured {
  grid-column: span 2;
  background: linear-gradient(135deg, #fff 0%, var(--cream-mid) 100%);
  border-color: rgba(122, 28, 28, 0.2);
}
.book-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-mid);
  margin-bottom: 12px !important;
  line-height: 1.5 !important;
}
.book-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.book-meta span {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
  font-weight: 400;
}

/* ── DIVIDER ── */
.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
  margin: 0;
}

/* ── NEWSLETTER PERKS ── */
.nl-perks {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.nl-perk {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-mid);
  letter-spacing: 0.04em;
}
.perk-icon { color: var(--red); font-size: 0.7rem; }

.nl-note {
  margin-top: 12px;
  font-size: 0.68rem;
  color: var(--text-light);
  letter-spacing: 0.08em;
}

/* ── FOOTER ── */
.footer-left { display: flex; flex-direction: column; gap: 4px; }
.footer-tagline {
  font-size: 0.72rem;
  color: rgba(250,248,244,0.4);
  font-style: italic;
  font-family: var(--font-serif);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .product-card.featured { grid-column: span 2; }
}
@media (max-width: 580px) {
  .products-grid { grid-template-columns: 1fr; }
  .product-card.featured { grid-column: span 1; }
  .nav-links { display: none; }
  .dl-btn { min-width: 160px; padding: 12px 20px; }
  .footer-inner { flex-direction: column; text-align: center; }
  .modal { padding: 36px 24px; }
  .nl-perks { flex-direction: column; align-items: center; gap: 10px; }
  .feature-strip-inner { gap: 8px; }
}
