:root {
  --bg: #050705;
  --panel: #0b0f0b;
  --panel-2: #111711;
  --line: rgba(215, 255, 211, 0.14);
  --line-strong: rgba(118, 255, 102, 0.48);
  --text: #f6fff3;
  --muted: #9ba99b;
  --soft: #dce9dc;
  --green: #78ff66;
  --green-2: #b4ffab;
  --danger: #ff746d;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.54);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 38% -12%, rgba(120, 255, 102, 0.13), transparent 35rem),
    linear-gradient(180deg, #050705 0%, #080b08 56%, #050705 100%);
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 58px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 0 44px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-logo {
  width: 44px;
  height: 44px;
  color: var(--green);
  fill: rgba(120, 255, 102, 0.05);
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 18px rgba(120, 255, 102, 0.22));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.nav-links a,
.secondary-action {
  text-decoration: none;
}

.nav-links a:hover,
.secondary-action:hover {
  color: var(--green);
}

.hero {
  min-height: 640px;
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(430px, 1fr);
  align-items: center;
  gap: 54px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-copy h1 {
  max-width: 730px;
  margin: 0;
  font-size: clamp(58px, 8vw, 112px);
  line-height: 0.88;
  letter-spacing: 0;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.hero-copy h1 span {
  display: block;
}

.hero-text {
  max-width: 570px;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
  font-weight: 650;
}

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

.primary-action {
  min-height: 52px;
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: #061006;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 16px 48px rgba(120, 255, 102, 0.2);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.72;
}

.primary-action svg,
.secondary-action svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-action:hover:not(:disabled) {
  background: var(--green-2);
  transform: translateY(-1px);
  box-shadow: 0 20px 58px rgba(120, 255, 102, 0.26);
}

.secondary-action {
  color: var(--soft);
  font-size: 14px;
  font-weight: 900;
}

.scan-panel {
  min-height: 594px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(rgba(120, 255, 102, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 255, 102, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(16, 22, 16, 0.96), rgba(4, 6, 4, 0.98));
  background-size: 44px 44px, 44px 44px, auto;
  box-shadow: var(--shadow);
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.scan-panel::after {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(120, 255, 102, 0.08);
  border-radius: 13px;
  pointer-events: none;
}

.panel-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}

.panel-topline span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(3, 5, 3, 0.64);
  color: var(--soft);
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 900;
}

.camera-stage {
  height: 370px;
  margin-top: 20px;
  border: 1px solid rgba(120, 255, 102, 0.14);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.42);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  z-index: 2;
}

#cameraPreview,
#landmarkCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

#cameraPreview {
  opacity: 0;
  transition: opacity 220ms ease;
}

#cameraPreview.is-live {
  opacity: 0.86;
}

#analysisCanvas {
  display: none;
}

.empty-camera {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: var(--green);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.empty-camera svg {
  width: 112px;
  height: 112px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 24px rgba(120, 255, 102, 0.28));
}

.camera-start {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: #061006;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 38px rgba(120, 255, 102, 0.2);
}

.camera-start:hover {
  background: var(--green-2);
}

.empty-camera.is-hidden {
  display: none;
}

.scan-badge {
  position: absolute;
  left: 50%;
  bottom: 24px;
  translate: -50% 0;
  border: 1px solid rgba(120, 255, 102, 0.24);
  border-radius: 10px;
  background: rgba(2, 4, 2, 0.78);
  color: var(--text);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.42);
}

.score-row {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 16px;
  align-items: center;
  margin-top: 16px;
  position: relative;
  z-index: 2;
}

.score-dial {
  --score: 0;
  width: 116px;
  height: 116px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  align-content: center;
  background:
    radial-gradient(circle at center, #070907 0 55%, transparent 56%),
    conic-gradient(var(--green) calc(var(--score) * 1%), rgba(120, 255, 102, 0.12) 0);
  color: var(--text);
  box-shadow: 0 0 42px rgba(120, 255, 102, 0.13);
}

.score-dial span {
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

.score-dial small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.verdict {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(16, 23, 16, 0.7);
  padding: 17px;
}

.readout-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.verdict strong,
.metric-grid strong {
  font-size: 17px;
  font-weight: 900;
}

.verdict p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 650;
}

.advice-list {
  display: none;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
}

.advice-list.is-visible {
  display: grid;
  gap: 7px;
}

.advice-list li {
  position: relative;
  padding-left: 18px;
}

.advice-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 14px rgba(120, 255, 102, 0.46);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
  position: relative;
  z-index: 2;
}

.metric-grid > div,
.privacy-note,
.protection-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(16, 23, 16, 0.68);
}

.metric-grid > div {
  padding: 15px;
  min-width: 0;
}

.privacy-note {
  margin-top: 20px;
  padding: 17px 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  font-weight: 650;
}

.privacy-note p {
  margin: 0;
}

.protection-panel {
  margin-top: 14px;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  background:
    linear-gradient(90deg, rgba(255, 116, 109, 0.11), transparent 50%),
    rgba(16, 23, 16, 0.75);
}

.protection-panel h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.12;
  font-weight: 900;
}

.protection-panel p {
  max-width: 700px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 650;
}

.protection-link {
  flex: 0 0 auto;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding: 18px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.site-footer nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--green);
}

.legal-page {
  width: min(840px, 100%);
  margin: 0 auto;
  padding: 28px 0 40px;
}

.legal-page h1 {
  margin: 0;
  font-size: clamp(44px, 8vw, 82px);
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: 0;
}

.legal-updated {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.legal-page section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(16, 23, 16, 0.68);
  margin-top: 14px;
  padding: 22px;
}

.legal-page section:first-of-type {
  margin-top: 30px;
}

.legal-page h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 900;
}

.legal-page p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  font-weight: 650;
}

.exposure-toast {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 30;
  width: min(660px, calc(100% - 32px));
  border: 1px solid rgba(120, 255, 102, 0.54);
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(120, 255, 102, 0.18), rgba(255, 116, 109, 0.12)),
    rgba(5, 8, 5, 0.98);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.72), 0 0 48px rgba(120, 255, 102, 0.2);
  padding: 22px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -44%) scale(0.96);
  transition: opacity 220ms ease, transform 220ms ease;
}

.toast-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(215, 255, 211, 0.18);
  border-radius: 10px;
  background: rgba(3, 5, 3, 0.72);
  color: var(--soft);
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
  cursor: pointer;
}

.toast-close:hover {
  color: var(--green);
  border-color: rgba(120, 255, 102, 0.44);
}

.exposure-toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.toast-kicker {
  display: block;
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 7px;
}

.exposure-toast strong {
  display: block;
  font-size: 24px;
  line-height: 1.12;
  font-weight: 900;
}

.exposure-toast p {
  margin: 9px 0 0;
  color: var(--soft);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 650;
}

.exposure-toast a {
  border-radius: 10px;
  background: var(--green);
  color: #061006;
  padding: 12px 14px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

@media (max-width: 960px) {
  .page-shell {
    width: min(100% - 22px, 700px);
    padding-top: 18px;
  }

  .site-header,
  .protection-panel,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: wrap;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 34px;
  }

  .hero-copy h1 {
    font-size: clamp(54px, 16vw, 84px);
  }

  .hero-text {
    font-size: 16px;
  }

  .scan-panel {
    min-height: auto;
  }

  .camera-stage {
    height: 340px;
  }
}

@media (max-width: 580px) {
  .page-shell {
    width: min(100% - 16px, 700px);
  }

  .hero-copy h1 {
    font-size: 38px;
    line-height: 0.96;
  }

  .hero-text {
    font-size: 15px;
    line-height: 1.55;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
  }

  .secondary-action {
    text-align: center;
  }

  .scan-panel {
    padding: 14px;
    border-radius: 12px;
  }

  .panel-topline {
    gap: 6px;
  }

  .panel-topline span {
    padding: 7px 9px;
    font-size: 11px;
  }

  .camera-stage {
    height: min(74vw, 330px);
    margin-top: 14px;
  }

  .score-row,
  .metric-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .score-dial {
    width: 108px;
    height: 108px;
    justify-self: center;
  }

  .score-dial span {
    font-size: 30px;
  }

  .verdict,
  .metric-grid > div {
    padding: 16px;
  }

  .empty-camera {
    gap: 10px;
  }

  .empty-camera svg {
    width: 78px;
    height: 78px;
  }

  .camera-start {
    min-height: 42px;
    padding: 0 16px;
    position: relative;
    z-index: 3;
  }

  .scan-badge {
    top: 12px;
    bottom: auto;
    font-size: 12px;
    padding: 8px 12px;
    max-width: calc(100% - 24px);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .exposure-toast {
    grid-template-columns: 1fr;
  }
}

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