:root {
  --ink: #0b1511;
  --paper: #f4f7f4;
  --muted: #6a746e;
  --line: rgba(11, 21, 17, 0.12);
  --green: #2bdc81;
  --green-bright: #4ff69b;
  --green-dark: #0b8f4e;
  --night: #07110d;
  --night-soft: #0f1b16;
  --shadow: 0 24px 70px rgba(6, 20, 13, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: smooth;
  /* iOS Safari: ignore accidental double-tap zoom, but keep pan and pinch zoom. */
  touch-action: manipulation;
}

.scanner-shell,
.scanner-shell button,
.scanner-shell a {
  touch-action: manipulation;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
a {
  font: inherit;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Landing */

.landing-shell {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 75% 22%, rgba(43, 220, 129, 0.1), transparent 23rem),
    linear-gradient(180deg, #fbfcfb 0%, #f0f5f1 100%);
}

.landing-nav {
  position: relative;
  z-index: 10;
  display: flex;
  width: min(1180px, calc(100% - 48px));
  height: 88px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #0c1a14;
  font-size: 16px;
  font-weight: 780;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(10, 48, 29, 0.14);
  border-radius: 11px;
  background: #dff8e9;
  color: #0b8f4e;
  font-size: 18px;
  font-weight: 850;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.62);
}

.prototype-pill {
  padding: 4px 7px 3px;
  border: 1px solid rgba(11, 143, 78, 0.15);
  border-radius: 999px;
  background: rgba(43, 220, 129, 0.08);
  color: #168454;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.nav-demo-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  border: 1px solid rgba(11, 21, 17, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  font-size: 13px;
  font-weight: 730;
  transition: transform 180ms ease, background 180ms ease;
}

.nav-demo-link:hover {
  transform: translateY(-2px);
  background: #fff;
}

.landing-hero {
  display: grid;
  width: min(1180px, calc(100% - 48px));
  min-height: 690px;
  margin: 0 auto;
  grid-template-columns: 0.92fr 1.08fr;
  align-items: center;
  gap: 60px;
  padding: 68px 0 78px;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  color: #327053;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.pulse-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(43, 220, 129, 0.11);
}

.hero-copy h1 {
  max-width: 600px;
  margin: 0;
  color: #07110d;
  font-size: clamp(54px, 5.45vw, 78px);
  font-weight: 820;
  letter-spacing: -0.067em;
  line-height: 0.97;
}

.hero-copy h1 span {
  display: block;
  color: #169c5b;
}

.hero-lede {
  max-width: 560px;
  margin: 28px 0 0;
  color: #56635c;
  font-size: 18px;
  line-height: 1.64;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 34px;
}

.primary-cta {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 0 22px 0 24px;
  border-radius: 16px;
  background: #0a1912;
  color: #fff;
  font-size: 14px;
  font-weight: 760;
  box-shadow: 0 14px 35px rgba(5, 23, 14, 0.2);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.primary-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(5, 23, 14, 0.25);
}

.primary-cta span {
  color: var(--green-bright);
  font-size: 20px;
}

.hero-actions p {
  display: flex;
  gap: 8px;
  color: #718078;
  font-size: 11px;
  font-weight: 650;
}

.truth-note {
  display: flex;
  max-width: 560px;
  align-items: flex-start;
  gap: 12px;
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.truth-icon {
  display: grid;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(22, 132, 84, 0.25);
  border-radius: 50%;
  color: #168454;
  font-size: 11px;
  font-weight: 800;
}

.truth-note p {
  margin: 0;
  color: #69746e;
  font-size: 12px;
  line-height: 1.55;
}

.truth-note strong {
  color: #33453b;
}

.hero-visual {
  position: relative;
  min-height: 610px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}

.ambient-one {
  width: 480px;
  height: 480px;
  background: rgba(43, 220, 129, 0.14);
  box-shadow: inset 0 0 100px rgba(255, 255, 255, 0.78);
}

.ambient-two {
  right: -45px;
  bottom: 28px;
  width: 220px;
  height: 220px;
  background: rgba(12, 143, 83, 0.1);
}

.phone-frame {
  position: relative;
  z-index: 2;
  width: 310px;
  height: 602px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 48px;
  background: #050b08;
  box-shadow:
    0 45px 90px rgba(2, 25, 13, 0.28),
    0 0 0 6px rgba(6, 19, 12, 0.1),
    inset 0 0 0 1px #29332e;
  transform: rotate(3deg);
}

.phone-speaker {
  position: absolute;
  z-index: 5;
  top: 17px;
  left: 50%;
  width: 92px;
  height: 24px;
  border-radius: 999px;
  background: #030705;
  transform: translateX(-50%);
}

.phone-screen {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 40px;
  background: #101a15;
}

.mock-camera {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.05), transparent 36%),
    repeating-linear-gradient(5deg, rgba(130, 165, 146, 0.08) 0 1px, transparent 1px 58px),
    linear-gradient(145deg, #26372f 0%, #101a15 50%, #080d0b 100%);
}

.mock-topbar {
  position: absolute;
  z-index: 4;
  top: 36px;
  right: 18px;
  left: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mock-live {
  padding: 6px 8px;
  border: 1px solid rgba(79, 246, 155, 0.35);
  border-radius: 999px;
  background: rgba(8, 25, 16, 0.76);
  color: #80f8b4;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.mock-count {
  color: rgba(255, 255, 255, 0.78);
  font-size: 10px;
  font-weight: 700;
}

.mock-total {
  position: absolute;
  z-index: 4;
  top: 77px;
  left: 18px;
  display: flex;
  flex-direction: column;
}

.mock-total small {
  color: rgba(255, 255, 255, 0.48);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.mock-total strong {
  color: #fff;
  font-size: 32px;
  letter-spacing: -0.06em;
}

.can {
  position: absolute;
  width: 56px;
  height: 98px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  background: linear-gradient(90deg, #a7b0ac 0%, #294b8b 30%, #bfc7c3 92%);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.3);
}

.can span {
  position: absolute;
  top: 15px;
  right: 12px;
  bottom: 15px;
  left: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
}

.can-one {
  top: 245px;
  left: 42px;
  transform: rotate(-16deg);
}

.can-two {
  top: 205px;
  left: 155px;
  background: linear-gradient(90deg, #a7b0ac 0%, #ba2d3d 30%, #d8dedb 92%);
  transform: rotate(8deg);
}

.can-three {
  top: 350px;
  left: 105px;
  transform: rotate(22deg);
}

.can-four {
  top: 330px;
  left: 210px;
  background: linear-gradient(90deg, #9ca6a2 0%, #2a725a 35%, #dce0de 92%);
  transform: rotate(-7deg);
}

.detection-box {
  position: absolute;
  z-index: 3;
  border: 1.5px solid rgba(107, 250, 169, 0.6);
  border-radius: 12px;
  background: rgba(53, 242, 139, 0.05);
}

.detection-box span {
  position: absolute;
  top: -24px;
  left: -1px;
  padding: 5px 8px;
  border-radius: 8px 8px 8px 0;
  background: rgba(7, 22, 13, 0.86);
  color: #86f9b8;
  font-size: 8px;
  font-weight: 750;
}

.box-one {
  top: 230px;
  left: 30px;
  width: 80px;
  height: 125px;
  transform: rotate(-4deg);
}

.box-two {
  top: 195px;
  left: 144px;
  width: 82px;
  height: 125px;
  border-width: 2px;
  border-color: var(--green-bright);
  background: rgba(53, 242, 139, 0.12);
  box-shadow: 0 0 28px rgba(79, 246, 155, 0.13);
}

.box-two span {
  background: var(--green-bright);
  color: #06140d;
}

.scan-sweep {
  position: absolute;
  z-index: 2;
  top: 310px;
  right: 20px;
  left: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79, 246, 155, 0.82), transparent);
  box-shadow: 0 0 14px rgba(79, 246, 155, 0.65);
  animation: mock-scan 3.4s ease-in-out infinite;
}

@keyframes mock-scan {
  0%,
  100% {
    transform: translateY(-90px);
    opacity: 0.35;
  }
  50% {
    transform: translateY(150px);
    opacity: 1;
  }
}

.mock-result-toast {
  position: absolute;
  z-index: 4;
  right: 16px;
  bottom: 18px;
  left: 16px;
  display: grid;
  grid-template-columns: 38px 1fr 26px;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(7, 17, 12, 0.87);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(15px);
}

.mini-can {
  width: 24px;
  height: 38px;
  justify-self: center;
  border-radius: 6px;
  background: linear-gradient(90deg, #a7b0ac, #2f9c66 45%, #dce0de);
}

.mock-result-toast div {
  display: flex;
  flex-direction: column;
}

.mock-result-toast strong {
  color: var(--green-bright);
  font-size: 18px;
  letter-spacing: -0.04em;
}

.mock-result-toast small {
  color: rgba(255, 255, 255, 0.55);
  font-size: 9px;
}

.toast-check {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: rgba(79, 246, 155, 0.14);
  color: var(--green-bright);
  font-size: 12px;
}

.qr-card {
  position: absolute;
  z-index: 4;
  right: 6px;
  bottom: 62px;
  display: grid;
  width: 190px;
  justify-items: center;
  padding: 17px;
  border: 1px solid rgba(13, 64, 39, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.89);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  transform: rotate(-2deg);
}

.qr-copy {
  display: flex;
  width: 100%;
  flex-direction: column;
  margin-bottom: 10px;
}

.qr-copy span {
  color: #2b8e59;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.qr-copy strong {
  margin-top: 3px;
  color: #1d2d24;
  font-size: 12px;
}

.qr-card img {
  width: 132px;
  height: 132px;
  padding: 7px;
  border-radius: 14px;
  background: #fff;
}

.qr-card a {
  margin-top: 7px;
  color: #4a6455;
  font-size: 9px;
  font-weight: 700;
}

.flow-section {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto 70px;
  padding: 64px;
  border-radius: 34px;
  background: #0a1610;
  color: #fff;
  box-shadow: 0 35px 75px rgba(3, 20, 11, 0.17);
}

.section-heading > span {
  color: #52e995;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.16em;
}

.section-heading h2 {
  max-width: 620px;
  margin: 12px 0 36px;
  font-size: clamp(32px, 4vw, 52px);
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.step-card {
  min-height: 210px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.035);
}

.step-number {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: rgba(79, 246, 155, 0.1);
  color: #6ef5aa;
  font-size: 10px;
  font-weight: 800;
}

.step-card h3 {
  margin: 27px 0 10px;
  font-size: 17px;
  letter-spacing: -0.025em;
}

.step-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.52);
  font-size: 13px;
  line-height: 1.58;
}

.landing-footer {
  display: flex;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  justify-content: space-between;
  padding: 0 0 32px;
  color: #758078;
  font-size: 10px;
}

/* Scanner */

.scanner-shell {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--night);
  color: #fff;
  isolation: isolate;
}

.camera-feed,
.detection-canvas,
.camera-vignette {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.camera-feed {
  z-index: 0;
  display: none;
  object-fit: cover;
  background: #07110d;
}

.camera-feed.is-visible {
  display: block;
}

.detection-canvas {
  z-index: 1;
}

.camera-vignette {
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(1, 8, 4, 0.62) 0%, transparent 20%, transparent 72%, rgba(1, 8, 4, 0.55) 100%),
    radial-gradient(circle at 50% 43%, transparent 35%, rgba(0, 0, 0, 0.2) 100%);
}

.scanner-topbar {
  position: absolute;
  z-index: 10;
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  min-height: 88px;
  grid-template-columns: 48px 1fr 70px;
  align-items: center;
  gap: 12px;
  padding: max(15px, env(safe-area-inset-top)) 16px 9px;
}

.scanner-close {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  background: rgba(4, 13, 8, 0.54);
  color: rgba(255, 255, 255, 0.86);
  font-size: 28px;
  line-height: 1;
  backdrop-filter: blur(12px);
}

.session-stat {
  display: flex;
  min-width: 0;
  min-height: 44px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  background: transparent;
  color: inherit;
}

.session-stat span {
  color: rgba(255, 255, 255, 0.56);
  font-size: 11px;
  font-weight: 650;
}

.session-stat strong {
  color: #fff;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.055em;
  line-height: 1.05;
  text-shadow: 0 2px 15px rgba(0, 0, 0, 0.35);
}

.mode-badge {
  justify-self: end;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(4, 13, 8, 0.56);
  color: rgba(255, 255, 255, 0.72);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.12em;
  backdrop-filter: blur(12px);
}

.mode-demo {
  border-color: rgba(79, 246, 155, 0.4);
  color: #75f5aa;
}

.mode-camera {
  border-color: rgba(79, 246, 155, 0.4);
  background: rgba(5, 32, 19, 0.68);
  color: #75f5aa;
}

.camera-unconnected-note {
  position: absolute;
  z-index: 5;
  top: 96px;
  left: 50%;
  display: flex;
  width: max-content;
  max-width: calc(100% - 40px);
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 220, 109, 0.22);
  border-radius: 999px;
  background: rgba(20, 18, 8, 0.64);
  color: rgba(255, 235, 173, 0.87);
  font-size: 9px;
  font-weight: 670;
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.scan-guidance {
  position: absolute;
  z-index: 4;
  top: 31%;
  left: 50%;
  display: flex;
  width: 260px;
  flex-direction: column;
  align-items: center;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  transform: translateX(-50%);
}

.guidance-reticle {
  position: relative;
  width: 76px;
  height: 76px;
  margin-bottom: 16px;
  border: 1px solid rgba(79, 246, 155, 0.65);
  border-radius: 22px;
  box-shadow: 0 0 24px rgba(79, 246, 155, 0.08);
}

.guidance-reticle::before,
.guidance-reticle::after {
  position: absolute;
  background: #4ff69b;
  content: "";
}

.guidance-reticle::before {
  top: 50%;
  left: 18px;
  width: 40px;
  height: 1px;
}

.guidance-reticle::after {
  top: 18px;
  left: 50%;
  width: 1px;
  height: 40px;
}

.scan-guidance strong {
  font-size: 15px;
}

.scan-guidance > span:last-child {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 11px;
}

.intro-card {
  position: absolute;
  z-index: 12;
  top: 50%;
  left: 50%;
  width: min(400px, calc(100% - 32px));
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  background: rgba(7, 17, 13, 0.86);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4);
  text-align: left;
  transform: translate(-50%, -48%);
  backdrop-filter: blur(22px);
}

.intro-kicker,
.summary-kicker {
  color: #5aee9c;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.15em;
}

.intro-card h1 {
  margin: 12px 0;
  font-size: clamp(29px, 8vw, 40px);
  letter-spacing: -0.055em;
  line-height: 1.04;
}

.intro-card > p {
  margin: 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
  line-height: 1.55;
}

.intro-actions {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.scan-primary,
.scan-secondary {
  min-height: 52px;
  border-radius: 15px;
  font-size: 13px;
  font-weight: 760;
}

.scan-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--green-bright);
  color: #06140d;
}

.scan-primary:disabled {
  opacity: 0.65;
}

.camera-symbol {
  position: relative;
  width: 18px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.camera-symbol::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  content: "";
  transform: translate(-50%, -50%);
}

.scan-secondary {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.88);
}

.intro-card small {
  display: block;
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.37);
  font-size: 9px;
  line-height: 1.45;
  text-align: center;
}

.camera-error {
  margin-top: 12px !important;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(255, 120, 110, 0.1);
  color: #ffb6af !important;
  font-size: 10px !important;
}

.live-detection-toast {
  position: absolute;
  z-index: 15;
  right: 16px;
  bottom: calc(104px + env(safe-area-inset-bottom));
  left: 16px;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 11px;
  max-width: 410px;
  margin: 0 auto;
  padding: 9px 10px;
  border: 1px solid rgba(79, 246, 155, 0.3);
  border-radius: 18px;
  background: rgba(5, 18, 11, 0.88);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.34);
  animation: toast-in 220ms ease-out both;
  backdrop-filter: blur(18px);
}

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

.detected-symbol {
  position: relative;
  width: 26px;
  height: 38px;
  justify-self: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  background: linear-gradient(90deg, #a8b1ad, #25845a 43%, #dce2de);
}

.detected-symbol::before {
  position: absolute;
  top: 8px;
  right: 7px;
  bottom: 8px;
  left: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
  content: "";
}

.live-detection-toast div {
  display: flex;
  flex-direction: column;
}

.live-detection-toast strong {
  color: var(--green-bright);
  font-size: 22px;
  letter-spacing: -0.04em;
}

.live-detection-toast small {
  color: rgba(255, 255, 255, 0.56);
  font-size: 10px;
}

.toast-undo {
  min-width: 52px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 760;
}

.scanner-controls {
  position: absolute;
  z-index: 10;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px 28px 0 0;
  background: rgba(6, 15, 11, 0.94);
  box-shadow: 0 -18px 52px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(22px);
}

.scanner-controls.is-camera-compact {
  right: 10px;
  bottom: calc(8px + env(safe-area-inset-bottom));
  left: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(5, 15, 10, 0.76);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
}

.scanner-controls.is-camera-compact .controls-handle,
.scanner-controls.is-camera-compact #reset,
.scanner-controls.is-camera-compact #finish {
  display: none;
}

.camera-compact-status {
  display: grid;
  min-width: 0;
  grid-template-columns: 9px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 0 4px;
  text-align: left;
}

.auto-scan-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-bright);
  box-shadow: 0 0 0 5px rgba(79, 246, 155, 0.1), 0 0 14px rgba(79, 246, 155, 0.7);
}

.scanner-controls.is-camera-compact .camera-compact-status {
  padding: 0 4px;
  text-align: left;
}

.scanner-controls.is-camera-compact .camera-compact-status strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scanner-controls.is-camera-compact .camera-compact-status p {
  margin: 2px 0 0;
  overflow: hidden;
  font-size: 9px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scanner-controls.is-camera-compact .session-actions {
  display: grid;
  grid-template-columns: 58px 72px;
  gap: 6px;
  margin: 0;
}

.scanner-controls.is-camera-compact .session-actions button {
  min-height: 44px;
  padding: 0 9px;
}

.scanner-controls.is-camera-compact .session-actions .finish-button {
  font-size: 10px;
}

.controls-handle {
  width: 37px;
  height: 4px;
  margin: 0 auto 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.17);
}

.test-disclaimer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 9px;
}

.test-disclaimer span {
  padding: 4px 6px;
  border: 1px solid rgba(79, 246, 155, 0.25);
  border-radius: 999px;
  color: #67f3a4;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.test-disclaimer p {
  margin: 0;
  color: rgba(255, 255, 255, 0.42);
  font-size: 9px;
}

.next-detection {
  display: grid;
  width: 100%;
  min-height: 62px;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border-radius: 17px;
  background: var(--green-bright);
  color: #06140d;
  text-align: left;
}

.plus-ring {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(2, 31, 15, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  font-size: 20px;
}

.next-detection > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.next-detection strong {
  font-size: 13px;
}

.next-detection small {
  margin-top: 2px;
  overflow: hidden;
  opacity: 0.64;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.next-value {
  font-size: 13px;
  font-weight: 820;
}

.manual-types {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 8px;
}

.manual-types button {
  display: flex;
  min-width: 0;
  min-height: 44px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 7px 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.74);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-types button span {
  margin-top: 2px;
  color: #66f2a3;
  font-size: 8px;
  font-weight: 750;
}

.camera-empty-state {
  padding: 5px 2px 10px;
  text-align: center;
}

.camera-empty-state strong {
  display: block;
  font-size: 13px;
}

.camera-empty-state p {
  margin: 6px auto 12px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  line-height: 1.45;
}

.camera-empty-state button {
  padding: 10px 15px;
  border-radius: 12px;
  background: rgba(79, 246, 155, 0.12);
  color: #71f2a7;
  font-size: 10px;
  font-weight: 740;
}

.session-actions {
  display: grid;
  grid-template-columns: 68px 76px 1fr;
  gap: 7px;
  margin-top: 9px;
}

.session-actions button {
  display: flex;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  font-weight: 690;
}

.session-actions button:disabled {
  opacity: 0.32;
}

.session-actions .finish-button {
  justify-content: space-between;
  padding: 0 15px;
  border-color: rgba(255, 255, 255, 0.14);
  background: #f3f7f4;
  color: #0b1912;
  font-size: 11px;
  font-weight: 790;
}

.summary-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 6, 3, 0.64);
  backdrop-filter: blur(8px);
}

.summary-sheet {
  position: relative;
  width: min(480px, 100%);
  max-height: calc(100vh - 30px);
  overflow: auto;
  padding: 30px 22px calc(21px + env(safe-area-inset-bottom));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 30px 30px 0 0;
  background:
    radial-gradient(circle at 50% -5%, rgba(79, 246, 155, 0.12), transparent 230px),
    #0a1510;
  box-shadow: 0 -20px 70px rgba(0, 0, 0, 0.46);
  animation: sheet-up 240ms ease-out both;
}

@keyframes sheet-up {
  from {
    transform: translateY(28px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.summary-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.65);
  font-size: 22px;
}

.summary-sheet h2 {
  margin: 13px 0 0;
  color: var(--green-bright);
  font-size: 56px;
  letter-spacing: -0.07em;
  line-height: 1;
}

.summary-count {
  margin: 7px 0 24px;
  color: rgba(255, 255, 255, 0.54);
  font-size: 12px;
}

.breakdown-list {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.025);
}

.breakdown-list div {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.breakdown-list div:last-child {
  border-bottom: 0;
}

.breakdown-list span {
  color: rgba(255, 255, 255, 0.57);
  font-size: 11px;
}

.breakdown-list strong {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.summary-caveat {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.summary-caveat > span {
  display: grid;
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 1px solid rgba(79, 246, 155, 0.3);
  border-radius: 50%;
  color: #63eca0;
  font-size: 9px;
  font-weight: 800;
}

.summary-caveat p {
  margin: 0;
  color: rgba(255, 255, 255, 0.41);
  font-size: 9px;
  line-height: 1.5;
}

.share-result,
.continue-scanning {
  width: 100%;
  min-height: 50px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 760;
}

.share-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 17px;
  background: var(--green-bright);
  color: #06140d;
}

.continue-scanning {
  margin-top: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.58);
}

@media (max-width: 980px) {
  .landing-hero {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-top: 55px;
  }

  .hero-copy {
    text-align: center;
  }

  .eyebrow,
  .hero-actions,
  .truth-note {
    justify-content: center;
  }

  .hero-copy h1,
  .hero-lede,
  .truth-note {
    margin-right: auto;
    margin-left: auto;
  }

  .hero-visual {
    min-height: 660px;
  }

  .qr-card {
    right: calc(50% - 250px);
  }
}

@media (max-width: 720px) {
  .landing-nav,
  .landing-hero,
  .flow-section,
  .landing-footer {
    width: min(100% - 28px, 1180px);
  }

  .landing-nav {
    height: 72px;
  }

  .prototype-pill,
  .nav-demo-link {
    display: none;
  }

  .landing-hero {
    min-height: auto;
    padding: 44px 0 62px;
  }

  .eyebrow {
    font-size: 8px;
  }

  .hero-copy h1 {
    font-size: clamp(45px, 13vw, 64px);
  }

  .hero-lede {
    font-size: 15px;
  }

  .hero-actions {
    flex-direction: column;
    gap: 9px;
  }

  .truth-note {
    text-align: left;
  }

  .hero-visual {
    min-height: 610px;
    transform: scale(0.91);
  }

  .phone-frame {
    transform: rotate(1.5deg);
  }

  .qr-card {
    right: 0;
    bottom: 20px;
    transform: rotate(-1deg) scale(0.86);
    transform-origin: bottom right;
  }

  .flow-section {
    padding: 38px 22px 22px;
    border-radius: 28px;
  }

  .steps-grid {
    grid-template-columns: 1fr;
  }

  .step-card {
    min-height: 0;
  }

  .landing-footer {
    flex-direction: column;
    gap: 5px;
  }
}

@media (min-width: 700px) {
  .scanner-shell {
    top: 24px;
    bottom: 24px;
    left: 50%;
    width: 430px;
    height: calc(100vh - 48px);
    border: 8px solid #020805;
    border-radius: 44px;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.35);
    transform: translateX(-50%);
  }

  body:has(.scanner-shell) {
    background:
      radial-gradient(circle at 50% 50%, rgba(43, 220, 129, 0.17), transparent 410px),
      #e9efe9;
  }
}

@media (max-height: 690px) and (max-width: 699px) {
  .scanner-topbar {
    min-height: 74px;
  }

  .session-stat strong {
    font-size: 23px;
  }

  .scanner-controls {
    padding-top: 6px;
  }

  #demo-controls .manual-types {
    display: none;
  }

  .live-detection-toast {
    bottom: calc(100px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Accessibility and static-demo hardening. */
:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid var(--green-bright);
  outline-offset: 3px;
}

.scanner-shell :where(
  .mode-badge,
  .camera-unconnected-note,
  .scan-guidance span,
  .intro-kicker,
  .intro-card small,
  .test-disclaimer span,
  .test-disclaimer p,
  .next-detection small,
  .manual-types button,
  .manual-types button span,
  .camera-empty-state p,
  .session-actions button,
  .summary-kicker,
  .summary-caveat p
) {
  font-size: max(11px, .68rem);
}

[hidden] {
  display: none !important;
}

/* --- paikallinen mittaustila (?perf=1) ---------------------------------- */
/* Näkyy vain mittausosoitteella. CSP kieltää inline-tyylit, joten paneelin
   ulkoasu on täällä eikä JavaScriptissä. */
.perf-hud {
  position: fixed;
  inset-block-start: 56px;
  inset-inline-start: 8px;
  z-index: 40;
  max-width: min(320px, calc(100vw - 16px));
  padding: 10px 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(120, 255, 190, .35);
  background: rgba(6, 16, 11, .88);
  color: #d6ffe9;
  font: 500 11px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  pointer-events: auto;
}
.perf-hud strong {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8ff0c0;
}
.perf-hud-rows {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
}
.perf-hud-copy {
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(120, 255, 190, .45);
  background: transparent;
  color: #a9ffd2;
  font: inherit;
  cursor: pointer;
}
.perf-hud-copy:hover { background: rgba(120, 255, 190, .12); }

/* --- musta laatikko (?rec=1) -------------------------------------------- */
/* Näkyy vain nauhoitusosoitteella. Ilmoitus on tarkoituksella koko ajan
   näkyvissä: käyttäjän pitää tietää että ruutuja tallennetaan muistiin. */
.rec-banner {
  position: fixed;
  inset-block-end: 96px;
  inset-inline: 12px;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 140, 140, .5);
  background: rgba(30, 8, 8, .9);
  color: #ffd9d9;
  font: 600 12px/1.35 system-ui, sans-serif;
}
.rec-save {
  padding: 7px 11px;
  border-radius: 9px;
  border: 1px solid rgba(255, 190, 190, .55);
  background: transparent;
  color: #fff0f0;
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
}
.rec-save:hover { background: rgba(255, 190, 190, .14); }
