/* ===== TOKENS ===== */
:root {
  --ink: #14231F;
  --ink-soft: #3A4A44;
  --paper: #F7F5F0;
  --paper-warm: #F1ECE1;
  --sage: #7C9885;
  --sage-deep: #5C7A66;
  --coral: #E8865A;
  --coral-deep: #D3703F;
  --gold: #C9A961;
  --line: rgba(20, 35, 31, 0.12);
  --shadow: 0 20px 60px rgba(20, 35, 31, 0.15);

  --display: 'Fraunces', serif;
  --body: 'Inter', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input { font-family: inherit; }

:focus-visible { outline: 2px solid var(--coral-deep); outline-offset: 3px; }

/* ===== NAV ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 6vw;
  background: rgba(247, 245, 240, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-mark {
  font-family: var(--display);
  font-weight: 600; font-size: 1.15rem; letter-spacing: -0.01em;
}
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a { font-size: 0.92rem; color: var(--ink-soft); transition: color 0.2s; }
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  font-size: 0.92rem; font-weight: 600; color: var(--ink);
  padding: 8px 18px; border: 1px solid var(--line); border-radius: 100px;
  transition: all 0.2s;
}
.nav-cta:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ===== HERO ===== */
.hero {
  display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 40px;
  padding: 8vh 6vw 10vh; min-height: 88vh;
  position: relative;
}
.hero-inner { max-width: 520px; position: relative; z-index: 2; }
.eyebrow {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--sage-deep); margin-bottom: 20px; font-weight: 500;
}
.hero-title {
  font-family: var(--display); font-weight: 500; font-size: clamp(2.6rem, 4.8vw, 4rem);
  line-height: 1.04; letter-spacing: -0.02em; color: var(--ink); margin-bottom: 24px;
}
.hero-title em { font-style: italic; font-weight: 500; color: var(--coral-deep); }
.hero-sub {
  font-size: 1.08rem; line-height: 1.6; color: var(--ink-soft); max-width: 460px; margin-bottom: 32px;
}
.hero-actions { display: flex; align-items: center; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.hero-note { font-size: 0.85rem; color: var(--ink-soft); opacity: 0.75; }

.btn-primary {
  background: var(--ink); color: var(--paper);
  padding: 15px 30px; border-radius: 100px; font-weight: 600; font-size: 0.98rem;
  transition: transform 0.2s ease, background 0.2s ease;
}
.btn-primary:hover { background: var(--coral-deep); transform: translateY(-2px); }
.btn-ghost { font-weight: 600; font-size: 0.98rem; color: var(--ink); border-bottom: 1.5px solid var(--ink); padding-bottom: 2px; }
.btn-outline {
  border: 1.5px solid var(--ink); color: var(--ink);
  padding: 13px 28px; border-radius: 100px; font-weight: 600; font-size: 0.95rem;
  transition: all 0.2s;
}
.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn-full { width: 100%; padding: 14px; }

/* ===== HERO ENVELOPE VISUAL ===== */
.hero-visual { position: relative; display: flex; justify-content: center; align-items: center; z-index: 2; }
.envelope {
  position: relative; width: 380px; height: 420px;
  transform: rotate(2deg);
}
.envelope-back {
  position: absolute; inset: 0; top: 60px;
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
}
.envelope-letter {
  position: absolute; top: 20px; left: 14px; right: 14px; bottom: 0;
  background: #FFFDF8;
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: 0 10px 30px rgba(20,35,31,0.12);
  animation: letterRise 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
  padding: 34px 30px;
}
.letter-kicker {
  font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--sage-deep); margin-bottom: 18px;
}
.letter-greeting { font-family: var(--display); font-size: 1.3rem; font-style: italic; margin-bottom: 14px; }
.letter-body { font-size: 0.92rem; line-height: 1.65; color: var(--ink-soft); margin-bottom: 22px; }
.letter-body strong { color: var(--ink); font-weight: 600; }
.letter-figure { border-top: 1px dashed var(--line); padding-top: 16px; display: flex; flex-direction: column; }
.fig-num { font-family: var(--mono); font-size: 2rem; font-weight: 500; color: var(--coral-deep); }
.fig-label { font-size: 0.78rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }
.envelope-flap {
  position: absolute; top: 60px; left: 0; right: 0; height: 90px;
  background: var(--sage);
  clip-path: polygon(0 0, 50% 70%, 100% 0);
  opacity: 0.9; border-radius: 4px 4px 0 0;
  z-index: 3;
}

@keyframes letterRise {
  from { opacity: 0; transform: translateY(40px) rotate(-1deg); }
  to { opacity: 1; transform: translateY(0) rotate(0.5deg); }
}

@media (prefers-reduced-motion: reduce) {
  .envelope-letter { animation: none; }
}

/* ===== LETTER STACK (hero signature — a fan of past letters behind the current one) ===== */
.letter-stack { position: relative; }
.stack-letter {
  position: absolute; top: 20px; left: 14px; right: 14px; bottom: 0;
  background: #FFFDF8; border: 1px solid var(--line); border-radius: 2px;
  box-shadow: 0 6px 16px rgba(20,35,31,0.08);
  opacity: 0;
}
.stack-back-1 {
  transform: rotate(-6deg) translateY(6px);
}
.stack-back-2 {
  transform: rotate(7deg) translateY(10px);
  background: var(--paper-warm);
}
.stack-back-1 { animation: stackIn1 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both; }
.stack-back-2 { animation: stackIn2 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0s both; }
@keyframes stackIn1 { from { opacity: 0; transform: rotate(0deg) translateY(30px); } to { opacity: 0.9; transform: rotate(-6deg) translateY(6px); } }
@keyframes stackIn2 { from { opacity: 0; transform: rotate(0deg) translateY(30px); } to { opacity: 0.6; transform: rotate(7deg) translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  .stack-back-1, .stack-back-2 { animation: none; opacity: 0.9; }
  .stack-back-2 { opacity: 0.6; }
}

/* ===== TRUST STRIP ===== */
.trust-strip { display: flex; gap: 36px; margin-top: 44px; flex-wrap: wrap; }
.trust-item { display: flex; flex-direction: column; gap: 2px; }
.trust-num { font-family: var(--mono); font-size: 1.5rem; font-weight: 500; color: var(--coral-deep); line-height: 1; }
.trust-label { font-size: 0.8rem; color: var(--ink-soft); }

/* ===== SCROLL REVEALS ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.in-view { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===== DEMO HOVER INTERACTIVITY ===== */
.demo-sub { text-align: center; color: var(--ink-soft); font-size: 0.95rem; margin: -28px auto 40px; max-width: 480px; }
.demo-bar-row { cursor: default; transition: transform 0.15s ease; }
.demo-bar-row:hover { transform: translateX(2px); }
.demo-bar-row:hover .demo-bar-label { color: var(--coral-deep); }
.demo-hint { font-size: 0.8rem; color: var(--ink-soft); opacity: 0.7; text-align: center; margin: 4px 0 22px; min-height: 1.2em; transition: opacity 0.2s; }

/* ===== QUOTE BAND ===== */
.quote-band { text-align: center; padding: 10vh 6vw; background: var(--ink); color: var(--paper); }
.quote-mark { font-family: var(--display); font-size: 4rem; color: var(--sage); opacity: 0.5; line-height: 1; margin-bottom: -1rem; }
.quote-text { font-family: var(--display); font-style: italic; font-weight: 500; font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -0.01em; margin-bottom: 12px; }
.quote-sub { font-family: var(--mono); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--sage); opacity: 0.8; }

/* ===== FAQ ===== */
.faq { padding: 12vh 6vw; max-width: 760px; margin: 0 auto; }
.faq-title {
  font-family: var(--display); font-weight: 500; font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  letter-spacing: -0.02em; text-align: center; margin-bottom: 48px;
}
.faq-list { display: flex; flex-direction: column; gap: 28px; }
.faq-item { border-top: 1px solid var(--line); padding-top: 22px; }
.faq-item h3 { font-family: var(--display); font-weight: 500; font-size: 1.15rem; margin-bottom: 8px; letter-spacing: -0.005em; }
.faq-item p { color: var(--ink-soft); font-size: 0.95rem; line-height: 1.65; }

/* ===== HOW IT WORKS ===== */
.how { padding: 12vh 6vw; max-width: 1200px; margin: 0 auto; }
.section-eyebrow {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--sage-deep); margin-bottom: 16px; font-weight: 500; text-align: center;
}
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; margin-top: 40px; }
.how-item { text-align: left; border-top: 2px solid var(--ink); padding-top: 20px; }
.how-mark {
  font-family: var(--display); font-style: italic; font-size: 1.1rem; color: var(--coral-deep);
  display: block; margin-bottom: 14px;
}
.how-item h3 { font-family: var(--display); font-weight: 500; font-size: 1.35rem; margin-bottom: 10px; letter-spacing: -0.01em; }
.how-item p { color: var(--ink-soft); font-size: 0.96rem; line-height: 1.6; }

/* ===== DEMO LETTER ===== */
.demo { padding: 10vh 6vw 12vh; background: var(--paper-warm); }
.demo-title {
  font-family: var(--display); font-weight: 500; font-style: italic; font-size: clamp(1.8rem, 3vw, 2.4rem);
  text-align: center; margin-bottom: 48px; letter-spacing: -0.01em;
}
.demo-letter {
  max-width: 640px; margin: 0 auto; background: #FFFDF8;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 48px 56px; position: relative;
}
.demo-letter::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px;
  background: linear-gradient(90deg, var(--sage), var(--gold), var(--coral));
}
.demo-letter-header {
  display: flex; justify-content: space-between; font-family: var(--mono);
  font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--sage-deep); padding-bottom: 20px; margin-bottom: 24px;
  border-bottom: 1px dashed var(--line);
}
.demo-greeting { font-family: var(--display); font-style: italic; font-size: 1.5rem; margin-bottom: 18px; }
.demo-para { font-size: 1rem; line-height: 1.75; color: var(--ink-soft); margin-bottom: 18px; }
.demo-para strong { color: var(--ink); font-weight: 600; }
.tag-good {
  display: inline-block; font-family: var(--mono); font-size: 0.72rem; font-weight: 500;
  background: rgba(124,152,133,0.18); color: var(--sage-deep); padding: 2px 9px; border-radius: 100px;
  vertical-align: middle;
}
.demo-bars { margin: 28px 0; display: flex; flex-direction: column; gap: 14px; }
.demo-bar-row { display: grid; grid-template-columns: 110px 1fr 60px; align-items: center; gap: 14px; }
.demo-bar-label { font-size: 0.85rem; color: var(--ink-soft); }
.demo-bar-track { height: 8px; background: var(--line); border-radius: 100px; overflow: hidden; }
.demo-bar-fill { height: 100%; background: var(--coral); border-radius: 100px; width: 0; transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.demo-bar-fill.down { background: var(--sage); }
@media (prefers-reduced-motion: reduce) {
  .demo-bar-fill { transition: none; }
}
.demo-bar-val { font-family: var(--mono); font-size: 0.85rem; text-align: right; }
.demo-signoff { font-family: var(--display); font-style: italic; color: var(--ink-soft); margin-top: 28px; }

/* ===== PRICING ===== */
.pricing { padding: 12vh 6vw; text-align: center; max-width: 1180px; margin: 0 auto; }
.pricing-title {
  font-family: var(--display); font-weight: 500; font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  letter-spacing: -0.02em; margin-bottom: 56px;
}
.pricing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; text-align: left; }
.pricing-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.price-card {
  border: 1px solid var(--line); border-radius: 16px; padding: 36px 32px;
  background: #FFFDF8; position: relative;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}
.price-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--sage-deep); }
.price-card.featured { border-color: var(--ink); box-shadow: var(--shadow); }
.price-card.featured:hover { border-color: var(--coral-deep); }
@media (prefers-reduced-motion: reduce) {
  .price-card, .price-card:hover { transform: none; transition: none; }
}
.price-badge {
  position: absolute; top: -13px; left: 32px; background: var(--coral); color: #FFFDF8;
  font-size: 0.72rem; font-weight: 600; padding: 5px 14px; border-radius: 100px;
}
.price-card h3 { font-family: var(--display); font-size: 1.3rem; font-weight: 500; margin-bottom: 8px; }
.price-amount { font-family: var(--mono); font-size: 2.4rem; font-weight: 500; margin-bottom: 22px; }
.price-amount span { font-size: 1rem; color: var(--ink-soft); }
.price-card ul { margin-bottom: 28px; display: flex; flex-direction: column; gap: 11px; }
.price-card li {
  font-size: 0.92rem; color: var(--ink-soft); padding-left: 22px; position: relative;
}
.price-card li::before {
  content: '—'; position: absolute; left: 0; color: var(--sage-deep);
}
.pricing-note { margin-top: 24px; font-size: 0.85rem; color: var(--ink-soft); opacity: 0.75; }
.pricing-note-link { color: var(--sage-deep); text-decoration: underline; opacity: 1; font-weight: 500; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(20,35,31,0.5);
  display: none; align-items: center; justify-content: center; backdrop-filter: blur(4px);
  padding: 20px; box-sizing: border-box;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--paper); border-radius: 16px; padding: 40px; width: 100%; max-width: 400px;
  position: relative; box-shadow: var(--shadow);
  max-height: calc(100vh - 40px); overflow-y: auto; -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}
.modal-close {
  position: sticky; top: 0; float: right; margin-top: -40px; margin-right: -18px;
  font-size: 1.4rem; color: var(--ink-soft); line-height: 1; background: var(--paper);
  width: 32px; height: 32px; border-radius: 100px; z-index: 2;
}
.modal-eyebrow {
  font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--sage-deep); margin-bottom: 8px;
}
.modal h3 { font-family: var(--display); font-size: 1.5rem; font-weight: 500; margin-bottom: 24px; }
#authForm label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 16px; color: var(--ink-soft); }
#authForm input {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 8px; font-size: 0.95rem; background: #FFFDF8;
  box-sizing: border-box;
}
#authForm input:focus { border-color: var(--sage-deep); outline: none; }

@media (max-width: 480px) {
  .modal { padding: 28px 22px; border-radius: 14px; max-height: calc(100vh - 20px); }
  .modal-overlay { padding: 10px; align-items: flex-end; }
  .modal { max-height: 88vh; }
}
.modal-switch { text-align: center; margin-top: 18px; font-size: 0.88rem; color: var(--ink-soft); }

.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #FFFDF8; color: var(--ink); border: 1px solid var(--line);
  padding: 13px 20px; border-radius: 100px; font-weight: 600; font-size: 0.92rem;
  transition: all 0.2s; margin-bottom: 18px;
}
.btn-google:hover { background: var(--paper-warm); border-color: var(--ink-soft); }
.modal-divider {
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px;
  color: var(--ink-soft); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.modal-divider::before, .modal-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.modal-switch button { color: var(--coral-deep); font-weight: 600; margin-left: 4px; }
.modal-error { color: var(--coral-deep); font-size: 0.85rem; margin-top: 12px; text-align: center; min-height: 1em; }

/* ===== FOOTER ===== */
.footer { padding: 40px 6vw; text-align: center; color: var(--ink-soft); font-size: 0.85rem; border-top: 1px solid var(--line); }

/* ===== RESPONSIVE ===== */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 4vh; text-align: left; }
  .hero-visual { order: -1; margin-bottom: 20px; }
  .envelope { width: 100%; max-width: 340px; height: 380px; }
  .letter-stack { max-width: 340px; margin: 0 auto; }
  .trust-strip { gap: 24px; margin-top: 32px; }
  .trust-num { font-size: 1.25rem; }
  .how-grid { grid-template-columns: 1fr; gap: 36px; }
  .pricing-grid { grid-template-columns: 1fr; }
  .demo-letter { padding: 32px 24px; }
  .demo-sub { margin-bottom: 28px; }
  .demo-bar-row { grid-template-columns: 90px 1fr 50px; }
  .quote-text { font-size: 1.6rem; }
  .nav-links { gap: 16px; }
  .nav-links a { display: none; }
}

@media (max-width: 480px) {
  .trust-strip { gap: 18px 22px; }
  .quote-band { padding: 8vh 6vw; }
  .price-card:hover { transform: none; } /* hover-lift doesn't apply well on touch */
  .faq { padding: 8vh 6vw; }
  .faq-list { gap: 22px; }
}
