/* Corven — bespoke design system (operational-intelligence SaaS)
   Self-hosted variable font + dark "signal" aesthetic. No build step. */

@font-face {
  font-family: "InterVar";
  src: url("/assets/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}

:root {
  --bg: #080b10;
  --bg-grad-1: #0a0e15;
  --surface: #0f141d;
  --surface-2: #141a25;
  --elevated: #1a2130;
  --line: #232c3b;
  --line-soft: #1b2330;
  --fg: #e8ecf3;
  --fg-strong: #ffffff;
  --dim: #8a94a7;
  --dimmer: #5f6b7e;
  --accent: #35e0c4;
  --accent-2: #6b8cff;
  --accent-glow: rgba(53, 224, 196, 0.35);
  --indigo: #6b8cff;
  --incident: #ff7a5c;
  --warn: #ffc857;
  --ok: #3fb950;
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1160px;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 0 1px rgba(53, 224, 196, 0.18), 0 20px 60px -18px rgba(53, 224, 196, 0.15);
  --font: "InterVar", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--fg);
  background:
    radial-gradient(1200px 600px at 78% -8%, rgba(107, 140, 255, 0.10), transparent 60%),
    radial-gradient(1000px 520px at 10% 4%, rgba(53, 224, 196, 0.08), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { color: var(--fg-strong); line-height: 1.12; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
img, svg { display: block; max-width: 100%; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.eyebrow {
  color: var(--accent); font-size: 12px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; margin: 0 0 14px;
}
.muted { color: var(--dim); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 14.5px; border-radius: 10px;
  padding: 11px 20px; border: 1px solid transparent; transition: all 0.16s ease;
  white-space: nowrap;
}
.btn-primary {
  color: #04120f;
  background: linear-gradient(135deg, var(--accent), #57e0ff);
  box-shadow: 0 10px 30px -8px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 40px -10px var(--accent-glow); }
.btn-ghost { color: var(--fg); border-color: var(--line); background: rgba(255, 255, 255, 0.02); }
.btn-ghost:hover { border-color: var(--accent); color: var(--fg-strong); }
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: 0.5; cursor: not-allowed; filter: grayscale(0.4);
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(8, 11, 16, 0.72);
  border-bottom: 1px solid var(--line-soft);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 17px; color: var(--fg-strong); letter-spacing: -0.01em; }
.brand .logo { width: 30px; height: 30px; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { color: var(--dim); font-size: 14.5px; font-weight: 500; transition: color 0.15s; }
.nav-links a:hover { color: var(--fg); }
.nav-cta { display: flex; align-items: center; gap: 12px; }
#employeeLogin.badge-locked {
  font-size: 13px; font-weight: 600; color: var(--dimmer);
  border: 1px solid var(--line); background: transparent; border-radius: 9px;
  padding: 9px 15px; display: inline-flex; align-items: center; gap: 7px;
}
#employeeLogin[data-active="true"] {
  color: var(--fg); border-color: var(--line); cursor: pointer;
}
#employeeLogin[data-active="true"]:hover { border-color: var(--accent); color: var(--fg-strong); }
@media (max-width: 820px) { .nav-links { display: none; } }

/* ---------- hero ---------- */
.hero { position: relative; padding: 92px 0 70px; overflow: hidden; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center;
}
.hero h1 { font-size: clamp(38px, 5vw, 62px); font-weight: 700; }
.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero .lede { font-size: 19px; color: var(--dim); margin: 22px 0 30px; max-width: 33ch; }
.hero-cta { display: flex; gap: 13px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 30px; margin-top: 42px; flex-wrap: wrap; }
.hero-stats .stat b { display: block; font-size: 26px; color: var(--fg-strong); font-weight: 700; letter-spacing: -0.02em; }
.hero-stats .stat span { font-size: 13px; color: var(--dim); }
.pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500;
  color: var(--accent); background: rgba(53, 224, 196, 0.08);
  border: 1px solid rgba(53, 224, 196, 0.22); border-radius: 999px; padding: 6px 14px; margin-bottom: 24px;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent-glow); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--accent-glow); } 70% { box-shadow: 0 0 0 9px rgba(53, 224, 196, 0); } 100% { box-shadow: 0 0 0 0 rgba(53, 224, 196, 0); } }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } .hero { padding: 60px 0 40px; } }

/* ---------- Regional Grid (signature element) ---------- */
.grid-panel {
  background: linear-gradient(180deg, var(--surface), var(--bg-grad-1));
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; position: relative;
}
.grid-panel .gp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line-soft);
}
.grid-panel .gp-title { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600; color: var(--fg-strong); }
.grid-panel .gp-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--accent); font-family: var(--mono); }
.grid-panel .gp-live .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
.map-shell { position: relative; padding: 8px 6px 4px; }
.map-svg { width: 100%; height: auto; }
.region-node { cursor: pointer; }
.region-node .rn-core { transition: r 0.2s; }
.region-ring { transform-origin: center; transform-box: fill-box; }
.gp-legend { display: flex; gap: 18px; padding: 10px 18px 16px; flex-wrap: wrap; }
.gp-legend .lg { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--dim); }
.gp-legend .lg i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.gp-ticker {
  font-family: var(--mono); font-size: 11.5px; color: var(--dim);
  border-top: 1px solid var(--line-soft); padding: 10px 18px; min-height: 38px;
  display: flex; align-items: center; gap: 10px;
}
.gp-ticker .tk-time { color: var(--dimmer); }
.gp-ticker .tk-ok { color: var(--ok); }
.gp-ticker .tk-warn { color: var(--warn); }

/* ---------- section scaffolding ---------- */
section.band { padding: 80px 0; }
.section-head { max-width: 62ch; margin: 0 0 46px; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 700; }
.section-head p { color: var(--dim); font-size: 17px; margin-top: 14px; }

/* module cards */
.modules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.module {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s; position: relative; overflow: hidden;
}
.module::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); opacity: 0; transition: opacity 0.2s;
}
.module:hover { transform: translateY(-4px); border-color: rgba(53, 224, 196, 0.35); box-shadow: var(--shadow-glow); }
.module:hover::before { opacity: 1; }
.module .m-ico { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 18px; background: rgba(53, 224, 196, 0.10); border: 1px solid rgba(53, 224, 196, 0.2); }
.module h3 { font-size: 19px; margin-bottom: 9px; }
.module p { color: var(--dim); font-size: 14.5px; }
.module .m-tag { font-family: var(--mono); font-size: 11px; color: var(--accent); margin-bottom: 6px; letter-spacing: 0.04em; }
@media (max-width: 860px) { .modules { grid-template-columns: 1fr; } }

/* feature split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.split.reverse .split-media { order: -1; }
.feature-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 16px; }
.feature-list li { display: flex; gap: 13px; align-items: flex-start; }
.feature-list .fi { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: rgba(107, 140, 255, 0.12); color: var(--accent-2); margin-top: 2px; }
.feature-list b { color: var(--fg-strong); font-weight: 600; }
.feature-list span { color: var(--dim); font-size: 14.5px; }
.code-card {
  background: #0a0e15; border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--mono); font-size: 13px; overflow: hidden; box-shadow: var(--shadow);
}
.code-card .cc-bar { display: flex; gap: 7px; padding: 12px 15px; border-bottom: 1px solid var(--line-soft); }
.code-card .cc-bar i { width: 11px; height: 11px; border-radius: 50%; background: #2a3242; }
.code-card pre { margin: 0; padding: 18px 18px 22px; overflow-x: auto; color: #b9c4d6; line-height: 1.7; }
.code-card .k { color: var(--accent-2); }
.code-card .s { color: var(--accent); }
.code-card .c { color: var(--dimmer); }
.code-card .n { color: var(--warn); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 34px; } .split.reverse .split-media { order: 0; } }

/* trust / logos */
.trust { border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); background: rgba(255, 255, 255, 0.012); }
.trust .wrap { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 26px 24px; flex-wrap: wrap; }
.trust .t-label { font-size: 13px; color: var(--dimmer); letter-spacing: 0.08em; text-transform: uppercase; }
.trust .t-logos { display: flex; gap: 34px; flex-wrap: wrap; align-items: center; }
.trust .t-logos span { color: var(--dim); font-weight: 700; font-size: 17px; letter-spacing: -0.01em; opacity: 0.72; }
.badges { display: flex; gap: 12px; flex-wrap: wrap; }
.badge-chip { font-family: var(--mono); font-size: 11.5px; color: var(--dim); border: 1px solid var(--line); border-radius: 7px; padding: 5px 11px; }

/* metrics band */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.metric { text-align: center; padding: 26px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, var(--surface), transparent); }
.metric b { display: block; font-size: 34px; font-weight: 700; letter-spacing: -0.03em; background: linear-gradient(120deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.metric span { color: var(--dim); font-size: 13.5px; }
@media (max-width: 720px) { .metrics { grid-template-columns: 1fr 1fr; } }

/* CTA */
.cta-band { text-align: center; }
.cta-card {
  background: linear-gradient(135deg, rgba(53, 224, 196, 0.08), rgba(107, 140, 255, 0.08));
  border: 1px solid rgba(53, 224, 196, 0.22); border-radius: 20px; padding: 56px 30px;
}
.cta-card h2 { font-size: clamp(28px, 3.5vw, 42px); }
.cta-card p { color: var(--dim); font-size: 18px; margin: 16px auto 30px; max-width: 52ch; }

/* footer */
footer.site-footer { border-top: 1px solid var(--line-soft); padding: 50px 0 40px; color: var(--dim); }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 34px; }
.foot-grid h4 { color: var(--fg); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 14px; }
.foot-grid a { display: block; color: var(--dim); font-size: 14px; padding: 4px 0; transition: color 0.15s; }
.foot-grid a:hover { color: var(--accent); }
.foot-bottom { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line-soft); padding-top: 22px; font-size: 13px; flex-wrap: wrap; gap: 12px; }
.foot-note { color: var(--dimmer); font-size: 12.5px; max-width: 60ch; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- chat widget (bespoke styling of chassis contract) ---------- */
#chatLaunch {
  position: fixed; right: 22px; bottom: 22px; z-index: 80;
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 14px; color: #04120f;
  background: linear-gradient(135deg, var(--accent), #57e0ff);
  border: none; border-radius: 999px; padding: 13px 20px;
  box-shadow: 0 14px 34px -8px var(--accent-glow);
  transition: transform 0.16s, box-shadow 0.16s;
}
#chatLaunch::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #04120f; opacity: 0.65; }
#chatLaunch:hover { transform: translateY(-2px); box-shadow: 0 20px 44px -10px var(--accent-glow); }
#chatPanel {
  position: fixed; right: 22px; bottom: 22px; z-index: 81;
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 44px));
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8); display: flex; flex-direction: column;
  opacity: 0; transform: translateY(16px) scale(0.98); visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
#chatPanel.open { opacity: 1; transform: translateY(0) scale(1); visibility: visible; }
#chatPanel header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 17px; border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(53, 224, 196, 0.06), transparent);
}
#chatPanel header span { font-weight: 700; color: var(--fg-strong); display: inline-flex; align-items: center; gap: 9px; }
#chatPanel header span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
#chatClose { background: none; border: none; color: var(--dim); font-size: 22px; cursor: pointer; line-height: 1; padding: 0 4px; }
#chatClose:hover { color: var(--fg); }
#chatLog { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
#chatLog .msg { max-width: 84%; padding: 10px 13px; border-radius: 13px; font-size: 14px; line-height: 1.5; }
#chatLog .msg.bot { background: var(--elevated); color: var(--fg); border-bottom-left-radius: 4px; align-self: flex-start; }
#chatLog .msg.user { background: linear-gradient(135deg, var(--accent-2), #8aa2ff); color: #06101f; border-bottom-right-radius: 4px; align-self: flex-end; font-weight: 500; }
#chatLog .msg.system { background: rgba(255, 122, 92, 0.12); border: 1px solid rgba(255, 122, 92, 0.3); color: #ffbda9; align-self: center; font-size: 13px; text-align: center; max-width: 96%; }
#chatLog .msg.typing { color: var(--dim); font-style: italic; }
#chatForm { display: flex; gap: 8px; padding: 13px; border-top: 1px solid var(--line-soft); }
#chatInput { flex: 1; font: inherit; font-size: 14px; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px; outline: none; }
#chatInput:focus { border-color: var(--accent); }
#chatSend { font: inherit; font-weight: 600; font-size: 14px; color: #04120f; background: linear-gradient(135deg, var(--accent), #57e0ff); border: none; border-radius: 10px; padding: 0 16px; cursor: pointer; }
#chatSend:disabled { opacity: 0.5; cursor: not-allowed; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } .pill .dot, .grid-panel .gp-live .dot { animation: none; } }
