/* ============================================
   The Gorham Bible — Dark Scholarly Aesthetic
   Candlelit library, not church lobby.
   ============================================ */

/* ── Variables ── */
:root {
  --bg-deepest:    #0e0b07;
  --bg-dark:       #1a1408;
  --bg-section:    #1f1810;
  --bg-card:       #252015;
  --border:        #3a3020;
  --border-light:  #4d3f28;
  --text-primary:  #e8d9be;
  --text-muted:    #9c8b6e;
  --text-dim:      #6b5a40;
  --gold:          #c9a84c;
  --gold-light:    #e0be6a;
  --gold-dark:     #8a6f2e;
  --amber:         #7a5c30;
  --cream:         #f0e6cc;

  --font-serif:    'Georgia', 'Times New Roman', serif;
  --font-sans:     -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius:        4px;
  --radius-lg:     8px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--bg-deepest);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout Helpers ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-dark {
  background: var(--bg-dark);
  padding: 80px 0;
}

.section-darker {
  background: var(--bg-section);
  padding: 80px 0;
}

.section-label {
  font-family: var(--font-serif);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  color: var(--cream);
  margin-bottom: 48px;
  line-height: 1.25;
}

/* ── Buttons ── */
.btn-primary {
  display: inline-block;
  background: var(--gold);
  color: var(--bg-deepest);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 14px 28px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.2s ease, transform 0.1s ease;
  cursor: pointer;
  border: none;
}

.btn-primary:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-large {
  font-size: 1.05rem;
  padding: 16px 36px;
}

.btn-ghost {
  display: inline-block;
  color: var(--text-muted);
  font-family: var(--font-serif);
  font-size: 0.9rem;
  padding: 14px 20px;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, color 0.2s;
}

.btn-ghost:hover {
  border-color: var(--gold-dark);
  color: var(--text-primary);
}

/* ── HERO ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero-image-wrap {
  position: absolute;
  inset: 0;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 7, 3, 0.3) 0%,
    rgba(10, 7, 3, 0.15) 40%,
    rgba(10, 7, 3, 0.75) 75%,
    rgba(10, 7, 3, 0.95) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 80px 24px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

.hero-label {
  font-family: var(--font-serif);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 20px;
}

.hero-headline {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  font-weight: 400;
  color: var(--cream);
  line-height: 1.15;
  margin-bottom: 24px;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 560px;
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-pwa-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 14px;
  font-size: 0.78rem;
  color: rgba(201, 168, 76, 0.65);
  letter-spacing: 0.04em;
  font-family: var(--font-sans);
}

/* ── WHAT IS THIS ── */
.what-is {
  max-width: 720px;
}

.what-is-body p {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.what-is-body strong {
  color: var(--text-primary);
}

/* ── VIEW MODES ── */
.modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}

.mode-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.mode-card:hover {
  border-color: var(--gold-dark);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.mode-icon {
  color: var(--gold-dark);
  margin-bottom: 20px;
}

.mode-name {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--cream);
  margin-bottom: 16px;
}

.mode-desc {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.mode-note {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.5;
}

/* ── THESIS QUOTE ── */
.thesis-section {
  padding: 72px 0;
}

.thesis-quote {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.75;
  text-align: center;
  border: none;
  padding: 0;
}

.thesis-quote::before {
  content: '\u201C';
  color: var(--gold-dark);
  font-size: 4rem;
  display: block;
  line-height: 0.5;
  margin-bottom: 24px;
}

/* ── PRICING ── */
.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 56px 48px;
  text-align: center;
}

.pricing-price {
  font-family: var(--font-serif);
  font-size: 4rem;
  font-weight: 400;
  color: var(--cream);
  line-height: 1;
  margin-bottom: 8px;
}

.pricing-type {
  font-size: 0.85rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 36px;
}

.pricing-features {
  list-style: none;
  text-align: left;
  max-width: 280px;
  margin: 0 auto 40px;
}

.pricing-features li {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--text-muted);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.pricing-features li::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-dark);
  flex-shrink: 0;
}

.pricing-note {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 16px;
}

/* ── FOOTER ── */
.footer {
  background: var(--bg-deepest);
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 16px;
}

.footer-brand {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text-muted);
}

.footer-note {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-style: italic;
}

/* ── PREVIEW SECTION ── */
.preview-section {
  background: var(--bg-deepest);
  padding: 80px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.preview-intro {
  max-width: 640px;
  margin: 0 auto 56px;
  text-align: center;
}

.preview-intro p {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.preview-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  margin-bottom: 48px;
}

.preview-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.preview-block-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.preview-block-ref {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cream);
  letter-spacing: 0.02em;
}

.preview-block-tag {
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-style: italic;
}

.preview-block-body {
  padding: 24px;
  flex: 1;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 0.97rem;
  line-height: 1.8;
  color: var(--text-muted);
}

.preview-verse {
  margin-bottom: 10px;
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.preview-vnum {
  font-size: 0.65rem;
  color: var(--text-dim);
  min-width: 18px;
  text-align: right;
  flex-shrink: 0;
  padding-top: 2px;
  font-style: normal;
  font-family: var(--font-sans);
}

/* Color markup — matches live app exactly */
.pv-red  { color: #cc3333; }
.pv-blue { color: #3355aa; }
.pv-black { color: var(--text-muted); }

/* Legend in preview header */
.preview-legend {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.legend-dot {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: var(--font-sans);
}

.legend-dot::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-dot.dot-red::before  { background: #cc3333; }
.legend-dot.dot-blue::before { background: #3355aa; }
.legend-dot.dot-black::before { background: var(--text-dim); }

/* Essay preview block */
.preview-essay-body {
  padding: 24px;
  flex: 1;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-muted);
}

.preview-essay-body p {
  margin-bottom: 16px;
}

.preview-essay-body p:last-child {
  margin-bottom: 0;
}

.preview-essay-fade {
  position: relative;
  margin-top: -40px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--bg-card));
  pointer-events: none;
}

.preview-essay-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--gold);
  font-style: italic;
  margin-bottom: 16px;
  display: block;
}

/* Preview CTA */
.preview-cta {
  text-align: center;
  padding-top: 16px;
}

.preview-cta p {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 20px;
  font-style: italic;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .section-dark,
  .section-darker {
    padding: 56px 0;
  }

  .section-title {
    font-size: 1.5rem;
    margin-bottom: 32px;
  }

  .hero-content {
    padding: 48px 20px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn-primary,
  .hero-actions .btn-ghost {
    text-align: center;
  }

  .pricing-card {
    padding: 40px 28px;
  }

  .pricing-price {
    font-size: 3rem;
  }

  .modes-grid {
    grid-template-columns: 1fr;
  }

  .preview-blocks {
    grid-template-columns: 1fr;
  }

  .preview-section {
    padding: 56px 0;
  }

  .preview-block-body,
  .preview-essay-body {
    font-size: 0.92rem;
  }

  .pv-red, .pv-blue, .pv-black {
    /* Ensure legibility on small screens — colors remain unchanged */
    -webkit-text-size-adjust: none;
  }
}

/* ── Waitlist Form ── */
.waitlist-section {
  background: var(--bg-dark);
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

.waitlist-hero-band {
  background: rgba(0,0,0,0.35);
  border-top: 1px solid rgba(201,168,76,0.15);
  border-bottom: 1px solid rgba(201,168,76,0.15);
  padding: 40px 0;
  margin-top: 0;
}

.waitlist-inner {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}

.waitlist-label {
  font-family: var(--font-serif);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 10px;
}

.waitlist-headline {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: normal;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.35;
}

.waitlist-sub {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  font-style: italic;
}

.waitlist-form {
  display: flex;
  gap: 10px;
  max-width: 440px;
  margin: 0 auto;
}

.waitlist-input {
  flex: 1;
  padding: 11px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.waitlist-input::placeholder {
  color: var(--text-dim);
}

.waitlist-input:focus {
  border-color: var(--gold);
}

.waitlist-btn {
  padding: 11px 22px;
  background: var(--gold);
  color: #0e0b07;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.waitlist-btn:hover {
  background: var(--gold-light);
}

.waitlist-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.waitlist-msg {
  margin-top: 12px;
  font-family: var(--font-serif);
  font-size: 0.88rem;
  min-height: 20px;
}

.waitlist-msg.success { color: #7ec87e; }
.waitlist-msg.error   { color: #d97878; }

.waitlist-note {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
}

/* Confirmation toast banner */
.wl-toast {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--gold);
  color: #0e0b07;
  text-align: center;
  padding: 14px 20px;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  display: none;
}

@media (max-width: 540px) {
  .waitlist-form {
    flex-direction: column;
  }
  .waitlist-btn {
    width: 100%;
  }
}