/* MedXT AI - Global Stylesheet - Single Source of Truth for brand design tokens */
:root {
  --bg: #071e34;
  --bg-2: #0a2540;
  --bg-3: #0e2f4f;
  --panel: #0c2a47;
  --line: rgba(0, 194, 179, 0.16);
  --cyan: #00c2b3;
  --cyan-dim: #00a79a;
  --blue: #1a8cff;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --text: #e8eefc;
  --muted: #93a4c3;
  --radius: 14px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --glow: 0 0 26px rgba(26, 140, 255, 0.3);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(5, 10, 24, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { max-width: 1400px; }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; gap: 28px; height: 68px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.25rem; color: var(--text); letter-spacing: 0.3px; flex-shrink: 0; white-space: nowrap; }
.brand .logo-img { height: 26px; width: auto; display: inline-block; }
.brand .ai-tag { color: var(--cyan); font-size: 1.15rem; font-weight: 800; letter-spacing: 0.06em; align-self: flex-end; line-height: 1; margin-bottom: 1px; }
.brand:hover { text-decoration: none; }
.brand .logo-mark { width: 34px; height: 34px; }
.brand em { font-style: normal; color: var(--cyan); }
.nav-links { display: flex; align-items: center; gap: 20px; list-style: none; flex-wrap: nowrap; }
.nav-links a { color: var(--muted); font-size: 0.88rem; font-weight: 500; white-space: nowrap; }
.nav-links a:hover, .nav-links a.active { color: var(--cyan); text-decoration: none; }
.nav-cta {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #04121f !important; font-weight: 700 !important;
  padding: 9px 16px; border-radius: 10px; white-space: nowrap;
}
.nav-cta:hover { filter: brightness(1.1); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--cyan); font-size: 1.3rem; border-radius: 8px; padding: 4px 12px; cursor: pointer; }
@media (max-width: 1230px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 10px 24px 18px;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 11px 0; font-size: 1rem; }
}

/* Hero */
.hero {
  position: relative; overflow: hidden;
  padding: 96px 0 84px;
  background:
    radial-gradient(ellipse 60% 50% at 70% 10%, rgba(26, 140, 255, 0.16), transparent),
    radial-gradient(ellipse 50% 40% at 20% 90%, rgba(0, 194, 179, 0.10), transparent),
    var(--bg);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(0,194,179,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(0,194,179,.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
}
.hero .container { position: relative; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.15; font-weight: 800; max-width: 820px; }
.hero h1 .accent { color: var(--cyan); }
.hero p.lede { margin-top: 18px; font-size: 1.15rem; color: var(--muted); max-width: 680px; }
.hero-ctas { margin-top: 30px; display: flex; gap: 14px; flex-wrap: wrap; }
.eyebrow {
  display: inline-block; margin-bottom: 16px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cyan); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
  background: rgba(0, 194, 179, 0.06);
}

/* Buttons */
.btn {
  display: inline-block; padding: 13px 26px; border-radius: 11px;
  font-weight: 700; font-size: 0.98rem; cursor: pointer; border: none;
  transition: transform 0.15s, filter 0.15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--blue), var(--cyan)); color: #04121f; box-shadow: var(--glow); }
.btn-primary:hover { filter: brightness(1.12); }
.btn-ghost { background: transparent; color: var(--cyan); border: 1px solid var(--cyan); }
.btn-ghost:hover { background: rgba(0, 194, 179, 0.08); }

/* Sections */
section.block { padding: 76px 0; }
section.block.alt { background: var(--bg-2); }
.section-head { max-width: 760px; margin: 0 auto 46px; text-align: center; }
.section-head h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 800; }
.section-head p { margin-top: 12px; color: var(--muted); font-size: 1.05rem; }

/* Cards */
.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.card:hover { transform: translateY(-3px); border-color: rgba(0, 194, 179, 0.45); box-shadow: var(--glow); }
.card .icon { font-size: 1.7rem; margin-bottom: 14px; width: 52px; height: 52px; display: grid; place-items: center; background: rgba(0, 194, 179, 0.08); border: 1px solid var(--line); border-radius: 12px; }
.card h3 { font-size: 1.08rem; font-weight: 700; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 0.93rem; }
.card a.more { display: inline-block; margin-top: 12px; font-weight: 600; font-size: 0.9rem; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 800px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { text-align: center; padding: 24px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.stat .num { font-size: 2rem; font-weight: 800; color: var(--blue); }
.stat .label { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.cmp { width: 100%; border-collapse: collapse; min-width: 640px; background: var(--panel); }
table.cmp th, table.cmp td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); font-size: 0.94rem; }
table.cmp th { background: var(--bg-3); color: var(--cyan); font-weight: 700; }
table.cmp tr:last-child td { border-bottom: none; }
table.cmp .no { color: var(--red); font-weight: 600; }
table.cmp .yes { color: var(--green); font-weight: 600; }

/* FAQ accordion */
.faq-tabs { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 34px; }
.faq-tab { background: var(--panel); border: 1px solid var(--line); color: var(--muted); padding: 9px 18px; border-radius: 999px; cursor: pointer; font-size: 0.9rem; font-weight: 600; font-family: var(--font); }
.faq-tab.active, .faq-tab:hover { color: #04121f; background: var(--cyan); border-color: var(--cyan); }
.faq-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.faq-q { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 22px; background: none; border: none; color: var(--text); font-family: var(--font); font-size: 1rem; font-weight: 600; text-align: left; cursor: pointer; }
.faq-q .chev { color: var(--cyan); transition: transform 0.2s; flex-shrink: 0; }
.faq-item.open .faq-q .chev { transform: rotate(180deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; color: var(--muted); font-size: 0.95rem; }
.faq-item.open .faq-a { max-height: 420px; }
.faq-a p { padding: 0 22px 20px; }

/* Layers (11-layer stack) */
.layer-stack { display: flex; flex-direction: column; gap: 8px; max-width: 820px; margin: 0 auto; }
.layer {
  display: flex; align-items: baseline; gap: 16px; padding: 15px 22px;
  background: linear-gradient(90deg, rgba(0, 194, 179, 0.07), var(--panel) 40%);
  border: 1px solid var(--line); border-radius: 10px;
}
.layer:hover { border-color: rgba(0, 194, 179, 0.5); }
.layer .n { font-family: var(--mono); color: var(--cyan); font-weight: 700; font-size: 0.85rem; min-width: 30px; }
.layer .t { font-weight: 700; min-width: 210px; }
.layer .d { color: var(--muted); font-size: 0.88rem; }
@media (max-width: 700px) { .layer { flex-direction: column; gap: 4px; } .layer .t { min-width: 0; } }

/* Steps */
.steps { counter-reset: step; display: grid; gap: 18px; grid-template-columns: repeat(2, 1fr); }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding: 26px 26px 26px 76px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 22px; top: 24px;
  width: 38px; height: 38px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--blue), var(--cyan)); color: #04121f;
  font-weight: 800; border-radius: 10px;
}
.step h3 { font-size: 1.05rem; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 0.92rem; }

/* Demo UI */
.demo-shell { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.demo-shell h3 { margin-bottom: 6px; }
.demo-shell .hint { color: var(--muted); font-size: 0.9rem; margin-bottom: 18px; }
textarea.demo-input, input.demo-input, select.demo-input {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 13px 15px;
  font-family: var(--mono); font-size: 0.88rem; resize: vertical;
}
textarea.demo-input:focus, input.demo-input:focus { outline: none; border-color: var(--cyan); }
.demo-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.mono-out {
  font-family: var(--mono); font-size: 0.78rem; background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 15px;
  word-break: break-all; white-space: pre-wrap; color: var(--muted);
  max-height: 260px; overflow-y: auto;
}
.mono-out .k { color: var(--cyan); }
.mono-out .ok { color: var(--green); }
.mono-out .bad { color: var(--red); }
.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; }
.badge.live { background: rgba(34, 197, 94, 0.14); color: var(--green); border: 1px solid rgba(34, 197, 94, 0.4); }
.badge.cyan { background: rgba(0, 194, 179, 0.1); color: var(--cyan); border: 1px solid var(--line); }
.badge.amber { background: rgba(245, 158, 11, 0.12); color: var(--amber); border: 1px solid rgba(245, 158, 11, 0.4); }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; background: var(--bg); color: var(--text); font-family: var(--font);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 0.95rem;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--cyan); }
.field.full { grid-column: 1 / -1; }

/* CTA band */
.cta-band {
  text-align: center; padding: 70px 24px; border-radius: 20px;
  background: radial-gradient(ellipse 70% 100% at 50% 0%, rgba(26, 140, 255, 0.16), transparent), var(--bg-3);
  border: 1px solid var(--line);
}
.cta-band h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; }
.cta-band p { color: var(--muted); margin: 12px auto 26px; max-width: 560px; }

/* Prose (legal, articles) */
.prose { max-width: 780px; margin: 0 auto; }
.prose h2 { font-size: 1.4rem; margin: 38px 0 12px; }
.prose h3 { font-size: 1.1rem; margin: 26px 0 10px; }
.prose p, .prose li { color: var(--muted); font-size: 0.97rem; margin-bottom: 12px; }
.prose ul, .prose ol { padding-left: 24px; margin-bottom: 14px; }
.prose strong { color: var(--text); }

/* Footer */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--line); padding: 56px 0 28px; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 36px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--cyan); margin-bottom: 14px; }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 9px; }
.site-footer a { color: var(--muted); font-size: 0.92rem; }
.site-footer a:hover { color: var(--cyan); }
.footer-about p { color: var(--muted); font-size: 0.92rem; margin-top: 12px; max-width: 320px; }
.footer-bottom { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 0.84rem; }

/* PQ Audit widget */
#pq-audit-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 10px 16px; cursor: pointer;
  font-family: var(--font); font-size: 0.82rem; font-weight: 600;
  box-shadow: var(--shadow);
}
#pq-audit-fab .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }
#pq-audit-fab .count { color: var(--cyan); font-family: var(--mono); }
#pq-audit-panel {
  position: fixed; right: 20px; bottom: 74px; z-index: 200;
  width: min(430px, calc(100vw - 40px)); max-height: 65vh; overflow: hidden;
  display: none; flex-direction: column;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
#pq-audit-panel.open { display: flex; }
#pq-audit-panel header { padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; position: static; background: none; }
#pq-audit-panel header strong { font-size: 0.92rem; }
#pq-audit-panel header small { display: block; color: var(--muted); font-size: 0.74rem; }
#pq-audit-log { overflow-y: auto; padding: 10px 14px; font-family: var(--mono); font-size: 0.72rem; }
.audit-entry { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: var(--bg); }
.audit-entry .ae-top { display: flex; justify-content: space-between; gap: 8px; color: var(--text); }
.audit-entry .ae-act { color: var(--cyan); font-weight: 700; }
.audit-entry .ae-sig { color: var(--muted); word-break: break-all; margin-top: 4px; }
.audit-entry .ae-ok { color: var(--green); }
.audit-entry .ae-verify { background: none; border: 1px solid var(--line); color: var(--cyan); border-radius: 6px; font-family: var(--mono); font-size: 0.68rem; padding: 2px 8px; cursor: pointer; margin-top: 6px; }
.audit-entry .ae-verify:hover { border-color: var(--cyan); }

/* Utility */
.center { text-align: center; }
.mt-1 { margin-top: 10px; } .mt-2 { margin-top: 20px; } .mt-3 { margin-top: 34px; } .mt-4 { margin-top: 52px; }
.muted { color: var(--muted); }
.page-hero { padding: 72px 0 50px; background: radial-gradient(ellipse 60% 70% at 50% 0%, rgba(26, 140, 255, 0.12), transparent), var(--bg); border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); font-weight: 800; }
.page-hero p { color: var(--muted); margin-top: 12px; max-width: 700px; font-size: 1.08rem; }

/* Motion system */
.reveal { opacity: 0; transform: translateY(22px); 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; } }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.sig-item { font-family: var(--mono); font-size: 0.74rem; color: var(--muted); }
.sig-item .si-act { color: var(--cyan); font-weight: 700; }
.sig-item .si-ok { color: var(--green); } }

/* Code blocks (SDK page) */
pre.code { font-family: var(--mono); font-size: 0.8rem; line-height: 1.6; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 18px; overflow-x: auto; color: var(--text); }
pre.code .c { color: var(--muted); } pre.code .k { color: var(--cyan); } pre.code .s { color: #7dd3a8; }

/* Illustrations */
.ill { width: 100%; height: auto; border-radius: 12px; display: block; }
.card .ill { margin-bottom: 16px; }
.hero-split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .hero-split { grid-template-columns: 1fr; } .hero-split .ill { max-width: 440px; } }

/* Mobile refinement pass */
html, body { overflow-x: clip; }
@media (max-width: 640px) {
  section.block { padding: 52px 0; }
  .hero { padding: 64px 0 56px; }
  .page-hero { padding: 52px 0 40px; }
  .hero-ctas .btn, .demo-shell .demo-row .btn, .cta-band .btn { width: 100%; text-align: center; }
  .hero-split .ill { margin: 0 auto; }
  .section-head { margin-bottom: 32px; }
  .card { padding: 20px; }
  .demo-shell { padding: 20px 16px; }
  .stat .num { font-size: 1.6rem; }
  .footer-bottom { flex-direction: column; }
  #pq-audit-fab { padding: 8px 13px; font-size: 0.76rem; right: 12px; bottom: 12px; }
  #pq-audit-panel { right: 12px; bottom: 62px; }
  .steps { grid-template-columns: 1fr; }
  .mono-out { font-size: 0.7rem; }
  pre.code { font-size: 0.7rem; }
}
.table-wrap { -webkit-overflow-scrolling: touch; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }
img { height: auto; }

/* Trust strip */
.trust-strip { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.trust-badge { border: 1px solid var(--line); background: var(--panel); color: var(--muted); padding: 8px 16px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.03em; }
.trust-badge:hover { color: var(--cyan); border-color: rgba(0, 194, 179, 0.5); }
