/* Storygate Letters — Boutique Heirloom Stationery & Editorial Design System */
:root {
  --ivory: #fbf8f2;
  --cream: #f4eee2;
  --paper: #fcfaf5;
  --ink: #241f1a;
  --ink-soft: #5c5348;
  --ink-faint: #8c8072;
  --olive: #2d4336;
  --olive-hover: #213328;
  --rust: #9a4a33;
  --gold: #a67f43;
  --gold-wash: rgba(166, 127, 67, 0.08);
  --line: #e4dac8;
  --line-strong: #cfc1a8;
  --radius-sm: 4px;
  --radius-md: 10px;
  --shadow-soft: 0 14px 40px rgba(36, 31, 26, 0.06);
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-serif: 'Newsreader', Georgia, serif;
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-hand: 'Caveat', cursive;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--ivory);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

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

/* Announcement Ribbon (Like The Flower Letters) */
.announcement-bar {
  background: var(--olive);
  color: #f4eee2;
  text-align: center;
  padding: 9px 16px;
  font-size: 12.5px;
  letter-spacing: 0.04em;
}

/* Editorial Header */
.site-nav {
  background: rgba(251, 248, 242, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}

.brand-wordmark {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
  line-height: 1;
}

.brand-wordmark em {
  font-style: italic;
  font-weight: 500;
  color: var(--rust);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 13.5px;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

.nav-links a:hover {
  color: var(--ink);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--olive);
  color: var(--ivory);
}

.btn-primary:hover {
  background: var(--olive-hover);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.btn-outline:hover {
  background: var(--ink);
  color: var(--ivory);
}

.btn-light {
  background: var(--ivory);
  color: var(--ink);
}

.btn-light:hover {
  background: #ffffff;
}

.btn-sm {
  padding: 9px 16px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

/* Full-Bleed Photographic Hero */
.photo-hero {
  position: relative;
  min-height: 580px;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center 42%;
  overflow: hidden;
}

.photo-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(24, 20, 16, 0.78) 0%,
    rgba(24, 20, 16, 0.34) 48%,
    rgba(24, 20, 16, 0.08) 100%
  );
}

.hero-overlay-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 80px 0 64px;
  color: #fbf8f2;
}

.hero-kicker {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.88;
  margin-bottom: 12px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 68px);
  font-weight: 500;
  line-height: 1.03;
  letter-spacing: -0.015em;
  margin: 0 0 18px;
  max-width: 720px;
  color: #fbf8f2;
}

.hero-title em {
  font-style: italic;
}

.hero-sub {
  font-family: var(--font-serif);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.5;
  max-width: 560px;
  margin: 0 0 28px;
  color: rgba(251, 248, 242, 0.92);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

/* Trust Ribbon */
.trust-strip {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}

.trust-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 36px;
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

/* Editorial Typography */
.section {
  padding: 84px 0;
}

.section-cream {
  background: var(--cream);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.kicker {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 12px;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 46px);
  font-weight: 500;
  line-height: 1.1;
  margin: 0 0 16px;
  color: var(--ink);
}

h2 em {
  font-style: italic;
}

h3 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 10px;
  color: var(--ink);
}

.serif-lead {
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
}

.centered-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 48px;
}

/* Split Editorial Rows */
.split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.art-frame {
  background: var(--paper);
  padding: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.art-frame img {
  width: 100%;
  height: auto;
}

/* 3-Step Story Row */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
}

.step-num {
  font-family: var(--font-display);
  font-size: 42px;
  font-style: italic;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 12px;
}

/* Stationery Letter Preview */
.grade-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
}

.grade-pill {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.18s ease;
}

.grade-pill:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.grade-pill.active {
  background: var(--olive);
  border-color: var(--olive);
  color: var(--ivory);
}

.letter-sheet {
  background: #faf6ee;
  border: 1px solid #dfd3bd;
  padding: 44px 52px;
  box-shadow: var(--shadow-soft);
  max-width: 760px;
  margin: 0 auto;
}

.letterhead-art {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  margin: -10px auto 18px;
  mix-blend-mode: multiply;
}

.letter-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 22px;
  border-bottom: 1px solid #dfd3bd;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.letter-prose {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.78;
  color: #29221a;
}

.letter-prose p {
  margin: 0 0 16px;
}

.ink-strike {
  text-decoration: line-through;
  opacity: 0.5;
}

.hand-ps {
  margin-top: 22px;
  padding: 12px 18px;
  border-left: 2px solid var(--gold);
  background: var(--gold-wash);
  font-family: var(--font-hand);
  font-size: 21px;
  line-height: 1.35;
  color: #3d3122;
}

.letter-verse-bar {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #dfd3bd;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-soft);
}

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

.plan-card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 32px 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  text-align: center;
}

.plan-featured {
  border: 2px solid var(--olive);
  box-shadow: var(--shadow-soft);
}

.plan-price {
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 500;
  line-height: 1;
  margin: 12px 0 6px;
  color: var(--ink);
}

.plan-sub {
  font-size: 13px;
  color: var(--ink-faint);
}

/* Inline Free Sample Signup Ribbon */
.sample-ribbon {
  background: var(--olive);
  color: var(--ivory);
  padding: 64px 0;
}

.sample-ribbon h2 {
  color: var(--ivory);
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr auto;
  gap: 10px;
  max-width: 860px;
  margin: 28px auto 0;
}

.inline-form input,
.inline-form select {
  padding: 13px 14px;
  border: 1px solid rgba(251, 248, 242, 0.25);
  border-radius: var(--radius-sm);
  background: rgba(251, 248, 242, 0.1);
  color: var(--ivory);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
}

.inline-form input::placeholder {
  color: rgba(251, 248, 242, 0.65);
}

.inline-form select option {
  color: var(--ink);
  background: var(--ivory);
}

/* FAQ */
.faq-list {
  max-width: 780px;
  margin: 0 auto;
}

.faq-row {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.faq-row h3 {
  font-size: 22px;
  margin-bottom: 6px;
}

.faq-row p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
}

/* Modal & Form Fields (for Checkout & Admin) */
.waitlist-panel {
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-soft);
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--ink);
}

.field input,
.field select {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--ivory);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

.form-note {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 0;
}

.error-msg {
  font-size: 13px;
  color: var(--rust);
  font-weight: 600;
  display: none;
}

.tag-inline {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--olive);
  background: var(--cream);
  padding: 4px 10px;
  border-radius: 3px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 36px 0 48px;
  font-size: 13px;
  color: var(--ink-faint);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}

/* Responsive */
@media (max-width: 860px) {
  .split-row,
  .steps-grid,
  .plans-grid,
  .inline-form {
    grid-template-columns: 1fr;
  }
  .nav-links a:not(.btn) {
    display: none;
  }
  .letter-sheet {
    padding: 28px 22px;
  }
  .section {
    padding: 56px 0;
  }
  .photo-hero {
    min-height: 480px;
  }
}

@media print {
  .no-print { display: none !important; }
  body { background: #ffffff !important; }
  .print-page {
    border: none !important;
    box-shadow: none !important;
    page-break-after: always;
    padding: 10px 0 !important;
    margin: 0 !important;
  }
}

/* === Living Storybook Interactions === */
@keyframes slowDrift {
  0% { transform: scale(1.0); }
  50% { transform: scale(1.045); }
  100% { transform: scale(1.0); }
}

.photo-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 42%;
  animation: slowDrift 26s ease-in-out infinite;
  z-index: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.85s ease, transform 0.85s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Interactive Map of Narven Hotspots */
.map-stage {
  position: relative;
  background: var(--paper);
  padding: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  max-width: 960px;
  margin: 0 auto;
}

.map-pin {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(154, 74, 51, 0.92);
  color: #fbf8f2;
  border: 2px solid #fbf8f2;
  box-shadow: 0 4px 14px rgba(24, 20, 16, 0.35);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease, background-color 0.2s ease;
  z-index: 5;
}

.map-pin:hover,
.map-pin.active {
  transform: translate(-50%, -50%) scale(1.18);
  background: var(--olive);
}

.map-note-drawer {
  margin-top: 16px;
  padding: 18px 22px;
  background: #faf6ee;
  border: 1px solid #dfd3bd;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

/* Interactive Sealed Envelope (Break the Wax Seal) */
.envelope-stage {
  max-width: 760px;
  margin: 0 auto;
}

.sealed-envelope {
  position: relative;
  background: linear-gradient(165deg, #f8f2e6 0%, #efe5d1 100%);
  border: 1px solid #d7c7aa;
  padding: 48px 36px 42px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}

.sealed-envelope:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 46px rgba(36, 31, 26, 0.1);
}

.envelope-flap-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 110px;
  background: linear-gradient(180deg, rgba(166, 127, 67, 0.11), transparent);
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  border-bottom: 1px solid rgba(166, 127, 67, 0.25);
  pointer-events: none;
}

.wax-seal-btn {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c69a55, #8e672b 75%);
  color: #fbf8f2;
  border: 2px solid rgba(251, 248, 242, 0.5);
  box-shadow: 0 6px 18px rgba(36, 31, 26, 0.28), inset 0 2px 4px rgba(255, 255, 255, 0.35);
  font-family: var(--font-display);
  font-size: 28px;
  font-style: italic;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 12px auto 18px;
  transition: transform 0.2s ease;
}

.sealed-envelope:hover .wax-seal-btn {
  transform: scale(1.08) rotate(-4deg);
}

.envelope-name-input {
  font-family: var(--font-hand);
  font-size: 32px;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1.5px dashed var(--gold);
  text-align: center;
  width: 220px;
  outline: none;
  padding: 2px 6px;
}

.letter-unfold {
  animation: unfoldLetter 0.55s ease forwards;
}

@keyframes unfoldLetter {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* === Sunlit Hero Motes Canvas === */
#hero-motes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* === Watch-Bell Golden Ripple === */
@keyframes bellRipple {
  0% { box-shadow: 0 0 0 0 rgba(212, 168, 87, 0.8); }
  100% { box-shadow: 0 0 0 46px rgba(212, 168, 87, 0); }
}

.bell-lit {
  background: #c89b44 !important;
  animation: bellRipple 1.6s ease-out infinite;
}

/* === 3D Flippable Parent Postcard === */
.flip-scene {
  perspective: 1200px;
  max-width: 540px;
  margin: 0 auto;
  cursor: pointer;
}

.flip-card {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  transform-style: preserve-3d;
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.flip-card.is-flipped {
  transform: rotateY(180deg);
}

.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: var(--shadow-soft);
}

.flip-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 1px solid var(--line);
}

.flip-back {
  transform: rotateY(180deg);
  background: #faf6ee;
  border: 1px solid #dfd3bd;
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  overflow-y: auto;
}

/* === Playable Mini Cipher Box === */
.cipher-box {
  max-width: 760px;
  margin: 24px auto 0;
  padding: 24px 28px;
  background: var(--cream);
  border: 1.5px dashed var(--gold);
  text-align: center;
}

.cipher-tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 16px 0;
}

.cipher-tile {
  width: 56px;
  padding: 8px 4px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.cipher-tile:hover {
  transform: translateY(-2px);
  border-color: var(--olive);
}

.cipher-num {
  font-size: 11px;
  color: var(--ink-faint);
  font-weight: 600;
}

.cipher-char {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  color: var(--olive);
  line-height: 1.1;
}

/* === Anti-Template: Tactile Scrapbook & Postal Pass Ledger === */
.scrapbook-spread {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 1fr;
  gap: 28px;
  align-items: start;
}

.scrap-piece {
  background: #fcfaf4;
  border: 1px solid #dfd3bd;
  padding: 16px 16px 22px;
  box-shadow: 0 12px 30px rgba(36, 31, 26, 0.08);
  position: relative;
  transition: transform 0.25s ease;
}

.scrap-tilt-l { transform: rotate(-1.6deg); }
.scrap-tilt-r { transform: rotate(1.4deg); margin-top: 24px; }
.scrap-tilt-s { transform: rotate(-0.8deg); margin-top: 10px; }

.scrap-piece:hover {
  transform: rotate(0deg) translateY(-4px);
  z-index: 3;
}

.tape-strip {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 78px;
  height: 22px;
  background: rgba(214, 198, 165, 0.58);
  border-left: 1px dashed rgba(140, 120, 88, 0.25);
  border-right: 1px dashed rgba(140, 120, 88, 0.25);
}

.scrap-caption {
  font-family: var(--font-hand);
  font-size: 21px;
  color: #3a2e21;
  margin-top: 12px;
  line-height: 1.25;
}

/* Postal Pass Ledger (Replaces generic 3-box SaaS pricing) */
.postal-ledger {
  max-width: 820px;
  margin: 0 auto;
  background: #faf6ee;
  border: 2px solid var(--line-strong);
  padding: 36px 40px;
  box-shadow: var(--shadow-soft);
  position: relative;
}

.postal-ledger::before {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1px solid #dfd3bd;
  pointer-events: none;
}

.ledger-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px dashed #d3c4a8;
  position: relative;
  z-index: 1;
}

.ledger-row:last-of-type {
  border-bottom: none;
}

@media (max-width: 860px) {
  .scrapbook-spread {
    grid-template-columns: 1fr;
  }
  .scrap-tilt-l, .scrap-tilt-r, .scrap-tilt-s {
    transform: none;
    margin-top: 0;
  }
  .postal-ledger {
    padding: 24px 20px;
  }
}
