/* TreeSnap home page. Mobile first: 390 base, breakpoints 768 and 1100. */

/* Geist (SIL Open Font License), self-hosted latin subset, variable weight. */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 400 800;
  font-display: optional;
  src: url(../fonts/geist-latin.woff2) format('woff2');
}

:root {
  --bg: #0a0d0f;
  --bg-2: #0f1418;
  --card: #151b20;
  --border: rgba(255, 255, 255, 0.09);
  --border-2: rgba(255, 255, 255, 0.16);
  --text: #eef2f5;
  --text-2: #c2cad1;
  --text-3: #9aa4ad;
  --green: #22c55e;
  --green-ink: #06210f;
  --green-hover: #4ade80;
  --green-soft: rgba(34, 197, 94, 0.12);
  --amber: #fbbf24;
  --radius: 14px;
  --font: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .sticky-cta { transition: none; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2 { margin: 0 0 24px; line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 8.4vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.55rem, 5.5vw, 2.25rem); font-weight: 750; }
p { margin: 0 0 12px; color: var(--text-2); }
[id] { scroll-margin-top: 72px; }

/* One container for every section, so all left edges line up. */
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow > * { max-width: 720px; }
.center { text-align: center; }

/* Buttons: one primary style (demo), one secondary (form submit). */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px; border-radius: 10px;
  font: 700 16px/1 var(--font); text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: background .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--green); color: var(--green-ink); }
.btn-primary:hover { background: var(--green-hover); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border-2); }
.btn-secondary:hover { border-color: var(--green); }
.btn-secondary:disabled, .btn-primary:disabled { opacity: .6; cursor: default; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn-lg { min-height: 54px; font-size: 17px; }
.btn:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 3px solid var(--green); outline-offset: 2px;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20; height: 56px;
  background: rgba(10, 13, 15, 0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-row { height: 56px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; font-size: 18px; }
.brand img { width: 30px; height: 30px; }
.nav { display: none; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.header-actions .btn-sm { display: none; }
.menu-btn {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--border); border-radius: 10px; color: var(--text); cursor: pointer;
}
/* Phone menu: a solid panel over a dimmed page, so it never reads as part of the hero. */
.nav.open {
  display: flex; flex-direction: column; position: absolute; top: 56px; left: 0; right: 0;
  background: var(--card); border-bottom: 1px solid var(--border-2); border-radius: 0 0 16px 16px;
  padding: 8px 24px 20px; box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
}
.nav.open a:not(.nav-demo) { border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.menu-backdrop { position: fixed; inset: 0; z-index: 15; background: rgba(0, 0, 0, 0.7); }
.nav a { text-decoration: none; color: var(--text-2); font-weight: 600; padding: 12px 0; min-height: 44px; }
.nav .nav-demo { color: var(--green-ink); margin-top: 16px; padding: 0 22px; }
.nav a:hover { color: var(--text); }

/* Hero */
.hero { padding: 28px 0 40px; }
.hero-grid { display: grid; gap: 28px; }
.hero-sub { font-size: 1.1rem; color: var(--text-2); margin-bottom: 20px; max-width: 34em; }
.hero .btn-lg { width: 100%; }
.microline { font-size: 14px; color: var(--text-3); margin: 10px 0 0; }
.hero-media { margin: 0; }

.est-card {
  max-width: 420px; margin: 0 auto;
  background: var(--card); border: 1px solid var(--border-2); border-radius: 18px;
  padding: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.est-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.est-label {
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-2); background: rgba(255,255,255,0.06); padding: 4px 8px; border-radius: 6px;
}
.est-badge { font-size: 12px; font-weight: 700; color: var(--amber); background: rgba(251,191,36,0.12); padding: 4px 8px; border-radius: 6px; }
.est-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.est-photos img { border-radius: 8px; aspect-ratio: 1; object-fit: cover; }
.est-row {
  display: flex; justify-content: space-between; gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text-2);
}
.est-row span:last-child { white-space: nowrap; color: var(--text); font-variant-numeric: tabular-nums; }
.est-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; gap: 12px; }
.est-total span { font-size: 13px; color: var(--text-3); }
.est-total strong { font-size: 1.25rem; color: var(--green); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Sections */
/* One section padding: 64px on phones, 96px from 768px up. */
.section { padding: 64px 0; border-top: 1px solid var(--border); }
.section-head { max-width: 640px; margin-bottom: 24px; }
.section-head.center { margin: 0 auto 32px; }

.steps { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 12px; }
.step {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
}
.step-icon {
  flex: 0 0 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--green-soft); color: var(--green);
}
.step-icon svg { width: 26px; height: 26px; }
.step-text { flex: 1 1 0; min-width: 0; font-weight: 650; font-size: 1.05rem; color: var(--text); }

.step-img { flex: 1 0 100%; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); }

/* Two-column rows: both columns top-aligned. On phones the copy comes first, then the image, on the text's left edge. */
.split { display: grid; gap: 32px; align-items: start; }
.split-copy p:last-child { margin-bottom: 0; }
.shot { border-radius: var(--radius); border: 1px solid var(--border-2); box-shadow: 0 18px 50px rgba(0,0,0,0.4); }
/* Lead email: 100% up to 360px on phones; up to 400px, centered in its column, on desktop. No fixed-height box. */
.lead-split .shot { width: 100%; max-width: 360px; height: auto; object-fit: contain; }
/* Rates: the full-width phone crop on phones, the 1200x900 shot up to 560px on desktop. */
.rates-split .shot { width: 100%; }

/* Pricing */
.plans { display: grid; gap: 12px; margin: 24px 0 20px; }
.plan {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left;
  padding: 20px; background: var(--card); color: var(--text); font: inherit; cursor: pointer;
  border: 2px solid var(--border); border-radius: var(--radius);
}
.plan:hover { border-color: var(--border-2); }
.plan[aria-pressed="true"] { border-color: var(--green); }
/* Selected = checkmark + the word + the border, never color alone. */
.plan-sel { display: none; align-items: center; gap: 6px; margin-top: 6px; font-weight: 700; font-size: 14px; color: var(--green); }
.plan[aria-pressed="true"] .plan-sel { display: inline-flex; }
.plan-name { font-weight: 700; font-size: 1.1rem; }
.plan-price { font-weight: 800; font-size: 1.6rem; letter-spacing: -0.02em; }
.plan-cap { color: var(--text-2); }
.plans-line { margin-bottom: 6px; }
/* Phones: room under the pricing note for the sticky demo bar (64px plus the safe area). */
#pricing { padding-bottom: calc(64px + 72px + env(safe-area-inset-bottom)); }
.text-link { color: var(--green); font-weight: 650; display: inline-block; padding: 12px 0; }

/* Demo band */
.band { background: var(--bg-2); border-top: 1px solid var(--border); padding: 64px 0; }
.band-grid { display: grid; gap: 24px; align-items: center; }
.band-img { border-radius: var(--radius); width: 100%; max-height: 420px; object-fit: cover; }
.band-copy .btn-lg { width: 100%; margin-top: 8px; }

/* Apply form */
.apply-form { margin-top: 20px; }
.form-row { display: grid; gap: 14px; margin-bottom: 14px; }
.field label, .tiers legend { display: block; font-weight: 600; font-size: 14px; color: var(--text-2); margin-bottom: 6px; }
.field input {
  width: 100%; min-height: 48px; padding: 10px 12px; font: 16px var(--font); color: var(--text);
  background: var(--card); border: 1px solid var(--border-2); border-radius: 10px;
}
.field input:focus { border-color: var(--green); outline: none; }
.field input[aria-invalid="true"], .suffix-input:has(input[aria-invalid="true"]) { border-color: #f87171; }
.suffix-input { display: flex; align-items: center; background: var(--card); border: 1px solid var(--border-2); border-radius: 10px; }
.suffix-input:focus-within { border-color: var(--green); }
.suffix-input input { border: none; background: transparent; min-width: 0; flex: 1; }
.suffix-input input:focus { outline: none; }
.suffix { padding-right: 12px; color: var(--text-3); white-space: nowrap; }
.tiers { border: none; padding: 0; margin: 4px 0 0; display: grid; gap: 8px; min-width: 0; }
.tiers:focus { outline: none; }
.tier {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 14px; cursor: pointer;
  background: var(--card); border: 2px solid var(--border); border-radius: 10px; font-weight: 600;
}
.tier:has(input:checked) { border-color: var(--green); }
.tier input { width: 18px; height: 18px; accent-color: var(--green); margin: 0; }
.apply-form #apply-btn { width: 100%; margin-top: 16px; }
.form-error { color: #fca5a5; margin-top: 12px; }
.field-hint { font-size: 14px; color: var(--text-3); margin: 6px 0 0; }
.field-hint strong { color: var(--text); font-weight: 650; }
/* Field errors carry an icon, so they never rely on color alone. */
.field-error { display: flex; gap: 6px; align-items: flex-start; font-size: 14px; color: #fca5a5; margin: 6px 0 0; }
.field-error::before {
  content: "!"; flex: 0 0 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: #f87171; color: #1a0606;
  font: 800 12px/18px var(--font); text-align: center;
}
.error-summary { border: 2px solid #f87171; border-radius: 10px; padding: 14px 16px; margin-bottom: 20px; background: rgba(248,113,113,0.08); }
.error-summary:focus { outline: 3px solid #f87171; outline-offset: 2px; }
.error-summary-title { color: var(--text); font-weight: 700; margin-bottom: 6px; }
.error-summary ul { margin: 0; padding-left: 20px; }
.error-summary li { padding: 4px 0; }
.error-summary a { color: #fca5a5; }
.next-steps { margin: 20px 0 0; padding-left: 22px; color: var(--text-2); }
.next-steps li { margin-bottom: 6px; padding-left: 4px; }
/* Notice above the submit button: 14px, underlined links with 44px-tall tap areas that don't change the line height. */
.apply-legal { font-size: 14px; color: var(--text-2); margin: 16px 0 0; }
.apply-legal a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; display: inline-block; padding: 12px 0; margin: -12px 0; }
.form-success {
  margin-top: 20px; padding: 18px; border-radius: var(--radius); font-weight: 600; color: var(--text);
  background: var(--green-soft); border: 1px solid var(--green);
}

/* FAQ */
.faq { margin-top: 16px; border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  min-height: 48px; padding: 14px 32px 14px 0; cursor: pointer; font-weight: 650; color: var(--text);
  list-style: none; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 12px; font-size: 22px; color: var(--green); line-height: 1;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding-bottom: 14px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0 calc(28px + 64px + env(safe-area-inset-bottom)); }
.site-footer p { font-size: 14px; color: var(--text-3); margin-bottom: 6px; }
.site-footer a { color: var(--text-2); }
.site-footer .fine { font-size: 14px; }

/* Sticky mobile CTA */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  background: rgba(10, 13, 15, 0.95); border-top: 1px solid var(--border);
  transform: translateY(110%); transition: transform .2s ease;
}
.sticky-cta.show { transform: none; }
/* Never a second bright demo button under the open phone menu. */
.menu-open .sticky-cta { visibility: hidden; }
.apply-in-view .header-actions .btn-sm { visibility: hidden; }
.sticky-cta .btn { width: 100%; min-height: 48px; }

@media (min-width: 768px) {
  .header-actions .btn-sm { display: inline-flex; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .step { flex-direction: column; align-items: flex-start; }
  .step-img { flex: none; margin-top: auto; }
  .form-row { grid-template-columns: 1fr 1fr; }
  .tiers { grid-template-columns: repeat(3, 1fr); }
  .plans { grid-template-columns: repeat(3, 1fr); }
  .split { grid-template-columns: 1fr 1fr; gap: 48px; }
  .band-grid { grid-template-columns: 5fr 7fr; gap: 48px; }
  .band-copy .btn-lg, .hero .btn-lg { width: auto; }
  .section, .band { padding: 96px 0; }
  #pricing { padding-bottom: 96px; }
  .lead-split .split-media { order: -1; display: flex; justify-content: center; }
  .lead-split .shot { max-width: 400px; }
  .rates-split .shot { max-width: 560px; margin-left: auto; }
  .nav .nav-demo { display: none; }
  .site-footer { padding-bottom: 28px; }
  .sticky-cta { display: none; }
}

@media (min-width: 1100px) {
  .nav { display: flex; gap: 24px; margin-left: 24px; }
  .menu-backdrop { display: none; }
  .menu-btn { display: none; }
  .hero { padding: 64px 0 72px; }
  .hero-grid { grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
  .est-card { margin: 0 0 0 auto; }
}

/* Grid children must be allowed to shrink below their image's intrinsic width. */
.hero-grid > *, .split > *, .band-grid > * { min-width: 0; }
.hero-grid, .split, .band-grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split { gap: 48px; }
  .band-grid { grid-template-columns: 5fr 7fr; }
}
@media (min-width: 1100px) {
  .hero-grid { grid-template-columns: 1.1fr 1fr; }
}

/* Legal pages (body.legal): one readable column, nothing sticky, no images. */
.legal .site-header { position: relative; }
.legal .site-footer { padding-bottom: 28px; }
.legal-main { padding: 40px 0 64px; }
.legal-doc { max-width: calc(62ch + 48px); font-size: 17px; line-height: 1.65; }
.legal-doc h1 { font-size: clamp(1.9rem, 7vw, 2.6rem); margin-bottom: 12px; }
.legal-doc h2 { font-size: 1.35rem; margin: 48px 0 16px; letter-spacing: -0.01em; }
.legal-doc h3 { font-size: 1.1rem; margin: 32px 0 12px; color: var(--text); }
.legal-doc p, .legal-doc li, .legal-doc td, .legal-doc th { color: var(--text-2); }
.legal-doc p { margin: 0 0 16px; }
.legal-doc strong { color: var(--text); }
.legal-doc a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.legal-doc a:hover { color: var(--green); }
.legal-doc ul, .legal-doc ol { padding-left: 22px; margin: 0 0 16px; }
.legal-doc li { margin-bottom: 8px; }
.legal-doc .clauses { list-style: none; padding-left: 16px; }
.legal-eyebrow { font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin: 0 0 8px; }
.legal-meta { font-size: 15px; color: var(--text-3); margin-bottom: 24px; }
.legal-lead { font-size: 18px; }
.legal-summary, .legal-toc { background: var(--card); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 20px 20px 8px; margin: 24px 0 32px; }
.legal-summary h2, .legal-toc h2 { margin-top: 0; font-size: 1.15rem; }
.legal-toc ol { padding-left: 22px; }
.legal-toc ol.plain { padding-left: 0; list-style: none; }
.legal-toc li { margin: 0; }
.legal-toc a { display: inline-block; padding: 8px 0; min-height: 44px; }
.legal-toc .appendix { margin-top: 8px; }
.legal-table { overflow-x: auto; margin: 0 0 16px; }
.legal-table table { width: 100%; border-collapse: collapse; font-size: 15px; }
.legal-table th, .legal-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.legal-table th { color: var(--text); font-weight: 700; }
.back-to-contents { font-size: 15px; margin-top: 8px; }
.legal-doc section > h2[id], .legal-doc h2[id], .legal-doc h3[id] { scroll-margin-top: 16px; }
@media (min-width: 768px) { .legal-main { padding: 64px 0 96px; } }
.legal .menu-backdrop { position: absolute; }
/* Privacy sub-processor table and the 7.1 plan table: a real table from 640px up; stacked cards below, labeled from data-label
   so the words come from the same cells. Roles in the markup keep it a table for screen readers. */
@media (max-width: 639px) {
  .subprocessors, .stack-table { overflow-x: visible; }
  .subprocessors table, .stack-table table, .subprocessors tbody, .stack-table tbody, .subprocessors tr, .stack-table tr, .subprocessors td, .stack-table td { display: block; width: 100%; }
  .subprocessors thead, .stack-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .subprocessors tr, .stack-table tr { background: var(--card); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
  .subprocessors td, .stack-table td { border: 0; padding: 4px 0; }
  .subprocessors td.sp-name, .stack-table td.sp-name { color: var(--text); font-weight: 700; font-size: 17px; padding-bottom: 6px; }
  .subprocessors td[data-label]::before, .stack-table td[data-label]::before { content: attr(data-label); display: block; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
}
