/* TreeTrace marketing site - design system.
   Color tokens are reconciled with brand/BRAND.md once the brand pass lands. */

:root {
  /* Surfaces - TreeTrace brand neutrals (green-cast) */
  --bg:        #0B1210;  /* Bark */
  --bg-1:      #0E1613;
  --bg-2:      #121A17;  /* Loam */
  --bg-3:      #18221E;
  --border:    #243430;  /* Understory */
  --border-strong: #314540;

  /* Text */
  --text:      #EDF7F2;  /* Sapwood */
  --text-2:    #C2D2CB;
  --muted:     #8FA8A0;  /* Lichen */
  --faint:     #5C6F68;

  /* Brand greens - lineage */
  --primary:   #5BF0B8;  /* Canopy */
  --primary-2: #0CA08A;  /* Rootstock */
  --teal:      #5BF0B8;  /* Canopy (accent text) */
  --deep:      #0CA08A;
  --grad:      linear-gradient(140deg, #5BF0B8 0%, #1CC39A 52%, #0CA08A 100%);
  --grad-text: linear-gradient(120deg, #7DF4C8 0%, #5BF0B8 46%, #19BD9C 100%);
  --glow:      rgba(91, 240, 184, 0.32);
  --glow-soft: rgba(91, 240, 184, 0.11);

  /* Type */
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;

  /* Geometry */
  --maxw: 1120px;
  --radius: 14px;
  --radius-lg: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Ambient background glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 520px at 50% -8%, rgba(52,229,164,0.10), transparent 70%),
    radial-gradient(700px 600px at 88% 12%, rgba(20,168,176,0.06), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
::selection { background: rgba(52,229,164,0.28); color: #fff; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
.eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary);
}
.section { padding: 96px 0; position: relative; z-index: 1; }
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head h2 {
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.12;
  font-weight: 580;
  letter-spacing: -0.02em;
}
.section-head p { margin-top: 16px; color: var(--text-2); font-size: 18px; }
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(140%) blur(14px);
  background: rgba(8,11,10,0.72);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.nav.scrolled { border-bottom-color: var(--border); background: rgba(8,11,10,0.86); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 560; font-size: 17px; letter-spacing: 0.01em; }
.brand .logo { width: 26px; height: 26px; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { color: var(--text-2); font-size: 14.5px; transition: color .18s; }
.nav-links a:hover { color: var(--text); }
.nav-cta { display: flex; align-items: center; gap: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 14.5px; font-weight: 560; line-height: 1;
  padding: 11px 18px; border-radius: 10px;
  border: 1px solid var(--border-strong);
  color: var(--text); background: var(--bg-2);
  transition: transform .12s ease, border-color .18s, background .18s, box-shadow .2s;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--primary-2); transform: translateY(-1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--grad); color: #042018; border: none; font-weight: 650;
  box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 8px 28px -8px var(--glow);
}
.btn-primary:hover { box-shadow: 0 1px 0 rgba(255,255,255,0.3) inset, 0 12px 34px -8px var(--glow); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 8px 13px; font-size: 13.5px; }

/* ---------- Hero ---------- */
.hero { padding: 84px 0 72px; text-align: center; }
.hero .badge-row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .03em;
  color: var(--text-2); background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 100px; padding: 6px 13px;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 10px var(--glow); }
.hero h1 {
  font-family: var(--display);
  font-size: clamp(34px, 6.2vw, 64px);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.02em;
  max-width: 17ch;
  margin: 0 auto;
}
.hero .sub {
  margin: 26px auto 0;
  max-width: 60ch;
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-2);
  line-height: 1.55;
}
.hero .cta-row { display: flex; justify-content: center; gap: 14px; margin-top: 36px; flex-wrap: wrap; }

/* install command */
.install {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--mono); font-size: 15px;
  background: var(--bg-1); border: 1px solid var(--border-strong);
  border-radius: 12px; padding: 13px 16px; margin-top: 30px;
}
.install .prompt { color: var(--primary); }
.install .cmd { color: var(--text); }
.install button {
  background: var(--bg-3); border: 1px solid var(--border); color: var(--muted);
  border-radius: 7px; padding: 6px 8px; cursor: pointer; transition: color .15s, border-color .15s;
  display: inline-flex;
}
.install button:hover { color: var(--text); border-color: var(--border-strong); }
.install button svg { width: 15px; height: 15px; }

/* ---------- Terminal mockup ---------- */
.terminal-shell {
  margin: 60px auto 0; max-width: 860px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, var(--bg-1), #070A09);
  box-shadow: 0 40px 120px -40px rgba(0,0,0,0.8), 0 0 0 1px rgba(52,229,164,0.04),
              0 0 80px -30px var(--glow-soft);
  overflow: hidden; text-align: left;
}
.terminal-bar { display: flex; align-items: center; gap: 8px; padding: 13px 16px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.012); }
.terminal-bar .dots { display: flex; gap: 7px; }
.terminal-bar .dots i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.terminal-bar .dots i:nth-child(1) { background: #ff5f57; }
.terminal-bar .dots i:nth-child(2) { background: #febc2e; }
.terminal-bar .dots i:nth-child(3) { background: #28c840; }
.terminal-bar .title { font-family: var(--mono); font-size: 12.5px; color: var(--faint); margin-left: 8px; }
.terminal-body { padding: 22px 24px 26px; font-family: var(--mono); font-size: 13.5px; line-height: 1.7; overflow-x: auto; }
.terminal-body .line { white-space: pre; }
.t-prompt { color: var(--primary); }
.t-dim { color: var(--muted); }
.t-tree { color: var(--text-2); }
.t-node { color: var(--text); }
.t-ok { color: var(--primary); }
.t-warn { color: #FFC857; }
.t-risk { color: #FF7A7A; }
.t-tag { color: var(--teal); }
.cursor { display: inline-block; width: 8px; height: 16px; background: var(--primary); vertical-align: text-bottom; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Trust strip ---------- */
.trust { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 26px 0; }
.trust-inner { display: flex; align-items: center; justify-content: center; gap: 14px 30px; flex-wrap: wrap; }
.trust-item { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 14px; }
.trust-item svg { width: 17px; height: 17px; color: var(--primary-2); }
.trust-sep { width: 1px; height: 16px; background: var(--border-strong); }

/* ---------- Generic grid ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: linear-gradient(180deg, var(--bg-1), var(--bg));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; transition: border-color .2s, transform .2s, background .2s;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.card .ico {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center; margin-bottom: 16px;
  background: var(--glow-soft); border: 1px solid rgba(52,229,164,0.2); color: var(--primary);
}
.card .ico svg { width: 20px; height: 20px; }
.card h3 { font-size: 17.5px; font-weight: 620; letter-spacing: -0.02em; margin-bottom: 8px; }
.card p { color: var(--text-2); font-size: 14.5px; line-height: 1.6; }
.card code { font-family: var(--mono); font-size: 12.5px; color: var(--teal); background: var(--bg-3); padding: 1px 6px; border-radius: 5px; }

/* ---------- Problem split ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: stretch; }
.compare {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 28px;
  background: var(--bg-1);
}
.compare.git { opacity: 0.92; }
.compare.tt { border-color: rgba(52,229,164,0.28); background: linear-gradient(180deg, rgba(52,229,164,0.05), var(--bg-1)); }
.compare h4 { font-family: var(--mono); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.compare.tt h4 { color: var(--primary); }
.compare .big { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; margin-bottom: 14px; }
.compare ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.compare li { display: flex; gap: 11px; color: var(--text-2); font-size: 14.5px; align-items: flex-start; }
.compare li svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 2px; }
.compare.git li svg { color: var(--faint); }
.compare.tt li svg { color: var(--primary); }

/* ---------- Security spike ---------- */
.security {
  border: 1px solid rgba(52,229,164,0.22);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(700px 300px at 80% 0%, rgba(52,229,164,0.07), transparent 70%),
    linear-gradient(180deg, var(--bg-1), var(--bg));
  padding: 48px;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 44px; align-items: center;
}
.security .eyebrow { color: var(--teal); }
.security h2 { font-family: var(--display); font-size: clamp(26px, 3.4vw, 36px); font-weight: 580; letter-spacing: -0.02em; line-height: 1.15; margin: 14px 0 16px; }
.security p { color: var(--text-2); font-size: 16.5px; }
.sec-list { display: flex; flex-direction: column; gap: 11px; }
.sec-item {
  display: flex; align-items: center; gap: 13px;
  font-family: var(--mono); font-size: 13.5px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 13px 15px; color: var(--text-2);
}
.sec-item .flag { color: #FF7A7A; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; margin-left: auto; padding: 3px 8px; border-radius: 6px; background: rgba(255,122,122,0.1); border: 1px solid rgba(255,122,122,0.2); }
.sec-item .dot-r { width: 7px; height: 7px; border-radius: 50%; background: #FF7A7A; box-shadow: 0 0 9px rgba(255,122,122,0.6); flex-shrink: 0; }

/* ---------- Steps ---------- */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { position: relative; padding: 28px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-1); }
.step::before {
  counter-increment: step; content: "0" counter(step);
  font-family: var(--mono); font-size: 13px; color: var(--primary);
  border: 1px solid rgba(52,229,164,0.3); border-radius: 8px; padding: 4px 9px;
  display: inline-block; margin-bottom: 16px; background: var(--glow-soft);
}
.step h3 { font-size: 18px; font-weight: 620; margin-bottom: 8px; letter-spacing: -0.02em; }
.step p { color: var(--text-2); font-size: 14.5px; }

/* ---------- Artifacts ---------- */
.artifact-name { font-family: var(--mono); font-size: 13px; color: var(--teal); margin-bottom: 10px; }
.code-block {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.65;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px; overflow-x: auto; color: var(--text-2); white-space: pre;
}
.code-block .k { color: var(--teal); }
.code-block .s { color: #9DE7C2; }
.code-block .c { color: var(--faint); }

/* ---------- The loop ---------- */
.loop { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; justify-content: center; }
.loop-node {
  flex: 1; min-width: 150px; text-align: center; padding: 26px 18px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-1);
}
.loop-node .n { font-family: var(--mono); font-size: 12px; color: var(--primary); margin-bottom: 8px; }
.loop-node h4 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.loop-node p { color: var(--muted); font-size: 13px; }
.loop-arrow { display: grid; place-items: center; color: var(--primary-2); width: 40px; flex-shrink: 0; }
.loop-arrow svg { width: 22px; height: 22px; }

/* ---------- Schema / CTA ---------- */
.cta {
  text-align: center; border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  padding: 64px 32px;
  background:
    radial-gradient(600px 280px at 50% 0%, rgba(52,229,164,0.10), transparent 70%),
    linear-gradient(180deg, var(--bg-1), var(--bg));
}
.cta h2 { font-family: var(--display); font-size: clamp(28px, 4vw, 44px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; }
.cta p { color: var(--text-2); font-size: 18px; margin: 16px auto 0; max-width: 52ch; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 56px 0 40px; margin-top: 40px; }
.footer-grid { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer .brand { margin-bottom: 14px; }
.footer .tag { color: var(--muted); font-size: 14px; max-width: 34ch; }
.footer-cols { display: flex; gap: 64px; flex-wrap: wrap; }
.footer-col h5 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin-bottom: 14px; font-weight: 600; }
.footer-col a { display: block; color: var(--text-2); font-size: 14px; margin-bottom: 9px; transition: color .15s; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--border); flex-wrap: wrap; gap: 12px; }
.footer-bottom p { color: var(--faint); font-size: 13px; }

/* ---------- Reveal-on-scroll (degrades to visible without JS) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-3, .steps { grid-template-columns: 1fr; }
  .split, .security { grid-template-columns: 1fr; }
  .security { padding: 32px; }
  .nav-links { display: none; }
  .loop { flex-direction: column; align-items: stretch; }
  .loop-node { width: 100%; }
  .loop-arrow { transform: rotate(90deg); width: 100%; height: 34px; }
  .section { padding: 72px 0; }
}
@media (max-width: 560px) {
  .grid-2 { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 48px; }
  .footer-cols { gap: 36px; }
}
