/* blue-kakapo — "Night Watch" visual system. Dark-first, Swiss-modern + glow. */
:root {
  --bg: #0a0e13;
  --bg2: #0e141c;
  --surface: rgba(255, 255, 255, 0.03);
  --surface2: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.09);
  --line2: rgba(255, 255, 255, 0.16);
  --text: #e9eef5;
  --muted: #8a97a6;
  --accent: #35e0a1;
  --accent-ink: #04140d;
  --accent-2: #4aa8ff;
  --green: #3ddc97;
  --amber: #ffb454;
  --red: #ff5c5c;
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --maxw: 1080px;
  --radius: 14px;
}
/* Light mode: this is a dark-first product site; we keep the night canvas but soften for light UA.
   (Guarded so an explicit dark theme always wins.) */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --bg: #0a0e13; } /* intentionally stays dark — it's the brand */
}
:root[data-theme="dark"] { --bg: #0a0e13; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--body); line-height: 1.6; -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before { /* ambient radial glow */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 40% at 15% -5%, rgba(53, 224, 161, 0.10), transparent 70%),
    radial-gradient(50% 40% at 95% 0%, rgba(74, 168, 255, 0.08), transparent 70%);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.3rem, 6vw, 4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
p { color: #cfd8e3; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

/* Nav */
header.nav { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(12px);
  background: rgba(10, 14, 19, 0.72); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 18px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 1.05rem; color: var(--text); }
.brand img { width: 26px; height: 26px; }
.nav nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.nav nav a { color: var(--muted); padding: 7px 12px; border-radius: 9px; font-size: 0.93rem; }
.nav nav a:hover { color: var(--text); text-decoration: none; background: var(--surface); }
.nav nav a.active { color: var(--text); background: var(--surface2); }
.nav .gh { border: 1px solid var(--line2); }
.navtoggle { display: none; background: none; border: 1px solid var(--line2); color: var(--text); border-radius: 9px; padding: 6px 10px; margin-left: auto; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 11px;
  font-weight: 600; font-size: 0.98rem; border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, filter .15s ease; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line2); }

/* Sections */
section { padding: 72px 0; }
.kicker { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.lede { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: #cfd8e3; max-width: 60ch; }

/* Hero */
.hero { padding: 84px 0 56px; text-align: center; }
.hero .lede { margin: 18px auto 26px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.install { display: inline-flex; align-items: center; gap: 12px; margin: 26px auto 0; padding: 10px 12px 10px 16px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; font-family: var(--mono); font-size: 0.9rem; color: var(--text); }
.install code { color: var(--accent); }
.copybtn { background: var(--surface2); color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; font-size: 0.75rem; cursor: pointer; }
.copybtn:hover { color: var(--text); }
.badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.chip { font-family: var(--mono); font-size: 0.74rem; color: var(--muted); border: 1px solid var(--line); border-radius: 20px; padding: 5px 11px; }
.chip.on { color: var(--accent); border-color: rgba(53,224,161,.4); }

/* Cards */
.grid { display: grid; gap: 18px; }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h3 { font-size: 1.15rem; }
.card .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: rgba(53,224,161,.12); color: var(--accent); margin-bottom: 12px; font-family: var(--mono); }

/* Glass panel (for hero product shot / callouts) */
.glass { background: linear-gradient(135deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  backdrop-filter: blur(16px) saturate(140%); border: 1px solid var(--line2); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.12); }

/* Pipeline / steps */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.step { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 0.86rem; }
.step .n { font-family: var(--mono); color: var(--accent); font-size: 0.75rem; }

/* Verdict demo badges */
.vbadge { font-family: var(--mono); font-size: 0.72rem; padding: 3px 9px; border-radius: 20px; border: 1px solid; }
.v-green { color: var(--green); border-color: var(--green); }
.v-amber { color: var(--amber); border-color: var(--amber); }
.v-red { color: var(--red); border-color: var(--red); }

/* Code block */
pre { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; overflow: auto; }
pre code { font-family: var(--mono); font-size: 0.85rem; color: #d6e2ee; }
code.inline { font-family: var(--mono); background: var(--surface2); padding: 1px 6px; border-radius: 6px; font-size: 0.86em; color: var(--accent); }

/* Doc prose */
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.4em; }
.prose ul { color: #cfd8e3; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 0.92rem; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--muted); font-family: var(--mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: .06em; }

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

/* Footer */
footer.foot { border-top: 1px solid var(--line); padding: 40px 0; color: var(--muted); font-size: 0.9rem; }
footer.foot .wrap { display: flex; gap: 20px; flex-wrap: wrap; justify-content: space-between; }
footer.foot a { color: var(--muted); }
footer.foot a:hover { color: var(--text); }

@media (max-width: 820px) {
  .grid.c3, .grid.c2, .steps { grid-template-columns: 1fr; }
  .nav nav { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column;
    background: var(--bg2); border-bottom: 1px solid var(--line); padding: 10px; gap: 2px; }
  .nav nav.open { display: flex; }
  .navtoggle { display: inline-block; }
  .nav nav a { padding: 12px; }
}
/* ============================================================================
   Motion layer — "Night Watch" comes alive. Everything here is disabled under
   prefers-reduced-motion (see the block at the end).
   ============================================================================ */

/* Animated aurora + drifting grid behind the hero (sits under content, non-interactive). */
.aurora { position: absolute; inset: 0 0 auto 0; height: 760px; z-index: -1; pointer-events: none; overflow: hidden; }
.aurora::before, .aurora::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55;
  background: radial-gradient(circle at center, rgba(53,224,161,.42), transparent 62%);
  animation: auroraDrift 18s ease-in-out infinite alternate;
}
.aurora::before { width: 56vw; height: 56vw; left: -8vw; top: -16vw; }
.aurora::after {
  width: 48vw; height: 48vw; right: -6vw; top: -10vw;
  background: radial-gradient(circle at center, rgba(74,168,255,.34), transparent 62%);
  animation-duration: 22s; animation-delay: -6s;
}
.aurora .grid-lines {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 46px 46px; mask-image: radial-gradient(70% 60% at 50% 0%, #000, transparent 85%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 0%, #000, transparent 85%);
  animation: gridPan 30s linear infinite;
}
@keyframes auroraDrift {
  from { transform: translate3d(0,0,0) scale(1); }
  to   { transform: translate3d(3vw, 2vw, 0) scale(1.12); }
}
@keyframes gridPan { from { background-position: 0 0; } to { background-position: 46px 46px; } }

/* Hero entrance — children rise & fade in sequence on load. */
.hero-rise > * { opacity: 0; transform: translateY(16px); animation: rise .7s cubic-bezier(.2,.7,.2,1) forwards; }
.hero-rise > *:nth-child(1) { animation-delay: .05s; }
.hero-rise > *:nth-child(2) { animation-delay: .14s; }
.hero-rise > *:nth-child(3) { animation-delay: .23s; }
.hero-rise > *:nth-child(4) { animation-delay: .32s; }
.hero-rise > *:nth-child(5) { animation-delay: .41s; }
.hero-rise > *:nth-child(6) { animation-delay: .50s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* Nav gains a shadow once the page scrolls. */
header.nav { transition: box-shadow .25s ease, background .25s ease; }
header.nav.scrolled { box-shadow: 0 10px 30px rgba(0,0,0,.4); background: rgba(10,14,19,.86); }

/* Stagger children of a revealed grid/steps block. */
.reveal .grid > *, .reveal .steps > * { opacity: 0; transform: translateY(16px); transition: opacity .55s ease, transform .55s ease; }
.reveal.in .grid > *, .reveal.in .steps > * { opacity: 1; transform: none; }

/* Cursor-spotlight + lift on cards. */
.card, .glass { position: relative; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s ease;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 0%), rgba(53,224,161,.14), transparent 60%);
}
.card:hover { transform: translateY(-4px); border-color: var(--line2); box-shadow: 0 18px 44px rgba(0,0,0,.4); }
.card:hover::before { opacity: 1; }
.card .ic { transition: transform .25s ease; }
.card:hover .ic { transform: translateY(-2px) scale(1.06); }

/* Install command: animated glow sweep + copy feedback. */
.install { position: relative; overflow: hidden; }
.install::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 20%, rgba(53,224,161,.14) 50%, transparent 80%);
  transform: translateX(-120%); animation: sweep 5.5s ease-in-out infinite;
}
@keyframes sweep { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.copybtn { transition: color .15s ease, background .15s ease; }
.copybtn.ok { color: var(--accent); border-color: rgba(53,224,161,.5); }

/* Primary button sheen on hover. */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: ""; position: absolute; top: 0; left: -75%; width: 50%; height: 100%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); transition: left .5s ease;
}
.btn-primary:hover::after { left: 125%; }

/* Live-verdict showpiece: evidence lines type in, confidence bar fills, ledger ticks. */
.vline, .vfinal { opacity: 0; transform: translateX(-6px); transition: opacity .4s ease, transform .4s ease; }
.vline.show, .vfinal.show { opacity: 1; transform: none; }
.vline::before { content: "▸ "; color: var(--accent); }
.confbar { height: 6px; border-radius: 999px; background: var(--surface2); overflow: hidden; margin: 10px 0 2px; }
.confbar > i { display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 1.1s cubic-bezier(.2,.7,.2,1); }
.vfinal { color: var(--accent); }
.vfinal .tick { display: inline-block; animation: none; }
.vfinal.show .tick { animation: pop .4s ease; }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* Count-up stat emphasis. */
.count { font-family: var(--display); font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

/* Floating kākāpō mark in the nav — gentle hover bob. */
.brand img { transition: transform .3s ease; }
.brand:hover img { transform: rotate(-6deg) scale(1.08); }

@media (max-width: 820px) {
  .grid.c3, .grid.c2, .steps { grid-template-columns: 1fr; }
  .nav nav { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column;
    background: var(--bg2); border-bottom: 1px solid var(--line); padding: 10px; gap: 2px; }
  .nav nav.open { display: flex; }
  .navtoggle { display: inline-block; }
  .nav nav a { padding: 12px; }
}
/* ---- Interactive triage demo ---- */
.demo h2 { margin-top: 6px; }
.demo-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 18px; margin-top: 26px; align-items: start; }
.demo-alerts { display: flex; flex-direction: column; gap: 12px; }
.alertcard { text-align: left; display: grid; gap: 4px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px; cursor: pointer; color: var(--text); transition: border-color .2s, background .2s, transform .15s; position: relative; }
.alertcard:hover { border-color: var(--line2); transform: translateX(3px); }
.alertcard.active { border-color: var(--accent); background: rgba(53,224,161,.07); }
.alertcard.active::before { content: ""; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--accent); }
.alertcard .at { font-weight: 600; font-size: .98rem; }
.alertcard .am { font-size: .76rem; color: var(--muted); }
.alertcard .sev { justify-self: start; font-family: var(--mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .08em;
  padding: 2px 8px; border-radius: 20px; border: 1px solid; }
.sev.s-high { color: var(--red); border-color: var(--red); }
.sev.s-med { color: var(--amber); border-color: var(--amber); }
.sev.s-low { color: var(--green); border-color: var(--green); }

.demo-console { padding: 20px; min-height: 280px; }
.dc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.dc-badge { transition: color .3s, border-color .3s; }
.pipeline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.pstage { font-family: var(--mono); font-size: .72rem; padding: 3px 9px; border-radius: 7px; border: 1px solid var(--line);
  color: var(--muted); opacity: .5; transition: opacity .3s, color .3s, border-color .3s, background .3s; }
.pstage.active { opacity: 1; color: var(--accent); border-color: var(--accent); background: rgba(53,224,161,.12); animation: pstagePulse .6s ease; }
.pstage.done { opacity: 1; color: var(--text); border-color: var(--line2); }
.pstage.skip { opacity: .25; text-decoration: line-through; }
.parr { color: var(--muted); opacity: .5; font-size: .72rem; }
@keyframes pstagePulse { 0% { transform: scale(1); } 50% { transform: scale(1.12); } 100% { transform: scale(1); } }
.dc-evidence { font-size: .83rem; color: #cfd8e3; line-height: 1.85; margin-top: 6px; min-height: 86px; }
.dc-evidence .vline { display: block; }
.dc-evidence .src { color: var(--accent-2); }
.dc-evidence .tag { color: var(--muted); }
.dc-final { margin-top: 10px; }
.dc-hint { font-size: .74rem; margin-top: 10px; }
.vbadge.v-red { color: var(--red); border-color: var(--red); }
.vbadge.v-amber { color: var(--amber); border-color: var(--amber); }
.vbadge.v-green { color: var(--green); border-color: var(--green); }

/* ---- Interactive 14-agent roster ---- */
.roster h2 { margin-top: 6px; }
.roster-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 18px; margin-top: 26px; align-items: start; }
.rgroup { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 10px 2px 8px; }
.rtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.atile { display: flex; flex-direction: column; gap: 3px; text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 11px; cursor: pointer; color: var(--text); transition: border-color .18s, background .18s, transform .12s; }
.atile:hover { transform: translateY(-2px); border-color: var(--line2); }
.atile.active { border-color: var(--accent); background: rgba(53,224,161,.08); }
.atile .an { font-family: var(--display); font-weight: 600; font-size: 0.92rem; }
.aau { font-family: var(--mono); font-size: 0.6rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-2); }
.aau.warn { color: var(--amber); }

.roster-detail { padding: 20px; min-height: 230px; }
.rd-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rd-name { font-family: var(--display); font-weight: 700; font-size: 1.5rem; }
.rd-role { color: #cfd8e3; margin: 8px 0 14px; }
.rd-k { font-family: var(--mono); font-size: 0.68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }
.rd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rchip { font-family: var(--mono); font-size: 0.72rem; color: #cfd8e3; background: var(--surface2); border: 1px solid var(--line); border-radius: 7px; padding: 3px 8px; }
.rd-legs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rd-legs .leg { font-family: var(--mono); font-size: 0.68rem; padding: 3px 9px; border-radius: 20px; border: 1px dashed var(--line2); color: var(--muted); text-decoration: line-through; opacity: .7; }
.rd-legs .leg.on { border-style: solid; border-color: var(--amber); color: var(--amber); text-decoration: none; opacity: 1; }
.rd-note { margin-top: 12px; font-size: 0.8rem; color: var(--accent); }

@media (max-width: 820px) {
  .demo-grid, .roster-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
  .reveal, .hero-rise > *, .reveal .grid > *, .reveal .steps > * { opacity: 1 !important; transform: none !important; }
  .vline, .vfinal { opacity: 1 !important; transform: none !important; }
  .aurora .grid-lines, .aurora::before, .aurora::after, .install::after { animation: none !important; }
  .btn:hover, .card:hover, .alertcard:hover { transform: none; }
}
