/* ==========================================================================
   Droot — AI enablement. Design system.
   Dark, premium, root-green accent. No dependencies.
   ========================================================================== */

/* ---- Fonts (self-hosted, variable) ---- */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../assets/fonts/spacegrotesk-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../assets/fonts/inter-var.woff2') format('woff2');
}

/* ---- Tokens ---- */
:root {
  --bg: #070b09;
  --bg-soft: #0a100d;
  --surface: #0e1712;
  --surface-2: #131f19;
  --border: rgba(167, 243, 195, 0.10);
  --border-strong: rgba(167, 243, 195, 0.22);
  --text: #eaf3ed;
  --text-muted: #9db2a6;
  --text-faint: #6d8177;
  --accent: #46e08a;
  --accent-strong: #6ff0a8;
  --accent-dim: rgba(70, 224, 138, 0.14);
  --accent-2: #c8f269;
  --gradient: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 100%);
  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --container: 1140px;
  --radius: 16px;
  --radius-sm: 10px;
  --nav-h: 72px;
  --section-pad: clamp(4.5rem, 10vw, 8rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }

::selection { background: var(--accent); color: #04170c; }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p { text-wrap: pretty; }

.container {
  width: min(var(--container), 100% - 3rem);
  margin-inline: auto;
}

.section { padding-block: var(--section-pad); position: relative; }
.section--soft { background: var(--bg-soft); border-block: 1px solid var(--border); }

/* ---- Type scale ---- */
.display {
  font-size: clamp(2.6rem, 6.2vw, 4.6rem);
  font-weight: 500;
}
.h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
.h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

.lede {
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 42em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}
.eyebrow::before {
  content: '';
  width: 22px; height: 2px;
  background: var(--gradient);
  border-radius: 2px;
}

.accent-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.muted { color: var(--text-muted); }
.small { font-size: 0.9rem; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 0.85rem 1.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out),
              background-color 0.25s, border-color 0.25s, color 0.25s;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; transition: transform 0.25s var(--ease-out); }
.btn:hover svg { transform: translateX(3px); }

.btn--primary {
  background: var(--accent);
  color: #04170c;
}
.btn--primary:hover {
  background: var(--accent-strong);
  color: #04170c;
  transform: translateY(-2px);
  box-shadow: 0 10px 34px -8px rgba(70, 224, 138, 0.45);
}

.btn--ghost {
  border-color: var(--border-strong);
  color: var(--text);
  background: transparent;
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  transform: translateY(-2px);
}

.btn--lg { padding: 1.05rem 2.1rem; font-size: 1.0625rem; }

/* ---- Nav ---- */
.nav {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: background-color 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(7, 11, 9, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.logo:hover { color: var(--text); }
.logo svg { width: 30px; height: 30px; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 2.2rem;
  list-style: none;
}
.nav__links a:not(.btn) {
  font-size: 0.975rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav__links a:not(.btn):hover { color: var(--text); }
.nav__links a[aria-current="page"] { color: var(--text); }
.nav__links a[aria-current="page"]:not(.btn) {
  position: relative;
}
.nav__links a[aria-current="page"]:not(.btn)::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -8px;
  height: 2px;
  background: var(--gradient);
  border-radius: 2px;
}
.nav__links .btn { padding: 0.6rem 1.3rem; font-size: 0.925rem; }

.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 44px; height: 44px;
  border-radius: 8px;
  color: var(--text);
  align-items: center;
  justify-content: center;
}
.nav__toggle svg { width: 26px; height: 26px; }
.nav__toggle .icon-close { display: none; }
.nav__toggle[aria-expanded="true"] .icon-open { display: none; }
.nav__toggle[aria-expanded="true"] .icon-close { display: block; }

/* ---- Hero ---- */
.hero {
  position: relative;
  padding-top: calc(var(--nav-h) + clamp(3.5rem, 9vw, 7rem));
  padding-bottom: clamp(4rem, 9vw, 7rem);
  overflow: hidden;
}
.hero__glow {
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: min(900px, 120vw);
  aspect-ratio: 1.6;
  background: radial-gradient(ellipse at center,
              rgba(70, 224, 138, 0.13) 0%,
              rgba(70, 224, 138, 0.045) 40%,
              transparent 70%);
  pointer-events: none;
}
.hero__roots {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(1400px, 160vw);
  opacity: 0.5;
  pointer-events: none;
}
.hero__content {
  position: relative;
  max-width: 850px;
}
.hero .display { margin-bottom: 1.4rem; }
.hero .lede { margin-bottom: 2.4rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; }

.hero__note {
  margin-top: 2.2rem;
  font-size: 0.9rem;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.hero__note svg { width: 15px; height: 15px; color: var(--accent); flex-shrink: 0; }

/* ---- Stats band ---- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat {
  background: var(--surface);
  padding: 2rem 1.8rem;
}
.stat__value {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3.1rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}
.stat__label { margin-top: 0.55rem; color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; }
.stat__source { margin-top: 0.5rem; font-size: 0.78rem; color: var(--text-faint); }

/* ---- Cards / grids ---- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.8rem;
  transition: transform 0.35s var(--ease-out), border-color 0.35s, background-color 0.35s;
}
a.card { color: inherit; display: block; }
.card:hover {
  transform: translateY(-5px);
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.card__num {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 1.1rem;
}
.card__icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.3rem;
}
.card__icon svg { width: 23px; height: 23px; color: var(--accent-strong); }
.card h3 { margin-bottom: 0.7rem; }
.card p { color: var(--text-muted); font-size: 0.985rem; }
.card__more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.2rem;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--accent);
}
.card__more svg { width: 15px; height: 15px; }

.card--tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  margin-bottom: 1.1rem;
}

/* ---- Section headers ---- */
.section-head { max-width: 720px; margin-bottom: clamp(2.5rem, 6vw, 4rem); }
.section-head .h2 { margin-bottom: 1rem; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow { justify-content: center; }

/* ---- Feature rows (checklist) ---- */
.checks { list-style: none; display: grid; gap: 0.9rem; }
.checks li {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  color: var(--text-muted);
}
.checks li strong { color: var(--text); font-weight: 600; }
.checks svg {
  width: 20px; height: 20px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 0.2rem;
}

/* ---- Split layout ---- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}

/* ---- Steps / timeline ---- */
.steps { display: grid; gap: 0; position: relative; counter-reset: step; }
.step {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 1.6rem;
  padding-block: 2rem;
  position: relative;
}
.step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 31px;
  top: 84px;
  bottom: -16px;
  width: 2px;
  background: linear-gradient(to bottom, var(--border-strong), var(--border));
}
.step__marker {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--accent);
  position: relative;
  z-index: 1;
}
.step__body h3 { margin-bottom: 0.35rem; }
.step__phase {
  font-size: 0.83rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.8rem;
  font-family: var(--font-display);
}
.step__body p { color: var(--text-muted); max-width: 56em; }
.step__deliverable {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  color: var(--accent-strong);
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}
.step__deliverable strong { color: var(--text); font-weight: 600; }

/* ---- CTA band ---- */
.cta-band {
  position: relative;
  border: 1px solid var(--border-strong);
  border-radius: calc(var(--radius) + 8px);
  padding: clamp(2.8rem, 6vw, 4.5rem);
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 90% at 50% 110%, rgba(70, 224, 138, 0.16), transparent),
    var(--surface);
}
.cta-band .h2 { margin-bottom: 1rem; }
.cta-band .lede { margin-inline: auto; margin-bottom: 2.2rem; }

/* ---- Forms ---- */
.form { display: grid; gap: 1.3rem; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; }
.field { display: grid; gap: 0.45rem; }
.field label {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
}
.field label .opt { color: var(--text-faint); font-weight: 400; }
.field input,
.field select,
.field textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field select { appearance: none; -webkit-appearance: none; }
.field--select { position: relative; }
.field--select::after {
  content: '';
  position: absolute;
  right: 1.1rem;
  bottom: 1.35rem;
  width: 9px; height: 9px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  pointer-events: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(70, 224, 138, 0.18);
}
.field textarea { resize: vertical; min-height: 120px; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }

.form__status {
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  font-size: 0.95rem;
  display: none;
}
.form__status.success {
  display: block;
  background: var(--accent-dim);
  border: 1px solid rgba(70, 224, 138, 0.4);
  color: var(--accent-strong);
}
.form__status.error {
  display: block;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}
.form__status a { text-decoration: underline; }

/* Honeypot */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ---- FAQ ---- */
.faq { display: grid; gap: 0.9rem; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.25s;
}
.faq details[open] { border-color: var(--border-strong); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1.15rem 1.4rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.02rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--accent);
  transition: transform 0.25s var(--ease-out);
  flex-shrink: 0;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p {
  padding: 0 1.4rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.97rem;
}

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--border);
  padding: 3.5rem 0 2.5rem;
  background: var(--bg-soft);
}
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.8rem;
}
.footer__tagline { color: var(--text-muted); margin-top: 1rem; max-width: 30em; font-size: 0.95rem; }
.footer h4 {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1.1rem;
  font-weight: 500;
}
.footer ul { list-style: none; display: grid; gap: 0.7rem; }
.footer ul a { color: var(--text-muted); font-size: 0.95rem; }
.footer ul a:hover { color: var(--text); }
.footer__bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.8rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-faint);
  font-size: 0.85rem;
}
.footer__bottom a { color: var(--text-faint); }
.footer__bottom a:hover { color: var(--text-muted); }

/* ---- Reveal on scroll ---- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }

/* ---- Page hero (inner pages) ---- */
.page-hero {
  padding-top: calc(var(--nav-h) + clamp(3rem, 7vw, 5.5rem));
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
  position: relative;
  overflow: hidden;
}
.page-hero .display { font-size: clamp(2.3rem, 5vw, 3.8rem); margin-bottom: 1.2rem; }
.page-hero .lede { max-width: 46em; }

/* ---- Utility ---- */
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.center { text-align: center; }

/* ---- Root growth animation (hero SVG) ---- */
.root-path {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: rootgrow 3.2s var(--ease-out) 0.3s forwards;
}
.root-path--d1 { animation-delay: 0.7s; }
.root-path--d2 { animation-delay: 1.1s; }
@keyframes rootgrow { to { stroke-dashoffset: 0; } }

/* ---- 404 ---- */
.error-hero {
  min-height: 72vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
}

/* ---- Prose (privacy etc.) ---- */
.prose { max-width: 720px; }
.prose h2 { font-size: 1.4rem; margin: 2.4rem 0 0.8rem; }
.prose p, .prose li { color: var(--text-muted); margin-bottom: 0.9rem; }
.prose ul { padding-left: 1.3rem; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(7, 11, 9, 0.97);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0.8rem 1.5rem 1.6rem;
    display: none;
  }
  .nav__links.open { display: flex; }
  .nav__links li { border-bottom: 1px solid var(--border); }
  .nav__links li:last-child { border-bottom: none; padding-top: 1.2rem; }
  .nav__links a:not(.btn) { display: block; padding: 1rem 0.2rem; font-size: 1.05rem; }
  .nav__links a[aria-current="page"]:not(.btn)::after { display: none; }
  .nav__links .btn { width: 100%; }

  .stats { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form__row { grid-template-columns: 1fr; }
  .step { grid-template-columns: 48px 1fr; gap: 1.1rem; }
  .step__marker { width: 48px; height: 48px; font-size: 1rem; }
  .step:not(:last-child)::before { left: 23px; top: 68px; }
  .footer__grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero__actions .btn { width: 100%; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .root-path { stroke-dashoffset: 0; animation: none; }
}
