/* ============================================================
   SurveillanceAI — marketing site
   Palette mirrors the desktop app's SOC dark theme for brand
   consistency (see src/ui/theme.py).
   ============================================================ */

:root {
  --bg:         #0d0f14;
  --surface:    #151820;
  --surface2:   #1e2130;
  --border:     #2a2d3e;
  --accent:     #00aaff;
  --accent-2:   #3a82f7;
  --accent-fg:  #06121d;
  --danger:     #ff4444;
  --warning:    #ffaa00;
  --success:    #00cc66;
  --text:       #e8ecf0;
  --muted:      #8b93a7;
  --radius:     14px;
  --radius-sm:  10px;
  --maxw:       1160px;
  --shadow:     0 18px 50px rgba(0,0,0,.45);
  --shadow-sm:  0 6px 20px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { line-height: 1.18; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.18rem; }
p  { margin: 0 0 1rem; color: var(--muted); }
a  { color: var(--accent); text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }

.accent { color: var(--accent); }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--accent); color: var(--accent-fg); padding: 10px 16px; border-radius: 0 0 8px 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-weight: 600; font-size: .98rem; border-radius: 10px; border: 1px solid transparent;
  padding: 12px 22px; cursor: pointer; transition: transform .15s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn-sm { padding: 9px 16px; font-size: .9rem; }
.btn-lg { padding: 15px 30px; font-size: 1.02rem; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-fg); box-shadow: 0 8px 24px rgba(0,170,255,.28); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,170,255,.42); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,15,20,.78);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--text); letter-spacing: -.02em; }
.brand-logo { border-radius: 8px; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { color: var(--muted); font-weight: 500; font-size: .95rem; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-links a.btn { color: var(--accent-fg); }
.nav-links a.btn:hover { color: var(--accent-fg); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu { display: none; flex-direction: column; gap: 6px; padding: 14px 22px 22px; border-bottom: 1px solid var(--border); background: var(--surface); }
.mobile-menu a { color: var(--text); padding: 11px 8px; border-radius: 8px; font-weight: 500; }
.mobile-menu a:hover { background: var(--surface2); }
.mobile-menu a.btn { margin-top: 6px; justify-content: center; }

/* ---------------- Hero ---------------- */
.hero { position: relative; padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); overflow: hidden; }
.hero-glow {
  position: absolute; inset: -20% -10% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
  background: radial-gradient(circle at 70% 30%, rgba(0,170,255,.20), transparent 60%);
  filter: blur(20px); pointer-events: none; z-index: 0;
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr .95fr; gap: 52px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; color: var(--accent); background: rgba(0,170,255,.08); border: 1px solid rgba(0,170,255,.25); padding: 6px 14px; border-radius: 999px; margin-bottom: 20px; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 rgba(0,204,102,.6); animation: pulse 2s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(0,204,102,.55);} 70%{box-shadow:0 0 0 10px rgba(0,204,102,0);} 100%{box-shadow:0 0 0 0 rgba(0,204,102,0);} }
.lead { font-size: 1.12rem; max-width: 38ch; }
.hero-copy .lead strong { color: var(--text); }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin: 26px 0 22px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.hero-points li { color: var(--muted); font-size: .96rem; }

/* Dashboard mockup */
.hero-visual { perspective: 1400px; }
.mock-window { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transform: rotateY(-9deg) rotateX(3deg); transition: transform .4s ease; }
.hero-visual:hover .mock-window { transform: rotateY(-4deg) rotateX(1deg); }
.mock-titlebar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; background: var(--surface2); border-bottom: 1px solid var(--border); }
.mock-dot { width: 11px; height: 11px; border-radius: 50%; }
.mock-dot.red{background:#ff5f56;} .mock-dot.amber{background:#ffbd2e;} .mock-dot.green{background:#27c93f;}
.mock-title { margin-left: 10px; font-size: .8rem; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.mock-body { display: grid; grid-template-columns: 44px 1fr 150px; gap: 10px; padding: 12px; }
.mock-sidebar { display: flex; flex-direction: column; gap: 8px; }
.ms-item { height: 22px; border-radius: 6px; background: var(--surface2); }
.ms-item.active { background: var(--accent); }
.mock-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cam { position: relative; aspect-ratio: 16/10; border-radius: 8px; background: linear-gradient(160deg, #11151f, #0b0e15); border: 1px solid var(--border); overflow: hidden; }
.cam-tag { position: absolute; top: 6px; left: 6px; font-size: .6rem; font-family: 'JetBrains Mono', monospace; color: var(--accent); background: rgba(0,0,0,.55); padding: 2px 5px; border-radius: 4px; }
.bbox { position: absolute; width: 38%; height: 52%; border: 2px solid var(--success); border-radius: 4px; left: 30%; top: 32%; }
.bbox.person { border-color: var(--accent); }
.bbox.alert { border-color: var(--danger); animation: blink 1.1s infinite; }
@keyframes blink { 50% { opacity: .35; } }
.badge { position: absolute; bottom: 6px; right: 6px; font-size: .58rem; font-weight: 700; padding: 3px 7px; border-radius: 5px; letter-spacing: .05em; }
.badge.danger { background: var(--danger); color: #fff; }
.badge.warn { background: var(--warning); color: #1a1206; }
.mock-alerts { display: flex; flex-direction: column; gap: 8px; }
.alert-card { background: var(--surface2); border: 1px solid var(--border); border-left: 3px solid var(--muted); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; }
.alert-card b { font-size: .72rem; }
.alert-card span { font-size: .64rem; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.alert-card.danger { border-left-color: var(--danger); }
.alert-card.warn { border-left-color: var(--warning); }

/* ---------------- Stats ---------------- */
.stats { border-block: 1px solid var(--border); background: var(--surface); }
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; padding: 36px 22px; }
.stat { text-align: center; }
.stat-num { display: block; font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 800; color: var(--accent); letter-spacing: -.03em; }
.stat-label { color: var(--muted); font-size: .9rem; }

/* ---------------- Sections ---------------- */
.section { padding: clamp(56px, 8vw, 100px) 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--border); }
.section-head { max-width: 720px; margin: 0 auto clamp(36px, 5vw, 56px); text-align: center; }
.kicker { display: inline-block; font-size: .82rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.section-head p { font-size: 1.08rem; }

/* Feature cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 24px; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.section-alt .card { background: var(--surface2); }
.card:hover { transform: translateY(-4px); border-color: rgba(0,170,255,.45); box-shadow: var(--shadow-sm); }
.card-ico { width: 50px; height: 50px; display: grid; place-items: center; font-size: 1.5rem; border-radius: 12px; background: rgba(0,170,255,.10); border: 1px solid rgba(0,170,255,.22); margin-bottom: 16px; }
.card h3 { margin-bottom: 8px; }
.card p { margin: 0; font-size: .96rem; }

/* Detection rules */
.rules { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.rule { display: flex; gap: 16px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px 20px; }
.section-alt .rule { background: var(--bg); }
.rule-ico { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }
.rule h4 { margin: 2px 0 4px; font-size: 1.05rem; }
.rule p { margin: 0; font-size: .93rem; }
.note { text-align: center; max-width: 760px; margin: 36px auto 0; color: var(--muted); font-size: .98rem; }

/* Pipeline */
.pipeline { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; }
.pipeline li { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 22px; }
.step-n { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-fg); font-weight: 800; font-size: 1.1rem; margin-bottom: 14px; }
.pipeline h4 { margin: 0 0 6px; }
.pipeline p { margin: 0; font-size: .93rem; }

/* Two column */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 52px; align-items: center; }
.two-col .kicker { margin-bottom: 12px; }
.check-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 12px; }
.check-list li { position: relative; padding-left: 30px; color: var(--muted); }
.check-list li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; display: grid; place-items: center; background: rgba(0,204,102,.14); color: var(--success); border-radius: 50%; font-size: .72rem; font-weight: 700; }
.check-list strong { color: var(--text); }

/* Panels (alerts + charts) */
.panel { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.section-alt .panel { background: var(--bg); }
.panel-title { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.alert-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--muted); margin-bottom: 10px; }
.alert-row:last-child { margin-bottom: 0; }
.alert-row.danger { border-left-color: var(--danger); }
.alert-row.warn { border-left-color: var(--warning); }
.ar-ico { font-size: 1.25rem; }
.alert-row b { display: block; font-size: .94rem; }
.alert-row small { color: var(--muted); font-size: .8rem; font-family: 'JetBrains Mono', monospace; }
.alert-row div { flex: 1; }
.ar-time { color: var(--muted); font-size: .78rem; font-family: 'JetBrains Mono', monospace; }

/* Chart panel */
.chart-panel .bars { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding: 6px 4px 0; }
.chart-panel .bars span { flex: 1; height: var(--h); background: linear-gradient(180deg, var(--accent), var(--accent-2)); border-radius: 6px 6px 0 0; opacity: .9; transition: height .8s ease; }
.bars-x { display: flex; gap: 10px; margin-top: 8px; }
.bars-x i { flex: 1; text-align: center; font-style: normal; font-size: .72rem; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.kpis { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; }
.kpi b { display: block; font-size: 1.3rem; color: var(--text); }
.kpi small { color: var(--muted); font-size: .78rem; }

/* Tech list */
.tech-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.tech-list li { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 10px 20px; color: var(--text); font-weight: 500; font-size: .92rem; }
.section-alt .tech-list li { background: var(--surface2); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 52px; align-items: start; }
.contact-methods { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 16px; }
.contact-methods li { display: flex; align-items: center; gap: 14px; }
.cm-ico { width: 46px; height: 46px; display: grid; place-items: center; font-size: 1.3rem; border-radius: 12px; background: rgba(0,170,255,.10); border: 1px solid rgba(0,170,255,.22); }
.contact-methods small { display: block; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.contact-methods a { font-size: 1.06rem; font-weight: 600; color: var(--text); }
.contact-methods a:hover { color: var(--accent); }

.contact-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 7px; color: var(--text); }
.field input, .field textarea { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; color: var(--text); font: inherit; font-size: .96rem; transition: border-color .2s, box-shadow .2s; }
.field input::placeholder, .field textarea::placeholder { color: #5b6275; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,170,255,.18); }
.field textarea { resize: vertical; }
.contact-form .btn { width: 100%; }
.form-note { margin: 14px 0 0; text-align: center; font-size: .9rem; min-height: 1.2em; }
.form-note.ok { color: var(--success); }
.form-note.err { color: var(--danger); }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 52px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
.footer-brand p { margin-top: 14px; max-width: 34ch; font-size: .94rem; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: var(--muted); font-size: .94rem; }
.footer-links a:hover { color: var(--text); }
.footer-contact { display: flex; flex-direction: column; gap: 10px; }
.footer-contact a { color: var(--muted); font-size: .94rem; font-family: 'JetBrains Mono', monospace; }
.footer-contact a:hover { color: var(--accent); }
.footer-bottom { padding-top: 22px; color: var(--muted); font-size: .85rem; text-align: center; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------------- Responsive ---------------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; max-width: 560px; }
  .cards, .cards.three { grid-template-columns: repeat(2, 1fr); }
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .two-col, .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .two-col.reverse .panel { order: 2; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .mobile-menu { display: flex; }
  .mobile-menu[hidden] { display: none; }
  .cards, .cards.three, .rules, .pipeline { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 26px 12px; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  h1 { font-size: 2.1rem; }
  .lead { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
