/* ============================================================
   Dendrite - dendrite.sh
   Light corporate theme. Brand gradient: #01F4FB → #3076F6 → #555CE7
   ============================================================ */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-alt: #f7f8fb;
  --bg-tint: #eef1f9;
  --surface: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.85);
  --border: #e4e7ef;
  --border-strong: #d3d8e4;
  --frame-border: #e4e7ef;
  --dot: #d9dde7;
  --text: #0b0f1e;
  --text-dim: #4d5568;
  --text-faint: #7a8194;
  --na-text: #b4b9c6;
  --na-icon: #c6cbd6;
  --code-accent: #27408f;
  --cyan: #01b9d8;
  --blue: #3076f6;
  --indigo: #555ce7;
  --link: #2a5fd9;
  --grad: linear-gradient(90deg, #01f4fb 0%, #3076f6 55%, #555ce7 100%);
  --grad-btn: linear-gradient(135deg, #3076f6 0%, #555ce7 100%);
  --shadow-sm: 0 1px 2px rgba(11, 15, 30, 0.05);
  --shadow-md: 0 4px 16px rgba(11, 15, 30, 0.07);
  --shadow-lg: 0 16px 48px rgba(11, 15, 30, 0.12);
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b0f1c;
    --bg-alt: #101527;
    --bg-tint: #1a2138;
    --surface: #12182e;
    --header-bg: rgba(11, 15, 28, 0.85);
    --border: #232a44;
    --border-strong: #323a5c;
    --frame-border: #2c3454;
    --dot: #3a4265;
    --text: #e7eaf6;
    --text-dim: #a6adc4;
    --text-faint: #767e99;
    --na-text: #5a6280;
    --na-icon: #4a5170;
    --code-accent: #9db8ff;
    --link: #7aa5ff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.55);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 28px; }

h1, h2, h3, h4 { letter-spacing: -0.022em; line-height: 1.15; color: var(--text); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 32px; height: 68px; }
.nav .logo img { height: 32px; display: block; }
.nav-links { display: flex; gap: 28px; margin-left: auto; align-items: center; }
.nav-links > a {
  color: var(--text-dim); font-size: 14.5px; font-weight: 500;
  transition: color .15s ease;
}
.nav-links > a:hover { color: var(--text); text-decoration: none; }
.nav-links a.cta {
  background: var(--grad-btn); color: #fff;
  padding: 9px 20px; border-radius: 8px; font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: filter .15s ease, transform .15s ease;
}
.nav-links a.cta:hover { filter: brightness(1.08); text-decoration: none; transform: translateY(-1px); }
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero { padding: 88px 0 72px; text-align: center; }
.hero h1 {
  font-size: clamp(38px, 5.6vw, 60px);
  font-weight: 800;
  max-width: 820px;
  margin: 0 auto 22px;
}
.hero h1 .grad {
  background: linear-gradient(90deg, #3076f6, #555ce7);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.tagline {
  font-size: clamp(17px, 2.1vw, 20px);
  color: var(--text-dim);
  max-width: 680px;
  margin: 0 auto 36px;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px;
  border-radius: 9px;
  font-weight: 600; font-size: 15.5px;
  transition: transform .15s ease, filter .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--grad-btn); color: #fff; box-shadow: 0 4px 14px rgba(48, 118, 246, .30); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-secondary {
  border: 1px solid var(--border-strong); color: var(--text);
  background: var(--surface);
}
.btn-secondary:hover { border-color: var(--indigo); color: var(--indigo); }
.hero .version-note { font-family: var(--mono); font-size: 12.5px; color: var(--text-faint); }

/* ---------- Browser frame (product screenshots) ---------- */
.frame {
  background: var(--surface);
  border: 1px solid var(--frame-border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.frame .frame-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 16px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.frame .frame-bar .dots { display: flex; gap: 6px; }
.frame .frame-bar .dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--dot); }
.frame .frame-bar .url {
  flex: 1; text-align: center;
  font-family: var(--mono); font-size: 12px; color: var(--text-faint);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 12px;
  margin: 0 40px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.frame img { display: block; width: 100%; height: auto; }
.frame.pad img { padding: 18px 18px 0; }
.hero-shot { max-width: 940px; margin: 44px auto 0; }

/* ---------- Trust bar ---------- */
.trust {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 34px 0;
}
.trust-row {
  display: flex; flex-wrap: wrap;
  justify-content: space-between; align-items: center; gap: 22px 36px;
}
.trust-item { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--text-dim); }
.trust-item svg { color: var(--blue); flex: none; }
.trust-item small { display: block; font-weight: 500; color: var(--text-faint); }

/* ---------- Sections ---------- */
section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.kicker {
  display: inline-block;
  font-size: 13px; font-weight: 700;
  letter-spacing: .10em; text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 14px;
}
.section-head { text-align: center; max-width: 720px; margin: 0 auto 56px; }
.section-head h2 { font-size: clamp(30px, 4vw, 42px); font-weight: 800; margin-bottom: 16px; }
.section-head p { color: var(--text-dim); font-size: 17.5px; }

/* ---------- Features ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 30px 28px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border-strong); }
.feature-card .f-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(1,185,216,.10), rgba(85,92,231,.12));
  color: var(--blue);
  margin-bottom: 20px;
}
.feature-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.feature-card p { color: var(--text-dim); font-size: 14.5px; }

/* ---------- Install ---------- */
.install { text-align: center; }
.install .cmd-wrap {
  max-width: 640px; margin: 0 auto 18px;
  position: relative;
  background: #0b0f1e;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}
.install pre {
  font-family: var(--mono); font-size: 14.5px;
  color: #e8eaf6;
  padding: 22px 60px 22px 24px;
  overflow-x: auto;
  text-align: left;
}
.install pre .p { color: #6fe3ef; }
.install .copy-btn {
  position: absolute; top: 50%; right: 14px; transform: translateY(-50%);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  color: #cfd6ea;
  font-size: 12.5px; font-weight: 600;
  border-radius: 7px; padding: 7px 13px; cursor: pointer;
  transition: background .15s ease;
}
.install .copy-btn:hover { background: rgba(255,255,255,.16); }
.install .copy-btn.copied { color: #7ef0c2; }
.install .alt-install { font-size: 14px; color: var(--text-faint); }
.install .alt-install code { font-family: var(--mono); font-size: 12.5px; background: var(--bg-tint); border: 1px solid var(--border); border-radius: 5px; padding: 2px 7px; }

/* ---------- Screenshots ---------- */
.shot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.shot { display: grid; gap: 14px; }
.shot.wide { grid-column: span 2; }
.shot figure { margin: 0; }
.shot .frame { transition: box-shadow .2s ease; }
.shot .frame:hover { box-shadow: var(--shadow-md); }
.shot figcaption strong { display: block; font-size: 15.5px; font-weight: 700; margin-bottom: 2px; }
.shot figcaption span { color: var(--text-dim); font-size: 14.5px; }

/* ---------- Pricing ---------- */
.tier-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; align-items: stretch; }
.tier {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px 24px;
  display: flex; flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.tier.featured {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--grad) border-box;
  box-shadow: var(--shadow-md);
}
.tier .badge {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--grad-btn); color: #fff;
  font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  padding: 5px 15px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(48,118,246,.35);
}
.tier h3 { font-size: 19px; font-weight: 700; }
.tier .for { color: var(--text-faint); font-size: 14px; margin: 4px 0 22px; }
.tier .price { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; }
.tier .price small { font-size: 15px; font-weight: 500; color: var(--text-faint); letter-spacing: 0; }
.tier .price-note { color: var(--text-faint); font-size: 13px; margin: 4px 0 26px; min-height: 20px; }
.tier ul { list-style: none; margin-bottom: 30px; flex: 1; }
.tier ul li { padding: 6px 0 6px 28px; position: relative; color: var(--text-dim); font-size: 14.5px; }
.tier ul li svg { position: absolute; left: 0; top: 11px; color: var(--blue); }
.tier ul li.na { color: var(--na-text); }
.tier ul li.na svg { color: var(--na-icon); }
.tier .btn { justify-content: center; }
.tier .btn-secondary { background: transparent; }

/* ---------- FAQ ---------- */
.faq { max-width: 780px; margin: 0 auto; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.faq details[open] { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.faq summary {
  cursor: pointer; font-weight: 600; font-size: 15.5px;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--blue); font-weight: 700; font-size: 18px; transition: transform .15s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--text-dim); font-size: 14.5px; margin-top: 12px; }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; padding: 96px 0; }
.cta-band h2 { font-size: clamp(30px, 4vw, 44px); font-weight: 800; margin-bottom: 16px; }
.cta-band p { color: var(--text-dim); margin-bottom: 34px; font-size: 17.5px; max-width: 560px; margin-left: auto; margin-right: auto; }

/* ---------- Contact form ---------- */
.contact-form {
  max-width: 680px; margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 34px 32px;
  box-shadow: var(--shadow-md);
  display: grid; gap: 18px;
}
.contact-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.contact-form label {
  display: flex; flex-direction: column; gap: 7px;
  font-size: 13.5px; font-weight: 600; color: var(--text-dim);
}
.contact-form input,
.contact-form textarea {
  font-family: var(--sans); font-size: 15px; line-height: 1.5;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--border-strong); border-radius: 9px;
  padding: 11px 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(48, 118, 246, .18);
}
.contact-form textarea { min-height: 130px; resize: vertical; }
.contact-form .form-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.contact-form .form-note { font-size: 13px; color: var(--text-faint); }

/* ---------- Docs ---------- */
.docs-layout { display: grid; grid-template-columns: 240px 1fr; gap: 56px; align-items: start; }
.docs-nav { position: sticky; top: 96px; border-right: 1px solid var(--border); padding-right: 24px; }
.docs-nav a { display: block; padding: 6px 0; color: var(--text-dim); font-size: 14.5px; }
.docs-nav a:hover { color: var(--text); text-decoration: none; }
.docs-nav .docs-nav-label {
  font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-faint); margin: 20px 0 6px;
}
.docs-nav .docs-nav-label:first-child { margin-top: 0; }
.doc-section { margin-bottom: 56px; }
.doc-section h2 { font-size: 27px; font-weight: 800; margin-bottom: 16px; padding-top: 10px; }
.doc-section h3 { font-size: 17px; font-weight: 700; margin: 26px 0 8px; }
.doc-section p, .doc-section li { color: var(--text-dim); font-size: 15px; }
.doc-section ul, .doc-section ol { padding-left: 22px; margin: 10px 0; }
.doc-section code {
  font-family: var(--mono); font-size: 13px;
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1.5px 6px;
  color: var(--code-accent);
}
.doc-section pre {
  font-family: var(--mono); font-size: 13.5px;
  background: #0b0f1e; color: #e8eaf6;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 16px 0;
  line-height: 1.7;
  box-shadow: var(--shadow-md);
}
.doc-section pre code { background: none; border: none; padding: 0; color: inherit; }
.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  background: var(--bg-alt);
  border-radius: 0 10px 10px 0;
  padding: 14px 18px;
  margin: 18px 0;
  font-size: 14.5px;
  color: var(--text-dim);
}
.callout strong { color: var(--text); }

/* ---------- Legal ---------- */
.legal { max-width: 780px; }
.legal .page-head { margin-bottom: 8px; }
.legal h1 { font-size: 36px; font-weight: 800; margin: 10px 0 10px; }
.legal .updated { color: var(--text-faint); font-size: 13.5px; margin-bottom: 44px; font-family: var(--mono); }
.legal h2 { font-size: 20px; font-weight: 700; margin: 40px 0 14px; }
.legal p, .legal li { color: var(--text-dim); font-size: 15px; margin-bottom: 11px; }
.legal ul, .legal ol { padding-left: 22px; margin-bottom: 16px; }
.legal strong { color: var(--text); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding: 56px 0 40px; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 48px; justify-content: space-between; }
.footer-brand { max-width: 280px; }
.footer-brand img { height: 30px; margin-bottom: 14px; }
.footer-brand p { font-size: 13.5px; color: var(--text-faint); }
.footer-col h4 { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--text-faint); margin-bottom: 14px; }
.footer-col a { display: block; color: var(--text-dim); font-size: 14px; padding: 4px 0; }
.footer-col a:hover { color: var(--text); text-decoration: none; }
.footer-bottom {
  margin-top: 44px; padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
  color: var(--text-faint); font-size: 13px;
}

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 200;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 14px 18px;
}
.cookie-banner-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text-dim);
  flex: 1;
}
.cookie-banner-actions { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-btn {
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-tint);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 9px 18px;
  cursor: pointer;
  white-space: nowrap;
}
.cookie-btn:hover { border-color: var(--text-faint); }
.cookie-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (max-width: 560px) {
  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    padding: 14px 16px;
  }
  .cookie-banner-actions { justify-content: stretch; }
  .cookie-btn { flex: 1; padding: 10px 12px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .feature-grid, .tier-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-nav { position: static; border-right: none; border-bottom: 1px solid var(--border); padding: 0 0 18px; margin-bottom: 32px; }
  .docs-nav a { display: inline-block; margin-right: 18px; }
  .docs-nav .docs-nav-label { display: none; }
}
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-toggle {
    display: block; margin-left: auto;
    background: var(--surface); border: 1px solid var(--border-strong); color: var(--text);
    border-radius: 8px; padding: 8px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
    font-family: var(--sans);
  }
  .nav-links.open {
    display: flex; flex-direction: column; align-items: flex-start;
    position: absolute; top: 68px; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 22px 28px; gap: 18px;
    box-shadow: var(--shadow-lg);
  }
  .shot-grid { grid-template-columns: 1fr; }
  .shot.wide { grid-column: span 1; }
  .feature-grid, .tier-grid { grid-template-columns: 1fr; }
  .contact-form .form-row { grid-template-columns: 1fr; }
  .contact-form { padding: 26px 20px; }
  .hero { padding: 64px 0 48px; }
  section { padding: 64px 0; }
}
/* Mobile fixes (Safari iOS):
   1. Liquid-Glass address bar: use 100dvh-independent layout and safe-area
      padding so the floating Safari bar does not overlap content; nav sticky
      offset uses env(safe-area-inset-top).
   2. Screenshot image padding: frame .pad on small screens.
   3. Trust items + feature cards + banner list centre-justified on mobile. */

@supports (-webkit-touch-callout: none) {
  /* Safari iOS only */
  body {
    /* Prevent the floating Liquid-Glass bar from overlapping content edges */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  .nav {
    padding-top: env(safe-area-inset-top);
  }
}

@media (max-width: 760px) {
  /* 2. Screenshot image padding on small screens */
  .frame.pad img { padding: 12px 12px 0; }
  .frame { border-radius: 10px; }

  /* 3. Centre-justify feature cards: icon, heading, text */
  .feature-card { text-align: center; }
  .feature-card .f-icon { margin-left: auto; margin-right: auto; }

  /* 3b. Centre-justify the trust/banner list (Self-hosted / Air-gap / Audit) */
  .trust-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
  }
  .trust-item {
    flex-direction: column;
    text-align: center;
    gap: 6px;
  }
  .trust-item svg { margin: 0 auto; }

  /* Section headings already centre via text-align on .section-head; make
     the platform banner list inside cards centred too */
  .section-head { text-align: center; }
  .section-head .kicker { justify-content: center; }
}
