/* ---------- Scan viewport ---------- */
.scan-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4.1;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg), inset 0 0 60px rgba(0, 0, 0, 0.4);
}

.scan-viewport::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(98, 230, 255, 0.08);
  pointer-events: none;
  z-index: 6;
}

/* Mock website canvas */
.mock-site {
  position: absolute;
  inset: 0;
  padding: 18px 16px;
  filter: grayscale(0.2) brightness(0.88) contrast(1.05);
  transition: filter 0.6s var(--ease-out);
}

.scan-viewport.is-scanning .mock-site {
  filter: grayscale(0.35) brightness(0.75) contrast(1.1);
}

.mock-nav {
  height: 26px;
  width: 58%;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  margin-bottom: 16px;
}

.mock-hero {
  height: 64px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 12px;
}

.mock-img {
  height: 86px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02));
  border-radius: 8px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

.mock-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(98, 230, 255, 0.04), transparent);
}

.mock-lines {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}

.mock-lines span {
  display: block;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
}

.mock-lines span:nth-child(1) { width: 92%; }
.mock-lines span:nth-child(2) { width: 74%; }
.mock-lines span:nth-child(3) { width: 84%; }
.mock-lines span:nth-child(4) { width: 61%; }

.mock-cta {
  height: 32px;
  width: 108px;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 20px;
}

/* Scan grid overlay */
.scan-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(98, 230, 255, 0.035) 0px,
      transparent 1px,
      transparent 4px
    );
  opacity: 0;
  transition: opacity 0.4s;
}

.scan-viewport.is-scanning .scan-grid {
  opacity: 1;
}

/* Cyan scan beam */
.scan-beam {
  position: absolute;
  left: 0;
  right: 0;
  top: -18%;
  height: 16%;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    180deg,
    rgba(98, 230, 255, 0) 0%,
    rgba(98, 230, 255, 0.12) 35%,
    rgba(98, 230, 255, 0.45) 80%,
    rgba(98, 230, 255, 0.9) 100%
  );
  box-shadow: 0 0 32px 8px var(--scan-glow);
}

.scan-beam::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--scan);
  box-shadow: 0 0 14px 3px var(--scan);
}

.scan-viewport.is-scanning .scan-beam {
  opacity: 1;
  animation: beamSweep 5.2s var(--ease-in-out) infinite;
}

@keyframes beamSweep {
  0%   { top: -18%; }
  48%  { top: 102%; }
  52%  { top: 102%; }
  100% { top: -18%; }
}

/* Soft vignette */
.scan-vignette {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(7, 8, 10, 0.55) 100%);
}

/* Finding callouts */
.callout {
  position: absolute;
  z-index: 5;
  background: rgba(7, 8, 10, 0.92);
  border: 1px solid var(--scan);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 0 20px rgba(98, 230, 255, 0.22);
  opacity: 0;
  transform: translateY(6px) scale(0.96);
  pointer-events: none;
  max-width: calc(100% - 24px);
}

.callout .label {
  display: block;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1px;
}

.callout.warn { border-color: var(--warn); color: var(--warn); box-shadow: 0 0 18px rgba(255, 184, 95, 0.2); }
.callout.danger { border-color: var(--danger); color: var(--danger); box-shadow: 0 0 18px rgba(255, 95, 95, 0.2); }
.callout.good { border-color: var(--good); color: var(--good); box-shadow: 0 0 18px rgba(95, 255, 160, 0.2); }
.callout.info { border-color: var(--info); color: var(--info); box-shadow: 0 0 18px rgba(122, 162, 255, 0.2); }

.callout.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}

.callout.fade-out {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Positions for callouts */
.callout.c1 { top: 7%; right: 10px; }
.callout.c2 { top: 26%; left: 10px; }
.callout.c3 { top: 46%; right: 10px; }
.callout.c4 { top: 66%; left: 10px; }
.callout.c5 { top: 82%; right: 10px; }

/* Scan status bar */
.scan-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--scan);
  min-height: 24px;
}

.scan-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--scan);
  box-shadow: 0 0 8px var(--scan);
  animation: pulse 1.1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.85); }
}

.scan-progress {
  margin-top: 12px;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.scan-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--scan), #a8f0ff);
  border-radius: inherit;
  box-shadow: 0 0 12px var(--scan-glow);
  transition: width 0.4s var(--ease-out);
}

/* Phase labels under status */
.scan-phase {
  text-align: center;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  min-height: 18px;
}
