:root {
  color: #172033;
  background: #eef2f8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(79, 70, 229, 0.16), transparent 38%),
    radial-gradient(circle at 100% 100%, rgba(6, 182, 212, 0.12), transparent 42%),
    #eef2f8;
}

button, input { font: inherit; }

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 36px 18px;
}

.card {
  width: min(760px, 100%);
  padding: clamp(24px, 5vw, 48px);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(30, 41, 59, 0.13);
}

.intro { margin-bottom: 24px; }
.eyebrow {
  margin-bottom: 10px;
  color: #4f46e5;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
}
.intro h1 {
  margin: 0;
  color: #111827;
  font-size: clamp(32px, 7vw, 52px);
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.intro p { margin: 14px 0 0; color: #64748b; font-size: 16px; }

.privacy-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding: 12px 14px;
  color: #0f766e;
  background: #ecfdf5;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
}
.privacy-note span { font-weight: 900; }

.drop-zone {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px;
  color: #475569;
  text-align: center;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 20px;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.drop-zone:hover, .drop-zone.dragging {
  border-color: #4f46e5;
  background: #eef2ff;
  transform: translateY(-1px);
}
.drop-zone:focus-visible, button:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.35);
  outline-offset: 3px;
}
.drop-zone strong { color: #1e293b; font-size: 19px; }
.drop-zone > span:last-child { max-width: 420px; font-size: 13px; line-height: 1.6; }
.upload-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.24);
  font-size: 28px;
}

.selection { margin-top: 22px; }
.selection-head, .progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.text-button {
  padding: 4px 0;
  color: #4f46e5;
  background: none;
  border: 0;
  cursor: pointer;
}
.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.preview-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #e2e8f0;
  border-radius: 14px;
}
.preview-item img { width: 100%; height: 100%; object-fit: cover; }
.preview-item button {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 28px;
  height: 28px;
  color: white;
  background: rgba(15, 23, 42, 0.76);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.progress-panel { margin-top: 22px; }
.progress-copy { color: #475569; font-size: 14px; }
.progress-track { height: 10px; overflow: hidden; background: #e2e8f0; border-radius: 999px; }
.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #4f46e5, #06b6d4);
  border-radius: inherit;
  transition: width 120ms linear;
}

.primary-button {
  width: 100%;
  margin-top: 22px;
  padding: 15px 20px;
  color: white;
  background: #4f46e5;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.22);
  font-weight: 800;
  cursor: pointer;
}
.primary-button:hover:not(:disabled) { background: #4338ca; }
.primary-button:disabled { opacity: 0.42; cursor: not-allowed; box-shadow: none; }
.status { min-height: 22px; margin: 12px 0 0; color: #b91c1c; text-align: center; font-size: 14px; }

.result {
  margin-top: 18px;
  padding: 24px;
  color: white;
  background: #111827;
  border-radius: 20px;
}
.result-kicker { display: block; color: #94a3b8; font-size: 13px; }
.speed { display: block; margin-top: 4px; font-size: clamp(32px, 8vw, 48px); letter-spacing: -0.04em; }
.metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 20px; }
.metrics div { padding: 12px; background: #1e293b; border-radius: 12px; }
.metrics span, .metrics strong { display: block; }
.metrics span { color: #94a3b8; font-size: 12px; }
.metrics strong { margin-top: 5px; font-size: 16px; }
.result p { margin: 16px 0 0; color: #a7f3d0; font-size: 13px; }

.hidden { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 560px) {
  .shell { align-items: start; padding: 12px; }
  .card { padding: 24px 18px; border-radius: 20px; }
  .drop-zone { min-height: 180px; padding: 22px 14px; }
  .preview-grid { gap: 8px; }
  .metrics { grid-template-columns: 1fr; }
}

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