/* =========================================================================
   SendMerlin - design system
   One file, no build step, vanilla CSS.
   Visual language follows the ease-health reference: cream page, forest
   green serif headings, tinted bento cards (keylime/mint/slate/sage),
   slate chip labels, dark forest pill buttons and full-width CTA bars.
   Sections: tokens > reset > typography > layout > buttons > chips > nav
             > cards > cta bar > footer > landing components > responsive
   ========================================================================= */

/* ---- Design tokens (colors match the reference palette exactly) -------- */
:root {
  --light: #fffefc;        /* page background */
  --cream: #f8f6f0;        /* alternate surface */
  --border: #efeeeb;       /* hairline borders */
  --forest: #0f3e17;       /* headings, body text, primary buttons */
  --forest-dark: #0c2f10;  /* button hover */
  --keylime: #e1f4df;      /* light green card surface */
  --mint: #cfe7d3;         /* green card surface */
  --sage: #b1dbb8;         /* stronger green surface */
  --slate: #b6ced5;        /* blue-grey surface - chips, media cards */
  --charcoal: #161608;     /* near-black accents */
  --link: #008316;         /* inline links */
  --muted: #5f6d62;        /* secondary text on light surfaces */
  --neutral-dark: #222;

  --r-xs: 0.5rem;
  --r-sm: 0.75rem;
  --r-md: 1rem;
  --r-lg: 1.5rem;
  --r-full: 999px;

  --wrap: 1280px;
  --shadow-soft: 0 20px 50px -28px rgba(15, 62, 23, 0.25);
  /* Reference fonts are Faire Octave + Suisse Int'l (commercial);
     Newsreader + Inter are the closest Google equivalents. */
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

/* ---- Minimal reset ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--forest);
  background: var(--light);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }
:target { scroll-margin-top: 96px; }

/* ---- Typography ------------------------------------------------------- */
h1, h2, h3 {
  font-family: var(--serif);
  color: var(--forest);
  font-weight: 300;
  margin: 0;
}
h1 {
  font-size: clamp(2.9rem, 5.2vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
h2 {
  font-size: clamp(2rem, 3.4vw, 2.55rem);
  line-height: 1.32;
  letter-spacing: -0.01em;
}
h3 {
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
}
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 600; }

.lead { font-size: 1.08rem; line-height: 1.65; color: var(--forest); }
.small { font-size: 0.88rem; }
.muted { color: var(--muted); }

/* ---- Layout ----------------------------------------------------------- */
.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
}
.section { padding: 108px 0; }

/* Left-aligned section header: chip above a serif heading */
.section-head { max-width: 720px; margin-bottom: 56px; }
.section-head h2 { margin-top: 22px; }
.section-head .lead { margin-top: 18px; max-width: 620px; }

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.92rem;
  line-height: 1;
  padding: 15px 24px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--forest); color: #fff; }
.btn-primary:hover { background: var(--forest-dark); }
.btn-ghost { background: transparent; color: var(--forest); border-color: var(--sage); }
.btn-ghost:hover { background: var(--keylime); }
.btn-sm { padding: 11px 18px; font-size: 0.88rem; }

/* ---- Chip (slate section label, mirrors the reference's tags) ---------- */
.chip {
  display: inline-block;
  background: var(--slate);
  color: var(--neutral-dark);
  font-family: var(--sans);
  font-size: 0.92rem;
  line-height: 1;
  padding: 8px 13px;
  border-radius: var(--r-xs);
}

/* ---- Nav --------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 254, 252, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}
.brand-mark { display: block; }
.brand span {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.62rem;
  color: var(--forest);
  letter-spacing: -0.02em;
}
.nav-links { display: flex; align-items: center; gap: 30px; }
.lnk {
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--neutral-dark);
  text-decoration: none;
  transition: color 0.16s ease;
}
.lnk:hover { color: var(--link); }

/* ---- Bento cards -------------------------------------------------------- */
.card {
  border-radius: var(--r-lg);
  padding: clamp(28px, 3.4vw, 44px);
}
.card-keylime { background: var(--keylime); }
.card-mint { background: var(--mint); }
.card-sage { background: var(--sage); }
.card-slate { background: var(--slate); }
.card-cream { background: var(--cream); }
.card-forest { background: var(--forest); color: #fff; }
.card-forest h2, .card-forest h3 { color: #fff; }

/* ---- Full-width forest CTA bar (reference's "Request a Demo ->") ------- */
.cta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--forest);
  color: #fff;
  border-radius: var(--r-lg);
  padding: 30px 40px;
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  font-family: var(--sans);
  text-decoration: none;
  transition: background-color 0.18s ease;
}
.cta-bar:hover { background: var(--forest-dark); }
.cta-bar .arrow { transition: transform 0.2s ease; flex-shrink: 0; }
.cta-bar:hover .arrow { transform: translateX(8px); }

/* ---- Inline animated mockups ------------------------------------------ */
/* Panels and cards are drawn inside each SVG; the container stays
   transparent and floats on its card surface. Resting state = final
   composed frame; entrance/idle animation only under .in-view. */
.mockup { display: block; width: 100%; height: auto; }
@media (prefers-reduced-motion: reduce) {
  .mockup * { animation: none !important; }
}

/* =========================================================================
   Landing components
   ========================================================================= */

/* ---- Hero bento (keylime headline card + slate media card) ------------- */
.hero { padding: 22px 0 64px; }
.hero-grid {
  display: grid;
  grid-template-columns: 0.42fr 0.58fr;
  gap: 22px;
  align-items: stretch;
}
.hero-copy { display: flex; flex-direction: column; gap: 22px; }
.hero-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: clamp(32px, 3.6vw, 46px);
}
.hero-card .sub { max-width: 420px; font-size: 1.06rem; line-height: 1.6; }
.hero-note { margin-top: 14px; font-size: 0.85rem; color: var(--muted); }
.hero-media {
  display: flex;
  align-items: center;
  padding: clamp(24px, 3vw, 44px);
}

/* ---- Proof strip -------------------------------------------------------- */
.proof { padding: 46px 0 10px; text-align: center; }
.proof-title { font-size: 0.95rem; color: var(--neutral-dark); margin-bottom: 26px; }
.proof-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px 48px;
  font-family: var(--serif);
  font-size: 1.22rem;
  color: var(--forest);
}
.proof-items span { display: inline-flex; align-items: center; gap: 10px; }

/* ---- Split section (tinted word card left, chip + h2 + stats right) ---- */
.split {
  display: grid;
  grid-template-columns: 0.47fr 0.53fr;
  gap: clamp(40px, 5vw, 76px);
  align-items: center;
}
.word-card {
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Rolling word loop: 8 rows in the track (5 words + first 3 repeated),
   window shows 3 rows, animation rolls down one row per step with a
   settle, and the 5-step cycle ends on a frame identical to the start. */
.word-window {
  --roll-step: 96px;
  height: calc(var(--roll-step) * 3);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 4%, #000 38%, #000 62%, transparent 96%);
  mask-image: linear-gradient(to bottom, transparent 4%, #000 38%, #000 62%, transparent 96%);
}
.word-track {
  text-align: center;
  font-family: var(--serif);
  color: var(--forest);
  animation: word-roll 14s cubic-bezier(0.3, 1.15, 0.4, 1) infinite;
}
.word-track span {
  display: block;
  height: var(--roll-step);
  line-height: var(--roll-step);
  font-size: 2.4rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
@keyframes word-roll {
  0%, 13%   { transform: translateY(calc(var(--roll-step) * -5)); }
  20%, 33%  { transform: translateY(calc(var(--roll-step) * -4)); }
  40%, 53%  { transform: translateY(calc(var(--roll-step) * -3)); }
  60%, 73%  { transform: translateY(calc(var(--roll-step) * -2)); }
  80%, 93%  { transform: translateY(calc(var(--roll-step) * -1)); }
  100%      { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .word-track { animation: none; transform: translateY(calc(var(--roll-step) * -5)); }
}
.split-body h2 { margin-top: 22px; }
.stats { display: flex; gap: 56px; margin-top: 44px; }
.stat-num {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 4vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-label { margin-top: 10px; font-size: 0.88rem; color: var(--neutral-dark); max-width: 210px; }

/* ---- Problem / solution ------------------------------------------------- */
.problem .chip { margin-bottom: 26px; }
.problem h3 { max-width: 760px; }
.problem-solution { max-width: 760px; margin-left: auto; }
/* Curved connector rising left-bottom to right-top. Base state = fully
   drawn (no-JS, crawlers, reduced motion). Where the browser supports
   scroll-driven animations the draw progress follows the scroll position
   (the line grows left to right as you scroll); elsewhere it falls back
   to a one-shot draw when scrolled into view. */
.problem-lines {
  display: block;
  width: 100%;
  height: auto;
  margin: 24px 0 20px;
}
.problem-lines path { stroke-dasharray: 1; stroke-dashoffset: 0; }
@keyframes line-draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@supports not (animation-timeline: view()) {
  .in-view .problem-lines path { animation: line-draw 1.4s cubic-bezier(0.4, 0, 0.2, 1) both; }
  .in-view .problem-lines path:nth-child(2) { animation-delay: 0.12s; }
  .in-view .problem-lines path:nth-child(3) { animation-delay: 0.24s; }
  .in-view .problem-lines path:nth-child(4) { animation-delay: 0.36s; }
}
@supports (animation-timeline: view()) {
  .problem-lines path {
    animation: line-draw linear both;
    animation-timeline: view();
    animation-range: entry 30% cover 55%;
  }
  .problem-lines path:nth-child(2) { animation-range: entry 35% cover 60%; }
  .problem-lines path:nth-child(3) { animation-range: entry 40% cover 65%; }
  .problem-lines path:nth-child(4) { animation-range: entry 45% cover 70%; }
}
@media (prefers-reduced-motion: reduce) {
  .problem-lines path { animation: none !important; }
}

/* ---- Feature cards ------------------------------------------------------ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.feature-card { min-height: 300px; display: flex; flex-direction: column; }
.feature-ico { margin-bottom: auto; }
.feature-ico svg { width: 44px; height: 44px; }
.feature-card h3 { font-size: 1.55rem; margin: 40px 0 12px; }
.feature-card p { font-size: 0.95rem; line-height: 1.6; margin: 0; }

/* ---- How it works ------------------------------------------------------- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.step-card { display: flex; flex-direction: column; min-height: 320px; }
.step-num {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--neutral-dark);
}
.step-card h3 { font-size: 1.55rem; margin: auto 0 12px; padding-top: 48px; }
.step-card p { font-size: 0.95rem; margin: 0; }

/* ---- Compare (why switch) ----------------------------------------------- */
.compare-grid {
  display: grid;
  grid-template-columns: 0.44fr 0.56fr;
  gap: clamp(40px, 5vw, 76px);
  align-items: start;
}
.compare-head h2 { margin-top: 22px; }
.compare-head .lead { margin-top: 18px; }
.check-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px 44px;
  padding-top: 8px;
}
.check-ico {
  width: 30px;
  height: 30px;
  border-radius: var(--r-xs);
  background: var(--sage);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.check-ico svg { width: 16px; height: 16px; }
.check-tile p { font-size: 0.95rem; color: var(--neutral-dark); margin: 0; }
.check-tile strong { display: block; color: var(--forest); margin-bottom: 6px; font-weight: 600; }
.compare-table-card { margin-top: 64px; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.compare-table th, .compare-table td {
  text-align: left;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(15, 62, 23, 0.14);
}
.compare-table tr:last-child th, .compare-table tr:last-child td { border-bottom: none; }
.compare-table thead th {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.15rem;
}
.compare-table tbody th { font-weight: 500; }
.compare-table .sm-col { background: rgba(255, 254, 252, 0.55); font-weight: 600; }
.compare-note { margin-top: 18px; font-size: 0.85rem; color: var(--muted); }

/* ---- Pricing ------------------------------------------------------------ */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.price-card { display: flex; flex-direction: column; }
.price-name { font-family: var(--serif); font-size: 1.7rem; }
.price-amount {
  font-family: var(--serif);
  font-size: 3.4rem;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-top: 22px;
}
.price-per { font-size: 0.9rem; color: var(--neutral-dark); }
.price-desc { margin: 16px 0 22px; font-size: 0.95rem; }
.price-list { list-style: none; padding: 0; margin: 0 0 30px; display: grid; gap: 11px; }
.price-list li { position: relative; padding-left: 28px; font-size: 0.95rem; }
.price-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 7px;
  width: 13px;
  height: 7px;
  border-left: 2px solid var(--forest);
  border-bottom: 2px solid var(--forest);
  transform: rotate(-45deg);
}
.price-card .btn { margin-top: auto; width: 100%; }
.pricing-note { margin-top: 30px; font-size: 0.95rem; color: var(--neutral-dark); }

/* ---- FAQ ---------------------------------------------------------------- */
.faq { max-width: 800px; margin-top: 8px; }
.faq-item { border-bottom: 1px solid var(--border); padding: 26px 0; }
.faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  list-style: none;
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--forest);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--forest);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { margin: 16px 0 0; font-size: 0.98rem; color: var(--neutral-dark); max-width: 680px; }

/* ---- Footer bento -------------------------------------------------------- */
.footer { padding: 40px 0 34px; }
.footer-bento {
  display: grid;
  grid-template-columns: 0.58fr 0.42fr;
  gap: 22px;
  align-items: stretch;
}
.footer-main { display: flex; flex-direction: column; gap: 22px; }
.footer-hello {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 64px;
  padding: clamp(32px, 3.6vw, 46px);
}
.footer-hello p { max-width: 380px; font-size: 1.02rem; }
.footer-side { display: flex; flex-direction: column; gap: 22px; }
.footer-waves { min-height: 180px; overflow: hidden; padding: 0; }
.footer-waves svg { width: 100%; height: 100%; min-height: 180px; }
.footer-links {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-content: start;
}
.footer-links h4 {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.88rem;
  color: rgba(15, 62, 23, 0.55);
  margin: 0 0 12px;
}
.footer-links a {
  display: block;
  font-size: 0.95rem;
  color: var(--forest);
  text-decoration: none;
  padding: 4px 0;
}
.footer-links a:hover { color: var(--link); }
.footer-links .footer-tile { grid-column: 1 / -1; margin-top: 18px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
  font-size: 0.85rem;
  color: var(--muted);
}
.footer-bottom a { text-decoration: none; color: var(--muted); margin-right: 16px; }
.footer-bottom a:hover { color: var(--forest); }

/* ---- Utilities ----------------------------------------------------------- */
.hide-sm { }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 1080px) {
  .features-grid, .steps-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; }
  .split, .compare-grid { grid-template-columns: 1fr; }
  .word-card { min-height: 320px; }
  .footer-bento { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .section { padding: 68px 0; }
  .hide-sm { display: none; }
  .nav-links { gap: 14px; }
  .navbar { height: 72px; }
  .features-grid, .steps-grid { grid-template-columns: 1fr; }
  .feature-card, .step-card { min-height: 0; }
  .feature-card h3 { margin-top: 28px; }
  .step-card h3 { padding-top: 28px; }
  .check-tiles { grid-template-columns: 1fr; gap: 28px; }
  .stats { gap: 36px; }
  .cta-bar { padding: 24px 26px; }
  .compare-table th, .compare-table td { padding: 12px 10px; font-size: 0.85rem; }
}
@media (max-width: 440px) {
  .brand span { font-size: 1.35rem; }
  .btn { padding: 13px 18px; }
}
