:root {
  color-scheme: dark;
  --bg: #04101f;
  --bg-deep: #020712;
  --text: #eefcff;
  --muted: #9fc5d0;
  --strong: #ffffff;
  --panel: rgba(4, 18, 31, 0.76);
  --panel-solid: #071827;
  --panel-border: rgba(111, 255, 233, 0.24);
  --accent: #6fffe9;
  --accent-2: #22d3ee;
  --accent-3: #b6ff5c;
  --danger: #ff7a8a;
  --warning: #ffd166;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
  --grid: rgba(111, 255, 233, 0.08);
  --footer: rgba(1, 8, 16, 0.82);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef9ff;
  --bg-deep: #dff5ff;
  --text: #082033;
  --muted: #36576a;
  --strong: #03121f;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --panel-border: rgba(0, 113, 133, 0.22);
  --accent: #007c89;
  --accent-2: #0369a1;
  --accent-3: #3f7d20;
  --danger: #be123c;
  --warning: #8a5a00;
  --shadow: 0 24px 80px rgba(14, 63, 91, 0.2);
  --grid: rgba(3, 105, 161, 0.12);
  --footer: rgba(255, 255, 255, 0.9);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(34, 211, 238, 0.22), transparent 34rem),
    linear-gradient(180deg, var(--bg-deep), var(--bg) 44%, var(--bg-deep));
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: background 400ms ease, color 400ms ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

#particle-field {
  position: fixed;
  inset: 0;
  z-index: -4;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #020617, #071827 48%, #03101e);
}

html[data-theme="light"] #particle-field { opacity: 0.35; filter: invert(0.92) saturate(0.85); }

.aurora {
  position: fixed;
  z-index: -2;
  width: 46rem;
  height: 46rem;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.32;
  animation: drift 16s ease-in-out infinite alternate;
}
.aurora-one { left: -14rem; top: 20%; background: var(--accent); }
.aurora-two { right: -18rem; top: 3rem; background: #5465ff; animation-delay: -5s; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, calc(100% - 32px));
  margin: 16px auto 0;
  padding: 12px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.brand, .nav-links a, .button, .site-footer a { color: inherit; text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: -0.03em; color: var(--strong); }
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 28px color-mix(in srgb, var(--accent) 55%, transparent);
}
.brand-mark svg { width: 23px; fill: #00111c; }

.nav-links { display: flex; gap: 6px; }
.nav-links a {
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 0.92rem;
  transition: color 180ms ease, background 180ms ease;
}
.nav-links a:hover { color: var(--strong); background: color-mix(in srgb, var(--accent) 12%, transparent); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 8px 12px 8px 8px;
  background: color-mix(in srgb, var(--panel-solid) 76%, transparent);
  color: var(--strong);
  cursor: pointer;
  font-weight: 800;
}
.toggle-orbit { position: relative; width: 38px; height: 22px; border-radius: 999px; background: rgba(111, 255, 233, 0.18); box-shadow: inset 0 0 0 1px var(--panel-border); }
.toggle-core { position: absolute; top: 3px; left: 19px; width: 16px; height: 16px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 14px var(--accent); transition: left 260ms ease, background 260ms ease; }
html[data-theme="light"] .toggle-core { left: 3px; background: #f59e0b; box-shadow: 0 0 14px rgba(245, 158, 11, 0.5); }

.section-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.hero { display: grid; grid-template-columns: 0.85fr 1.25fr; gap: 32px; align-items: center; padding: 92px 0 64px; }
.hero-copy h1, .section-heading h2, .glass-card h2 {
  margin: 0;
  color: var(--strong);
  font-size: clamp(3rem, 7vw, 6.9rem);
  line-height: 0.9;
  letter-spacing: -0.08em;
}
.hero-lede, .section-heading p, .glass-card p, .workflow-card p { color: var(--muted); line-height: 1.7; }
.hero-lede { max-width: 650px; font-size: 1.09rem; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; color: var(--accent); font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.76rem; }
.eyebrow span { width: 34px; height: 2px; border-radius: 99px; background: currentColor; box-shadow: 0 0 14px currentColor; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 999px; padding: 0 20px; font-weight: 900; transition: transform 180ms ease, box-shadow 180ms ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #00111c; box-shadow: 0 16px 44px color-mix(in srgb, var(--accent) 28%, transparent); }
.button-secondary { border: 1px solid var(--panel-border); background: var(--panel); color: var(--strong); }

.trust-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 32px 0 0; }
.trust-strip div { padding: 16px; border: 1px solid var(--panel-border); border-radius: 20px; background: var(--panel); }
.trust-strip dt { color: var(--strong); font-weight: 950; font-size: 1.35rem; }
.trust-strip dd { margin: 3px 0 0; color: var(--muted); font-size: 0.8rem; }

.command-console {
  position: relative;
  min-height: 610px;
  padding: 20px;
  border: 1px solid var(--panel-border);
  border-radius: 32px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel-solid) 88%, transparent), color-mix(in srgb, var(--panel-solid) 68%, transparent)),
    radial-gradient(circle at 50% 50%, rgba(111, 255, 233, 0.12), transparent 42%);
  box-shadow: var(--shadow), inset 0 0 70px rgba(111, 255, 233, 0.05);
  overflow: hidden;
  backdrop-filter: blur(24px);
}
.command-console::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(transparent 50%, rgba(111,255,233,.035) 50%); background-size: 100% 5px; mix-blend-mode: screen; animation: scanlines 7s linear infinite; }
.console-topline { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; color: var(--accent); font-weight: 900; letter-spacing: 0.03em; text-align: center; }
.console-topline span { height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.console-grid { display: grid; grid-template-columns: 230px 1fr 260px; gap: 16px; min-height: 540px; margin-top: 18px; }
.console-panel { border: 1px solid var(--panel-border); border-radius: 22px; padding: 16px; background: color-mix(in srgb, var(--panel) 88%, transparent); }
.console-panel h2 { margin: 16px 0 12px; color: var(--accent); font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.18em; }
.ring-stat { display: inline-grid; width: 76px; height: 76px; place-items: center; border-radius: 999px; border: 2px dotted var(--accent); color: var(--accent); animation: pulse 2.8s ease-in-out infinite; }
.ring-stat span { font-size: 1.7rem; font-weight: 950; line-height: 1; }
.ring-stat small { margin-top: -20px; color: var(--muted); }
.patient-count { display: inline-block; margin-left: 18px; vertical-align: top; }
.patient-count strong { display: block; color: var(--accent-3); font-size: 3rem; line-height: 1; }
.patient-count small { color: var(--muted); font-size: 0.65rem; }
.mini-bars { display: inline-grid; gap: 5px; margin-left: 12px; vertical-align: top; }
.mini-bars i { display: block; width: 5px; height: 18px; border-radius: 99px; background: var(--accent); animation: equalize 1.4s ease-in-out infinite alternate; }
.mini-bars i:nth-child(2) { animation-delay: .1s; } .mini-bars i:nth-child(3) { animation-delay: .2s; } .mini-bars i:nth-child(4) { animation-delay: .3s; }
.spark-row { margin: 14px 0; }
.spark-row span, .spark-row b { display: inline-block; font-size: 0.75rem; }
.spark-row b { color: var(--strong); margin-left: 8px; }
.spark-row svg { width: 100%; height: 34px; overflow: visible; }
.spark-row polyline { fill: none; stroke-width: 2; stroke: var(--accent); filter: drop-shadow(0 0 6px currentColor); stroke-dasharray: 250; animation: draw 2.8s ease-in-out infinite alternate; }
.spark-row.amber polyline { stroke: var(--warning); }
.ranking-table { overflow: hidden; margin-top: 16px; border: 1px solid var(--panel-border); border-radius: 12px; font-size: 0.69rem; }
.ranking-table div { display: grid; grid-template-columns: 0.6fr 1.4fr 0.8fr; padding: 8px; color: var(--muted); }
.ranking-table div:first-child { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--strong); }

.anatomy-stage { position: relative; display: grid; place-items: center; min-width: 0; overflow: hidden; border-radius: 24px; background: radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 34%), radial-gradient(circle, rgba(255,255,255,.05), transparent 54%); }
.scan-ring { position: absolute; aspect-ratio: 1; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent); animation: rotate 16s linear infinite; }
.ring-a { width: min(86%, 440px); }
.ring-b { width: min(64%, 310px); animation-direction: reverse; animation-duration: 11s; }
.scan-ring::before, .scan-ring::after { content: ""; position: absolute; width: 8px; height: 8px; border-radius: 99px; background: var(--accent); box-shadow: 0 0 16px var(--accent); }
.scan-ring::before { left: 50%; top: -4px; } .scan-ring::after { bottom: -4px; right: 24%; }
.scan-beam { position: absolute; inset: 10% 46%; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 18%, transparent), transparent); animation: beam 4s ease-in-out infinite; }
.body-wireframe { position: relative; width: min(80%, 330px); height: 500px; overflow: visible; filter: drop-shadow(0 0 18px color-mix(in srgb, var(--accent) 60%, transparent)); }
.body-wireframe circle, .body-wireframe path, .body-wireframe ellipse { fill: none; stroke: url(#bodyGlow); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.body-wireframe .organ { fill: rgba(111, 255, 233, 0.08); stroke-width: 2; }
.body-wireframe .lesion { fill: color-mix(in srgb, var(--danger) 35%, transparent); stroke: var(--danger); animation: lesionPulse 1.8s ease-in-out infinite; }
.body-wireframe .spine { stroke-width: 4; }
.hologram-base { position: absolute; bottom: 34px; width: 300px; height: 34px; border-radius: 50%; border: 1px solid var(--accent-2); background: radial-gradient(ellipse, color-mix(in srgb, var(--accent-2) 25%, transparent), transparent 68%); box-shadow: 0 0 28px color-mix(in srgb, var(--accent-2) 45%, transparent); animation: pulse 2.4s ease-in-out infinite; }
.floating-chip { position: absolute; z-index: 2; border: 1px solid var(--panel-border); border-radius: 999px; padding: 8px 11px; background: var(--panel); color: var(--strong); font-size: 0.72rem; font-weight: 900; box-shadow: var(--shadow); animation: float 5s ease-in-out infinite; }
.chip-one { left: 7%; top: 18%; } .chip-two { right: 7%; top: 27%; animation-delay: -1.2s; } .chip-three { left: 17%; bottom: 17%; animation-delay: -2.4s; }

.site-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 0.68rem; color: var(--muted); }
.site-grid span::before { content: "✥"; color: var(--accent); margin-right: 6px; }
.tool-row { display: flex; gap: 10px; margin: 18px 0; }
.tool-row span { display: grid; width: 38px; height: 34px; place-items: center; border: 1px solid var(--panel-border); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); font-weight: 950; }
.progress-stack { display: grid; gap: 14px; }
.progress-stack label { display: grid; grid-template-columns: 1fr auto; gap: 8px; color: var(--muted); font-size: 0.68rem; }
.progress-stack i { grid-column: 1 / -1; height: 10px; border-radius: 99px; border: 1px solid var(--panel-border); overflow: hidden; }
.progress-stack i::before { content: ""; display: block; width: var(--value); height: 100%; background: linear-gradient(90deg, var(--accent-3), var(--accent)); box-shadow: 0 0 14px var(--accent); animation: loadbar 2.6s ease-out both; }
.bar-chart { display: flex; align-items: end; gap: 14px; height: 132px; margin-top: 24px; padding: 12px; border: 1px solid var(--panel-border); border-radius: 16px; }
.bar-chart i { flex: 1; height: var(--h); border-radius: 8px 8px 2px 2px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); animation: barDance 2.8s ease-in-out infinite alternate; }
.bar-chart i:nth-child(even) { opacity: .45; animation-delay: -.7s; }

.workflow-section { padding: 54px 0; }
.section-heading { max-width: 780px; margin-bottom: 24px; }
.section-heading h2, .glass-card h2 { font-size: clamp(2.3rem, 5vw, 4.7rem); }
.workflow-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.workflow-card, .glass-card, .reference-card {
  border: 1px solid var(--panel-border);
  border-radius: 26px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.workflow-card { min-height: 230px; padding: 24px; transition: transform 240ms ease, border-color 240ms ease; }
.workflow-card:hover { transform: translateY(-8px); border-color: color-mix(in srgb, var(--accent) 80%, transparent); }
.workflow-card strong { color: var(--accent); font-size: 0.82rem; letter-spacing: 0.18em; }
.workflow-card h3 { color: var(--strong); font-size: 1.35rem; }

.security-section { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 20px; align-items: stretch; padding: 48px 0 72px; }
.glass-card { padding: 30px; }
.reference-card { margin: 0; padding: 12px; overflow: hidden; }
.reference-card img { display: block; width: 100%; height: 100%; min-height: 320px; object-fit: cover; border-radius: 18px; filter: saturate(1.08) contrast(1.02); }
.reference-card figcaption { padding: 12px 6px 4px; color: var(--muted); font-size: 0.88rem; }

.site-footer { display: grid; place-items: center; padding: 34px 16px 42px; border-top: 1px solid var(--panel-border); background: var(--footer); backdrop-filter: blur(18px); }
.footer-center { text-align: center; color: var(--muted); }
.footer-center p { margin: 6px 0; }
.footer-center a { display: inline-flex; align-items: center; gap: 7px; color: var(--strong); font-weight: 900; border-bottom: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); }
.footer-center svg { width: 18px; height: 18px; fill: currentColor; }

.reveal { opacity: 1; transform: translateY(0); transition: opacity 700ms ease, transform 700ms ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@keyframes drift { to { transform: translate3d(8rem, -2rem, 0) scale(1.1); } }
@keyframes scanlines { to { background-position: 0 40px; } }
@keyframes pulse { 50% { transform: scale(1.04); opacity: .75; } }
@keyframes equalize { to { height: 34px; opacity: .55; } }
@keyframes draw { from { stroke-dashoffset: 250; } to { stroke-dashoffset: 0; } }
@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes beam { 0%,100% { transform: translateX(-60px); opacity: .15; } 50% { transform: translateX(60px); opacity: .8; } }
@keyframes lesionPulse { 50% { transform: scale(1.08); opacity: .65; } }
@keyframes float { 50% { transform: translateY(-12px); } }
@keyframes loadbar { from { width: 0; } }
@keyframes barDance { to { transform: scaleY(.72); filter: hue-rotate(35deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: 0.001ms !important; }
}

@media (max-width: 1060px) {
  .hero, .security-section { grid-template-columns: 1fr; }
  .console-grid { grid-template-columns: 1fr; }
  .anatomy-stage { min-height: 540px; order: -1; }
  .workflow-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .site-header { border-radius: 24px; flex-wrap: wrap; justify-content: center; }
  .nav-links { order: 3; width: 100%; justify-content: center; }
  .hero { padding-top: 54px; }
  .trust-strip, .workflow-grid { grid-template-columns: 1fr; }
  .hero-copy h1 { font-size: clamp(2.8rem, 16vw, 4.5rem); }
  .command-console { padding: 12px; border-radius: 24px; }
  .body-wireframe { height: 430px; }
  .floating-chip { display: none; }
}
