:root {
  --bg: #07090d;
  --panel: rgba(255,255,255,0.05);
  --panel-strong: rgba(10,16,28,0.86);
  --line: rgba(255,255,255,0.12);
  --text: #f5f7fb;
  --muted: rgba(255,255,255,0.68);
  --soft: rgba(255,255,255,0.48);
  --cyan: #8df4ff;
  --blue: #6fa8ff;
  --violet: #7c6dff;
  --pink: #ff70b5;
  --shadow: 0 40px 90px rgba(0,0,0,0.42);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.bg-orb { position: fixed; border-radius: 50%; filter: blur(110px); opacity: .34; pointer-events: none; z-index: 0; }
.orb-1 { width: 520px; height: 520px; background: rgba(0, 217, 255, .17); top: -140px; left: -130px; }
.orb-2 { width: 520px; height: 520px; background: rgba(156, 74, 255, .18); right: -150px; top: 120px; }
.grid-overlay { position: fixed; 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: 44px 44px; opacity: .08; pointer-events: none; }
.demo-header, .demo-shell, .demo-footer { position: relative; z-index: 1; }
.demo-header {
  min-height: 78px;
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 42px; height: 42px; border-radius: 16px; display: grid; place-items: center; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: var(--cyan); font-weight: 800; box-shadow: var(--shadow); }
.brand-title { font-size: 1.2rem; font-weight: 800; }
.brand-sub { font-size: .72rem; color: var(--soft); text-transform: uppercase; letter-spacing: .22em; }
.demo-header nav { display: flex; flex-wrap: wrap; gap: 22px; color: var(--muted); }
.demo-header nav a:hover { color: #fff; }
.demo-shell { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 56px; }
.glass-card { background: linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.035)); border: 1px solid rgba(255,255,255,.12); box-shadow: var(--shadow); border-radius: 28px; }
.hero-panel { display: grid; grid-template-columns: 1.08fr .92fr; gap: 42px; align-items: center; padding: 44px; min-height: 470px; position: relative; overflow: hidden; }
.hero-panel:before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 15% 10%, rgba(141,244,255,.14), transparent 34%), radial-gradient(circle at 86% 12%, rgba(255,112,181,.12), transparent 36%); pointer-events: none; }
.hero-panel > * { position: relative; z-index: 1; }
.eyebrow { display: inline-flex; color: var(--cyan); text-transform: uppercase; letter-spacing: .18em; font-weight: 800; font-size: .78rem; margin-bottom: 16px; }
h1 { font-size: clamp(2.5rem, 6vw, 5.4rem); line-height: .95; margin: 0 0 22px; letter-spacing: -.06em; max-width: 850px; }
h2 { margin: 0 0 10px; font-size: clamp(1.6rem, 3vw, 2.5rem); letter-spacing: -.04em; }
.lead { color: rgba(255,255,255,.74); font-size: 1.14rem; line-height: 1.72; max-width: 760px; }
.hero-actions, .button-row, .access-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.button { display: inline-flex; align-items: center; justify-content: center; border-radius: 18px; padding: 14px 22px; font-weight: 750; transition: .25s ease; border: 1px solid transparent; cursor: pointer; }
.button-light { background: white; color: #090c12; }
.button-light:hover { transform: translateY(-1px); background: #f1f3f7; }
.button-ghost { background: rgba(255,255,255,.045); border-color: rgba(255,255,255,.16); color: white; }
.button-ghost:hover { background: rgba(255,255,255,.09); }
.demo-limits { margin: 18px 0 0; color: var(--soft); font-size: .94rem; }
.hero-visual { min-height: 360px; display: grid; place-items: center; }
.image-orbit { width: min(430px, 88vw); aspect-ratio: 1 / 1; border-radius: 42px; border: 1px solid rgba(141,244,255,.34); background: linear-gradient(145deg, rgba(10,17,32,.92), rgba(4,7,16,.82)); position: relative; overflow: hidden; box-shadow: inset 0 0 80px rgba(111,168,255,.15), 0 0 74px rgba(141,244,255,.16); }
.image-orbit:before { content: ""; position: absolute; inset: 46px; border: 1px solid rgba(255,255,255,.1); border-radius: 28px; background-image: linear-gradient(rgba(141,244,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(141,244,255,.12) 1px, transparent 1px); background-size: 32px 32px; opacity: .75; }
.image-orbit:after { content: ""; position: absolute; width: 54%; height: 54%; left: 23%; top: 23%; border-radius: 50%; border: 1px solid rgba(255,112,181,.3); box-shadow: 0 0 60px rgba(255,112,181,.22); }
.scan-bar { position: absolute; left: 0; right: 0; height: 3px; top: 28%; background: linear-gradient(90deg, transparent, var(--cyan), white, var(--cyan), transparent); box-shadow: 0 0 22px rgba(141,244,255,.9); animation: scan 3.8s linear infinite; }
@keyframes scan { 0% { top: 16%; opacity: .3; } 50% { opacity: 1; } 100% { top: 82%; opacity: .3; } }
.corner { position: absolute; width: 72px; height: 72px; border-color: var(--cyan); opacity: .9; }
.c1 { left: 30px; top: 30px; border-left: 2px solid; border-top: 2px solid; }
.c2 { right: 30px; top: 30px; border-right: 2px solid; border-top: 2px solid; }
.c3 { left: 30px; bottom: 30px; border-left: 2px solid; border-bottom: 2px solid; }
.c4 { right: 30px; bottom: 30px; border-right: 2px solid; border-bottom: 2px solid; }
.visual-node { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 30px rgba(141,244,255,1); }
.n1 { left: 28%; top: 35%; } .n2 { right: 28%; top: 60%; } .n3 { left: 55%; bottom: 25%; background: var(--pink); box-shadow: 0 0 30px rgba(255,112,181,1); }
.status-strip { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0; }
.chip, .mode-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 9px 13px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.78); font-size: .82rem; font-weight: 700; }
.analysis-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; align-items: stretch; }
.panel { padding: 28px; }
.drop-panel { grid-column: span 7; min-height: 560px; }
.score-panel { grid-column: span 5; }
.xwide { grid-column: 1 / -1; }
.metrics-panel { grid-column: span 5; }
.result-panel { grid-column: span 7; }
.section-title { color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: .14em; font-weight: 800; font-size: .78rem; margin-bottom: 16px; }
.drop-inner { border: 1px dashed rgba(141,244,255,.42); border-radius: 24px; min-height: 170px; display: grid; place-items: center; text-align: center; padding: 22px; margin-bottom: 18px; background: rgba(141,244,255,.035); }
.drop-panel.drag-over .drop-inner { border-color: white; background: rgba(141,244,255,.08); }
.drop-icon { font-size: 3rem; color: var(--cyan); filter: drop-shadow(0 0 18px rgba(141,244,255,.6)); }
.drop-inner h2 { margin: 2px 0; }
.drop-inner p, .drop-inner small, .muted { color: var(--muted); }
#previewCanvas { width: 100%; height: 320px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.1); border-radius: 22px; display: block; }
.gauge-wrap { position: relative; width: min(270px, 100%); margin: 26px auto 18px; }
.gauge-svg { width: 100%; transform: rotate(-90deg); }
.ring-bg, .ring-progress { fill: none; stroke-width: 18; }
.ring-bg { stroke: rgba(255,255,255,.1); }
.ring-progress { stroke: url(#imageRingGradient); stroke-linecap: round; stroke-dasharray: 578; stroke-dashoffset: 578; transition: .8s ease; filter: drop-shadow(0 0 10px rgba(141,244,255,.5)); }
.gauge-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.score { font-size: 3.2rem; font-weight: 850; letter-spacing: -.05em; }
.score-label { color: var(--muted); font-weight: 700; }
.confidence-line { display: flex; justify-content: space-between; border-top: 1px solid rgba(255,255,255,.1); padding-top: 18px; color: var(--muted); }
.confidence-line strong { color: white; }
.small { font-size: .92rem; line-height: 1.55; }
.graph-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 12px; }
.graph-badges { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
#radarCanvas { width: 100%; height: 420px; background: radial-gradient(circle at center, rgba(141,244,255,.07), transparent 48%); border: 1px solid rgba(255,255,255,.09); border-radius: 24px; }
.metric-list { display: grid; gap: 16px; }
.metric-item { display: grid; gap: 8px; }
.metric-row { display: flex; justify-content: space-between; gap: 12px; color: rgba(255,255,255,.76); }
.metric-bar { height: 10px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
.metric-bar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--cyan), var(--blue), var(--pink)); transition: .75s ease; }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.summary-card { padding: 18px; border-radius: 20px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.045); }
.summary-card span { display: block; color: var(--soft); font-size: .82rem; margin-bottom: 8px; }
.summary-card strong { font-size: 1.02rem; overflow-wrap: anywhere; }
.findings-list { margin: 0; padding-left: 20px; display: grid; gap: 12px; color: rgba(255,255,255,.8); line-height: 1.55; }
.findings-list li::marker { color: var(--cyan); }
.access-panel { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; }
.demo-footer { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 44px; display: flex; flex-wrap: wrap; gap: 18px; color: var(--soft); }
.demo-footer a:hover { color: #fff; }
@media (max-width: 980px) {
  .hero-panel, .access-panel { grid-template-columns: 1fr; }
  .drop-panel, .score-panel, .metrics-panel, .result-panel { grid-column: 1 / -1; }
  .demo-header { align-items: flex-start; flex-direction: column; padding-top: 18px; }
  h1 { font-size: clamp(2.5rem, 11vw, 4.2rem); }
}
@media (max-width: 620px) {
  .demo-shell, .demo-header, .demo-footer { width: min(100% - 24px, 1240px); }
  .hero-panel, .panel { padding: 22px; border-radius: 22px; }
  .summary-grid { grid-template-columns: 1fr; }
  .button { width: 100%; }
  .hero-actions, .access-actions { width: 100%; }
}

/* V18 additions */
.tabs-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr);
  gap: 24px;
  padding: 22px 26px;
  margin-bottom: 22px;
  align-items: center;
}
.tab-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.tab-button {
  appearance: none;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.045);
  color: rgba(255,255,255,.82);
  border-radius: 18px;
  padding: 14px 18px;
  font: 700 0.98rem Inter, sans-serif;
  cursor: pointer;
  transition: .25s ease;
}
.tab-button:hover { background: rgba(255,255,255,.09); }
.tab-button.active {
  background: linear-gradient(135deg, rgba(105,213,255,.18), rgba(139,140,255,.14));
  border-color: rgba(105,213,255,.44);
  color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.24);
}
.workspace-section { display: none; }
.workspace-section.active { display: block; }
.section-intro {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 24px 28px;
  margin-bottom: 20px;
}
.section-intro h2 { margin-bottom: 8px; }
.workspace-anchor { position: relative; top: -24px; }
.hero-visual .dual:before { box-shadow: inset 0 0 80px rgba(111,168,255,.15), 0 0 82px rgba(141,244,255,.16); }
.orbit-badge {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  height: 34px;
  border-radius: 999px;
  padding: 0 14px;
  font-size: .82rem;
  font-weight: 800;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
}
.b1 { left: 34px; bottom: 40px; }
.b2 { right: 38px; top: 48px; }
.b3 { right: 54px; bottom: 44px; }
.compare-inputs { min-height: auto; }
.compare-canvases {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.canvas-card, .match-candidate {
  display: grid;
  gap: 14px;
}
.canvas-card canvas, #matchCandidateCanvas {
  width: 100%;
  height: 320px;
  display: block;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
}
.canvas-meta { color: var(--soft); font-size: .88rem; line-height: 1.5; }
.compare-score .metric-pair {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.78);
}
.compare-score .metric-pair strong { color: #fff; }
.compare-score .metric-pair:last-of-type { border-bottom: 0; }
.compare-diff canvas {
  width: 100%;
  height: 320px;
  display: block;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
}
.match-grid { align-items: start; }
.match-best { align-self: stretch; }
.single-column { grid-template-columns: 1fr; }
.match-results {
  display: grid;
  gap: 14px;
}
.empty-state {
  border: 1px dashed rgba(105,213,255,.28);
  border-radius: 22px;
  padding: 28px;
  color: rgba(255,255,255,.62);
  background: rgba(255,255,255,.03);
}
.match-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  background: rgba(255,255,255,.04);
}
.match-rank {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: rgba(105,213,255,.12);
  border: 1px solid rgba(105,213,255,.24);
  color: var(--cyan);
}
.match-main { display: grid; gap: 10px; }
.match-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: baseline;
}
.match-head strong { font-size: 1rem; }
.match-head span { color: var(--soft); font-size: .88rem; }
.match-bar {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.1);
}
.match-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--pink));
}
.match-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: rgba(255,255,255,.76);
  font-size: .9rem;
}
.match-meta strong { color: #fff; }
button.button { font-family: Inter, sans-serif; }
@media (max-width: 980px) {
  .tabs-panel, .section-intro, .compare-canvases { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .match-row { grid-template-columns: 1fr; }
  .tab-button { width: 100%; }
  .compare-cta .button { width: 100%; }
}


/* V18.1 additions */
.video-frame-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.video-frame-grid .canvas-card canvas {
  width: 100%;
  height: 210px;
  display: block;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
}
.match-preview {
  margin-top: 0;
}
.video-grid .score-panel {
  align-self: stretch;
}
.video-grid .metrics-panel {
  align-self: stretch;
}
@media (max-width: 1180px) {
  .video-frame-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .video-frame-grid { grid-template-columns: 1fr; }
  .video-frame-grid .canvas-card canvas { height: 240px; }
}
