/* ============================================================================
   CORTEX — deck visuals lifted from the pilot deck
   cost→asset flywheel (.c2), endpoint-sensor orbit (.cdwrap), knowledge graph
   (.wkwin + .wkask). Pilot-deck design tokens are scoped to .deckviz so they
   flip with [data-theme] and never leak into the landing token set.
   ============================================================================ */

.deckviz {
  color: var(--fg);
  --bg: #0c111d;
  --panel: rgba(15, 22, 38, 0.6);
  --panel-2: rgba(20, 28, 44, 0.7);
  --inset: rgba(12, 17, 29, 0.55);
  --win: #0c111d;
  --fg: #f2f4f7;
  --fg-strong: #fcfcfd;
  --fg-muted: #98a2b3;
  --fg-quiet: #667488;
  --fg-faint: #475467;
  --border: #1e2a3c;
  --border-2: #25354b;
  --border-bright: rgba(101, 137, 158, 0.36);
  --primary: #2D6AE7;
  --primary-soft: rgba(45, 106, 231, 0.14);
  --primary-line: rgba(45, 106, 231, 0.32);
  --affirm: #3dd68c;
  --affirm-soft: rgba(61, 214, 140, 0.08);
  --affirm-line: rgba(61, 214, 140, 0.24);
  --caution: #f5a524;
  --caution-soft: rgba(245, 165, 36, 0.1);
  --caution-line: rgba(245, 165, 36, 0.28);
  --deny: #f2667c;
  --deny-soft: rgba(242, 102, 124, 0.1);
  --deny-line: rgba(242, 102, 124, 0.28);
  --agent: #b084ec;
  --mono: var(--font-mono);
  --display: var(--font-secondary);
}
:root[data-theme="light"] .deckviz {
  --bg: #ffffff;
  --panel: #f7fafc;
  --panel-2: #ffffff;
  --inset: #f1f5f9;
  --win: #ffffff;
  --fg: #16202e;
  --fg-strong: #0b1018;
  --fg-muted: #51607a;
  --fg-quiet: #7a8a9c;
  --fg-faint: #a7b3c0;
  --border: #e6ecf2;
  --border-2: #d7e0e9;
  --border-bright: rgba(101, 137, 158, 0.42);
  --primary: #2D6AE7;
  --primary-soft: #eaf1fd;
  --primary-line: #c9dcfa;
  --affirm: #0e9c6e;
  --affirm-soft: #e4f4ee;
  --affirm-line: #bbe3d3;
  --caution: #b57514;
  --caution-soft: #f9efdd;
  --caution-line: #ecd6ae;
  --deny: #d6374e;
  --deny-soft: #fbe7ea;
  --deny-line: #f2c4cc;
  --agent: #7a47c9;
}
/* mono logos (openai / grok / github / x) recolor with the page theme */
.deckviz .mono-logo {
  filter: var(--logo-filter);
}
.deckviz img {
  display: block;
}

/* ─────────────────────────────────────────────────────────────────────────
   COST → ASSET → ARTIFACTS  (.c2)
   ───────────────────────────────────────────────────────────────────────── */
.c2 {
  display: flex;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  margin: 0 auto;
  gap: 0;
}
.c2stage {
  flex: 1;
  border: 1px solid var(--border-2);
  border-radius: 14px;
  background: var(--panel);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.c2stage.asset {
  flex: 1.12;
}
.c2k {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.c2t {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--fg-strong);
  line-height: 1.06;
  margin-top: 3px;
}
.c2stage.cost {
  border-color: var(--deny-line);
  background:
    linear-gradient(180deg, var(--deny-soft), transparent 70%), var(--panel);
}
.c2stage.cost .c2k {
  color: var(--deny);
}
.c2stage.asset {
  border-color: var(--primary-line);
  background:
    linear-gradient(180deg, var(--primary-soft), transparent 62%), var(--panel);
  box-shadow: 0 24px 60px rgba(45, 106, 231, 0.18);
}
.c2stage.asset .c2k {
  color: var(--primary);
}
.c2stage.art {
  border-color: var(--affirm-line);
  background:
    linear-gradient(180deg, var(--affirm-soft), transparent 70%), var(--panel);
}
.c2stage.art .c2k {
  color: var(--affirm);
}
.c2arrow {
  flex: none;
  width: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--fg-faint);
}
.c2arrow svg {
  width: 34px;
  height: 34px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--primary);
}
.c2arrow .lbl {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.4;
  color: var(--fg-quiet);
}
@media (max-width: 880px) {
  .c2 {
    flex-direction: column;
  }
  .c2arrow {
    width: 100%;
    flex-direction: row;
    padding: 10px 0;
  }
  .c2arrow svg {
    transform: rotate(90deg);
  }
}
.costviz {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex: 1;
  min-height: 170px;
  margin-top: 6px;
}
.costviz .mc {
  flex: 1;
  border: 1px dashed var(--deny-line);
  border-radius: 10px;
  padding: 14px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.costviz .mc .dol {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 500;
  color: var(--deny);
  line-height: 1;
}
.costviz .mc .mo {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--fg-quiet);
}
.assetviz {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  flex: 1;
  min-height: 170px;
  margin-top: 6px;
}
.assetviz .ab {
  flex: 1;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #6e98f0, var(--primary));
  height: var(--h);
}
.deckviz[data-deck-active] .assetviz .ab {
  animation: c2grow 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.deckviz[data-deck-active] .assetviz .ab:nth-child(1) {
  animation-delay: 0.05s;
}
.deckviz[data-deck-active] .assetviz .ab:nth-child(2) {
  animation-delay: 0.13s;
}
.deckviz[data-deck-active] .assetviz .ab:nth-child(3) {
  animation-delay: 0.21s;
}
.deckviz[data-deck-active] .assetviz .ab:nth-child(4) {
  animation-delay: 0.29s;
}
.deckviz[data-deck-active] .assetviz .ab:nth-child(5) {
  animation-delay: 0.37s;
}
.deckviz[data-deck-active] .assetviz .ab:nth-child(6) {
  animation-delay: 0.45s;
}
@keyframes c2grow {
  from {
    height: 0;
  }
  to {
    height: var(--h);
  }
}
@media (prefers-reduced-motion: reduce) {
  .deckviz[data-deck-active] .assetviz .ab {
    animation: none;
  }
}
.c2pill {
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-line);
  padding: 6px 12px;
  border-radius: 9999px;
}
.artlist {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  justify-content: space-between;
  margin-top: 6px;
}
.artrow {
  display: flex;
  align-items: center;
  gap: 13px;
}
.artrow .ai {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--affirm-soft);
  border: 1px solid var(--affirm-line);
  color: var(--affirm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.artrow .ai svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.artrow .at {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg-strong);
  line-height: 1.18;
}
.artrow .at span {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--fg-muted);
}

/* ─────────────────────────────────────────────────────────────────────────
   ENDPOINT-SENSOR ORBIT  (.cdwrap)
   ───────────────────────────────────────────────────────────────────────── */
.cdwrap {
  position: relative;
  width: 720px;
  height: 540px;
  margin: 0 auto;
  /* Design box stays 720×540 (nodes use absolute px). Parent clips;
     mobile scale-to-fit below. Do not max-width:100% — that shrinks the
     layout box while content stays at 720 coords and flags as truncated. */
}

/* Contain scaled orbit so layout width never becomes page-level overflow */
.deckviz:has(> .cdwrap) {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  container-type: inline-size;
  container-name: deck-orbit;
}
.cdfield {
  position: absolute;
  inset: 0;
}
.cdlines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.cdlines line {
  stroke: var(--primary);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.42;
}
.cdlines .cdring {
  fill: none;
  stroke: var(--border-bright);
  stroke-width: 1.4;
  stroke-dasharray: 3 6;
  opacity: 0.55;
}
.cdpkt {
  fill: var(--primary);
}
@media (prefers-reduced-motion: reduce) {
  .cdpkt {
    display: none;
  }
}
.cdnode {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.cdnode .ct {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  border-radius: 40px;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  backdrop-filter: blur(14px);
}
.cdnode .ct .tlogo {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cdnode .ct .tlogo img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}
.cdnode .ct .tn {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--fg-strong);
  white-space: nowrap;
}
.cdnode .cm {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-quiet);
}
.cdhub {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
}
.cdhub .hc {
  width: 92px;
  height: 92px;
  border-radius: 24px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 10px var(--primary-soft),
    0 22px 60px rgba(45, 106, 231, 0.38);
  position: relative;
}
.cdhub .hc img {
  width: 50px;
  height: 50px;
}
.cdhub .hc::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 32px;
  border: 1.5px solid var(--primary-line);
}
.deckviz[data-deck-active] .cdhub .hc::before {
  animation: cdpulse 2.6s ease-out infinite;
}
@keyframes cdpulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.22);
    opacity: 0;
  }
}
.cdhub .hn {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary);
}
@keyframes cdbob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-9px);
  }
}
.deckviz[data-deck-active] .cdnode .ct {
  animation: cdbob var(--dur, 3.2s) ease-in-out infinite;
  animation-delay: var(--d, 0s);
  will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
  .deckviz[data-deck-active] .cdnode .ct {
    animation: none;
  }
  .cdhub .hc::before {
    animation: none;
  }
}
/* F4 — scale entire orbit to fit container on tablet/mobile.
   Uses cqi so scale tracks parent width; negative margins collapse the
   unused post-scale layout space (transform does not shrink the box).
   !important beats landing.js inline fitScale so CSS is the single source. */
@media (max-width: 900px) {
  .cdwrap {
    width: 720px !important;
    height: 540px !important;
    max-width: none !important;
    transform: scale(min(1, calc(100cqi / 720))) !important;
    transform-origin: top left !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: calc(720px * (min(1, 100cqi / 720) - 1)) !important;
    margin-bottom: calc(540px * (min(1, 100cqi / 720) - 1)) !important;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   KNOWLEDGE GRAPH — profile (.wkwin) + Ask Cortex (.wkask)
   ───────────────────────────────────────────────────────────────────────── */
.wkwin,
.wkask {
  border: 1px solid var(--border-2);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.wkbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--inset);
}
.wkdots {
  display: flex;
  gap: 6px;
}
.wkdots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-bright);
}
.wkdots i:nth-child(1) {
  background: #ef6b5f;
}
.wkdots i:nth-child(2) {
  background: #f4bf51;
}
.wkdots i:nth-child(3) {
  background: #61c454;
}
.wkurl {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg-quiet);
}
.wkurl b {
  color: var(--fg-strong);
  font-weight: 600;
}
.wkbody {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}
.wkhead {
  display: flex;
  align-items: center;
  gap: 13px;
}
.wkav {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2D6AE7, #7a3ff2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  flex: none;
}
.wknm {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wknm b {
  font-size: 20px;
  font-weight: 600;
  color: var(--fg-strong);
  line-height: 1.05;
}
.wknm span {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--fg-quiet);
}
.wkstatus {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--affirm);
  background: var(--affirm-soft);
  border: 1px solid var(--affirm-line);
  padding: 6px 11px;
  border-radius: 9999px;
}
.wkstatus .d {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--affirm);
}
.wktiles {
  display: grid;
  grid-template-columns: 1fr 1fr 1.1fr;
  gap: 10px;
}
.wktile {
  border: 1px solid var(--border-2);
  border-radius: 4px;
  background: var(--inset);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}
:root[data-theme="light"] .wktile {
  background: #f9fafb;
}

.wktile b {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  color: var(--fg-strong);
  letter-spacing: -0.01em;
  line-height: 1;
}
.wktile span,
.wktile .wkl {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-quiet);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.wktile .wkpz {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-top: 3px;
}
.wkpz img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 4px;
}
.wkgrp {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.wkgl {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.wkrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--panel-2);
}
.wkrn {
  font-size: 15px;
  font-weight: 500;
  color: var(--fg-strong);
}
.wkpill {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 5px 11px;
  border-radius: 9999px;
  white-space: nowrap;
}
.wkpill.prog {
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-line);
}
.wkpill.done {
  color: var(--affirm);
  background: var(--affirm-soft);
  border: 1px solid var(--affirm-line);
}
.wkexp {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.wkchip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-strong);
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  padding: 8px 14px;
  border-radius: 9999px;
}
.wkmeter {
  display: inline-flex;
  gap: 2px;
}
.wkmeter i {
  width: 5px;
  height: 12px;
  border-radius: 1.5px;
  background: var(--border-bright);
}
.wkmeter.h i {
  background: var(--affirm);
}
.wkmeter.m i:nth-child(-n + 2) {
  background: var(--caution);
}
.wkrisk {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 3px;
  padding: 11px 14px;
  border-radius: 4px;
  background: var(--caution-soft);
  border: 1px solid var(--caution-line);
  color: var(--caution);
  font-size: 14px;
  font-weight: 600;
}
.wkrisk svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.wkask-h {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-strong);
  background: var(--inset);
}
.wkask-ic {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.wkask-ic img {
  width: 60%;
  height: 60%;
}
.wkask-st {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--affirm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.wkask-st::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--affirm);
}
.wkask-body {
  flex: 1;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
}
.wkmsg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.wkmsg.user {
  flex-direction: row-reverse;
}
.wkmav {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
}
.wkmav.u {
  background: var(--win);
  border: 1px solid var(--border-2);
  color: var(--fg-muted);
}
.wkmav.b {
  background: var(--primary);
}
.wkmav.b img {
  width: 58%;
  height: 58%;
}
.wkbub {
  font-size: 15px;
  line-height: 1.5;
  padding: 12px 15px;
  border-radius: 4px;
  max-width: 84.5%;
}
.wkbub.q {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.wkbub.a {
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  color: var(--fg);
  border-bottom-left-radius: 5px;
}
.wkbub.a b {
  color: var(--fg-strong);
  font-weight: 600;
}
.wkchips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 11px 0;
}
.wkcc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-muted);
  border: 1px solid var(--border-2);
  padding: 5px 10px;
  border-radius: 4px;
}
.wkcc img {
  width: 14px;
  height: 14px;
  object-fit: contain;
}
.wkneg {
  color: var(--caution);
  font-weight: 600;
}
.wkask-input {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}
.wkbox {
  flex: 1;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--fg-quiet);
}
.wksend {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.wksend svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.kg-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
  margin-top: 8px;
}
@media (max-width: 900px) {
  .kg-split {
    grid-template-columns: 1fr;
  }
}
