/* Once Upon a Bookshelf — marketing site
   Palette and type mirror OnceUponABookshelf/Sources/Theme/AppTheme.swift */

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

:root {
  /* Surfaces */
  --paper: #FBF7EC;
  --card: #FFFDF6;
  --linen: #EFE8D7;
  --linen-warm: #F1EADA;

  /* Brand */
  --shelf-blue: #456479;
  --shelf-blue-soft: #4F6E82;
  --clay: #A85F42;
  --olive: #63724D;
  --gold: #C8A75E;
  --gold-soft: #EBD9A8;

  /* Text */
  --ink: #33414A;
  --text-secondary: #5A6770;
  --text-tertiary: #5E6A69;

  /* Borders */
  --border-linen: #E9E1CE;
  --border-deep: #D9CDB2;
  --dashed: #A99B7E;

  /* Gold banner */
  --gold-banner-bg: #F3EAD3;
  --gold-banner-border: #E3CB93;
  --gold-ink-title: #5A4A22;
  --gold-ink-body: #6F5D33;

  --error: #9B3D2E;

  --shadow-soft: 0 12px 30px rgba(51, 65, 74, 0.10);
  --shadow-card: 0 8px 22px rgba(51, 65, 74, 0.08);

  --max-width: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

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

a { color: var(--shelf-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, .display {
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.4em;
  line-height: 1.12;
  letter-spacing: 0.002em;
}

h1 { font-size: clamp(2.4rem, 5.4vw, 3.6rem); font-weight: 600; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); font-weight: 600; }

p { margin: 0 0 1em; }

.lede {
  font-family: "Lora", Georgia, serif;
  font-style: italic;
  color: var(--olive);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.5;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Divider: dashed rule + diamond, as seen throughout the app ─────────── */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 22px 0 30px;
}
.divider::before,
.divider::after {
  content: "";
  width: 64px;
  height: 0;
  border-top: 1.5px dashed var(--dashed);
}
.divider .diamond {
  width: 8px;
  height: 8px;
  background: var(--clay);
  transform: rotate(45deg);
  flex: none;
}
.divider.left {
  justify-content: flex-start;
}

/* ── Header / nav ─────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 247, 236, 0.88);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border-linen);
}
.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--ink);
}
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand:hover { text-decoration: none; }

nav.primary-nav { display: flex; align-items: center; gap: 28px; }
nav.primary-nav a {
  color: var(--text-secondary);
  font-size: 0.98rem;
  font-weight: 500;
}
nav.primary-nav a:hover { color: var(--shelf-blue); text-decoration: none; }
nav.primary-nav a.current { color: var(--shelf-blue); }

.nav-cta {
  background: var(--shelf-blue);
  color: var(--paper) !important;
  padding: 10px 20px;
  border-radius: 14px;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(69, 100, 121, 0.28);
}
.nav-cta:hover { text-decoration: none; opacity: 0.92; }

.nav-toggle { display: none; }

@media (max-width: 760px) {
  nav.primary-nav { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 30px;
  border-radius: 18px;
  font-weight: 600;
  font-size: 1.02rem;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--shelf-blue);
  color: var(--paper);
  box-shadow: 0 9px 20px rgba(69, 100, 121, 0.28);
}
.btn-primary:hover { text-decoration: none; opacity: 0.94; }
.btn-secondary {
  background: rgba(69, 100, 121, 0.1);
  color: var(--shelf-blue);
}
.btn-secondary:hover { text-decoration: none; background: rgba(69, 100, 121, 0.16); }

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero {
  padding: 68px 0 40px;
  text-align: center;
}
.hero h1 { margin: 0 auto 18px; max-width: 16ch; }
.hero .lede { max-width: 42ch; margin: 0 auto; }
.hero .cta-row {
  margin-top: 30px;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero .fineprint {
  margin-top: 14px;
  font-size: 0.86rem;
  color: var(--text-tertiary);
}

.store-badge img { height: 52px; width: auto; }

.hero-screen {
  margin: 52px auto 0;
  max-width: 300px;
}
.hero-screen img {
  border-radius: 30px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-linen);
}

/* ── Feature grid ─────────────────────────────────────────────────────── */
.section { padding: 64px 0; }
.section-head { text-align: center; margin-bottom: 44px; }
.section-head .lede { max-width: 50ch; margin: 0 auto; }

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
@media (max-width: 860px) {
  .features { grid-template-columns: 1fr; }
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--border-linen);
  border-radius: 22px;
  padding: 30px 26px;
  box-shadow: var(--shadow-card);
}
.feature-card .glyph {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
  background: var(--linen-warm);
}
.feature-card h3 { margin-bottom: 8px; }
.feature-card p { color: var(--text-secondary); margin: 0; font-size: 0.98rem; }

/* ── Alternating showcase rows (How it works) ────────────────────────── */
.showcase-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  padding: 54px 0;
  border-bottom: 1px solid var(--border-linen);
}
.showcase-row:last-child { border-bottom: none; }
.showcase-row.reverse .showcase-copy { order: 2; }
.showcase-row.reverse .showcase-shot { order: 1; }

.showcase-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--clay);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.showcase-copy p { color: var(--text-secondary); font-size: 1.05rem; }
.showcase-shot { text-align: center; }
.showcase-shot img {
  max-width: 280px;
  margin: 0 auto;
  border-radius: 26px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-linen);
}

@media (max-width: 760px) {
  .showcase-row, .showcase-row.reverse {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 38px 0;
  }
  .showcase-row.reverse .showcase-copy,
  .showcase-row.reverse .showcase-shot,
  .showcase-row .showcase-copy,
  .showcase-row .showcase-shot { order: initial; }
  .showcase-row .showcase-shot { order: -1; }
}

/* ── Gold callout banner ──────────────────────────────────────────────── */
.callout {
  background: var(--gold-banner-bg);
  border: 1px solid var(--gold-banner-border);
  border-radius: 20px;
  padding: 24px 28px;
  color: var(--gold-ink-body);
}
.callout strong { color: var(--gold-ink-title); }
.callout p:last-child { margin: 0; }

/* ── Privacy pillars ──────────────────────────────────────────────────── */
.pillars {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 40px 0;
}
@media (max-width: 700px) { .pillars { grid-template-columns: 1fr; } }
.pillar {
  background: var(--card);
  border: 1px solid var(--border-linen);
  border-radius: 18px;
  padding: 24px;
}
.pillar h3 { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; }
.pillar p { color: var(--text-secondary); margin: 8px 0 0; font-size: 0.97rem; }

/* ── FAQ accordion ────────────────────────────────────────────────────── */
.faq-list { max-width: 800px; margin: 0 auto; }
details.faq-item {
  background: var(--card);
  border: 1px solid var(--border-linen);
  border-radius: 16px;
  padding: 4px 24px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}
details.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 0;
  font-weight: 600;
  font-size: 1.08rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after {
  content: "+";
  font-family: "Cormorant Garamond", serif;
  font-size: 1.6rem;
  color: var(--clay);
  flex: none;
  transition: transform 0.15s ease;
}
details.faq-item[open] summary::after { transform: rotate(45deg); }
details.faq-item .faq-answer {
  padding: 0 0 20px;
  color: var(--text-secondary);
  font-size: 1rem;
}
details.faq-item .faq-answer p:last-child { margin-bottom: 0; }

/* ── Table (privacy policy) ──────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  font-size: 0.95rem;
  background: var(--card);
  border: 1px solid var(--border-linen);
  border-radius: 14px;
  overflow: hidden;
}
th, td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-linen);
  vertical-align: top;
}
th {
  background: var(--linen-warm);
  font-weight: 600;
  color: var(--ink);
}
tr:last-child td { border-bottom: none; }

/* ── Legal / prose page ───────────────────────────────────────────────── */
.prose { max-width: 760px; margin: 0 auto; }
.prose h2 { margin-top: 2em; }
.prose h2:first-child { margin-top: 0; }
.prose ul { color: var(--text-secondary); }
.prose li { margin-bottom: 6px; }
.prose p { color: var(--text-secondary); }
.updated { color: var(--text-tertiary); font-size: 0.9rem; }

/* ── CTA band ─────────────────────────────────────────────────────────── */
.cta-band {
  background: var(--shelf-blue);
  color: var(--paper);
  border-radius: 28px;
  padding: 56px 40px;
  text-align: center;
  margin: 0 24px;
}
.cta-band h2 { color: var(--paper); }
.cta-band .lede { color: var(--gold-soft); font-style: normal; opacity: 0.92; }
.cta-band .cta-row { margin-top: 26px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.cta-band .btn-secondary { background: rgba(255,255,255,0.14); color: var(--paper); }
.cta-band .btn-secondary:hover { background: rgba(255,255,255,0.22); }
.cta-band .btn-primary { background: var(--paper); color: var(--shelf-blue); box-shadow: none; }

/* ── Footer ───────────────────────────────────────────────────────────── */
footer.site-footer {
  margin-top: 80px;
  border-top: 1px solid var(--border-linen);
  padding: 44px 0 34px;
  color: var(--text-tertiary);
  font-size: 0.9rem;
}
footer.site-footer .foot-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
  align-items: flex-start;
}
footer.site-footer .foot-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.15rem;
  color: var(--ink);
  font-weight: 600;
}
footer.site-footer .foot-brand img { width: 28px; height: 28px; border-radius: 7px; }
footer.site-footer .foot-links {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}
footer.site-footer .foot-links a { color: var(--text-tertiary); }
footer.site-footer .foot-links a:hover { color: var(--shelf-blue); }
footer.site-footer .foot-bottom {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border-linen);
}

/* ── Decorative sparkle glyphs ────────────────────────────────────────── */
.sparkle { color: var(--gold); }

/* ── Guides (long-tail articles) ─────────────────────────────────────── */
.guide-eyebrow {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clay);
  font-weight: 700;
  margin-bottom: 10px;
}
a.feature-card.guide-card {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
a.feature-card.guide-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}
a.feature-card.guide-card h3 { margin-bottom: 8px; }
.guide-answer {
  background: var(--card);
  border: 1px solid var(--border-linen);
  border-left: 4px solid var(--clay);
  border-radius: 4px 14px 14px 4px;
  padding: 22px 26px;
  margin: 0 0 8px;
  font-size: 1.08rem;
  color: var(--ink);
}
.guide-answer p { margin: 0; }
