/* ============================================================
   EDGEVISION — Dark Space Theme
   ============================================================ */

:root {
  --bg-base:         #08080f;
  --bg-surface:      #0e0e1a;
  --bg-card:         #111120;
  --bg-raised:       #191928;
  --bg-hover:        #1c1c2e;

  --border-dim:      rgba(255, 255, 255, 0.04);
  --border-muted:    rgba(255, 255, 255, 0.08);
  --border-base:     rgba(255, 255, 255, 0.12);
  --border-active:   rgba(139, 92, 246, 0.6);

  --violet:          #8b5cf6;
  --violet-light:    #a78bfa;
  --violet-dim:      rgba(139, 92, 246, 0.12);
  --violet-glow:     rgba(139, 92, 246, 0.25);
  --violet-glow-lg:  rgba(139, 92, 246, 0.18);

  --teal:            #2dd4bf;
  --teal-dim:        rgba(45, 212, 191, 0.12);

  --success:         #10b981;
  --error:           #f87171;
  --warning:         #fbbf24;
  --info:            #60a5fa;

  --text-0:          #ffffff;
  --text-1:          #e8e8f8;
  --text-2:          #9090b8;
  --text-3:          #5a5a78;

  --r-sm:   6px;
  --r-md:   12px;
  --r-lg:   18px;
  --r-xl:   24px;
  --r-pill: 100px;

  --sh-sm:     0 2px 8px rgba(0, 0, 0, 0.4);
  --sh-md:     0 8px 30px rgba(0, 0, 0, 0.5);
  --sh-lg:     0 20px 60px rgba(0, 0, 0, 0.7);
  --sh-violet: 0 8px 40px rgba(139, 92, 246, 0.2);
  --sh-violet-lg: 0 20px 80px rgba(139, 92, 246, 0.3);

  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:    cubic-bezier(0, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t:      all 0.2s var(--ease);
  --t-slow: all 0.4s var(--ease);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

.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;
}

body {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-base);
  color: var(--text-1);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection {
  background: var(--violet-dim);
  color: var(--violet-light);
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-base); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--violet); }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: var(--t-slow);
}

.navbar.scrolled {
  background: rgba(8, 8, 15, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-0);
}

.brand-name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--violet-light), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Eye Logo */
.eye-logo {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eye {
  width: 32px;
  height: 20px;
  background: linear-gradient(135deg, var(--violet), var(--teal));
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 18px var(--violet-glow);
  animation: eyeFloat 4s ease-in-out infinite;
  transition: var(--t);
}

.pupil {
  width: 11px;
  height: 11px;
  background: var(--bg-base);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  animation: lookAround 8s ease-in-out infinite;
}

.pupil::before {
  content: '';
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  top: 1px;
  left: 1px;
}

.eye-logo:hover .eye {
  animation: blink 0.5s ease;
  box-shadow: 0 0 30px var(--violet-glow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  color: var(--text-2);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.88rem;
  padding: 0.5rem 1rem;
  border-radius: var(--r-pill);
  transition: var(--t);
  letter-spacing: 0.01em;
}

.nav-link:hover {
  color: var(--text-0);
  background: var(--border-dim);
}

.nav-cta {
  color: var(--violet-light) !important;
  background: var(--violet-dim) !important;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.nav-cta:hover {
  background: rgba(139, 92, 246, 0.22) !important;
  box-shadow: var(--sh-violet);
  transform: translateY(-1px);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-base);
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  animation: orbFloat 12s ease-in-out infinite;
}

.orb-1 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.32) 0%, transparent 70%);
  top: -160px;
  left: -160px;
  animation-delay: 0s;
  animation-duration: 13s;
}

.orb-2 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.18) 0%, transparent 70%);
  bottom: -120px;
  right: -120px;
  animation-delay: -4s;
  animation-duration: 15s;
}

.orb-3 {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, transparent 70%);
  top: 45%;
  left: 58%;
  animation-delay: -8s;
  animation-duration: 10s;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.04) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  animation: gridDrift 12s linear infinite;
}

.hero-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, var(--bg-base) 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 740px;
  padding: 2rem;
  padding-top: 6rem;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.1rem;
  background: var(--violet-dim);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--r-pill);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--violet-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  animation: fadeSlideUp 0.6s var(--ease-out) 0.1s both;
}

.tag-dot {
  width: 6px;
  height: 6px;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--teal);
  animation: blinkDot 2s ease-in-out infinite;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--text-0);
  margin-bottom: 1.5rem;
  animation: fadeSlideUp 0.6s var(--ease-out) 0.2s both;
}

.hero-accent {
  background: linear-gradient(135deg, var(--violet-light) 0%, var(--teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-2);
  max-width: 480px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
  animation: fadeSlideUp 0.6s var(--ease-out) 0.3s both;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  animation: fadeSlideUp 0.6s var(--ease-out) 0.4s both;
}

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

.stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-0);
  letter-spacing: -0.03em;
}

.stat-lbl {
  font-size: 0.75rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border-base);
}

.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-3);
  font-size: 0.9rem;
  animation: bounceDot 2.5s ease-in-out infinite;
  cursor: pointer;
  z-index: 2;
}

/* ============================================================
   APP CONTAINER
   ============================================================ */
.app-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--r-xl);
  padding: 2rem;
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.6), rgba(45, 212, 191, 0.4), transparent);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.card:hover::before { opacity: 1; }

.card-step {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--violet);
  background: var(--violet-dim);
  border: 1px solid rgba(139, 92, 246, 0.22);
  padding: 0.28rem 0.8rem;
  border-radius: var(--r-pill);
  margin-bottom: 1.25rem;
}

.card-head {
  margin-bottom: 1.75rem;
}

.card-head h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-0);
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
}

.card-head p {
  font-size: 0.88rem;
  color: var(--text-2);
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out);
  will-change: opacity, transform;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

/* ============================================================
   UPLOAD ZONE
   ============================================================ */
.upload-zone {
  border: 2px dashed rgba(139, 92, 246, 0.25);
  border-radius: var(--r-lg);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--t-slow);
  background: var(--bg-surface);
  position: relative;
}

.upload-zone:hover,
.upload-zone.active {
  border-color: var(--violet);
  background: var(--violet-dim);
  box-shadow: 0 0 50px var(--violet-glow), inset 0 0 50px rgba(139, 92, 246, 0.04);
}

.file-input { display: none; }

.upload-icon-wrap {
  width: 72px;
  height: 72px;
  background: var(--violet-dim);
  border: 1px solid rgba(139, 92, 246, 0.28);
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 1.7rem;
  color: var(--violet);
  transition: var(--t-slow);
}

.upload-zone:hover .upload-icon-wrap {
  background: rgba(139, 92, 246, 0.22);
  transform: translateY(-4px) scale(1.05);
  box-shadow: var(--sh-violet);
}

.uz-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 0.25rem;
}

.uz-sub {
  font-size: 0.82rem;
  color: var(--text-3);
  margin-bottom: 1rem;
}

.uz-formats {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin: 1rem 0 0.75rem;
}

.uz-formats span {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.22rem 0.65rem;
  background: var(--border-dim);
  border: 1px solid var(--border-base);
  border-radius: var(--r-pill);
  color: var(--text-3);
}

.uz-limit {
  font-size: 0.78rem;
  color: var(--text-3);
  margin-top: 0.5rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--t);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-ghost {
  background: var(--border-dim);
  color: var(--text-2);
  border: 1px solid var(--border-muted);
}

.btn-ghost:hover {
  background: var(--border-muted);
  color: var(--text-0);
}

.btn-outline {
  background: transparent;
  color: var(--violet-light);
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.btn-outline:hover {
  background: var(--violet-dim);
  border-color: var(--violet);
}

.btn-sm {
  padding: 0.38rem 0.85rem;
  font-size: 0.78rem;
}

/* ============================================================
   PREVIEW BLOCK
   ============================================================ */
.preview-block {
  margin-top: 1.75rem;
  animation: fadeSlideUp 0.4s var(--ease-out);
}

.preview-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.preview-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.preview-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 1.5rem;
  align-items: start;
}

.preview-img-wrap {
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-muted);
}

.preview-img-wrap img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  display: block;
}

.preview-meta {
  background: var(--bg-surface);
  border: 1px solid var(--border-muted);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border-dim);
  gap: 1rem;
}

.meta-row:last-child { border-bottom: none; }

.meta-key {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.meta-val {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-1);
  text-align: right;
  word-break: break-all;
}

/* ============================================================
   ALGORITHM CARDS
   ============================================================ */
.algo-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  border: none;
  padding: 0;
  min-width: 0;
}

.algo-card {
  border: 1px solid var(--border-muted);
  border-radius: var(--r-lg);
  background: var(--bg-surface);
  cursor: pointer;
  transition: var(--t);
  overflow: hidden;
}

.algo-card input[type="radio"] { display: none; }

.algo-card:hover {
  border-color: rgba(139, 92, 246, 0.35);
  background: var(--bg-hover);
}

.algo-card.selected {
  border-color: var(--violet);
  background: var(--violet-dim);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.4), var(--sh-violet);
}

.algo-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.5rem;
  cursor: pointer;
  width: 100%;
}

.algo-icon {
  width: 46px;
  height: 46px;
  background: var(--bg-raised);
  border: 1px solid var(--border-base);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--violet);
  flex-shrink: 0;
  transition: var(--t);
}

.algo-card.selected .algo-icon {
  background: var(--violet);
  color: white;
  border-color: transparent;
  box-shadow: var(--sh-violet);
}

.algo-info { flex: 1; }

.algo-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-0);
  margin-bottom: 0.2rem;
  letter-spacing: -0.01em;
}

.algo-info p {
  font-size: 0.8rem;
  color: var(--text-2);
  margin-bottom: 0.55rem;
  line-height: 1.5;
}

.algo-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.algo-tags span {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.18rem 0.6rem;
  background: var(--border-dim);
  border: 1px solid var(--border-muted);
  border-radius: var(--r-pill);
  color: var(--text-3);
}

.algo-card.selected .algo-tags span {
  background: rgba(139, 92, 246, 0.14);
  border-color: rgba(139, 92, 246, 0.3);
  color: var(--violet-light);
}

.algo-check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border-base);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: transparent;
  flex-shrink: 0;
  transition: var(--t);
}

.algo-card.selected .algo-check {
  background: var(--violet);
  border-color: var(--violet);
  color: white;
  box-shadow: var(--sh-violet);
}

/* ============================================================
   SENSITIVITY
   ============================================================ */
.sensitivity-block {
  background: var(--bg-surface);
  border: 1px solid var(--border-muted);
  border-radius: var(--r-lg);
  padding: 1.5rem;
}

.sens-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.sens-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-1);
}

.sens-badge {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
  background: var(--violet-dim);
  border: 1px solid rgba(139, 92, 246, 0.28);
  padding: 0.28rem 0.9rem;
  border-radius: var(--r-pill);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--violet-light);
}

.sens-unit {
  font-size: 0.72rem;
  opacity: 0.65;
}

.range-wrap { margin-bottom: 1.25rem; }

.range-slider {
  width: 100%;
  height: 5px;
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  background: var(--border-base);
  margin: 0.75rem 0;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--violet);
  cursor: pointer;
  border: 3px solid var(--bg-card);
  box-shadow: 0 0 0 1px var(--violet), var(--sh-violet);
  transition: transform 0.2s var(--ease-bounce);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  box-shadow: 0 0 0 2px var(--violet), var(--sh-violet-lg);
}

.range-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.73rem;
  color: var(--text-3);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.sens-presets {
  display: flex;
  gap: 0.5rem;
}

.preset-btn {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--border-muted);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-3);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--t);
  letter-spacing: 0.01em;
}

.preset-btn:hover {
  border-color: rgba(139, 92, 246, 0.5);
  color: var(--violet-light);
  background: var(--violet-dim);
}

.preset-btn.active {
  background: var(--violet);
  border-color: var(--violet);
  color: white;
  box-shadow: var(--sh-violet);
}

/* ============================================================
   ACTION BAR
   ============================================================ */
.action-bar {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  margin: 1.75rem 0;
}

.btn-detect {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 2.5rem;
  background: linear-gradient(135deg, var(--violet) 0%, #6d28d9 100%);
  color: white;
  border: none;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--t-slow);
  box-shadow: var(--sh-violet), 0 4px 20px rgba(109, 40, 217, 0.3);
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

.btn-detect::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transition: left 0.5s var(--ease);
}

.btn-detect:hover:not(:disabled)::before { left: 100%; }

.btn-detect:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--sh-violet-lg), 0 8px 40px rgba(109, 40, 217, 0.4);
}

.btn-detect:active:not(:disabled) { transform: translateY(0); }

.btn-detect:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.5rem;
  background: var(--border-dim);
  color: var(--text-2);
  border: 1px solid var(--border-muted);
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--t);
  letter-spacing: 0.01em;
}

.btn-reset:hover {
  background: var(--border-muted);
  color: var(--text-0);
}

.btn-loading { display: none; }

.loading-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ============================================================
   SKELETON SCREEN
   ============================================================ */
.sk-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--r-xl);
  padding: 2rem;
  margin-bottom: 1.25rem;
}

.sk-block {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.03) 100%
  );
  background-size: 200% 100%;
  border-radius: var(--r-md);
  animation: shimmer 1.8s ease-in-out infinite;
}

.sk-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.sk-title   { height: 26px; width: 180px; border-radius: var(--r-sm); }
.sk-btn-placeholder { height: 34px; width: 100px; border-radius: var(--r-md); }

.sk-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.sk-img { height: 250px; border-radius: var(--r-lg); }

.sk-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.sk-stat { height: 72px; border-radius: var(--r-lg); }

/* ============================================================
   RESULTS
   ============================================================ */
.results-content {
  animation: fadeSlideUp 0.5s var(--ease-out);
}

.results-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-dim);
}

.results-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
  align-items: center;
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.compare-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
}

.img-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.18rem 0.65rem;
  border-radius: var(--r-pill);
  background: var(--border-dim);
  border: 1px solid var(--border-muted);
  color: var(--text-3);
}

.img-badge.success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--success);
}

.img-frame {
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border-muted);
  background: var(--bg-surface);
  position: relative;
}

.img-frame img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  display: block;
}

.result-overlay {
  position: absolute;
  inset: 0;
  background: rgba(16, 185, 129, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.result-overlay.show { opacity: 1; }

.overlay-content { color: white; text-align: center; }

.overlay-content i {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.overlay-content span {
  font-size: 0.95rem;
  font-weight: 600;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.r-stat {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.1rem 1.2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-muted);
  border-radius: var(--r-lg);
  transition: var(--t);
}

.r-stat:hover {
  border-color: rgba(139, 92, 246, 0.3);
  background: var(--bg-hover);
}

.r-stat i {
  color: var(--violet);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.r-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-0);
  letter-spacing: -0.01em;
}

.r-key {
  font-size: 0.72rem;
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================================
   FEATURES
   ============================================================ */
.features-section { margin-top: 2.5rem; }

.feat-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.feat-header h2 {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-0);
  letter-spacing: -0.025em;
}

.feat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.feat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: var(--r-xl);
  padding: 1.75rem 1.5rem;
  text-align: center;
  transition: var(--t-slow);
}

.feat-card:hover {
  border-color: rgba(139, 92, 246, 0.3);
  background: var(--bg-hover);
  transform: translateY(-5px);
  box-shadow: var(--sh-md);
}

.feat-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 1.2rem;
  background: var(--violet-dim);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: var(--violet);
  transition: var(--t);
}

.feat-card:hover .feat-icon {
  background: var(--violet);
  color: white;
  box-shadow: var(--sh-violet);
  transform: scale(1.08) rotate(-3deg);
}

.feat-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-0);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.feat-card p {
  font-size: 0.82rem;
  color: var(--text-2);
  line-height: 1.65;
}

/* ============================================================
   LOADING OVERLAY
   ============================================================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 15, 0.9);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.loading-modal {
  text-align: center;
  max-width: 340px;
  width: 90%;
}

.loader-rings {
  width: 88px;
  height: 88px;
  position: relative;
  margin: 0 auto 2rem;
}

.ring {
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-radius: 50%;
}

.ring-1 {
  border-top-color: var(--violet);
  animation: spin 1.2s linear infinite;
}

.ring-2 {
  inset: 9px;
  border-right-color: var(--teal);
  animation: spin 1.9s linear infinite reverse;
}

.ring-3 {
  inset: 18px;
  border-bottom-color: var(--violet-light);
  animation: spin 2.6s linear infinite;
}

.loader-eye {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.2rem;
  color: var(--violet-light);
  animation: pulseEye 2s ease-in-out infinite;
}

.loading-modal h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-0);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.loading-modal p {
  font-size: 0.83rem;
  color: var(--text-2);
  margin-bottom: 1.5rem;
}

.prog-bar {
  width: 100%;
  height: 4px;
  background: var(--border-base);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--violet), var(--teal));
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s var(--ease);
}

/* ============================================================
   NOTIFICATION
   ============================================================ */
.notification {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--r-lg);
  font-weight: 600;
  font-size: 0.84rem;
  box-shadow: var(--sh-lg);
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.35s var(--ease-bounce), opacity 0.35s var(--ease);
  z-index: 3000;
  max-width: 360px;
  border: 1px solid transparent;
  backdrop-filter: blur(20px);
  cursor: pointer;
  line-height: 1.4;
}

.notification.show {
  transform: translateY(0);
  opacity: 1;
}

.notification.success {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.notification.error {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fca5a5;
}

.notification.info {
  background: rgba(96, 165, 250, 0.14);
  border-color: rgba(96, 165, 250, 0.4);
  color: #93c5fd;
}

.notification.warning {
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.4);
  color: #fcd34d;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--border-dim);
  padding: 2.5rem;
  text-align: center;
  margin-top: 2rem;
}

.footer-inner p {
  font-size: 0.82rem;
  color: var(--text-3);
  line-height: 1.9;
}

/* ============================================================
   KEYFRAMES
   ============================================================ */
@keyframes gridDrift {
  0%   { background-position: 0 0; }
  100% { background-position: 50px 50px; }
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(30px, -40px) scale(1.05); }
  66%       { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes eyeFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-4px); }
}

@keyframes blink {
  0%, 100% { transform: scaleY(1); }
  50%       { transform: scaleY(0.12); }
}

@keyframes lookAround {
  0%, 100% { transform: translate(-50%, -50%); }
  25%       { transform: translate(-65%, -42%); }
  50%       { transform: translate(-36%, -58%); }
  75%       { transform: translate(-44%, -36%); }
}

@keyframes blinkDot {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--teal); }
  50%       { opacity: 0.3; box-shadow: none; }
}

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

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulseEye {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

@keyframes bounceDot {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.5; }
  50%       { transform: translateX(-50%) translateY(8px); opacity: 1; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ── Hamburger toggle (mobile nav) ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: var(--t);
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── 1024px — small desktops / landscape tablets ── */
@media (max-width: 1024px) {
  .app-wrap   { max-width: 100%; padding: 2.5rem 2rem 4rem; }
  .feat-grid  { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
  .compare-grid { gap: 1rem; }
  .result-stats { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
  .algo-grid  { gap: 0.6rem; }
}

/* ── 768px — tablets ── */
@media (max-width: 768px) {
  /* Navbar */
  .nav-links  { display: none; flex-direction: column; gap: 0.25rem; }
  .nav-toggle { display: flex; }

  .nav-inner  { flex-wrap: wrap; gap: 0; padding: 1rem 1.25rem; }

  .nav-links.open {
    display: flex;
    width: 100%;
    padding: 0.75rem 0 0.5rem;
    border-top: 1px solid var(--border-dim);
    margin-top: 0.75rem;
  }

  .nav-link { width: 100%; padding: 0.6rem 0.75rem; border-radius: var(--r-md); }

  /* Hero */
  .hero-title { font-size: 2.6rem; }
  .hero-sub   { font-size: 0.95rem; }
  .hero-stats { gap: 1.5rem; }
  .hero-inner { padding: 2rem 1.5rem; padding-top: 5rem; }

  /* App */
  .app-wrap  { padding: 2rem 1rem 3.5rem; }
  .card      { padding: 1.5rem; border-radius: var(--r-lg); }

  /* Upload */
  .upload-zone { padding: 2rem 1.5rem; }
  .upload-icon-wrap { width: 60px; height: 60px; font-size: 1.5rem; }

  /* Preview */
  .preview-layout { grid-template-columns: 1fr; }
  .preview-img-wrap img { max-height: 280px; }

  /* Algorithms */
  .algo-inner { padding: 1rem 1.25rem; gap: 0.75rem; }
  .algo-icon  { width: 40px; height: 40px; font-size: 0.95rem; }
  .algo-info h4 { font-size: 0.9rem; }

  /* Sensitivity */
  .sensitivity-block { padding: 1.25rem; }
  .sens-presets { flex-wrap: wrap; gap: 0.4rem; }
  .preset-btn   { flex: 1 1 calc(50% - 0.2rem); min-width: 0; }

  /* Actions */
  .action-bar { flex-direction: column; gap: 0.75rem; }
  .btn-detect { width: 100%; justify-content: center; padding: 0.85rem 1.5rem; }
  .btn-reset  { width: 100%; justify-content: center; padding: 0.75rem 1.5rem; }

  /* Results */
  .results-head    { flex-direction: column; gap: 1rem; align-items: flex-start; }
  .results-actions { width: 100%; justify-content: flex-start; }
  .compare-grid    { grid-template-columns: 1fr; gap: 1rem; }
  .img-frame img   { max-height: 280px; }
  .result-stats    { grid-template-columns: 1fr; gap: 0.6rem; }
  .r-stat          { padding: 0.9rem 1rem; }

  /* Skeleton */
  .sk-images { grid-template-columns: 1fr; gap: 1rem; }
  .sk-img    { height: 200px; }
  .sk-stats  { grid-template-columns: 1fr; gap: 0.6rem; }
  .sk-stat   { height: 60px; }

  /* Features */
  .feat-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .feat-card { padding: 1.4rem 1.25rem; }
}

/* ── 480px — phones ── */
@media (max-width: 480px) {
  /* Hero */
  .hero-title  { font-size: 2rem; letter-spacing: -0.03em; }
  .hero-sub    { font-size: 0.88rem; }
  .hero-stats  { flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
  .stat-divider { display: none; }
  .hero-inner  { padding: 2rem 1rem; padding-top: 5rem; }
  .hero-tag    { font-size: 0.7rem; }
  .scroll-hint { bottom: 1.5rem; }

  /* Navbar */
  .nav-inner   { padding: 0.9rem 1rem; }
  .brand-name  { font-size: 1.05rem; }

  /* App */
  .app-wrap   { padding: 1.5rem 0.75rem 3rem; }
  .card       { padding: 1.25rem; border-radius: var(--r-md); }
  .card-step  { font-size: 0.65rem; }
  .card-head h2 { font-size: 1.25rem; }

  /* Upload */
  .upload-zone     { padding: 1.75rem 1rem; border-radius: var(--r-md); }
  .upload-icon-wrap { width: 54px; height: 54px; font-size: 1.3rem; margin-bottom: 1rem; }
  .uz-title        { font-size: 0.95rem; }
  .uz-formats      { flex-wrap: wrap; justify-content: center; gap: 0.3rem; }

  /* Meta info */
  .meta-row   { flex-direction: column; align-items: flex-start; gap: 0.2rem; padding: 0.75rem 1rem; }
  .meta-val   { text-align: left; }

  /* Algorithms */
  .algo-inner { flex-wrap: wrap; }
  .algo-info p { display: none; }
  .algo-tags  { display: none; }

  /* Sensitivity */
  .sens-header { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
  .preset-btn  { flex: 1 1 calc(50% - 0.2rem); font-size: 0.75rem; padding: 0.45rem; }

  /* Actions */
  .btn-detect { font-size: 0.95rem; padding: 0.8rem 1.25rem; }

  /* Results */
  .results-head .card-head h2 { font-size: 1.2rem; }
  .img-frame img { max-height: 220px; }
  .r-stat i    { font-size: 1rem; }
  .r-val       { font-size: 0.88rem; }

  /* Notification */
  .notification { left: 1rem; right: 1rem; max-width: none; bottom: 1rem; }

  /* Features */
  .feat-card   { padding: 1.25rem 1rem; }
  .feat-icon   { width: 46px; height: 46px; font-size: 1.15rem; margin-bottom: 1rem; }
  .feat-card h3 { font-size: 0.95rem; }
}

/* ── 360px — tiny phones ── */
@media (max-width: 360px) {
  .hero-title { font-size: 1.75rem; }
  .app-wrap   { padding: 1.25rem 0.5rem 2.5rem; }
  .card       { padding: 1rem; }
  .upload-zone { padding: 1.5rem 0.75rem; }
  .algo-inner  { padding: 0.85rem 1rem; }
  .btn-detect  { font-size: 0.88rem; }

  /* Hide algo description text to save space */
  .algo-check  { display: none; }
}

/* ── Touch / hover media queries ── */
@media (hover: none) {
  /* Disable hover-only transforms on touch devices */
  .feat-card:hover { transform: none; }
  .card:hover::before { opacity: 0; }
  .btn-detect:hover:not(:disabled) { transform: none; }
  .upload-zone:hover { box-shadow: none; }
  .upload-zone:hover .upload-icon-wrap { transform: none; }
}

/* ── Landscape phones ── */
@media (max-width: 768px) and (orientation: landscape) {
  .hero { min-height: auto; padding: 5rem 2rem 3rem; }
  .hero-title { font-size: 2rem; }
  .hero-stats { margin-top: 1.5rem; }
  .hero-inner { padding-top: 4rem; }
  .scroll-hint { display: none; }

  .algo-inner { flex-wrap: wrap; gap: 0.75rem; }
}
