/* ── 1. Custom Properties ─────────────────────── */
:root {
  --bg: #0a0118;
  --glass: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.13);
  --glass-highlight: rgba(255, 255, 255, 0.22);
  --accent-1: #5eead4;
  --accent-2: #a78bfa;
  --accent-3: #38bdf8;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --error: #fda4af;
  --radius: 20px;
  --blur: 16px;
}

/* ── 2. Reset & Base ─────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ── 3. Background Mesh ──────────────────────── */
.bg-mesh { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.blob {
  position: absolute; border-radius: 50%;
  filter: blur(120px); will-change: transform; pointer-events: none;
}
.blob-1 {
  width: 55vmax; height: 55vmax; top: -15%; left: -10%;
  background: rgba(167, 139, 250, 0.3);
  animation: float-1 22s ease-in-out infinite alternate;
}
.blob-2 {
  width: 45vmax; height: 45vmax; bottom: -20%; right: -5%;
  background: rgba(94, 234, 212, 0.22);
  animation: float-2 26s ease-in-out infinite alternate;
}
.blob-3 {
  width: 35vmax; height: 35vmax; top: 40%; left: 50%;
  background: rgba(56, 189, 248, 0.15);
  animation: float-3 30s ease-in-out infinite alternate;
}
@keyframes float-1 { to { transform: translate(8vw, 12vh) scale(1.15); } }
@keyframes float-2 { to { transform: translate(-10vw, -8vh) scale(1.1); } }
@keyframes float-3 { to { transform: translate(5vw, -10vh) scale(1.2); } }

/* ── 4. Glass System ─────────────────────────── */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), inset 0 1px 0 var(--glass-highlight);
}
@supports (backdrop-filter: blur(1px)) {
  .glass { backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); }
}
@supports not (backdrop-filter: blur(1px)) {
  .glass { background: rgba(20, 10, 40, 0.88); }
}

/* ── 5. Layout ───────────────────────────────── */
.page { display: flex; flex-direction: column; align-items: center; }

/* ── 6. Hero ─────────────────────────────────── */
.hero {
  min-height: 100vh; min-height: 100dvh;
  width: 100%; display: grid; place-items: center;
  padding: clamp(1rem, 3vw, 2rem);
}
.hero-card {
  width: min(680px, 92vw);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  display: flex; flex-direction: column; align-items: center;
  gap: 1.25rem; text-align: center;
}
.badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 1rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent-1); --blur: 10px;
}
.badge .icon { width: 14px; height: 14px; fill: currentColor; }
h1 {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700; line-height: 1.1; letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ── 7. Drop Zone ────────────────────────────── */
.drop-zone {
  width: 100%; min-height: 180px;
  border: 1.5px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px; padding: 2rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer; transition: all 200ms ease;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0.5rem; outline: none;
}
.drop-zone:hover, .drop-zone:focus-visible {
  border-color: rgba(94, 234, 212, 0.5);
  background: rgba(94, 234, 212, 0.05);
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.1);
}
.drop-zone.active {
  border-color: var(--accent-1);
  background: rgba(94, 234, 212, 0.08);
  transform: scale(1.01);
}
.drop-zone[hidden] { display: none; }
.drop-icon {
  width: 48px; height: 48px;
  color: var(--text-muted); opacity: 0.6; transition: opacity 200ms;
}
.drop-zone:hover .drop-icon { opacity: 1; color: var(--accent-1); }
.drop-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem; font-weight: 600; color: var(--text);
}
.drop-sub { font-size: 0.85rem; color: var(--text-muted); }

/* ── 7b. Preview (after file selected) ───────── */
.preview {
  width: 100%;
  border: 1px solid rgba(94, 234, 212, 0.3);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: border-color 200ms;
}
.preview:hover { border-color: rgba(94, 234, 212, 0.5); }
.preview[hidden] { display: none; }
.preview-img {
  width: 100%; max-height: 300px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.3);
}
.preview-name {
  padding: 0.6rem 1rem;
  font-size: 0.8rem;
  color: var(--accent-1);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── 8. Buttons ──────────────────────────────── */
.btn-row {
  display: flex; gap: 0.75rem;
  flex-wrap: wrap; justify-content: center;
}
.btn {
  appearance: none; border: none;
  padding: 0.75rem 1.5rem; border-radius: 999px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600; font-size: 0.9rem;
  cursor: pointer; transition: all 150ms ease;
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  color: #041018;
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 20px rgba(94, 234, 212, 0.3);
}

/* Processing state — gentle pulse glow */
.btn-primary.is-processing {
  pointer-events: none;
  animation: processing-pulse 1.8s ease-in-out infinite;
}
@keyframes processing-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(94, 234, 212, 0); }
  50%      { box-shadow: 0 0 20px 4px rgba(94, 234, 212, 0.35); }
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(255,255,255,0.05); color: var(--text);
}

.status {
  min-height: 1.2rem; font-size: 0.85rem; color: var(--text-muted);
}

/* ── 9. Result View (original vs clean) ──────── */
.result-view {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  animation: fade-in 0.4s ease;
}
.result-view[hidden] { display: none; }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.result-card {
  position: relative;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
}
.result-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.result-card a { display: block; cursor: pointer; }
.result-card a:hover img {
  filter: brightness(1.05);
  transition: filter 150ms;
}
.result-label {
  position: absolute; top: 10px; left: 10px;
  padding: 0.3rem 0.7rem; border-radius: 999px;
  font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.result-label-clean { color: var(--accent-1); }
.result-hint {
  padding: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  opacity: 0.7;
}

/* ── 10. Examples Section ────────────────────── */
.examples {
  width: 100%; max-width: 1000px;
  padding: 4rem clamp(1rem, 3vw, 2rem) 5rem;
  display: flex; flex-direction: column; align-items: center;
  gap: 2.5rem;
}
.section-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 700; text-align: center;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.examples-grid {
  width: 100%; max-width: 600px;
  display: grid; grid-template-columns: 1fr; gap: 2rem;
}

/* ── 11. Comparison Slider ───────────────────── */
.comparison {
  position: relative; overflow: hidden;
  border-radius: 16px; cursor: ew-resize;
  touch-action: none; user-select: none;
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}
/* After image is the base layer — gives container its height */
.comp-after {
  display: block; width: 100%; height: auto;
}
/* Before image overlays on top, clipped to right half */
.comp-before {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  clip-path: inset(0 0 0 50%);
}
.comp-handle {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 3px; background: rgba(255, 255, 255, 0.8);
  z-index: 5; transform: translateX(-50%);
  pointer-events: none;
}
.comp-handle::before {
  content: ''; position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}
.comp-handle::after {
  content: '\2194'; position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: 14px; color: white;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.comp-label {
  position: absolute; top: 10px; z-index: 4;
  padding: 0.3rem 0.75rem; border-radius: 999px;
  font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: white;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.comp-label-after { left: 10px; }
.comp-label-before { right: 10px; }

/* ── 12. Steps Section ───────────────────────── */
.steps {
  width: 100%; max-width: 900px;
  padding: 0 clamp(1rem, 3vw, 2rem) 5rem;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem;
}
.step-card {
  --blur: 10px; padding: 1.5rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  text-align: center;
}
.step-num {
  font-family: 'Outfit', sans-serif;
  font-size: 2.5rem; font-weight: 700; line-height: 1;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-1));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.step-text { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; }

/* ── 13. Footer ──────────────────────────────── */
.footer {
  padding: 2rem; text-align: center;
  font-size: 0.78rem; color: rgba(148, 163, 184, 0.5);
}

/* ── 14. Scroll Reveal ───────────────────────── */
[data-reveal] {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }
[data-reveal]:nth-child(2) { transition-delay: 0.1s; }
[data-reveal]:nth-child(3) { transition-delay: 0.2s; }

/* ── 15. Responsive ──────────────────────────── */
@media (max-width: 768px) {
  .steps { grid-template-columns: 1fr; gap: 1rem; }
  .blob { filter: blur(80px); }
  .hero-card { padding: 1.25rem; }
  .btn-row { width: 100%; }
  .btn-row .btn { flex: 1; justify-content: center; }
  .result-view { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .hero-card { width: 100%; }
}
