/* =========================================================
   Neon Hands — styles
   ========================================================= */

:root {
  --bg: #050505;
  --cyan: #00f0ff;
  --magenta: #ff2bd6;
  --purple: #b026ff;
  --glass: rgba(10, 12, 22, 0.42);
  --glass-strong: rgba(10, 12, 22, 0.68);
  --border: rgba(0, 240, 255, 0.32);
  --text: #f4faff;
  --muted: rgba(244, 250, 255, 0.65);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Rajdhani', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Layers ---------- */
#cam {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
  background: #000;
  transform: scaleX(1);
  transition: transform 200ms ease;
}
#cam.mirror { transform: scaleX(-1); }

#vignette {
  position: fixed; inset: 0; z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,0.55) 100%),
    linear-gradient(180deg, rgba(8,2,20,0.18), rgba(2,8,20,0.18));
}

#fx {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* ---------- HUD ---------- */
#hud {
  position: fixed; top: 16px; left: 16px;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 10px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.16);
  z-index: 10;
}
.brand {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  letter-spacing: 4px;
  font-size: 13px;
  color: #fff;
  text-shadow: 0 0 8px var(--cyan), 0 0 18px rgba(0, 240, 255, 0.55);
  text-decoration: none;
  transition: opacity 200ms ease;
}
.brand:hover, .brand:focus-visible { opacity: 0.8; outline: none; }
.brand:focus-visible { text-shadow: 0 0 12px var(--cyan), 0 0 24px rgba(0, 240, 255, 0.8); }
.meta {
  display: inline-flex; gap: 6px;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
  font-family: 'Orbitron', sans-serif;
}
.meta .dot { opacity: 0.4; }

/* ---------- Controls ---------- */
#controls {
  position: fixed; bottom: 18px; left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.18);
  z-index: 10;
  max-width: calc(100% - 28px);
  flex-wrap: wrap;
  justify-content: center;
}

.toggle {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
  font-size: 12px; letter-spacing: 1.5px;
  font-family: 'Orbitron', sans-serif;
  color: var(--muted);
}
.toggle input { display: none; }
.toggle .track {
  position: relative;
  width: 32px; height: 18px;
  border-radius: 12px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.15);
  transition: all 200ms ease;
}
.toggle .thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #777;
  box-shadow: 0 0 4px rgba(0,0,0,0.4);
  transition: all 200ms ease;
}
.toggle input:checked ~ .track {
  background: rgba(0, 240, 255, 0.18);
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.55);
}
.toggle input:checked ~ .track .thumb {
  left: 16px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}
.toggle input:checked ~ .label { color: #fff; }

.slider {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: 1.5px;
  font-family: 'Orbitron', sans-serif;
  color: var(--muted);
}
.slider input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 110px; height: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  cursor: pointer;
}
.slider input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  border: none;
  cursor: pointer;
}

#shoot {
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--border);
  width: 36px; height: 36px;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 180ms ease;
}
#shoot:hover, #shoot:focus-visible {
  background: rgba(0, 240, 255, 0.12);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.4);
  outline: none;
}
#shoot:active { transform: scale(0.94); }

/* ---------- Overlays ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 50%, #0a0a14 0%, #000 75%);
  transition: opacity 500ms ease;
}
.overlay.hidden { opacity: 0; pointer-events: none; }

.card {
  padding: 28px 36px; max-width: 460px;
  text-align: center;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 0 38px rgba(0, 240, 255, 0.25);
}
.card h2 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900; font-size: 20px;
  letter-spacing: 5px;
  color: var(--cyan);
  text-shadow: 0 0 10px var(--cyan), 0 0 26px rgba(0, 240, 255, 0.55);
  margin-bottom: 10px;
}
.card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.card.error h2 { color: var(--magenta); text-shadow: 0 0 10px var(--magenta); }
.card.error p { margin-bottom: 18px; }
.card.error button {
  font-family: 'Orbitron', sans-serif;
  background: transparent; color: var(--cyan);
  border: 1px solid var(--cyan);
  padding: 10px 24px;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 4px; font-size: 12px;
  text-shadow: 0 0 6px var(--cyan);
  transition: all 200ms ease;
}
.card.error button:hover {
  background: var(--cyan); color: #000;
  box-shadow: 0 0 16px var(--cyan);
}

.dots { display: inline-flex; gap: 6px; margin-bottom: 14px; }
.dots span {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: pulse 1.2s ease-in-out infinite;
}
.dots span:nth-child(2) { animation-delay: 0.15s; }
.dots span:nth-child(3) { animation-delay: 0.30s; }
@keyframes pulse {
  0%, 100% { transform: scale(0.6); opacity: 0.4; }
  50%      { transform: scale(1.2); opacity: 1; }
}

/* ---------- Engage gate (consent before camera) ---------- */
.engage-card {
  max-width: 480px;
}
.engage-card .eyebrow {
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 4px;
  color: var(--cyan);
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.5);
  margin-bottom: 8px;
}
.engage-card h2 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 4px;
  color: #fff;
  text-shadow: 0 0 12px var(--cyan), 0 0 32px rgba(0, 240, 255, 0.4);
  margin-bottom: 14px;
}
.engage-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 12px;
}
.engage-card .hint {
  color: rgba(0, 240, 255, 0.78);
  font-size: 13px;
  margin-bottom: 18px;
}
.engage-card .micro {
  margin-top: 14px;
  margin-bottom: 0;
  font-size: 11px;
  color: rgba(244, 250, 255, 0.45);
  letter-spacing: 0.3px;
}
#engage-btn {
  font-family: 'Orbitron', sans-serif;
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--cyan);
  padding: 12px 28px;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 5px;
  font-size: 13px;
  font-weight: 700;
  text-shadow: 0 0 6px var(--cyan);
  transition: all 200ms ease;
  min-height: 48px;
}
#engage-btn:hover, #engage-btn:focus-visible {
  background: var(--cyan);
  color: #000;
  box-shadow: 0 0 18px var(--cyan), 0 0 36px rgba(0, 240, 255, 0.5);
  outline: none;
  text-shadow: none;
}
#engage-btn:active { transform: scale(0.97); }

/* ---------- Privacy notice in loader ---------- */
.card .privacy {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 240, 255, 0.15);
  font-size: 11px;
  color: rgba(244, 250, 255, 0.5);
  line-height: 1.45;
}

/* ---------- Reveal overlay ("+" gesture payoff) ---------- */
#reveal {
  background: rgba(2, 6, 23, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.reveal-card {
  position: relative;
  max-width: 420px;
  padding: 32px 28px;
  border-radius: 20px;
  background: linear-gradient(180deg, #0b1220 0%, #050813 100%);
  box-shadow:
    inset 0 0 0 1px rgba(34, 211, 238, 0.35),
    0 0 0 1px rgba(217, 70, 239, 0.18),
    0 0 60px rgba(34, 211, 238, 0.25),
    0 30px 80px rgba(0, 0, 0, 0.6);
  outline: none;
  animation: reveal-pulse 2.4s ease-in-out infinite;
}
@keyframes reveal-pulse {
  0%, 100% { box-shadow:
    inset 0 0 0 1px rgba(34, 211, 238, 0.35),
    0 0 0 1px rgba(217, 70, 239, 0.18),
    0 0 60px rgba(34, 211, 238, 0.22),
    0 30px 80px rgba(0, 0, 0, 0.6); }
  50%      { box-shadow:
    inset 0 0 0 1px rgba(34, 211, 238, 0.5),
    0 0 0 1px rgba(217, 70, 239, 0.28),
    0 0 80px rgba(34, 211, 238, 0.32),
    0 30px 80px rgba(0, 0, 0, 0.6); }
}
#reveal:not(.hidden) .reveal-card {
  animation:
    reveal-enter 280ms cubic-bezier(0.2, 0.8, 0.2, 1) both,
    reveal-pulse 2.4s ease-in-out 280ms infinite;
}
@keyframes reveal-enter {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.reveal-eyebrow {
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.24em;
  color: #67e8f9;
  margin-bottom: 12px;
  text-align: center;
}
.reveal-url {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 32px;
  color: #f0fdff;
  text-align: center;
  letter-spacing: 2px;
  text-shadow: 0 0 18px rgba(34, 211, 238, 0.55), 0 0 2px #fff;
  margin-bottom: 12px;
  word-break: break-all;
}
.reveal-message {
  text-align: center;
  font-size: 13px;
  color: rgba(165, 243, 252, 0.7);
  line-height: 1.5;
  margin-bottom: 22px;
}
.reveal-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto;
  background: rgba(34, 211, 238, 0.08);
  color: #a5f3fc;
  border: 1px solid rgba(34, 211, 238, 0.35);
  padding: 12px 22px;
  border-radius: 10px;
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  letter-spacing: 2.5px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  transition: all 180ms ease;
  display: flex;
  width: fit-content;
}
.reveal-copy:hover, .reveal-copy:focus-visible {
  border-color: rgba(34, 211, 238, 0.6);
  background: rgba(34, 211, 238, 0.14);
  outline: none;
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.4);
}
.reveal-copy:active { transform: scale(0.97); }
.reveal-copy.is-copied {
  background: rgba(217, 70, 239, 0.1);
  border-color: rgba(217, 70, 239, 0.4);
  color: #f5d0fe;
  box-shadow: 0 0 14px rgba(217, 70, 239, 0.35);
}
.reveal-copy[disabled] { cursor: default; }
.reveal-hint {
  margin-top: 20px;
  text-align: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(165, 243, 252, 0.45);
}
.reveal-dismiss {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: rgba(165, 243, 252, 0.6);
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: 8px;
  cursor: pointer;
  transition: all 150ms ease;
}
.reveal-dismiss:hover, .reveal-dismiss:focus-visible {
  color: #fff;
  border-color: rgba(34, 211, 238, 0.5);
  outline: none;
}
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  #cam { transition: none; }
  .dots span { animation: none; opacity: 0.7; }
  .reveal-card,
  #reveal:not(.hidden) .reveal-card {
    animation: reveal-enter-no-scale 200ms ease-out both;
  }
  @keyframes reveal-enter-no-scale {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 540px) {
  .brand { font-size: 11px; letter-spacing: 3px; }
  .meta { font-size: 10px; }
  #controls { gap: 10px; padding: 8px 12px; }
  .toggle .label, .slider .label { display: none; }
  .slider input[type="range"] { width: 80px; }
  .engage-card { padding: 24px 24px; }
  .engage-card h2 { font-size: 18px; letter-spacing: 3px; }
  #engage-btn { width: 100%; padding: 14px 20px; }
  .reveal-card { max-width: 92vw; padding: 28px 22px; }
  .reveal-url { font-size: 24px; }
  .reveal-copy { width: 100%; justify-content: center; }
  .reveal-dismiss { width: 44px; height: 44px; }
}
