/* =========================================================
   DhammX Technologies — site styles
   Dark-first; light theme via [data-theme="light"]
   ========================================================= */

:root {
  --bg: #060913;
  --bg-2: #0a0f1d;
  --surface: rgba(255, 255, 255, .035);
  --surface-solid: #0e1424;
  --surface-hi: rgba(255, 255, 255, .06);
  --border: rgba(255, 255, 255, .09);
  --border-hi: rgba(255, 255, 255, .16);
  --text: #eef1fb;
  --text-2: #aab3c9;
  --muted: #7a849c;
  --violet: #8b6cff;
  --cyan: #22d3ee;
  --pink: #f472b6;
  --green: #34d399;
  --brand: var(--violet);
  --grad: linear-gradient(110deg, #8b6cff 0%, #5b8cff 45%, #22d3ee 100%);
  --grad-soft: linear-gradient(110deg, rgba(139,108,255,.18), rgba(34,211,238,.14));
  --glow: 0 0 0 1px rgba(139,108,255,.25), 0 12px 40px rgba(91,140,255,.18);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, .5);
  --radius: 16px;
  --maxw: 1200px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", var(--font);
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --header-h: 70px;
  --canvas-node: 139, 108, 255;
  --canvas-link: 91, 140, 255;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f7f8fc;
  --bg-2: #eef1f8;
  --surface: rgba(255, 255, 255, .75);
  --surface-solid: #ffffff;
  --surface-hi: #ffffff;
  --border: rgba(14, 20, 40, .1);
  --border-hi: rgba(14, 20, 40, .2);
  --text: #0c1224;
  --text-2: #465068;
  --muted: #6b748a;
  --violet: #6a4cff;
  --cyan: #0891b2;
  --brand: var(--violet);
  --grad: linear-gradient(110deg, #6a4cff 0%, #3b6cff 45%, #0891b2 100%);
  --glow: 0 0 0 1px rgba(106,76,255,.2), 0 12px 40px rgba(59,108,255,.14);
  --shadow-lg: 0 30px 70px rgba(14, 20, 40, .14);
  --canvas-node: 106, 76, 255;
  --canvas-link: 59, 108, 255;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 400 16px/1.65 var(--font); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.1; margin: 0 0 .5em; letter-spacing: -.02em; font-weight: 600; }
h1 { font-size: clamp(2.6rem, 6.2vw, 4.9rem); font-weight: 700; letter-spacing: -.04em; }
h2 { font-size: clamp(2rem, 4vw, 3.1rem); letter-spacing: -.03em; }
h3 { font-size: 1.22rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; color: var(--text-2); }
.muted { color: var(--muted); }
::selection { background: rgba(139,108,255,.35); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 860px; }
@media (max-width: 600px) { .container { padding: 0 16px; } }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 200; }
.skip-link:focus { left: 8px; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mono { font-family: var(--mono); }

/* page background ambience */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(50% 40% at 15% 0%, rgba(139,108,255,.14), transparent 70%),
    radial-gradient(40% 35% at 90% 10%, rgba(34,211,238,.10), transparent 70%);
}

/* scroll progress */
.progress { position: fixed; top: 0; left: 0; height: 2px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: var(--grad); z-index: 120; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  font: 600 .96rem/1 var(--font); padding: 15px 24px; border-radius: 12px; border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; isolation: isolate;
  transition: transform .2s ease, box-shadow .25s ease, border-color .2s ease, background .2s ease;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.btn:hover svg { transform: translateX(3px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 30px rgba(91,140,255,.35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(91,140,255,.5); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-hi); backdrop-filter: blur(8px); }
.btn-ghost:hover { border-color: var(--text-2); }
.btn-sm { padding: 11px 16px; font-size: .9rem; border-radius: 10px; }
.btn-block { width: 100%; }

.icon-btn {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--border); }
.nav { height: 100%; display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 1.3rem/1 var(--display); letter-spacing: -.03em; }
.brand-mark { width: 34px; height: 34px; }
.brand b { font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a:not(.btn) { font-weight: 500; font-size: .94rem; color: var(--text-2); padding: 8px 14px; border-radius: 9px; transition: color .15s, background .15s; }
.nav-links a:not(.btn):hover { color: var(--text); background: var(--surface-hi); }
.nav-links a[aria-current="page"] { color: var(--text); background: var(--surface-hi); }
.nav-links .btn { margin-left: 10px; }
.nav-actions { display: flex; gap: 8px; }
.menu-btn { display: none; }
.i-sun { display: none; }
:root[data-theme="light"] .i-sun { display: block; }
:root[data-theme="light"] .i-moon { display: none; }

@media (max-width: 960px) {
  .menu-btn { display: grid; }
  .nav-actions { margin-left: auto; }
  .nav-links {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 2px;
    padding: 14px 16px 20px; background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg);
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav-links.open { transform: none; opacity: 1; visibility: visible; }
  .nav-links a:not(.btn) { padding: 13px 10px; font-size: 1.05rem; }
  .nav-links .btn { margin: 10px 0 0; }
}

/* ---------- Common bits ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; font-size: .84rem; font-weight: 500; color: var(--text-2);
  padding: 7px 14px 7px 8px; border: 1px solid var(--border-hi); border-radius: 999px; background: var(--surface); backdrop-filter: blur(8px);
}
.eyebrow .pill { font: 600 .72rem/1 var(--font); padding: 5px 8px; border-radius: 999px; background: var(--grad); color: #fff; letter-spacing: .02em; }
.kicker { display: inline-flex; align-items: center; gap: 8px; font: 600 .78rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--cyan) !important; margin-bottom: 18px; }
.kicker::before { content: ""; width: 18px; height: 1px; background: currentColor; }

.section { position: relative; padding: clamp(80px, 11vw, 136px) 0; overflow-x: clip; }
.section-alt { background: linear-gradient(180deg, transparent, var(--bg-2) 12%, var(--bg-2) 88%, transparent); }
.section-head { text-align: center; max-width: 740px; margin: 0 auto 60px; }
.section-head .kicker { justify-content: center; }
.section-head.left { text-align: left; margin: 0 0 48px; }
.section-head p { font-size: 1.1rem; }

/* glass card with cursor spotlight */
.glass {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); overflow: hidden;
}
.spot::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(139,108,255,.16), transparent 45%);
}
.spot::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), rgba(34,211,238,.7), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.spot:hover::before, .spot:hover::after { opacity: 1; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 18px 0 0; }
.tags li { font: 500 .74rem/1 var(--mono); padding: 6px 9px; border-radius: 7px; background: var(--surface-hi); border: 1px solid var(--border); color: var(--text-2); }

.checks { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 28px; font-size: .95rem; color: var(--text); }
.checks li::before { content: ""; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 6px; background: rgba(34,211,238,.14); }
.checks li::after { content: ""; position: absolute; left: 6.5px; top: 6.5px; width: 5px; height: 9px; border: solid var(--cyan); border-width: 0 2px 2px 0; transform: rotate(45deg); }

.icon {
  width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 22px;
  background: var(--grad-soft); border: 1px solid var(--border-hi); color: var(--cyan);
}
.icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: calc(100vh - var(--header-h)); min-height: calc(100svh - var(--header-h)); display: flex; align-items: center; padding: 64px 0 96px; overflow: hidden; }
#neural { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 180px; background: linear-gradient(transparent, var(--bg)); z-index: -1; pointer-events: none; }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.hero h1 { margin: 26px 0 22px; }
.rotator { display: inline-grid; vertical-align: bottom; }
.rotator span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .08em; grid-area: 1 / 1; opacity: 0; transform: translateY(40%); filter: blur(6px); transition: opacity .6s, transform .6s cubic-bezier(.2,.8,.2,1), filter .6s; white-space: nowrap; }
.rotator span.on { opacity: 1; transform: none; filter: none; }
.rotator span.out { opacity: 0; transform: translateY(-40%); filter: blur(6px); }
.hero .lead { font-size: clamp(1.05rem, 1.5vw, 1.2rem); max-width: 34em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
.hero-chips span { font: 500 .78rem/1 var(--mono); padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); }
@media (max-width: 1000px) {
  .hero { min-height: 0; }
  .hero-inner { grid-template-columns: 1fr; }
}

/* agent console */
.console { background: rgba(8, 12, 24, .82); border: 1px solid rgba(255,255,255,.1); border-radius: 18px; box-shadow: var(--shadow-lg), var(--glow); overflow: hidden; color: #dfe5f5; backdrop-filter: blur(14px); }
:root[data-theme="light"] .console { background: rgba(12, 17, 32, .94); }
.console-bar { display: flex; align-items: center; gap: 7px; padding: 13px 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
.console-bar i { width: 11px; height: 11px; border-radius: 50%; background: #2a3350; }
.console-bar i:nth-child(1) { background: #ff5f57; } .console-bar i:nth-child(2) { background: #febc2e; } .console-bar i:nth-child(3) { background: #28c840; }
.console-bar span { margin-left: 10px; font: 500 .78rem/1 var(--mono); color: #7d879f; }
.console-bar .live { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--green); font: 600 .7rem/1 var(--mono); letter-spacing: .1em; }
.console-bar .live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.6); } 100% { box-shadow: 0 0 0 10px rgba(52,211,153,0); } }
.console-body { padding: 18px 20px 22px; font: 400 .82rem/1.75 var(--mono); min-height: 340px; }
.console-body .ln { opacity: 0; transform: translateY(4px); animation: lnIn .35s forwards; white-space: pre-wrap; }
@keyframes lnIn { to { opacity: 1; transform: none; } }
.console .k { color: #8b96ff; } .console .t { color: #22d3ee; } .console .ok { color: #34d399; } .console .m { color: #6b7591; } .console .w { color: #fbbf24; } .console .p { color: #f472b6; }
.console .bar { display: inline-block; height: 6px; width: 120px; border-radius: 3px; background: rgba(255,255,255,.08); vertical-align: middle; overflow: hidden; margin-left: 6px; }
.console .bar i { display: block; height: 100%; width: 0; background: var(--grad); animation: fill 1.1s ease forwards; }
@keyframes fill { to { width: 100%; } }
.caret { display: inline-block; width: 7px; height: 1.1em; vertical-align: -3px; background: #8b96ff; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Trust / values strip ---------- */
.strip { border-block: 1px solid var(--border); background: var(--surface); }
.strip-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.strip-item { padding: 26px 24px; }
.strip-item + .strip-item { border-left: 1px solid var(--border); }
.strip-item strong { display: block; font: 600 1.02rem/1.3 var(--display); margin-bottom: 4px; }
.strip-item span { font-size: .9rem; color: var(--text-2); }
@media (max-width: 900px) { .strip-grid { grid-template-columns: 1fr 1fr; } .strip-item:nth-child(3) { border-left: 0; } .strip-item:nth-child(n+3) { border-top: 1px solid var(--border); } }
@media (max-width: 520px) { .strip-grid { grid-template-columns: 1fr; } .strip-item + .strip-item { border-left: 0; border-top: 1px solid var(--border); } .strip-item { padding: 20px 4px; } }

/* ---------- AI Lab (tabs + visuals) ---------- */
.lab { display: grid; grid-template-columns: 360px 1fr; gap: 24px; align-items: stretch; }
.lab-tabs { display: grid; gap: 10px; align-content: start; }
.lab-tab {
  text-align: left; cursor: pointer; font: inherit; color: var(--text); padding: 20px 22px; border-radius: 14px;
  background: transparent; border: 1px solid var(--border); position: relative; overflow: hidden; transition: background .2s, border-color .2s;
}
.lab-tab:hover { background: var(--surface); }
.lab-tab h3 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.08rem; }
.lab-tab h3 .n { font: 500 .72rem/1 var(--mono); color: var(--muted); }
.lab-tab p { margin: 0; max-height: 0; opacity: 0; overflow: hidden; font-size: .92rem; transition: max-height .4s ease, opacity .3s, margin .3s; }
.lab-tab[aria-selected="true"] { background: var(--surface); border-color: var(--border-hi); box-shadow: var(--glow); }
.lab-tab[aria-selected="true"] p { max-height: 160px; opacity: 1; margin-top: 10px; }
.lab-tab .timer { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--grad); }
.lab-tab[aria-selected="true"] .timer { animation: timer var(--dur, 9s) linear forwards; }
.lab.paused .lab-tab .timer { animation-play-state: paused; }
@keyframes timer { to { width: 100%; } }

.lab-stage { position: relative; min-height: 460px; border-radius: 20px; padding: 28px; overflow: hidden;
  background: radial-gradient(80% 70% at 70% 0%, rgba(139,108,255,.14), transparent 60%), var(--surface-solid); border: 1px solid var(--border); }
.lab-stage::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(var(--border-hi) 1px, transparent 1px); background-size: 22px 22px; opacity: .5;
  -webkit-mask-image: radial-gradient(70% 70% at 50% 40%, #000, transparent); mask-image: radial-gradient(70% 70% at 50% 40%, #000, transparent); }
.panel { position: absolute; inset: 28px; display: flex; flex-direction: column; opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .45s, transform .45s, visibility .45s; }
.panel.active { opacity: 1; visibility: visible; transform: none; }
.panel-title { display: flex; justify-content: space-between; align-items: center; font: 500 .76rem/1 var(--mono); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 18px; }
.panel-title b { color: var(--green); font-weight: 600; }
@media (max-width: 1000px) {
  .lab { grid-template-columns: 1fr; }
  .lab-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .lab-tab { padding: 14px; }
  .lab-tab h3 { font-size: .92rem; flex-direction: column; align-items: flex-start; gap: 4px; }
  .lab-tab p { display: none; }
}
@media (max-width: 560px) {
  .lab-tabs { grid-template-columns: 1fr 1fr; }
  .lab-stage { min-height: 580px; padding: 18px; }
  .msg { font-size: .88rem; }
  .panel { inset: 18px; }
}

/* GenAI chat */
.chat { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.msg { max-width: 88%; padding: 13px 16px; border-radius: 14px; font-size: .94rem; line-height: 1.6; }
.msg.user { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: var(--surface-hi); border: 1px solid var(--border); color: var(--text); border-bottom-left-radius: 4px; min-height: 48px; }
.msg.ai .who { display: flex; align-items: center; gap: 8px; font: 600 .74rem/1 var(--mono); color: var(--cyan); margin-bottom: 8px; }
.sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.sources span { font: 500 .72rem/1 var(--mono); padding: 6px 8px; border-radius: 6px; background: rgba(34,211,238,.1); color: var(--cyan); border: 1px solid rgba(34,211,238,.25); opacity: 0; transform: scale(.9); transition: .3s; }
.sources span.on { opacity: 1; transform: none; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: dots 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dots { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.rag-row { display: flex; gap: 8px; margin-top: auto; padding-top: 16px; }
.rag-step { flex: 1; font: 500 .72rem/1.3 var(--mono); text-align: center; padding: 10px 6px; border-radius: 9px; border: 1px solid var(--border); color: var(--muted); transition: .3s; }
.rag-step.on { color: var(--text); border-color: var(--cyan); background: rgba(34,211,238,.08); box-shadow: 0 0 20px rgba(34,211,238,.15); }

/* Agentic graph */
.agent-graph { flex: 1; position: relative; min-height: 300px; }
.agent-graph > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.edge { fill: none; stroke: var(--border-hi); stroke-width: 1.5; }
.edge.flow { stroke: url(#edgeGrad); stroke-width: 2; stroke-dasharray: 6 10; animation: dash 1s linear infinite; opacity: 0; transition: opacity .3s; }
.edge.flow.on { opacity: 1; }
@keyframes dash { to { stroke-dashoffset: -32; } }
.node { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.node .dot { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-solid); border: 1px solid var(--border-hi); color: var(--text-2); transition: .35s; }
.node .dot svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.node.core .dot { width: 76px; height: 76px; border-radius: 22px; background: var(--grad); color: #fff; border: 0; box-shadow: 0 0 40px rgba(139,108,255,.5); }
.node.core .dot::after { content: ""; position: absolute; width: 76px; height: 76px; border-radius: 22px; border: 1px solid rgba(139,108,255,.6); animation: ring 2.4s infinite; }
@keyframes ring { from { transform: scale(1); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
.node .lbl { font: 600 .74rem/1 var(--mono); color: var(--text-2); white-space: nowrap; }
.node.on .dot { color: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(34,211,238,.12), 0 0 30px rgba(34,211,238,.35); transform: scale(1.08); }
.node.on .lbl { color: var(--text); }
.agent-status { display: flex; align-items: center; gap: 10px; font: 500 .84rem/1.4 var(--mono); padding: 12px 14px; border-radius: 10px; background: var(--surface-hi); border: 1px solid var(--border); margin-top: 12px; }
.agent-status .spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-hi); border-top-color: var(--cyan); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ML chart */
.ml { flex: 1; display: grid; grid-template-rows: 1fr auto; gap: 16px; }
.ml-chart { position: relative; }
.ml-chart svg { width: 100%; height: 100%; min-height: 220px; }
.ml-chart .grid line { stroke: var(--border); }
.ml-chart .axis { fill: var(--muted); font: 500 10px var(--mono); }
.curve { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 1000; stroke-dashoffset: 1000; }
.curve.train { stroke: var(--violet); } .curve.val { stroke: var(--cyan); }
.area { fill: url(#areaGrad); opacity: 0; transition: opacity 1s .8s; }
.panel.active .curve { animation: draw 3.2s cubic-bezier(.4,.1,.2,1) forwards; }
.panel.active .curve.val { animation-delay: .25s; }
.panel.active .area { opacity: 1; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.legend { display: flex; gap: 16px; font: 500 .74rem/1 var(--mono); color: var(--text-2); }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.metric { padding: 14px; border-radius: 12px; background: var(--surface-hi); border: 1px solid var(--border); }
.metric b { display: block; font: 600 1.5rem/1.1 var(--display); }
.metric span { font: 500 .72rem/1 var(--mono); color: var(--muted); }

/* MLOps pipeline */
.pipe { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 26px; }
.pipe-row { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.pipe-row::before { content: ""; position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: var(--border-hi); }
.stage { position: relative; z-index: 1; text-align: center; padding: 14px 6px; border-radius: 12px; background: var(--surface-solid); border: 1px solid var(--border-hi); transition: .3s; }
.stage svg { width: 22px; height: 22px; margin: 0 auto 8px; fill: none; stroke: var(--text-2); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.stage span { display: block; font: 600 .7rem/1.2 var(--mono); color: var(--text-2); }
.stage.on { border-color: var(--violet); box-shadow: 0 0 24px rgba(139,108,255,.35); }
.stage.on svg { stroke: var(--violet); }
.packet { position: absolute; top: 50%; left: 6%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); z-index: 2; offset-anchor: center; animation: packet 3.6s linear infinite; }
.packet:nth-of-type(2) { animation-delay: 1.2s; background: var(--violet); box-shadow: 0 0 14px var(--violet); }
.packet:nth-of-type(3) { animation-delay: 2.4s; background: var(--pink); box-shadow: 0 0 14px var(--pink); }
@keyframes packet { from { left: 6%; opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } to { left: 94%; opacity: 0; } }
.monitor { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.spark { padding: 12px 14px; border-radius: 12px; background: var(--surface-hi); border: 1px solid var(--border); }
.spark span { display: flex; justify-content: space-between; font: 500 .72rem/1 var(--mono); color: var(--muted); }
.spark span b { color: var(--green); font-weight: 600; }
.spark svg { width: 100%; height: 38px; margin-top: 8px; }
.spark path { fill: none; stroke: var(--cyan); stroke-width: 1.8; }
@media (max-width: 560px) {
  .pipe-row { grid-template-columns: repeat(3, 1fr); row-gap: 14px; }
  .pipe-row::before, .packet { display: none; }
  .monitor, .metrics { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .spark { padding: 10px; min-width: 0; }
  .spark span { flex-direction: column; gap: 4px; }
  .metric b { font-size: 1.15rem; }
}

/* ---------- Card grids ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card { padding: 30px; transition: transform .3s cubic-bezier(.2,.8,.2,1), border-color .3s; }
.card:hover { transform: translateY(-4px); border-color: var(--border-hi); }
.card p { font-size: .96rem; margin: 0; }
.card h3 { margin-bottom: 10px; }
.card .more { display: inline-flex; margin-top: 18px; font-weight: 600; font-size: .92rem; color: var(--cyan); }
.card.feature { grid-column: span 2; display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; }
@media (max-width: 1000px) { .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } .card.feature { grid-column: span 2; } }
@media (max-width: 640px) { .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; } .card.feature { grid-column: auto; grid-template-columns: 1fr; } .card { padding: 24px; } }

/* ---------- Split sections ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.split.top { align-items: start; }
@media (max-width: 960px) { .split { grid-template-columns: 1fr; gap: 40px; } }

/* staffing orbit visual */
.orbit { position: relative; aspect-ratio: 1; width: min(460px, calc(100% - 130px)); margin: 50px auto; }
.orbit .ring { position: absolute; inset: 0; border: 1px dashed var(--border-hi); border-radius: 50%; animation: rot 60s linear infinite; }
.orbit .ring.r2 { inset: 17%; animation-duration: 40s; animation-direction: reverse; }
.orbit .ring.r3 { inset: 34%; border-style: solid; border-color: var(--border); animation: none; }
.orbit .hub { position: absolute; inset: 38%; border-radius: 50%; background: var(--grad); display: grid; place-items: center; text-align: center; color: #fff; font: 700 clamp(.8rem, 2.2vw, 1rem)/1.2 var(--display); box-shadow: 0 0 60px rgba(139,108,255,.5); }
.orbit .sat { position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%) rotate(calc(var(--a) * -1)); }
.orbit .ring > .sat-wrap { position: absolute; inset: 0; transform: rotate(var(--a)); }
.orbit .chip { display: inline-block; font: 600 .76rem/1 var(--mono); padding: 9px 12px; border-radius: 10px; background: var(--surface-solid); border: 1px solid var(--border-hi); white-space: nowrap; animation: rot 60s linear infinite reverse; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.orbit .ring.r2 .chip { animation: rot 40s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* stats-free highlights */
.hl-list { display: grid; gap: 14px; margin-top: 28px; }
.hl { display: flex; gap: 16px; padding: 18px 20px; }
.hl .icon { margin: 0; flex: none; width: 42px; height: 42px; }
.hl h4 { margin-bottom: 2px; }
.hl p { margin: 0; font-size: .92rem; }

/* ---------- Gov band ---------- */
.gov { position: relative; padding: clamp(32px, 5vw, 56px); border-radius: 24px; overflow: hidden;
  background: radial-gradient(60% 90% at 100% 0%, rgba(34,211,238,.15), transparent 60%), radial-gradient(60% 90% at 0% 100%, rgba(139,108,255,.18), transparent 60%), var(--surface-solid);
  border: 1px solid var(--border-hi); }
.gov-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.gov-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gov-item { padding: 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: .9rem; color: var(--text-2); }
.gov-item strong { display: block; color: var(--text); font-family: var(--display); font-size: .98rem; margin-bottom: 3px; }
@media (max-width: 960px) { .gov-grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .gov-list { grid-template-columns: 1fr; } }

/* ---------- Tech marquee ---------- */
.marquee { position: relative; overflow: hidden; display: grid; gap: 14px; padding: 6px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.track { display: flex; gap: 14px; width: max-content; animation: scroll 40s linear infinite; }
.track.rev { animation-direction: reverse; animation-duration: 46s; }
.marquee:hover .track { animation-play-state: paused; }
@keyframes scroll { to { transform: translateX(calc(-50% - 7px)); } }
.tech-chip { display: inline-flex; align-items: center; gap: 10px; padding: 14px 20px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font: 600 .95rem/1 var(--display); white-space: nowrap; transition: border-color .2s, transform .2s; }
.tech-chip:hover { border-color: var(--cyan); transform: translateY(-2px); }
.tech-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--violet)); box-shadow: 0 0 10px var(--c, var(--violet)); }

/* ---------- Process ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; position: relative; }
.steps::before { content: ""; position: absolute; top: 27px; left: 28px; right: 28px; height: 1px; background: linear-gradient(90deg, var(--violet), var(--cyan)); opacity: .5; }
.step { position: relative; }
.step-num { position: relative; z-index: 1; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font: 600 1.05rem/1 var(--mono); background: var(--bg); border: 1px solid var(--border-hi); margin-bottom: 22px; color: var(--cyan); }
.step p { font-size: .95rem; margin: 0; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; row-gap: 36px; } .steps::before { display: none; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* ---------- CTA band ---------- */
.cta-band { position: relative; text-align: center; padding: clamp(48px, 7vw, 80px) 24px; border-radius: 28px; overflow: hidden; border: 1px solid var(--border-hi);
  background: radial-gradient(70% 120% at 50% 0%, rgba(139,108,255,.3), transparent 60%), var(--surface-solid); }
.cta-band h2 { max-width: 16em; margin: 0 auto 16px; }
.cta-band p { max-width: 34em; margin: 0 auto 30px; font-size: 1.08rem; }
.cta-band .hero-cta { justify-content: center; margin: 0; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { position: relative; padding: clamp(64px, 10vw, 120px) 0 clamp(40px, 6vw, 72px); overflow: hidden; }
.page-hero h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); max-width: 14em; margin-top: 24px; }
.page-hero .lead { font-size: 1.15rem; max-width: 40em; }
.page-hero .grid-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px); background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(70% 80% at 30% 0%, #000, transparent 75%); mask-image: radial-gradient(70% 80% at 30% 0%, #000, transparent 75%); }

/* ---------- Roles (staffing) ---------- */
.roles { display: flex; flex-wrap: wrap; gap: 10px; }
.role { font: 500 .9rem/1 var(--font); padding: 12px 16px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); transition: .2s; cursor: default; }
.role:hover { border-color: var(--violet); background: rgba(139,108,255,.1); transform: translateY(-2px); }
.role.ai { border-color: rgba(34,211,238,.35); }

.compare { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .94rem; }
.compare th, .compare td { padding: 16px 18px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.compare th { font: 600 .78rem/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.compare td:first-child { font-weight: 600; color: var(--text); font-family: var(--display); }
.compare td { color: var(--text-2); }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }

/* ---------- Team ---------- */
.leader { padding: 32px; display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: start; }
.avatar { position: relative; width: 88px; height: 88px; border-radius: 24px; display: grid; place-items: center; font: 700 1.7rem/1 var(--display); color: #fff; background: var(--grad); box-shadow: 0 10px 30px rgba(139,108,255,.35); }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.leader .role-title { font: 500 .8rem/1 var(--mono); color: var(--cyan); margin-bottom: 12px; display: block; }
.leader h3 { margin-bottom: 6px; font-size: 1.4rem; }
.socials { display: flex; gap: 8px; margin-top: 16px; }
.socials a { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); color: var(--text-2); transition: .2s; }
.socials a:hover { color: var(--text); border-color: var(--border-hi); }
.socials svg { width: 17px; height: 17px; fill: currentColor; }
@media (max-width: 520px) { .leader { grid-template-columns: 1fr; } }

.team-card { padding: 28px; }
.team-card .icon { margin-bottom: 18px; }
.team-card h3 { margin-bottom: 8px; }
.team-card p { font-size: .94rem; margin: 0; }

/* ---------- Contact / Location ---------- */
.contact { display: grid; grid-template-columns: .9fr 1.1fr; gap: 48px; align-items: start; }
.info-list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.info-list li { display: flex; gap: 14px; align-items: flex-start; padding: 18px; }
.info-list .icon { margin: 0; width: 42px; height: 42px; flex: none; }
.info-list h4 { margin: 0 0 2px; font-size: .95rem; }
.info-list p, .info-list a { margin: 0; font-size: .94rem; color: var(--text-2); }
.info-list a:hover { color: var(--cyan); }

.form { padding: 32px; display: grid; gap: 18px; }
.form .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form label { display: grid; gap: 8px; font-size: .88rem; font-weight: 500; }
.opt { color: var(--muted); font-weight: 400; }
.form input, .form select, .form textarea {
  width: 100%; font: 400 1rem/1.4 var(--font); color: var(--text); background: var(--bg);
  border: 1px solid var(--border-hi); border-radius: 10px; padding: 13px 14px; transition: border-color .15s, box-shadow .15s;
}
.form select option { background: var(--surface-solid); color: var(--text); }
.form textarea { resize: vertical; min-height: 130px; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(139,108,255,.2); }
.form .invalid { border-color: #f43f5e; }
.seg { position: relative; display: flex; flex-wrap: wrap; gap: 8px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { display: inline-block; cursor: pointer; font-size: .88rem; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border-hi); color: var(--text-2); transition: .15s; }
.seg input:checked + label { color: var(--text); border-color: var(--violet); background: rgba(139,108,255,.14); }
.seg input:focus-visible + label { outline: 2px solid var(--cyan); outline-offset: 2px; }
.form-status { margin: 0; font-size: .92rem; min-height: 1.4em; text-align: center; }
.form-status.ok { color: var(--green); } .form-status.err { color: #f43f5e; }
@media (max-width: 960px) { .contact { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .form .field-row { grid-template-columns: 1fr; } .form { padding: 22px; } }

.map-wrap { position: relative; border-radius: 20px; overflow: hidden; border: 1px solid var(--border-hi); min-height: 420px; background: var(--surface-solid); }
.map-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
:root:not([data-theme="light"]) .map-wrap iframe { filter: invert(.9) hue-rotate(180deg) saturate(.7) brightness(.95); }
.map-card { position: absolute; left: 20px; bottom: 20px; right: 20px; max-width: 360px; padding: 20px; background: color-mix(in srgb, var(--surface-solid) 88%, transparent); }
.map-card h4 { margin-bottom: 4px; }
.map-card p { margin: 0 0 12px; font-size: .92rem; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 0 22px; transition: border-color .2s; }
.faq details[open] { border-color: var(--border-hi); }
.faq summary { cursor: pointer; list-style: none; padding: 20px 0; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 1.5rem/1 var(--font); color: var(--muted); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding-bottom: 20px; margin: 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 64px 0 28px; margin-top: 40px; background: linear-gradient(180deg, transparent, var(--bg-2)); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1.2fr; gap: 32px; }
.footer-grid nav { display: grid; gap: 10px; align-content: start; }
.footer-grid nav a, .footer-grid address a { color: var(--text-2); font-size: .94rem; }
.footer-grid nav a:hover, .footer-grid address a:hover { color: var(--text); }
.footer-grid h4 { font: 600 .74rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.footer-grid address { font-style: normal; color: var(--text-2); font-size: .94rem; display: grid; gap: 8px; align-content: start; }
.footer-about p { margin-top: 16px; font-size: .94rem; max-width: 26em; }
.legal { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.legal p { margin: 0; font-size: .84rem; }
@media (max-width: 1000px) { .footer-grid { grid-template-columns: 1fr 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid address { grid-column: 1 / -1; } }

/* ---------- Legal docs ---------- */
.doc { padding: clamp(48px, 8vw, 88px) 0; }
.doc h1 { font-size: clamp(2rem, 5vw, 3rem); }
.doc h2 { font-size: 1.35rem; margin-top: 2em; }
.doc p, .doc li { color: var(--text-2); }
.doc a { color: var(--cyan); }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 90;
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--border-hi); cursor: pointer; padding: 0;
  display: grid; place-items: center; color: var(--text);
  background: color-mix(in srgb, var(--surface-solid) 85%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  opacity: 0; visibility: hidden; transform: translateY(16px) scale(.9);
  transition: opacity .3s, transform .3s cubic-bezier(.2,.8,.2,1), visibility .3s, box-shadow .2s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { box-shadow: 0 12px 34px rgba(91,140,255,.4); }
.to-top > svg { grid-area: 1 / 1; }
.to-top .ring { width: 52px; height: 52px; transform: rotate(-90deg); }
.to-top .ring circle { fill: none; stroke: var(--cyan); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p, 0)); }
.to-top .arrow { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.to-top:hover .arrow { transform: translateY(-3px); }
#main:focus { outline: none; }
@media (max-width: 600px) { .to-top { width: 46px; height: 46px; right: 16px; bottom: 16px; } .to-top .ring { width: 46px; height: 46px; } }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }

/* Reduced motion: stop large continuous movement, keep gentle fades & interactive demos */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { transform: none; transition: opacity .6s ease; }
  .track, .orbit .ring, .orbit .chip, .node.core .dot::after { animation: none !important; }
  .packet { display: none; }
  .rotator span, .rotator span.out { transform: none; filter: none; }
  .card:hover, .btn-primary:hover, .role:hover, .tech-chip:hover { transform: none; }
}
