/* ============================================================
   Data Druid Tech Services — "Intelligence" theme
   Built on Ákotí tokens: Fraunces/Outfit, mud-brick radius,
   brand bronze. Dark canvas + emerald data accent.
   ============================================================ */

:root {
  /* Canvas */
  --ink-900: #070a12;
  --ink-800: #0b1020;
  --ink-700: #111829;
  --ink-600: #18202f;
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.28);

  /* Text */
  --fg: #e8edf6;
  --fg-muted: #9aa7bd;
  --fg-dim: #64748b;

  /* Accents */
  --emerald: #10b981;
  --emerald-bright: #34d399;
  --emerald-deep: #047857;
  --bronze: #cd7f32;      /* Ákotí brand */
  --sky: #38bdf8;         /* geospatial */
  --violet: #8b5cf6;      /* AI */

  /* Radius — Ákotí mud-brick */
  --r-brick: 24px 8px 24px 8px;
  --r-brick-alt: 8px 24px 8px 24px;
  --r-soft: 16px;

  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font-body: "Outfit", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--ink-900);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient data-grid + glow backdrop */
.canvas-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 600px at 78% -10%, rgba(16, 185, 129, 0.10), transparent 60%),
    radial-gradient(700px 500px at 12% 8%, rgba(56, 189, 248, 0.07), transparent 60%),
    var(--ink-900);
}
.canvas-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(circle at 50% 0%, black, transparent 78%);
  mask-image: radial-gradient(circle at 50% 0%, black, transparent 78%);
  opacity: 0.5;
}

/* Layout */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
section { position: relative; padding: clamp(64px, 9vw, 128px) 0; }
.section-tight { padding: clamp(40px, 6vw, 80px) 0; }

/* Typography */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(2.5rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); }
p { margin: 0 0 1rem; }
a { color: inherit; text-decoration: none; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--emerald-bright);
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--emerald); }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--fg-muted); max-width: 60ch; }
.muted { color: var(--fg-muted); }
.text-grad {
  background: linear-gradient(120deg, var(--emerald-bright), var(--sky));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.95rem;
  padding: 13px 24px; border-radius: var(--r-brick); cursor: pointer;
  border: 1px solid transparent; transition: all 0.3s var(--ease);
  white-space: nowrap;
}
.btn:hover { border-radius: var(--r-brick-alt); }
.btn-primary { background: var(--emerald); color: #04140e; box-shadow: 0 8px 30px rgba(16, 185, 129, 0.28); }
.btn-primary:hover { background: var(--emerald-bright); transform: translateY(-2px); box-shadow: 0 14px 40px rgba(16, 185, 129, 0.4); }
.btn-ghost { background: rgba(255, 255, 255, 0.04); color: var(--fg); border-color: var(--line-strong); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); transform: translateY(-2px); }

/* Cards / surfaces */
.panel {
  background: linear-gradient(180deg, var(--ink-700), var(--ink-800));
  border: 1px solid var(--line);
  border-radius: var(--r-brick);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: all 0.4s var(--ease);
}
.panel:hover { border-color: var(--line-strong); border-radius: var(--r-brick-alt); transform: translateY(-4px); }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(16, 185, 129, 0.1); color: var(--emerald-bright);
  border: 1px solid rgba(16, 185, 129, 0.22);
}

/* Grid helpers */
.grid { display: grid; gap: 22px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .g-3, .g-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .g-2, .g-3, .g-4 { grid-template-columns: 1fr; } }

/* Navbar */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(7, 10, 18, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 600; font-size: 1.18rem; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px 4px 10px 4px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--emerald), var(--emerald-deep));
  color: #04140e; font-weight: 700; box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { font-size: 0.92rem; color: var(--fg-muted); transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--fg); }
.nav-toggle { display: none; background: none; border: 0; color: var(--fg); cursor: pointer; }
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 70px; left: 0; right: 0;
    background: var(--ink-800); padding: 20px 24px; gap: 18px; border-bottom: 1px solid var(--line);
  }
}

/* Hero */
.hero { padding-top: clamp(48px, 7vw, 90px); }
.hero h1 { max-width: 16ch; }
.hero .lead { margin-top: 22px; }
.hero-cta { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; margin-top: 56px; flex-wrap: wrap; }
.hero-stat .num { font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.6rem); color: var(--fg); }
.hero-stat .lbl { font-size: 0.82rem; color: var(--fg-dim); letter-spacing: 0.04em; }

/* Live demo console */
.console {
  border-radius: var(--r-soft); border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #0c1322, #080d18);
  overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.console-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.console-dot { width: 11px; height: 11px; border-radius: 50%; }
.console-title { margin-left: 10px; font-size: 0.78rem; color: var(--fg-dim); font-family: var(--font-body); }
.console-body { padding: 22px; font-family: "SFMono-Regular", ui-monospace, monospace; font-size: 0.82rem; }

/* Metric counters */
.metric .val { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3.2rem); color: var(--emerald-bright); line-height: 1; }
.metric .lbl { color: var(--fg-muted); margin-top: 8px; font-size: 0.92rem; }
.metric .note { color: var(--fg-dim); font-size: 0.78rem; margin-top: 4px; }

/* Icon chip */
.ichip {
  width: 48px; height: 48px; border-radius: 14px 5px 14px 5px;
  display: grid; place-items: center; flex-shrink: 0;
  background: rgba(16, 185, 129, 0.12); color: var(--emerald-bright);
  border: 1px solid rgba(16, 185, 129, 0.22);
}
.ichip.sky { background: rgba(56,189,248,0.12); color: var(--sky); border-color: rgba(56,189,248,0.22); }
.ichip.violet { background: rgba(139,92,246,0.12); color: var(--violet); border-color: rgba(139,92,246,0.22); }
.ichip.bronze { background: rgba(205,127,50,0.12); color: var(--bronze); border-color: rgba(205,127,50,0.22); }

/* Section heading block */
.shead { max-width: 60ch; margin-bottom: 48px; }
.shead.center { margin-left: auto; margin-right: auto; text-align: center; }

/* Sage widget */
.sage-wrap { position: fixed; right: 22px; bottom: 22px; z-index: 60; }
.sage-fab {
  width: 60px; height: 60px; border-radius: 20px 7px 20px 7px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--emerald), var(--emerald-deep)); color: #04140e;
  display: grid; place-items: center; box-shadow: 0 12px 36px rgba(16, 185, 129, 0.45);
  transition: transform 0.3s var(--ease);
}
.sage-fab:hover { transform: scale(1.07) rotate(-4deg); }
.sage-panel {
  position: absolute; right: 0; bottom: 76px; width: min(380px, 88vw);
  background: var(--ink-700); border: 1px solid var(--line-strong); border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6); display: none; flex-direction: column; overflow: hidden;
}
.sage-panel.open { display: flex; }
.sage-head { padding: 16px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(120deg, rgba(16,185,129,0.12), transparent); }
.sage-log { padding: 16px 18px; max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.sage-msg { font-size: 0.9rem; padding: 10px 13px; border-radius: 14px; max-width: 86%; }
.sage-msg.user { align-self: flex-end; background: var(--emerald); color: #04140e; border-radius: 14px 14px 4px 14px; }
.sage-msg.bot { align-self: flex-start; background: var(--ink-600); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; }
.sage-msg.bot strong { color: var(--emerald-bright); }
.sage-form { display: flex; gap: 8px; padding: 14px; border-top: 1px solid var(--line); }
.sage-form input { flex: 1; background: var(--ink-800); border: 1px solid var(--line); color: var(--fg); padding: 11px 14px; border-radius: 12px; font-family: var(--font-body); }
.sage-form input:focus { outline: none; border-color: var(--emerald); }
.sage-form button { background: var(--emerald); border: 0; color: #04140e; padding: 0 16px; border-radius: 12px; cursor: pointer; font-weight: 600; }
.sage-suggest { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 18px 14px; }
.sage-suggest button { font-size: 0.76rem; padding: 6px 11px; border-radius: 999px; background: rgba(16,185,129,0.1); color: var(--emerald-bright); border: 1px solid rgba(16,185,129,0.22); cursor: pointer; }

/* Forms (Engage) */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.field label { font-size: 0.85rem; color: var(--fg-muted); font-weight: 500; }
.field input, .field select, .field textarea {
  background: var(--ink-800); border: 1px solid var(--line); color: var(--fg);
  padding: 13px 15px; border-radius: 12px; font-family: var(--font-body); font-size: 0.95rem;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(16,185,129,0.15); }

/* Alerts */
.alert { padding: 14px 18px; border-radius: 12px; margin-bottom: 18px; font-size: 0.92rem; }
.alert-success { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.3); color: var(--emerald-bright); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 64px 0 32px; background: var(--ink-800); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer h5 { font-family: var(--font-body); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-dim); margin: 0 0 16px; }
.footer a { display: block; color: var(--fg-muted); font-size: 0.92rem; margin-bottom: 10px; transition: color 0.2s; }
.footer a:hover { color: var(--emerald-bright); }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 0.82rem; color: var(--fg-dim); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* Marquee for clients */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent); mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent); }
.marquee-track { display: flex; gap: 56px; width: max-content; animation: scroll-x 30s linear infinite; align-items: center; }
@keyframes scroll-x { to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .marquee-track { animation: none; }
  html { scroll-behavior: auto; }
}
