/* exfil.cx reader — one-way QR receiver
   Shares the design tokens of the main app's style.css. */

:root {
  color-scheme: dark;

  --bg: #0a0c11;
  --bg-deep: #06080c;
  --surface-1: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);

  --text: #e6e9f2;
  --text-dim: #aab1c4;
  --text-faint: #6d7589;

  --electric: #00d1ff;
  --electric-soft: rgba(0, 209, 255, 0.18);
  --electric-glow: rgba(0, 209, 255, 0.35);
  --deep-purple: #8a2be2;

  --ok: #4ade80;
  --warn: #ffbe5c;
  --err: #ff6a88;
  --on-primary: #001026;

  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 22px;

  --sans: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "Geist Mono", "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
  padding-top: 60px;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% -10%, rgba(0, 209, 255, 0.12), transparent 45%),
    radial-gradient(circle at 90% 5%, rgba(138, 43, 226, 0.10), transparent 50%),
    linear-gradient(180deg, #07090e 0%, #0a0c11 40%, #050608 100%);
}

.ambient::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 80%);
}

/* topbar */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 60px;
  background: rgba(10, 12, 17, 0.78);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.brand__mark {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--electric), var(--deep-purple));
  box-shadow: 0 0 16px -2px var(--electric-glow);
  position: relative;
}

.brand__mark::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 3px;
  background: var(--bg);
}

.brand__dot { color: var(--electric); }
.brand__sub { color: var(--text-faint); font-weight: 500; font-size: 13px; margin-left: 4px; }

/* badge */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin-left: auto;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--text);
}

.badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--text-faint);
}

.badge--idle::before { background: var(--text-faint); }
.badge--scan { background: rgba(0, 209, 255, 0.12); border-color: rgba(0, 209, 255, 0.4); color: #b4f5ff; }
.badge--scan::before { background: var(--electric); box-shadow: 0 0 8px var(--electric); animation: pulse 1.4s infinite; }
.badge--ok { background: rgba(74, 222, 128, 0.12); border-color: rgba(74, 222, 128, 0.4); color: #b6f5cc; }
.badge--ok::before { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.badge--warn { background: rgba(255, 190, 92, 0.12); border-color: rgba(255, 190, 92, 0.4); color: #f5d8a3; }
.badge--warn::before { background: var(--warn); }
.badge--error { background: rgba(255, 106, 136, 0.12); border-color: rgba(255, 106, 136, 0.4); color: #ffb4c2; }
.badge--error::before { background: var(--err); }

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

/* shell */

.shell {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 20px 64px;
  display: grid;
  gap: 20px;
}

.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--electric);
  margin-bottom: 12px;
}

.hero { padding-bottom: 4px; }

.hero__title {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

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

.hero__lede {
  margin: 0;
  font-size: 1rem;
  color: var(--text-dim);
}

.hero__lede code,
.howto code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--text);
}

/* cards */

.card {
  background: var(--surface-1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
}

.card__title {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--electric);
  font-weight: 500;
}

.card__hint { margin-left: auto; }

/* viewfinder */

.vf-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--electric);
  border-style: solid;
  border-width: 0;
  z-index: 5;
  pointer-events: none;
}
.vf-corner--tl { top: 10px; left: 10px; border-top-width: 2px; border-left-width: 2px; }
.vf-corner--tr { top: 10px; right: 10px; border-top-width: 2px; border-right-width: 2px; }
.vf-corner--bl { bottom: 10px; left: 10px; border-bottom-width: 2px; border-left-width: 2px; }
.vf-corner--br { bottom: 10px; right: 10px; border-bottom-width: 2px; border-right-width: 2px; }

.video-shell {
  position: relative;
  overflow: hidden;
  background: #000;
  aspect-ratio: 4 / 3;
}

.video-shell video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.video-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 18px;
  color: #d9e8ff;
  font-size: 0.95rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.74));
  z-index: 4;
  transition: opacity 200ms ease;
}

.scanline {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--electric), transparent);
  z-index: 3;
  animation: scanline 3.4s linear infinite;
  pointer-events: none;
}

@keyframes scanline {
  0% { transform: translateY(-2px); }
  100% { transform: translateY(80vh); }
}

.camera-controls {
  display: grid;
  gap: 12px;
  padding: 14px 18px;
}

/* form */

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field--full { grid-column: 1 / -1; }

.field__label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

select {
  width: 100%;
  font: inherit;
  font-family: var(--mono);
  font-size: 0.92rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 11px 14px;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%2300d1ff' d='M0 0l5 6 5-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

select:focus {
  border-color: var(--electric);
  box-shadow: 0 0 0 3px rgba(0, 209, 255, 0.18);
}

/* buttons */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: transform 120ms ease, background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn--compact { min-height: 38px; padding: 8px 14px; font-size: 0.9rem; }

.btn--primary {
  background: var(--electric);
  color: var(--on-primary);
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 0 22px -8px var(--electric-glow);
}

.btn--primary:hover:not(:disabled) {
  background: #19d8ff;
  box-shadow: 0 0 32px -6px var(--electric-glow);
}

.btn--danger {
  background: rgba(255, 106, 136, 0.12);
  border-color: rgba(255, 106, 136, 0.4);
  color: #ffb4c2;
}

.btn--danger:hover:not(:disabled) { background: rgba(255, 106, 136, 0.2); }

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px;
}

.card__head + .controls,
.status-progress + .meta-grid + .controls { border-top: 1px solid var(--border); }

/* progress */

.status-progress {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.status-progress__track {
  height: 6px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.status-progress__bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--electric), var(--deep-purple));
  box-shadow: 0 0 12px -2px var(--electric-glow);
  transition: width 240ms ease;
}

/* meta grid */

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 18px;
  margin: 0;
}

.meta-grid__full { grid-column: 1 / -1; }

.meta-grid > div {
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
}

.meta-grid dt {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.meta-grid dd {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.4;
}

.mono { font-family: var(--mono); font-size: 0.88rem; }
.mono--dim { color: var(--text-faint); }
.wrap { overflow-wrap: anywhere; word-break: break-all; }

/* how-to list */

.howto {
  margin: 0;
  padding: 14px 18px 18px 36px;
  display: grid;
  gap: 8px;
  color: var(--text-dim);
}

.howto li { padding-left: 4px; }
.howto strong { color: var(--text); font-weight: 600; }

/* footer */

.footer {
  max-width: 880px;
  margin: 8px auto 32px;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
}

/* mobile */

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .brand__sub { display: none; }
  .shell { padding: 18px 14px 48px; gap: 14px; }
  .hero__title { font-size: clamp(1.6rem, 7vw, 2rem); }
  .video-shell { aspect-ratio: 3 / 4; min-height: 60vh; }
  .meta-grid { grid-template-columns: 1fr; padding: 12px 14px; }
  .status-progress, .camera-controls, .controls, .card__head { padding-left: 14px; padding-right: 14px; }
  .footer { flex-direction: column; align-items: flex-start; gap: 4px; }
  .controls .btn--compact { flex: 1 1 calc(50% - 5px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
