/* White Tree Labs — shared site styles */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #ffffff;
  --bg-subtle: #f6f7f5;
  --surface: #ffffff;
  --border: #e4e8e5;
  --border-strong: #d0d7d2;
  --line: #b3beb7;
  --text: #0f1613;
  --text-muted: #4d5953;
  --text-faint: #5f6b65;
  --accent: #1f6b53;
  --accent-soft: #e6f0eb;
  --brand: #1f5c4a;
  --btn-bg: #0f1613;
  --btn-text: #ffffff;
  --btn-bg-hover: #29332e;
  --focus: #2a8a6a;

  --radius: 16px;
  --radius-sm: 10px;
  --container: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --header-h: 4rem;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f0d;
    --bg-subtle: #0f1512;
    --surface: #121916;
    --border: #212a26;
    --border-strong: #303c36;
    --line: #45544c;
    --text: #edf2ef;
    --text-muted: #a5b0aa;
    --text-faint: #8a968f;
    --accent: #7fc8ac;
    --accent-soft: #14231d;
    --brand: #2a7a61;
    --btn-bg: #edf2ef;
    --btn-text: #0b0f0d;
    --btn-bg-hover: #d3dcd7;
    --focus: #7fc8ac;
  }
}

/* ---------- Base ---------- */

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1 0 auto;
}

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

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  color: var(--text);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 100;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-text);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
}

/* ---------- Header & navigation ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 1rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding-block: 0.5rem;
  color: var(--text);
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  text-decoration: none;
}

.brand-mark {
  width: 28px;
  height: 28px;
  flex: none;
}

.brand-tile {
  fill: var(--brand);
}

.site-nav {
  width: 100%;
  margin-inline: -0.75rem;
  padding-bottom: 0.5rem;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.125rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--bg-subtle);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: -0.5rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.nav-toggle:hover {
  background: var(--bg-subtle);
}

.nav-toggle svg {
  width: 22px;
  height: 22px;
}

.nav-toggle .icon-close,
.nav-toggle[aria-expanded="true"] .icon-open {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

@media (max-width: 47.99rem) {
  .js .nav-toggle {
    display: inline-flex;
  }

  .js .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0.5rem var(--gutter) 1.25rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }

  .js .site-header.is-open .site-nav {
    display: block;
  }

  .js .site-nav ul {
    flex-direction: column;
  }

  .js .site-nav a {
    padding: 0.8rem 0.75rem;
    font-size: 1.0625rem;
  }
}

@media (min-width: 48rem) {
  .header-inner {
    flex-wrap: nowrap;
  }

  .site-nav {
    width: auto;
    margin: 0 -0.75rem 0 0;
    padding: 0;
  }

  .site-nav ul {
    gap: 0.25rem;
  }
}

/* ---------- Buttons & small elements ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.875rem;
  padding: 0.625rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-text);
}

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

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--text-faint);
}

.btn-small {
  min-height: 2.25rem;
  padding: 0.375rem 0.875rem;
  font-size: 0.875rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 600;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.text-link span[aria-hidden] {
  transition: transform 0.15s ease;
}

.text-link:hover span[aria-hidden] {
  transform: translateX(3px);
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead {
  max-width: 40rem;
  color: var(--text-muted);
  font-size: clamp(1.125rem, 1.02rem + 0.45vw, 1.3125rem);
  line-height: 1.55;
}

.muted {
  color: var(--text-muted);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  padding: 0.3rem 0.75rem 0.3rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Sections & layout ---------- */

.section {
  padding-block: clamp(4rem, 9vw, 6.5rem);
}

.section + .section {
  border-top: 1px solid var(--border);
}

.section-alt {
  background: var(--bg-subtle);
}

.section-head {
  max-width: 42rem;
  margin-bottom: clamp(2rem, 5vw, 3.25rem);
}

.section-head > :last-child {
  margin-bottom: 0;
}

.section-title {
  font-size: clamp(1.875rem, 1.35rem + 2.1vw, 2.75rem);
  letter-spacing: -0.03em;
}

.split {
  display: grid;
  gap: 2.5rem;
}

.split > * {
  min-width: 0;
}

@media (min-width: 60rem) {
  .split {
    grid-template-columns: 1fr 1fr;
    gap: 4.5rem;
    align-items: center;
  }

  .split-top {
    align-items: start;
  }
}

.grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 40rem) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 60rem) {
  .grid {
    gap: 1.25rem;
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Cards ---------- */

.card {
  padding: clamp(1.5rem, 3vw, 2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
  letter-spacing: -0.015em;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
}

.card-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(4rem, 11vw, 8rem) clamp(4rem, 9vw, 6.5rem);
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.hero-grid > * {
  min-width: 0;
}

.hero h1 {
  max-width: 13em;
  margin-bottom: 1.5rem;
  font-size: clamp(2.5rem, 1.5rem + 3.6vw, 4rem);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: -0.042em;
}

.hero .actions {
  margin-top: 2.25rem;
}

.hero-art {
  display: none;
}

@media (min-width: 60rem) {
  .hero-grid {
    grid-template-columns: 1.3fr 0.7fr;
    gap: 4rem;
  }

  .hero-art {
    display: block;
    aspect-ratio: 1;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 8px);
    background: var(--bg-subtle);
  }
}

.tree-art {
  width: 100%;
  height: 100%;
}

.tree-art .dot {
  fill: var(--border-strong);
}

.tree-art .edge {
  fill: none;
  stroke: var(--line);
  stroke-width: 2;
  stroke-linecap: round;
}

.tree-art .node {
  fill: var(--surface);
  stroke: var(--line);
  stroke-width: 2;
}

.tree-art .node-root {
  fill: var(--brand);
  stroke: none;
}

.tree-art .node-accent {
  fill: var(--accent);
  stroke: none;
}

.tree-art .ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  opacity: 0.35;
}

/* ---------- Page hero (inner pages) ---------- */

.page-hero {
  padding-block: clamp(3.5rem, 9vw, 6.5rem) clamp(3rem, 7vw, 4.5rem);
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  max-width: 50rem;
  margin-bottom: 1.25rem;
  font-size: clamp(2.25rem, 1.45rem + 3.6vw, 3.75rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.038em;
}

.page-hero .lead {
  margin-bottom: 0;
}

.page-hero-center {
  padding-block: clamp(5rem, 14vw, 9rem);
  border-bottom: 0;
  text-align: center;
}

.page-hero-center h1,
.page-hero-center .lead {
  margin-inline: auto;
}

.page-hero-center .actions {
  justify-content: center;
  margin-top: 2.25rem;
}

/* ---------- Product feature ---------- */

.product-feature {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  background: var(--surface);
}

.product-visual {
  display: grid;
  place-items: center;
  min-height: 15rem;
  padding: 2.5rem;
  border-bottom: 1px solid var(--border);
  background-color: var(--bg-subtle);
  background-image: radial-gradient(var(--border-strong) 1px, transparent 1.5px);
  background-size: 20px 20px;
  background-position: 10px 10px;
}

.product-visual .app-mark {
  width: 6.5rem;
  height: 6.5rem;
  border-radius: 24px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 12px 32px rgb(15 22 19 / 0.14);
}

.product-body {
  padding: clamp(1.75rem, 4vw, 3rem);
}

.product-body h2,
.product-body h3 {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  letter-spacing: -0.028em;
}

.product-body > p {
  color: var(--text-muted);
}

.product-compact .product-visual {
  min-height: 11rem;
}

.product-compact .app-mark {
  width: 5rem;
  height: 5rem;
  border-radius: 19px;
}

.product-compact .product-body h3 {
  font-size: 1.375rem;
}

.product-compact .product-body > p:last-child {
  margin-bottom: 0;
}

@media (min-width: 60rem) {
  .product-feature:not(.product-compact) {
    grid-template-columns: 0.85fr 1.15fr;
  }

  .product-feature:not(.product-compact) .product-visual {
    border-bottom: 0;
    border-right: 1px solid var(--border);
  }
}

/* ---------- Definition / fact lists ---------- */

.facts {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.facts > div {
  display: grid;
  gap: 0.125rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

.facts > div:first-child {
  border-top: 0;
}

.facts dt {
  color: var(--text-faint);
  font-size: 0.875rem;
  font-weight: 500;
}

.facts dd {
  margin: 0;
  min-width: 0;
  color: var(--text);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.facts a {
  color: inherit;
}

@media (min-width: 40rem) {
  .facts > div {
    grid-template-columns: 11rem 1fr;
    gap: 1rem;
    align-items: baseline;
  }
}

.facts-plain {
  margin-top: 2rem;
  border-radius: var(--radius-sm);
}

/* ---------- Call to action panel ---------- */

.cta {
  display: grid;
  gap: 2rem;
  padding: clamp(2rem, 5vw, 3.5rem);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  background: var(--surface);
}

.cta h2 {
  font-size: clamp(1.625rem, 1.25rem + 1.6vw, 2.25rem);
  letter-spacing: -0.028em;
}

.cta p {
  max-width: 36rem;
  margin-bottom: 0;
  color: var(--text-muted);
}

@media (min-width: 60rem) {
  .cta {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 3rem;
  }
}

/* ---------- Contact ---------- */

.contact-card {
  display: flex;
  flex-direction: column;
}

.card .card-label {
  margin-bottom: 0.375rem;
  color: var(--text);
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.card .card-desc {
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-size: 1rem;
}

.card .card-foot {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.9375rem;
}

.contact-email {
  display: block;
  margin-bottom: 1.5rem;
  color: var(--text);
  font-size: clamp(1.1875rem, 1.05rem + 0.6vw, 1.4375rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.contact-email:hover {
  color: var(--accent);
  text-decoration: underline;
}

.contact-card .actions {
  margin-top: auto;
}

.contact-card-stacked .actions {
  margin-top: 0;
  margin-bottom: 1.75rem;
}

.copy-btn[data-state="copied"] {
  border-color: var(--accent);
  color: var(--accent);
}

.checklist {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  position: relative;
  padding-left: 1.75rem;
  color: var(--text-muted);
  font-size: 1rem;
}

.checklist li::before {
  content: "";
  position: absolute;
  top: 0.45em;
  left: 0.125rem;
  width: 0.7rem;
  height: 0.4rem;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

.note,
.card .note {
  margin: 1.5rem 0 0;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* ---------- FAQ ---------- */

.faq {
  border-top: 1px solid var(--border);
}

.faq details {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.375rem 0;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.25rem;
  border-right: 2px solid var(--text-faint);
  border-bottom: 2px solid var(--text-faint);
  transform: translateY(-25%) rotate(45deg);
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  transform: translateY(15%) rotate(225deg);
}

.faq summary:hover {
  color: var(--accent);
}

.faq .answer {
  max-width: 44rem;
  padding-bottom: 1.5rem;
  color: var(--text-muted);
}

.faq .answer p:last-child {
  margin-bottom: 0;
}

/* ---------- Legal documents ---------- */

.legal-layout {
  display: grid;
  gap: 2.5rem;
}

.legal-layout > * {
  min-width: 0;
}

.toc {
  font-size: 0.9375rem;
}

.toc-title {
  margin-bottom: 0.75rem;
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toc ol {
  display: grid;
  gap: 0.125rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: block;
  padding: 0.3rem 0;
  color: var(--text-muted);
  text-decoration: none;
}

.toc a:hover {
  color: var(--text);
}

@media (max-width: 59.99rem) {
  .toc {
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-subtle);
  }
}

@media (min-width: 60rem) {
  .legal-layout {
    grid-template-columns: 14rem 1fr;
    gap: 4.5rem;
  }

  .toc {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
    align-self: start;
  }
}

.doc-meta {
  margin: 1.5rem 0 0;
  color: var(--text-faint);
  font-size: 0.9375rem;
}

.prose {
  max-width: 44rem;
}

.prose h2 {
  margin: 3rem 0 0.75rem;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
}

.prose > h2:first-child {
  margin-top: 0;
}

.prose p,
.prose li {
  color: var(--text-muted);
}

.prose ul {
  margin: 0 0 1em;
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: 0.4em;
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 3.5rem 2rem;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.footer-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: repeat(2, 1fr);
}

.footer-brand {
  grid-column: 1 / -1;
}

.footer-brand p {
  max-width: 20rem;
  margin: 0.75rem 0 0;
}

.footer-col h2 {
  margin-bottom: 0.875rem;
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-col ul {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-col a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--text);
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 0.875rem;
}

.footer-bottom p {
  margin: 0;
}

@media (min-width: 48rem) {
  .footer-grid {
    grid-template-columns: 2fr repeat(3, 1fr);
  }

  .footer-brand {
    grid-column: auto;
  }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  /* No entrance animations: content must render fully even if animations never run. */
  .status-dot {
    animation: pulse 2.4s ease-in-out infinite;
  }

  @keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent); }
    50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 0%, transparent); }
  }
}

/* ---------- Print ---------- */

@media print {
  .site-header,
  .skip-link,
  .toc,
  .footer-grid {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .page-hero,
  .section {
    padding-block: 1.5rem;
  }

  .footer-bottom {
    margin: 0;
    border: 0;
  }
}
