/* CADC shared design system */
:root {
  --bg: #070b12;
  --bg-2: #0b111b;
  --panel: rgba(17, 24, 36, .72);
  --panel-solid: #111824;
  --panel-2: #0c131d;
  --border: rgba(148, 178, 214, .12);
  --border-strong: rgba(148, 178, 214, .22);
  --text: #e8eef6;
  --text-2: #b4c2d3;
  --muted: #7f90a6;
  --accent: #4cc2ff;
  --accent-2: #8b7bff;
  --accent-3: #ff7ab8;
  --grad: linear-gradient(135deg, #4cc2ff 0%, #8b7bff 55%, #ff7ab8 100%);
  --benign: #34d399;
  --warn: #fbbf24;
  --malignant: #f87171;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .45);
  --maxw: 1240px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(76, 194, 255, .13), transparent 60%),
    radial-gradient(800px 520px at 100% 0%, rgba(139, 123, 255, .12), transparent 55%),
    radial-gradient(700px 500px at 50% 110%, rgba(255, 122, 184, .07), transparent 60%);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
img { max-width: 100%; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(7, 11, 18, .72); backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-weight: 700; letter-spacing: .2px; }
.brand:hover { text-decoration: none; }
.logo {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: var(--grad); box-shadow: 0 6px 22px rgba(76, 194, 255, .35);
}
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; letter-spacing: 0; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  color: var(--text-2); padding: 8px 14px; border-radius: 10px; font-size: 15px; font-weight: 500;
}
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, .05); text-decoration: none; }
.nav-links a.active { color: var(--text); background: rgba(76, 194, 255, .1); }
.nav-cta { margin-left: 8px; }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
@media (max-width: 880px) {
  .menu-btn { display: inline-flex; }
  .nav-links {
    display: none; position: absolute; left: 0; right: 0; top: 68px; flex-direction: column; gap: 2px;
    background: rgba(7, 11, 18, .97); border-bottom: 1px solid var(--border); padding: 10px 16px 16px;
  }
  .nav-links.open { display: flex; }
  .btn.nav-cta { display: none; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 15px;
  border: 1px solid var(--border-strong); background: rgba(255, 255, 255, .04); color: var(--text);
  transition: transform .15s, background .15s, border-color .15s, box-shadow .15s, filter .15s;
}
.btn:hover { text-decoration: none; background: rgba(255, 255, 255, .08); border-color: rgba(148, 178, 214, .35); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad); border: 0; color: #060a12; box-shadow: 0 8px 28px rgba(76, 194, 255, .28); }
.btn.primary:hover { filter: brightness(1.08); box-shadow: 0 10px 34px rgba(139, 123, 255, .38); }
.btn.lg { padding: 14px 24px; font-size: 16px; border-radius: 14px; }
.btn.sm { padding: 7px 12px; font-size: 13.5px; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; box-shadow: none; }

/* ---------- surfaces ---------- */
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); backdrop-filter: blur(10px);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: .2px; }
.card-body { padding: 20px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: rgba(255, 255, 255, .03); font-size: 13px; color: var(--text-2);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--benign); box-shadow: 0 0 10px var(--benign); }
.dot.bad { background: var(--malignant); }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12.5px; font-weight: 600; color: var(--accent); }

/* ---------- sections ---------- */
section.block { padding: 72px 0; }
.section-head { max-width: 760px; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.15; margin: 10px 0 12px; letter-spacing: -.02em; }
.section-head p { color: var(--text-2); margin: 0; font-size: 17px; }
.grid { display: grid; gap: 20px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .grid.c3, .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; } section.block { padding: 52px 0; } }

.feature { padding: 22px; }
.feature .ic {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px;
  background: rgba(76, 194, 255, .1); color: var(--accent); border: 1px solid rgba(76, 194, 255, .2);
}
.feature h3 { margin: 0 0 6px; font-size: 17px; }
.feature p { margin: 0; color: var(--text-2); font-size: 15px; }

.stat { padding: 20px 22px; }
.stat .v { font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: 13.5px; margin-top: 4px; }

/* ---------- alerts ---------- */
.alert {
  display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; border-radius: var(--radius-sm);
  border: 1px solid rgba(251, 191, 36, .35); background: linear-gradient(90deg, rgba(251, 191, 36, .1), rgba(251, 191, 36, .03));
  color: #fde9b8; font-size: 14.5px;
}
.alert svg { flex: none; color: var(--warn); margin-top: 2px; }
.alert b { color: #fff3d6; }
.alert.danger { border-color: rgba(248, 113, 113, .4); background: linear-gradient(90deg, rgba(248, 113, 113, .12), rgba(248, 113, 113, .03)); color: #fecaca; }
.alert.danger svg { color: var(--malignant); }
.alert.info { border-color: rgba(76, 194, 255, .35); background: linear-gradient(90deg, rgba(76, 194, 255, .1), rgba(76, 194, 255, .03)); color: #cfeeff; }
.alert.info svg { color: var(--accent); }

/* ---------- consent modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 16px;
  background: rgba(3, 6, 10, .78); backdrop-filter: blur(6px);
}
.modal-backdrop.on { display: grid; animation: fade .25s ease both; }
.modal {
  width: min(560px, 100%); background: var(--panel-solid); border: 1px solid var(--border-strong);
  border-radius: 22px; box-shadow: 0 30px 90px rgba(0, 0, 0, .6); padding: 28px; animation: rise .3s ease both;
}
.modal h2 { margin: 12px 0 8px; font-size: 23px; letter-spacing: -.01em; }
.modal ul { margin: 12px 0 18px; padding-left: 20px; color: var(--text-2); font-size: 15px; }
.modal li { margin: 6px 0; }
.modal .badge {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center;
  background: rgba(251, 191, 36, .12); color: var(--warn); border: 1px solid rgba(251, 191, 36, .35);
}
.check { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel-2); cursor: pointer; font-size: 14.5px; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- footer ---------- */
footer.site { border-top: 1px solid var(--border); margin-top: 40px; padding: 36px 0 44px; color: var(--muted); font-size: 14px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.foot-grid h4 { color: var(--text); margin: 0 0 10px; font-size: 14px; }
.foot-grid a { display: block; color: var(--muted); margin: 5px 0; }
.foot-grid a:hover { color: var(--text); }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-warn { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 13px; line-height: 1.6; }

/* ---------- misc ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } * { animation: none !important; } }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid #23324a; border-top-color: var(--accent); animation: spin .9s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; transition: .25s; pointer-events: none;
  background: #2a1519; border: 1px solid rgba(248, 113, 113, .5); color: #fecaca; padding: 12px 18px; border-radius: 12px; z-index: 120; max-width: 90vw;
}
.toast.on { opacity: 1; transform: translateX(-50%); }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
table.data th { color: var(--muted); font-weight: 600; font-size: 13px; }
table.data td.num, table.data th.num { text-align: right; }
details.more { margin-top: 12px; }
details.more summary { cursor: pointer; color: var(--muted); font-size: 13.5px; }

/* page hero (inner pages) */
.page-hero { padding: 56px 0 24px; }
.page-hero h1 { font-size: clamp(32px, 4.4vw, 52px); line-height: 1.08; letter-spacing: -.03em; margin: 12px 0 14px; }
.page-hero p { color: var(--text-2); font-size: 18px; max-width: 720px; margin: 0; }

/* ---------- 3D viewer ---------- */
.stage3d { position: relative; width: 100%; height: 100%; min-height: 320px; cursor: grab; touch-action: pan-y; }
.stage3d:active { cursor: grabbing; }
.hotspot {
  position: absolute; left: 0; top: 0; pointer-events: auto; display: flex; align-items: center; gap: 7px;
  background: none; border: 0; padding: 0; margin: -7px 0 0 -7px; transition: opacity .2s;
}
.hs-dot {
  width: 14px; height: 14px; border-radius: 50%; background: var(--accent); flex: none;
  box-shadow: 0 0 0 4px rgba(76, 194, 255, .22), 0 0 16px var(--accent); animation: hsPulse 2.2s ease-in-out infinite;
}
.hs-label {
  font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  background: rgba(7, 11, 18, .82); border: 1px solid var(--border-strong); color: var(--text-2);
}
.hotspot:hover .hs-label { color: var(--text); border-color: var(--accent); }
.hotspot.on .hs-label { color: #060a12; background: var(--grad); border-color: transparent; }
@keyframes hsPulse { 50% { box-shadow: 0 0 0 8px rgba(76, 194, 255, 0), 0 0 22px var(--accent); } }

/* stage selector */
.stages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 14px; padding: 5px; }
.stages button { border: 0; background: transparent; color: var(--muted); padding: 9px 4px; border-radius: 10px; font-weight: 600; font-size: 13.5px; }
.stages button:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.stages button.on { background: var(--grad); color: #060a12; }

/* hero */
.hero { padding: 40px 0 20px; }
.hero-grid { display: grid; grid-template-columns: 1.02fr 1fr; gap: 28px; align-items: center; min-height: 600px; }
.hero h1 { font-size: clamp(38px, 5.4vw, 66px); line-height: 1.03; letter-spacing: -.035em; margin: 16px 0 18px; }
.hero p.lead { font-size: 19px; color: var(--text-2); max-width: 560px; margin: 0 0 28px; }
.hero-3d { height: 600px; position: relative; }
.hero-3d::before {
  content: ""; position: absolute; inset: 8% 6%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(139, 123, 255, .22), rgba(76, 194, 255, .08) 60%, transparent);
  filter: blur(10px); z-index: -1;
}
.hero-hint { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); }
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; min-height: 0; } .hero-3d { height: 440px; } }
@media (max-width: 520px) { .hero-3d { height: 380px; } }

/* steps / pipeline */
.pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: step; }
.pipeline .card { padding: 22px; position: relative; }
.pipeline .n { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.pipeline h3 { margin: 8px 0 6px; font-size: 17px; }
.pipeline p { margin: 0; color: var(--text-2); font-size: 14.5px; }
@media (max-width: 980px) { .pipeline { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .pipeline { grid-template-columns: 1fr; } }

/* prose */
.prose h3 { font-size: 20px; margin: 0 0 10px; }
.prose p, .prose li { color: var(--text-2); }
.prose ul { padding-left: 20px; margin: 10px 0; }
.prose li { margin: 6px 0; }
.list-check { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.list-check li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); }
.list-check li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: rgba(76, 194, 255, .1); color: var(--accent); border: 1px solid rgba(76, 194, 255, .25); }
.stage-row { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.stage-row:last-child { border-bottom: 0; }
.stage-row b.s { font-size: 18px; }
@media (max-width: 560px) { .stage-row { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- AI assistant ---------- */
.chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 90; display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 18px 13px 15px; border-radius: 999px; border: 0; background: var(--grad); color: #060a12; font-weight: 700; font-size: 15px;
  box-shadow: 0 12px 36px rgba(76, 194, 255, .35), 0 0 0 1px rgba(255, 255, 255, .12) inset; transition: transform .2s, opacity .2s;
}
.chat-fab:hover { transform: translateY(-2px); }
.chat-fab.hide { opacity: 0; pointer-events: none; transform: scale(.9); }
.chat-fab.off { filter: grayscale(.8) brightness(.7); }
.chat-panel {
  position: fixed; right: 22px; bottom: 22px; z-index: 95; width: min(410px, calc(100vw - 32px)); height: min(640px, calc(100vh - 110px));
  display: flex; flex-direction: column; background: rgba(12, 18, 28, .97); border: 1px solid var(--border-strong); border-radius: 22px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .6); backdrop-filter: blur(14px); opacity: 0; pointer-events: none;
  transform: translateY(14px) scale(.98); transform-origin: bottom right; transition: opacity .22s, transform .22s;
}
.chat-panel.on { opacity: 1; pointer-events: auto; transform: none; }
@media (max-width: 560px) { .chat-panel { right: 8px; left: 8px; bottom: 8px; width: auto; height: calc(100vh - 90px); } .chat-fab span { display: none; } .chat-fab { padding: 14px; } }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; border-bottom: 1px solid var(--border); }
.chat-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text-2); }
.chat-icon:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.55; overflow-wrap: anywhere; }
.msg p { margin: 0 0 8px; } .msg p:last-child { margin: 0; }
.msg ul, .msg ol { margin: 4px 0 8px; padding-left: 20px; } .msg li { margin: 3px 0; }
.msg code { font-family: var(--mono); font-size: 12.5px; background: rgba(255, 255, 255, .07); padding: 1px 5px; border-radius: 5px; }
.msg.user { align-self: flex-end; background: linear-gradient(135deg, rgba(76, 194, 255, .22), rgba(139, 123, 255, .22)); border: 1px solid rgba(76, 194, 255, .3); border-bottom-right-radius: 5px; }
.msg.assistant { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--border); border-bottom-left-radius: 5px; color: var(--text); }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.chat-suggest { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 10px; }
.chat-suggest .chip { border: 1px solid var(--border-strong); background: rgba(76, 194, 255, .06); color: var(--text-2); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.chat-suggest .chip:hover { color: var(--text); border-color: var(--accent); }
.chat-form { display: flex; gap: 8px; align-items: flex-end; margin: 0 12px; padding: 8px; border-radius: 16px; border: 1px solid var(--border-strong); background: var(--panel-2); }
.chat-form:focus-within { border-color: var(--accent); }
.chat-form textarea { flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: var(--text); font: 14.5px/1.5 var(--font); padding: 6px 6px; max-height: 120px; }
.chat-send { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; border: 0; background: var(--grad); color: #060a12; }
.chat-send:disabled { opacity: .5; }
.chat-foot { color: var(--muted); padding: 8px 16px 12px; line-height: 1.45; }
@media print { .chat-fab, .chat-panel { display: none !important; } }
