:root {
  --bg: #fbf7f0;
  --bg-alt: #f3eadc;
  --surface: #ffffff;
  --ink: #1f1b18;
  --muted: #5c534a;
  --crimson: #9e2226;
  --crimson-dark: #7a181b;
  --forest: #16382c;
  --forest-soft: #204c3d;
  --gold: #c59b43;
  --gold-soft: #f5ebd4;
  --border: #e5dac7;
  --radius: 14px;
  --shadow: 0 12px 32px rgba(31, 27, 24, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* Top announcement bar */
.top-banner {
  background: var(--forest);
  color: #f9f3e8;
  text-align: center;
  font-size: 13px;
  padding: 8px 16px;
  letter-spacing: 0.01em;
}
.top-banner strong { color: #f0cf85; }

/* Navigation */
.site-header {
  background: rgba(251, 247, 240, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--forest);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand-seal {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--crimson);
  color: #f9f3e8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  box-shadow: inset 0 0 0 2px rgba(240, 207, 133, 0.7);
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}
.nav-links a { color: var(--ink); font-weight: 500; }
.nav-links a:hover { color: var(--crimson); }
.nav-cta {
  background: var(--crimson);
  color: #fff !important;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600 !important;
}
.nav-cta:hover { background: var(--crimson-dark); text-decoration: none !important; }
@media (max-width: 720px) {
  .nav-inner { flex-direction: column; align-items: flex-start; gap: 10px; padding: 10px 0; }
  .nav-links { gap: 10px 14px; font-size: 13px; }
}

/* Hero */
.hero {
  padding: 34px 0 22px;
  text-align: center;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold-soft);
  color: var(--forest);
  border: 1px solid #e4cfa0;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}
.hero h1 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(28px, 4.2vw, 46px);
  line-height: 1.15;
  margin: 0 auto 14px;
  max-width: 820px;
  color: var(--forest);
}
.hero p.lead {
  font-size: 16.5px;
  color: var(--muted);
  max-width: 720px;
  margin: 0 auto 18px;
}
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
  font-size: 13.5px;
  color: var(--forest);
  font-weight: 600;
}
.trust-strip span::before {
  content: "✓ ";
  color: var(--crimson);
  font-weight: 800;
}

/* Studio Layout */
.studio-section { padding: 14px 0 48px; }
.studio-grid {
  display: grid;
  grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
@media (max-width: 960px) {
  .studio-grid { grid-template-columns: 1fr; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.panel h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 21px;
  margin: 0;
  color: var(--forest);
}
.reset-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  padding: 2px 4px;
}
.reset-btn:hover { color: var(--crimson); }

/* Child tabs */
.child-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}
.child-pill {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.child-pill.active {
  background: var(--forest);
  color: #fff;
  border-color: var(--forest);
}
.child-remove {
  font-size: 13px;
  opacity: 0.75;
  margin-left: 2px;
  line-height: 1;
}
.child-add {
  border: 1px dashed var(--crimson);
  background: #fff8f8;
  color: var(--crimson);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.child-add:hover { background: #fceeee; }

/* Form controls */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }
.field { margin-bottom: 13px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--forest);
  margin-bottom: 5px;
}
.field input[type="text"],
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #d7cab5;
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fffdf9;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--crimson);
  box-shadow: 0 0 0 3px rgba(158, 34, 38, 0.12);
}
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.45; }

/* Quick chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip {
  font-size: 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
}
.chip:hover { background: var(--gold-soft); border-color: var(--gold); }

/* Theme selector */
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.theme-btn {
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 9px 8px;
  text-align: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.theme-btn.active {
  border-color: var(--crimson);
  background: #fff8f8;
  color: var(--crimson);
}
.swatch {
  display: block;
  height: 12px;
  border-radius: 6px;
  margin-bottom: 6px;
}
.swatch-crimson { background: linear-gradient(90deg, #9e2226, #c59b43); }
.swatch-midnight { background: linear-gradient(90deg, #162a48, #d8b25a); }
.swatch-parchment { background: linear-gradient(90deg, #16382c, #c89d54); }

/* Preview pane */
.preview-sticky { position: sticky; top: 76px; }
.doc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.doc-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.doc-tab.active {
  background: var(--crimson);
  color: #fff;
  border-color: var(--crimson);
}
.badge-tag {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 5px;
  background: rgba(255, 255, 255, 0.22);
}
.doc-tab:not(.active) .badge-tag {
  background: var(--gold-soft);
  color: var(--forest);
}

.paper-stage {
  background: #e9e0d2;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #d8ccb8;
}

/* Heirloom Printable Sheet — REAL CSS borders (print-safe even without box-shadow!) */
.sheet {
  position: relative;
  background: #fffdf8;
  color: #1f1b18;
  border-radius: 4px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
  padding: 14px;
  aspect-ratio: 8.5 / 11;
  display: flex;
  overflow: hidden;
}
.sheet.paper-a4 { aspect-ratio: 210 / 297; }
.sheet-outer {
  flex: 1;
  display: flex;
  border: 3px solid #9e2226;
  padding: 5px;
  position: relative;
}
.sheet-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1.5px solid #c59b43;
  padding: 26px 32px;
  position: relative;
  overflow: hidden;
}
.corner-ornament {
  position: absolute;
  width: 24px;
  height: 24px;
  pointer-events: none;
  z-index: 2;
}
.corner-tl { top: 6px; left: 6px; }
.corner-tr { top: 6px; right: 6px; transform: scaleX(-1); }
.corner-bl { bottom: 6px; left: 6px; transform: scaleY(-1); }
.corner-br { bottom: 6px; right: 6px; transform: scale(-1); }

/* Theme overrides on real borders */
.sheet.theme-crimson { background: #fffdf8; }
.sheet.theme-crimson .sheet-outer { border-color: #9e2226; }
.sheet.theme-crimson .sheet-inner { border-color: #c59b43; }

.sheet.theme-midnight { background: #ffffff; }
.sheet.theme-midnight .sheet-outer { border-color: #162a48; }
.sheet.theme-midnight .sheet-inner { border-color: #d6b15c; }

.sheet.theme-parchment { background: #faf3e3; }
.sheet.theme-parchment .sheet-outer { border-color: #16382c; }
.sheet.theme-parchment .sheet-inner { border-color: #b88b3a; }

.sheet.basic-bw { background: #ffffff; padding: 18px; }
.sheet.basic-bw .sheet-outer { border: 1.5px solid #333333; padding: 0; }
.sheet.basic-bw .sheet-inner { border: none; padding: 26px 30px; }
.sheet.basic-bw .letter-header { border-bottom-color: #999999; }

.elf-rules-box {
  margin-top: 18px;
  padding: 16px 20px;
  border: 1.5px dashed #c59b43;
  border-radius: 10px;
  background: rgba(251, 245, 230, 0.72);
}
.elf-rules-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--forest);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.elf-rules-box ul {
  margin: 0;
  padding-left: 18px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 16.5px;
  line-height: 1.5;
  color: #2c251f;
}
.elf-rules-box li { margin-bottom: 4px; }

@media (max-width: 640px) {
  .paper-stage { padding: 8px; }
  .sheet { aspect-ratio: auto; min-height: 540px; padding: 8px; }
  .sheet-inner { padding: 16px 16px; }
}

/* Header & SVG Banner */
.midnight-banner-svg {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 14px;
  border-radius: 4px;
}
.letter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1.5px solid rgba(197, 155, 67, 0.55);
  padding-bottom: 12px;
  margin-bottom: 16px;
  gap: 12px;
}
.letter-header .title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 21px;
  font-weight: 700;
  color: var(--crimson);
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.sheet.theme-parchment .letter-header .title { color: #16382c; }
.sheet.basic-bw .letter-header .title { color: #111111; }
.letter-header .sub {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
  margin-top: 3px;
}

.letter-body {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 16.8px;
  line-height: 1.52;
  color: #26211d;
  flex: 1;
}
.letter-body p { margin: 0 0 11px; }
.letter-salutation {
  font-size: 20.5px;
  font-weight: 700;
  color: var(--forest);
  margin-bottom: 10px !important;
}
.sheet.basic-bw .letter-salutation { color: #111; }
.letter-ps {
  margin-top: 10px !important;
  font-style: italic;
  color: #4b3d33;
  border-left: 2.5px solid #c59b43;
  padding-left: 10px;
}
.sheet.basic-bw .letter-ps { border-left-color: #666; color: #333; }

.letter-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 10px;
  padding-top: 8px;
  gap: 12px;
}
.santa-sign {
  font-family: "Great Vibes", "Brush Script MT", cursive;
  font-size: 36px;
  color: var(--crimson);
  line-height: 1.05;
}
.sheet.theme-midnight .santa-sign { color: #162a48; }
.sheet.theme-parchment .santa-sign { color: #16382c; }
.sheet.basic-bw .santa-sign { color: #111; }

/* Nice List Certificate Layout */
.cert-wrap {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 4px 4px;
}
.cert-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #a67d2a;
  font-weight: 700;
}
.cert-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 29px;
  color: var(--crimson);
  margin: 6px 0 4px;
  line-height: 1.15;
}
.sheet.theme-midnight .cert-title { color: #162a48; }
.sheet.theme-parchment .cert-title { color: #16382c; }
.cert-name {
  font-family: "Great Vibes", "Brush Script MT", cursive;
  font-size: 48px;
  color: var(--forest);
  margin: 8px auto;
  border-bottom: 1.5px solid #d5c29d;
  padding: 0 12px 6px;
  line-height: 1.15;
  max-width: 95%;
  word-break: break-word;
}
.cert-name.name-long { font-size: 36px; }
.cert-copy {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 17.5px;
  max-width: 92%;
  margin: 6px auto;
  color: #2c251f;
  line-height: 1.48;
}
.cert-badge {
  margin: 12px auto 4px;
  display: inline-block;
  padding: 6px 16px;
  border: 1.5px solid #c59b43;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #16382c;
  background: #fbf5e6;
}
.cert-meta {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--muted);
  gap: 8px;
}
.cert-sig-col { text-align: center; min-width: 115px; }
.cert-sig-line { border-bottom: 1px solid #b8aa93; padding-bottom: 3px; margin-bottom: 4px; }

/* Watermark Overlay */
.watermark-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  overflow: hidden;
  z-index: 5;
}
.watermark-overlay span {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: rgba(158, 34, 38, 0.13);
  transform: rotate(-28deg);
  white-space: nowrap;
  user-select: none;
}
.sheet.unlocked .watermark-overlay { display: none; }

/* Action bar under preview */
.checkout-card {
  margin-top: 16px;
  background: var(--surface);
  border: 1.5px solid #dfc89c;
  border-radius: 12px;
  padding: 16px 18px;
}
.tier-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
@media (max-width: 560px) { .tier-grid { grid-template-columns: 1fr; } }
.tier-option {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  background: #fffdf9;
  text-align: left;
  position: relative;
}
.tier-option.selected {
  border-color: var(--crimson);
  background: #fff7f7;
}
.tier-top { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; gap: 8px; }
.tier-price { font-size: 19px; color: var(--crimson); }
.tier-desc { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-primary {
  flex: 1;
  min-width: 210px;
  background: var(--crimson);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--crimson-dark); }
.btn-secondary {
  background: var(--bg);
  color: var(--forest);
  border: 1.5px solid var(--forest);
  border-radius: 10px;
  padding: 12px 15px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-secondary:hover { background: #eaf2ee; }
.unlocked-banner {
  display: none;
  background: #e9f6ef;
  border: 1px solid #86c7a4;
  color: var(--forest);
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
}
.unlocked-banner.show { display: block; }
.upgrade-note {
  display: none;
  background: #fff8e6;
  border: 1px solid #e6c978;
  color: #5c4610;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 12.5px;
}
.upgrade-note.show { display: block; }

/* Content & GEO sections */
.info-section { padding: 44px 0; border-top: 1px solid var(--border); }
.info-section h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 28px;
  color: var(--forest);
  margin: 0 0 16px;
}
.cards-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 820px) { .cards-3 { grid-template-columns: 1fr; } }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card h3 { margin: 0 0 8px; font-size: 17px; color: var(--forest); }
.card p { margin: 0; font-size: 14px; color: var(--muted); }

/* Comparison / Honest Free vs Paid Table */
.table-scroll { overflow-x: auto; }
.compare-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14px;
}
.compare-table th, .compare-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.compare-table th { background: var(--bg-alt); color: var(--forest); font-weight: 700; }

/* FAQ */
.faq-list { display: grid; gap: 12px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 16px 18px;
}
.faq-item h3 { margin: 0 0 6px; font-size: 16px; color: var(--forest); }
.faq-item p { margin: 0; font-size: 14px; color: var(--muted); }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(22, 56, 44, 0.56);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: 16px;
  max-width: 470px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}
.modal h3 { font-family: "Playfair Display", Georgia, serif; margin: 0 0 10px; color: var(--forest); font-size: 22px; }
.modal-note {
  background: #fff8e6;
  border: 1px solid #e6c978;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: #5c4610;
  margin: 12px 0 16px;
}

/* Footer */
.site-footer {
  background: var(--forest);
  color: #dcd3c4;
  padding: 36px 0;
  font-size: 13.5px;
}
.site-footer a { color: #f0cf85; }
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }

/* Print Area (exact physical US Letter / A4 dimensions — ZERO extra blank pages, FULL borders!) */
#print-root { display: none; }
@media print {
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  body > *:not(#print-root) { display: none !important; }
  #print-root {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .print-page {
    width: 8.5in;
    height: 10.96in;
    padding: 0.32in;
    margin: 0;
    box-sizing: border-box;
    overflow: hidden;
    page-break-after: always;
    break-after: page;
    display: flex;
  }
  #print-root[data-paper="a4"] .print-page {
    width: 210mm;
    height: 296mm;
    padding: 8.5mm;
  }
  .print-page:last-child {
    page-break-after: auto;
    break-after: auto;
  }
  .print-page .sheet {
    flex: 1;
    width: 100%;
    height: 100%;
    aspect-ratio: auto !important;
    min-height: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .print-page .sheet-inner {
    padding: 0.42in 0.5in !important;
  }
  .print-page .letter-body {
    font-size: 17.5px !important;
    line-height: 1.56 !important;
  }
  .print-page .cert-title { font-size: 32px !important; }
  .print-page .cert-name { font-size: 52px !important; }
  .print-page .cert-name.name-long { font-size: 38px !important; }
  .print-page .cert-copy { font-size: 18.5px !important; }
}
