:root {
  --bg: #08110f;
  --bg-elev: #10201c;
  --ink: #eef7f2;
  --muted: #9bb5ab;
  --accent: #d6ff4b;
  --accent-ink: #10200a;
  --danger: #ff6b5a;
  --line: rgba(238, 247, 242, 0.14);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --font-display: "Syne", sans-serif;
  --font-body: "Instrument Sans", sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 15% 10%, rgba(214, 255, 75, 0.16), transparent 55%),
    radial-gradient(ellipse 55% 45% at 90% 20%, rgba(56, 180, 140, 0.18), transparent 50%),
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(16, 48, 40, 0.9), transparent 60%),
    linear-gradient(160deg, #06100e 0%, #0c1a16 45%, #08110f 100%);
  z-index: 0;
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  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.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) 0 3rem;
  display: grid;
  gap: 1.5rem;
}

.brand {
  animation: rise 0.7s ease both;
}

.brand-mark {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 14vw, 6.5rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.9;
  color: var(--ink);
  text-shadow: 0 0 40px rgba(214, 255, 75, 0.18);
}

.brand h1 {
  margin: 0;
  max-width: 14ch;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 4.4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.lede {
  margin: 0.85rem 0 0;
  max-width: 36ch;
  color: var(--muted);
  font-size: 1.02rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.4rem;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.85rem 1.25rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn.ghost {
  background: rgba(238, 247, 242, 0.04);
  border-color: var(--line);
  color: var(--ink);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.stage {
  animation: rise 0.55s ease both;
}

.viewport {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #000;
  aspect-ratio: 3 / 4;
  max-height: min(72vh, 640px);
  box-shadow: var(--shadow);
}

video,
#overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#overlay {
  pointer-events: none;
}

.scan-frame {
  position: absolute;
  inset: 18% 14%;
  border: 1px solid rgba(214, 255, 75, 0.28);
  border-radius: 14px;
  overflow: hidden;
}

.corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 3px solid var(--accent);
}

.corner.tl {
  top: -2px;
  left: -2px;
  border-right: 0;
  border-bottom: 0;
  border-radius: 8px 0 0 0;
}

.corner.tr {
  top: -2px;
  right: -2px;
  border-left: 0;
  border-bottom: 0;
  border-radius: 0 8px 0 0;
}

.corner.bl {
  bottom: -2px;
  left: -2px;
  border-right: 0;
  border-top: 0;
  border-radius: 0 0 0 8px;
}

.corner.br {
  bottom: -2px;
  right: -2px;
  border-left: 0;
  border-top: 0;
  border-radius: 0 0 8px 0;
}

.beam {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 18px rgba(214, 255, 75, 0.75);
  animation: sweep 2.2s ease-in-out infinite;
}

.hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1rem;
  margin: 0;
  text-align: center;
  font-size: 0.92rem;
  color: rgba(238, 247, 242, 0.86);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.9rem;
}

.result {
  padding: 1.15rem 1.2rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(16, 32, 28, 0.92), rgba(10, 20, 17, 0.92));
  animation: pop 0.35s ease both;
}

.result-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.result-value {
  margin: 0.55rem 0 0;
  font-size: 1.08rem;
  word-break: break-word;
  white-space: pre-wrap;
}

.status {
  min-height: 1.4em;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.status.error {
  color: var(--danger);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes sweep {
  0%,
  100% {
    top: 12%;
    opacity: 0.35;
  }
  50% {
    top: 82%;
    opacity: 1;
  }
}

@media (min-width: 720px) {
  .viewport {
    aspect-ratio: 4 / 3;
  }
}

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