/* TreeO marketing pages (welcome.html, pricing.html). Static, no build step:
   these files are copied into every build as-is and served next to the app.
   The one script is /pricing.js, same-origin progressive enhancement
   (checkout wiring and regional price display); every page is fully
   functional without it.

   The marketing palette is deliberately its own, not a mirror of the app's
   src/styles/tokens.css. The page tells one story: it starts above the soil
   (pale bone, air) and goes underground at a hard soil line, below which
   everything is dark, warm earth. Four anchors carry it:

     bone   : dry, pale background for the above-soil half
     soil   : dark, warm brown for the below-soil half (never grey, never navy)
     green  : one real leaf green, reserved for Roots and nothing else
     amber  : one warm accent for money movement, used sparingly

   Colour discipline: if green shows up on buttons and charts it stops meaning
   anything. Here green only ever means "what you kept". */

/* Sora, self-hosted (copied from @fontsource/sora into public/fonts) so the
   pages work under the app's strict same-origin CSP and offline. */
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/sora-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/sora-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/sora-latin-800-normal.woff2") format("woff2");
}

:root {
  /* Above the soil */
  --bone: #f2ecdf;
  --bone-card: #faf6eb;
  --bone-2: #e9e1cc;
  --hairline: #dcd2b9;
  --ink: #2b2318;
  --ink-muted: #857a63;
  --ink-faint: #a49a83;

  /* Below the soil */
  --soil: #271c11;
  --soil-2: #312517;
  --bedrock: #1a1109;
  --soil-edge: #58401f;
  --soil-text: #ece2cd;
  --soil-muted: #a8977b;
  --soil-hairline: #40301d;

  /* The four accents */
  --green: #4b6b3f;        /* Roots only */
  --green-on-soil: #8aa46c;
  --amber: #b57f24;        /* money movement only */
  --amber-on-soil: #d5a244;
  --bark: #6d5138;         /* Trunk */
  --clay: #b5613f;         /* Leaves */

  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(43, 35, 24, 0.06);
  --shadow-card: 0 10px 30px rgba(43, 35, 24, 0.08);
  --font-brand: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1020px; margin: 0 auto; padding: 0 24px; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  background: color-mix(in srgb, var(--bone) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand { display: block; color: var(--ink); }
.site-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: var(--r-pill);
}
.site-nav a:hover { background: var(--bone-2); color: var(--ink); }
.site-nav a.active { color: var(--ink); }
/* The nav's CTA pill must not inherit the muted link colour. */
.site-nav a.btn-primary, .site-nav a.btn-primary:hover { background: var(--ink); color: var(--bone); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  border-radius: var(--r-pill);
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-brand);
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--bone); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: #453a2a; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--bone-2); }
/* Below the soil the roles invert: a bone button on dark earth. */
.btn-light { background: var(--soil-text); color: var(--soil); }
.btn-light:hover { background: #fff8e8; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ── Type ───────────────────────────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--font-brand); line-height: 1.18; margin: 0 0 12px; }
h1 { font-size: clamp(34px, 5.5vw, 56px); font-weight: 800; letter-spacing: -1px; }
h2 { font-size: clamp(24px, 3.5vw, 34px); font-weight: 800; letter-spacing: -0.5px; }
h3 { font-size: 18px; font-weight: 700; }
.lede { font-size: clamp(16px, 2vw, 19px); color: var(--ink-muted); max-width: 600px; }
.muted { color: var(--ink-muted); }
.faint { color: var(--ink-faint); }
.small { font-size: 13px; }

/* The slogan: a piece of received wisdom, then the rebuttal. The first line
   is something said TO you (lighter, the colour of dry grass); the second
   answers it at full weight and full contrast, tight underneath, on the same
   left edge. Never centre it. */
.slogan { display: block; }
.slogan .received {
  display: block;
  font-weight: 600;
  color: var(--ink-muted);
}
.slogan .rebuttal {
  display: block;
  font-weight: 800;
  color: var(--ink);
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-brand);
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 10px;
}

/* ── Sections and cards ─────────────────────────────────────────────────── */
section { padding: 60px 0; }
section.tight { padding: 36px 0; }
.card {
  background: var(--bone-card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }

/* The 50/30/20 ratio bar: Trunk bark, Leaves clay, Roots green. */
.ratio-pill { display: flex; height: 12px; width: 100%; border-radius: var(--r-pill); overflow: hidden; }
.ratio-pill span { display: block; height: 100%; }

/* The folklore block: a story told aloud, set off by a bark rule. */
.story {
  border-left: 3px solid var(--bark);
  padding: 6px 22px;
  max-width: 640px;
}
.story .refrain { font-weight: 700; font-family: var(--font-brand); margin: 12px 0 0; }

/* ── The root system under the hero ─────────────────────────────────────── */
/* Geometric and thin-stroked, closer to a subway diagram than to botany.
   It draws downward once on load, about 800ms, then never moves again. */
.rootline { display: block; width: min(560px, 80%); margin: 8px 0 0; overflow: visible; }
.rootline path {
  fill: none;
  stroke: var(--ink-faint);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw-root 620ms ease-out forwards;
}
.rootline path.late { animation-delay: 240ms; animation-duration: 560ms; }
@keyframes draw-root { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .rootline path { animation: none; stroke-dashoffset: 0; }
}

/* ── The soil line and everything under it ──────────────────────────────── */
/* One hard, full-bleed horizontal rule where the background flips dark. */
.underground {
  background: var(--soil);
  color: var(--soil-text);
  border-top: 4px solid var(--soil-edge);
}
.underground .eyebrow { color: var(--amber-on-soil); }
.underground .lede, .underground .muted { color: var(--soil-muted); }
.underground .card {
  background: var(--soil-2);
  border-color: var(--soil-hairline);
  box-shadow: none;
}
.underground h1, .underground h2, .underground h3 { color: var(--soil-text); }
.underground .roots-figure { color: var(--green-on-soil); }
.rings { display: block; }

/* ── Pricing cards ──────────────────────────────────────────────────────── */
/* Every card shares one vertical rhythm (name, description, price, billing
   note, then the list), with min-heights on the wrapping rows so the three
   columns stay aligned however the copy wraps. */
.plan { display: flex; flex-direction: column; position: relative; }
.plan .plan-desc { margin: 0 0 10px; min-height: 2.6em; }
.plan .price { font-size: 38px; font-weight: 800; font-family: var(--font-brand); letter-spacing: -1px; white-space: nowrap; }
.plan .price .per { font-size: 14px; font-weight: 600; color: var(--ink-muted); letter-spacing: 0; }
.plan .plan-bill { margin: 2px 0 0; min-height: 2.6em; }
@media (max-width: 860px) { .plan .plan-desc, .plan .plan-bill { min-height: 0; } }
.plan ul { list-style: none; padding: 0; margin: 14px 0 20px; }
.plan li { padding: 6px 0 6px 26px; position: relative; font-size: 14.5px; }
.plan li::before { content: "✓"; position: absolute; left: 2px; color: var(--bark); font-weight: 700; }
.plan li.soon::before { content: "·"; color: var(--ink-faint); }
.plan li.soon { color: var(--ink-muted); }
.plan .cta { margin-top: auto; text-align: center; }
.plan-featured { border: 2px solid var(--ink); box-shadow: var(--shadow-card); }
.badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bone);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.badge.soon { background: var(--bone-2); color: var(--ink-muted); }

/* ── Comparison table ───────────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bone-card); }
table.compare { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 14px; }
table.compare th, table.compare td { padding: 10px 16px; border-bottom: 1px solid var(--hairline); text-align: center; }
table.compare th:first-child, table.compare td:first-child { text-align: left; }
table.compare thead th { background: var(--bone-2); font-size: 13px; }
table.compare tbody tr:last-child td { border-bottom: none; }
table.compare .yes { color: var(--bark); font-weight: 700; }
table.compare .no { color: var(--ink-faint); }
table.compare .note { font-size: 12px; color: var(--ink-muted); font-weight: 400; }
table.compare td.group {
  text-align: left;
  background: var(--bone-2);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ── FAQ ────────────────────────────────────────────────────────────────── */
details {
  background: var(--bone-card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 16px 20px;
  margin-bottom: 10px;
}
details summary { cursor: pointer; font-weight: 700; font-size: 15.5px; }
details[open] summary { margin-bottom: 8px; }
details p { margin: 6px 0; font-size: 14.5px; color: var(--ink-muted); }

/* ── Footer: bedrock ────────────────────────────────────────────────────── */
/* The darkest tone on the page, small type, quiet. */
.site-footer { background: var(--bedrock); color: var(--soil-muted); padding: 36px 0 52px; }
.underground + .site-footer { border-top: 1px solid var(--soil-hairline); }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--soil-muted); text-decoration: none; font-size: 13px; margin-right: 16px; }
.site-footer a:hover { color: var(--soil-text); text-decoration: underline; }
