/* ═══════════════════════════════════════════
   I Have Nothing To Hide Club — dashboard
   ═══════════════════════════════════════════ */

:root {
  --bg: #0a0c0f;
  --bg-elevated: #11151b;
  --bg-panel: #131820;
  --bg-panel-hover: #171d27;
  --border: #243041;
  --border-strong: #334155;
  --text: #e8edf4;
  --text-muted: #8b9bb0;
  --text-dim: #5c6b7f;
  --accent: #22c55e;
  --accent-dim: rgba(34, 197, 94, 0.15);
  --danger: #ef4444;
  --danger-dim: rgba(239, 68, 68, 0.15);
  --warn: #f59e0b;
  --cyan: #22d3ee;
  --radius: 12px;
  --radius-sm: 8px;
  --font-sans: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --shadow: 0 0 0 1px var(--border), 0 12px 40px rgba(0, 0, 0, 0.45);
  --header-h: auto;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(34, 197, 94, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(239, 68, 68, 0.05), transparent),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Scanlines / noise (subtle CRT vibe) */
.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  opacity: 0.5;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9997;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Header ── */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 12, 15, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--danger-dim);
  border: 1px solid rgba(239, 68, 68, 0.4);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.eye {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--danger);
  position: relative;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

.eye::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: var(--danger);
  animation: pupil 4s ease-in-out infinite;
}

@keyframes pupil {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(2px, -1px); }
  50% { transform: translate(-1px, 1px); }
  75% { transform: translate(1px, 1px); }
}

.brand-text h1 {
  margin: 0;
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.tagline {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.live-pill.is-live {
  border-color: rgba(239, 68, 68, 0.5);
  color: var(--danger);
  background: var(--danger-dim);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
}

.live-pill.is-live .live-dot {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.watchers {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}

.watchers-count {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
}

.watchers-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Dashboard layout ── */
.dashboard {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  padding: 1.25rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

@media (min-width: 800px) {
  .hero-panel {
    grid-template-columns: 1.4fr 1fr;
    padding: 1.5rem 1.75rem;
    align-items: start;
  }
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--danger);
}

.hero-copy h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.lede {
  margin: 0 0 1.1rem;
  color: var(--text-muted);
  max-width: 42ch;
}

.lede em {
  color: var(--text);
  font-style: normal;
  border-bottom: 1px dashed var(--border-strong);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.consent-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-dim);
  max-width: 48ch;
}

/* Score card */
.score-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.15rem;
}

.score-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.score-value {
  font-family: var(--font-mono);
  font-size: 2.75rem;
  font-weight: 600;
  line-height: 1.1;
  margin: 0.25rem 0 0.65rem;
  color: var(--text);
}

.score-value span {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-left: 0.1rem;
}

.score-value.is-high {
  color: var(--accent);
  text-shadow: 0 0 24px rgba(34, 197, 94, 0.35);
}

.score-bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.score-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--danger), var(--warn), var(--accent));
  border-radius: inherit;
  transition: width 0.4s ease;
}

.score-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 0.75rem;
}

.score-checklist li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.score-checklist li.done {
  color: var(--accent);
}

.score-checklist .check {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
  position: relative;
}

.score-checklist li.done .check {
  background: var(--accent-dim);
  border-color: var(--accent);
}

.score-checklist li.done .check::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 0px;
  width: 4px;
  height: 8px;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .panel-wide {
    grid-column: span 2;
  }
}

/* Panels */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: border-color 0.2s, background 0.2s;
}

.panel.is-active {
  border-color: rgba(34, 197, 94, 0.35);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.1);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.panel-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.panel-sub {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.panel-badges {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.45rem;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.badge.badge-on,
.badge.is-on {
  color: var(--accent);
  border-color: rgba(34, 197, 94, 0.4);
  background: var(--accent-dim);
}

.badge.is-err {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.4);
  background: var(--danger-dim);
}

/* Buttons */
.btn {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, opacity 0.15s;
}

.btn:hover:not(:disabled) {
  background: var(--bg-panel-hover);
  border-color: var(--text-dim);
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-sm {
  font-size: 0.72rem;
  padding: 0.3rem 0.55rem;
  font-weight: 500;
}

.btn-danger {
  background: linear-gradient(180deg, #f04444 0%, #dc2626 100%);
  border-color: #b91c1c;
  color: #fff;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.25);
  letter-spacing: 0.04em;
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(180deg, #f87171 0%, #ef4444 100%);
  border-color: #ef4444;
}

.btn-ghost {
  background: transparent;
}

/* Camera / screen */
.camera-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.camera-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  transform: scaleX(-1); /* mirror selfie */
}

.camera-stage video.is-on {
  display: block;
}

#screenVideo {
  transform: none;
}

.camera-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background:
    radial-gradient(circle at center, rgba(34, 197, 94, 0.04), transparent 60%),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 8px,
      rgba(255, 255, 255, 0.015) 8px,
      rgba(255, 255, 255, 0.015) 16px
    );
}

.camera-placeholder small {
  font-size: 0.7rem;
  opacity: 0.7;
}

.camera-stage video.is-on + .camera-placeholder,
.camera-stage:has(video.is-on) .camera-placeholder {
  display: none;
}

.camera-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.65rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  font-family: var(--font-mono);
  font-size: 0.7rem;
  pointer-events: none;
}

.rec-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--danger);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse 1s infinite;
}

.cam-meta {
  color: rgba(255, 255, 255, 0.7);
}

/* Audio meter */
.meter-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

#audioCanvas {
  width: 100%;
  height: 100px;
  background: #0a0e14;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: block;
}

.meter-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.stat-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
}

.level-bar {
  height: 10px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.level-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--warn) 70%, var(--danger));
  border-radius: inherit;
  transition: width 0.05s linear;
}

/* Transcript */
.transcript {
  flex: 1;
  min-height: 140px;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
}

.transcript-placeholder {
  margin: 0;
  color: var(--text-dim);
}

#transcriptText {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

#transcriptText .interim {
  color: var(--text-muted);
  font-style: italic;
}

/* Key-value lists */
.kv {
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.kv > div {
  display: grid;
  grid-template-columns: minmax(90px, 38%) 1fr;
  gap: 0.5rem;
  align-items: baseline;
  font-size: 0.8rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(36, 48, 65, 0.6);
}

.kv dt {
  margin: 0;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.kv dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text);
  word-break: break-all;
}

.kv-dense > div {
  grid-template-columns: minmax(80px, 32%) 1fr;
}

.geo-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.map-link {
  color: var(--cyan);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
}

.map-link:hover {
  text-decoration: underline;
}

/* Motion */
.motion-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.gyro-viz {
  height: 90px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  perspective: 400px;
}

.gyro-phone {
  width: 36px;
  height: 60px;
  border-radius: 6px;
  border: 2px solid var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.2);
  transition: transform 0.1s linear;
  transform-style: preserve-3d;
}

/* Dual stats */
.dual-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 400px) {
  .dual-stats {
    grid-template-columns: 1fr 1fr;
  }
}

.stat-block h4 {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 500;
}

.big-num {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.6rem;
  line-height: 1.2;
}

/* Input */
.input-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cursor-pad {
  position: relative;
  height: 100px;
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  touch-action: none;
}

.cursor-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 12px var(--danger);
  left: 50%;
  top: 50%;
  pointer-events: none;
  opacity: 0.85;
}

.pad-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  pointer-events: none;
}

.key-log {
  min-height: 2.2em;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--warn);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
  word-break: break-all;
}

/* Device list */
.device-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 220px;
  overflow-y: auto;
}

.device-list li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.45rem 0.55rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}

.device-list li .kind {
  display: inline-block;
  color: var(--cyan);
  margin-right: 0.4rem;
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
}

.device-list .muted {
  color: var(--text-dim);
  border-style: dashed;
}

/* Manifesto */
.panel-manifesto {
  grid-column: 1 / -1;
}

.manifesto {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.manifesto li {
  margin-bottom: 0.4rem;
  padding-left: 0.25rem;
}

.manifesto li::marker {
  color: var(--danger);
  font-family: var(--font-mono);
  font-weight: 600;
}

.disclaimer {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
  line-height: 1.45;
}

/* Footer */
.site-footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.site-footer p {
  margin: 0.25rem 0;
}

.footer-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

/* Toasts */
.toast-host {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  left: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  pointer-events: none;
}

@media (min-width: 480px) {
  .toast-host {
    left: auto;
    max-width: 360px;
  }
}

.toast {
  pointer-events: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.25s ease;
  max-width: 100%;
}

.toast.is-error {
  border-color: rgba(239, 68, 68, 0.5);
}

.toast.is-ok {
  border-color: rgba(34, 197, 94, 0.45);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .eye::after,
  .live-pill.is-live .live-dot,
  .rec-dot {
    animation: none;
  }

  .score-fill,
  .level-fill,
  .gyro-phone {
    transition: none;
  }
}
