:root {
  --bg: #0b0f0e;
  --panel: #131a18;
  --panel-2: #182420;
  --line: #223530;
  --accent: #00e5a0;
  --accent-dim: #0a3d2d;
  --accent-2: #ffb020;
  --text: #e9f5f1;
  --muted: #7c9c93;
  --danger: #ff6b6b;
}

html.light {
  --bg: #f3f7f5;
  --panel: #ffffff;
  --panel-2: #eef4f2;
  --line: #dbe6e2;
  --accent: #00a875;
  --accent-dim: #d7f5e9;
  --accent-2: #b8720a;
  --text: #0e1a17;
  --muted: #5b6f6a;
  --danger: #d13b3b;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  transition: background .2s ease, color .2s ease;
}

.font-display { font-family: 'Space Grotesk', 'Inter', sans-serif; }
.font-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

.bg-panel { background: var(--panel); }
.bg-panel-2 { background: var(--panel-2); }
.border-line { border-color: var(--line); }
.text-accent { color: var(--accent); }
.text-accent-2 { color: var(--accent-2); }
.text-muted { color: var(--muted); }
.bg-accent { background: var(--accent); }
.bg-accent-dim { background: var(--accent-dim); }

/* ---- Scrollbars ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

/* ---- Viewfinder / reticle ---- */
.reticle {
  position: relative;
  aspect-ratio: 3 / 4;
  max-height: 62vh;
  background: #000;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.reticle video, .reticle canvas, .reticle img.captured-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reticle-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 3px solid var(--accent);
  opacity: .9;
  z-index: 10;
}
.reticle-corner.tl { top: 14px; left: 14px; border-right: none; border-bottom: none; border-top-left-radius: 8px; }
.reticle-corner.tr { top: 14px; right: 14px; border-left: none; border-bottom: none; border-top-right-radius: 8px; }
.reticle-corner.bl { bottom: 14px; left: 14px; border-right: none; border-top: none; border-bottom-left-radius: 8px; }
.reticle-corner.br { bottom: 14px; right: 14px; border-left: none; border-top: none; border-bottom-right-radius: 8px; }

.scan-line {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 12px 2px var(--accent);
  z-index: 15;
  top: 0;
  opacity: 0;
}
.scan-line.active {
  opacity: 1;
  animation: sweep 1.3s linear infinite;
}
@keyframes sweep {
  0% { top: 6%; }
  50% { top: 92%; }
  100% { top: 6%; }
}

.box-label {
  position: absolute;
  border: 2px solid var(--accent);
  border-radius: 6px;
  z-index: 12;
  pointer-events: none;
}
.box-label .tag {
  position: absolute;
  top: -1px;
  left: -2px;
  transform: translateY(-100%);
  background: var(--accent);
  color: #04140f;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px 4px 4px 0;
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
}

/* ---- Tab / nav ---- */
.tab-page { display: none; }
.tab-page.active { display: block; }

.nav-item.active-nav {
  color: var(--accent);
}
.nav-item.active-nav .nav-dot {
  opacity: 1;
  transform: scale(1);
}
.nav-dot {
  opacity: 0;
  transform: scale(0);
  transition: all .18s ease;
}

/* ---- Misc ---- */
.pulse-ring {
  animation: pulseRing 1.6s ease-out infinite;
}
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 var(--accent-dim); }
  70% { box-shadow: 0 0 0 14px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.fade-in { animation: fadeIn .25s ease both; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.skeleton {
  background: linear-gradient(90deg, var(--panel-2) 25%, var(--line) 37%, var(--panel-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
