/* ============================================
   imatrix — JLS Studio
   Light mode (default) + Deep Matrix (data-deep="1")
   ============================================ */

:root {
  --bg: #ffffff;
  --bg-soft: #fafaf9;
  --bg-card: #ffffff;
  --bg-hover: #f5f5f4;

  --text: #0a0a0a;
  --text-dim: #525252;
  --text-faint: #a3a3a3;
  --text-mute: #d4d4d4;

  --border: #e7e5e4;
  --border-strong: #d6d3d1;

  --accent: #16a34a;
  --accent-hover: #15803d;
  --accent-soft: #dcfce7;
  --accent-text: #14532d;
  --accent-glow: rgba(22, 163, 74, 0.25);

  --red: #dc2626;
  --red-soft: #fee2e2;
  --red-pill: #ef4444;
  --blue-pill: #3b82f6;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.10);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
}

/* DEEP MATRIX MODE */
body[data-deep="1"] {
  --bg: #000000;
  --bg-soft: #050805;
  --bg-card: #0a120a;
  --bg-hover: #102810;

  --text: #d6ffd6;
  --text-dim: #4ade80;
  --text-faint: #166534;
  --text-mute: #1a4d1a;

  --border: #14532d;
  --border-strong: #16a34a;

  --accent: #22c55e;
  --accent-hover: #4ade80;
  --accent-soft: rgba(34, 197, 94, 0.15);
  --accent-text: #bbf7d0;
  --accent-glow: rgba(34, 197, 94, 0.5);

  --red: #ff3030;
  --red-soft: rgba(255, 48, 48, 0.15);

  --shadow: 0 4px 24px rgba(34, 197, 94, 0.15);
  --shadow-lg: 0 16px 60px rgba(34, 197, 94, 0.25);
}

body[data-deep="1"] .hero-title,
body[data-deep="1"] .section-title,
body[data-deep="1"] .step-title,
body[data-deep="1"] .results-title,
body[data-deep="1"] .config-title {
  text-shadow: 0 0 12px var(--accent-glow);
}

body[data-deep="1"] #matrix-rain {
  display: block;
}

body[data-deep="1"] .nav {
  background: rgba(0, 0, 0, 0.7);
  border-bottom-color: var(--border);
}

body[data-deep="1"] .footer {
  background: #000;
  border-top: 1px solid var(--border);
}

body[data-deep="1"] .btn-primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  text-shadow: none;
  font-weight: 600;
  box-shadow: 0 0 24px var(--accent-glow);
}

body[data-deep="1"] .btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 0 36px var(--accent-glow);
}

body[data-deep="1"] .btn-ghost { background: transparent; color: var(--text); }

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.4s ease, color 0.4s ease;
}

a { color: inherit; text-decoration: none; }

/* Deep matrix rain canvas */
#matrix-rain {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
}

body > * { position: relative; z-index: 1; }
#matrix-rain { z-index: 0; }

/* ============================================
   NAV
   ============================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  cursor: pointer;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  display: inline-block;
}

.brand-name-dim { color: var(--text-faint); font-weight: 500; }

.brand-name-i {
  color: var(--accent);
  font-weight: 800;
  text-shadow: 0 0 12px var(--accent-glow);
  font-style: italic;
  margin-right: -1px;
}

body[data-deep="1"] .brand-name-i {
  text-shadow: 0 0 16px var(--accent-glow), 0 0 4px var(--accent);
}

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

.nav-links a { transition: color 0.15s ease; }
.nav-links a:hover { color: var(--text); }
.nav-link-studio { color: var(--accent) !important; font-weight: 500; }

/* Pill toggle */
.pill-toggle {
  position: relative;
  width: 64px;
  height: 30px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 3px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.pill-toggle-red, .pill-toggle-blue {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pill-toggle-red {
  background: var(--red-pill);
  box-shadow: 0 0 12px var(--red-pill);
  left: 4px;
  z-index: 2;
  transform: scale(1);
}

.pill-toggle-blue {
  background: var(--blue-pill);
  box-shadow: 0 0 12px var(--blue-pill);
  right: 4px;
  z-index: 1;
  opacity: 0.6;
  transform: scale(0.85);
}

body[data-deep="1"] .pill-toggle { background: rgba(34, 197, 94, 0.1); border-color: var(--accent); }
body[data-deep="1"] .pill-toggle-red { transform: scale(1.15); box-shadow: 0 0 18px var(--red-pill); }
body[data-deep="1"] .pill-toggle-blue { opacity: 0.3; transform: scale(0.6); }

.pill-toggle:hover .pill-toggle-red { box-shadow: 0 0 16px var(--red-pill); }
.pill-toggle:hover .pill-toggle-blue { box-shadow: 0 0 16px var(--blue-pill); }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--text);
  color: white;
  border-color: var(--text);
}

body[data-deep="1"] .btn-primary { background: var(--accent); color: #000; }

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

body[data-deep="1"] .btn-primary:hover { color: #000; background: var(--accent-hover); }

.btn-ghost {
  background: white;
  color: var(--text);
  border-color: var(--border-strong);
}

body[data-deep="1"] .btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }

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

.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

.link {
  background: none;
  border: none;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link:hover { color: var(--accent-hover); }

/* ============================================
   HERO (always Deep Matrix vibe — black + rain)
   ============================================ */
.hero {
  position: relative;
  padding: 96px 24px 88px;
  overflow: hidden;
  background: #000;
  color: #e7e5e4;
  isolation: isolate;
}

.hero::before {
  /* Subtle vignette + green tint */
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at top left, rgba(34, 197, 94, 0.18), transparent 55%),
    radial-gradient(ellipse at bottom right, rgba(34, 197, 94, 0.10), transparent 60%);
  z-index: 0;
  pointer-events: none;
}

.hero-rain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
  mix-blend-mode: screen;
}

.hero-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  z-index: 1;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 60px;
  align-items: center;
}

/* Override colors inside the hero so it reads on black */
.hero .badge {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
  backdrop-filter: blur(4px);
}

.hero .hero-title { color: #ffffff; text-shadow: 0 2px 32px rgba(34, 197, 94, 0.15); }
.hero .hero-sub { color: #a3a3a3; }
.hero .hero-sub strong { color: #4ade80; font-weight: 600; }

.hero .btn-primary {
  background: #22c55e;
  color: #000;
  border-color: #22c55e;
  font-weight: 600;
  box-shadow: 0 0 24px rgba(34, 197, 94, 0.4);
}

.hero .btn-primary:hover {
  background: #4ade80;
  border-color: #4ade80;
  color: #000;
  box-shadow: 0 0 36px rgba(34, 197, 94, 0.6);
}

.hero .btn-ghost {
  background: transparent;
  color: #d6ffd6;
  border-color: rgba(34, 197, 94, 0.35);
}

.hero .btn-ghost:hover {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
  color: #ffffff;
}

.hero .hero-trust { color: #525252; }
.hero .hero-trust .dot { color: #404040; }

.hero .hero-gif-wrap {
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: 0 0 60px rgba(34, 197, 94, 0.25), 0 24px 48px rgba(0, 0, 0, 0.5);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  background: var(--accent-soft);
  color: var(--accent-text);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 24px;
  font-family: var(--font-mono);
}

body[data-deep="1"] .badge { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent); }

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px var(--accent-glow); }
  50% { box-shadow: 0 0 0 6px transparent; }
}

.hero-title {
  font-size: clamp(40px, 5vw, 60px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.caret {
  display: inline-block;
  color: var(--accent);
  animation: blink 1s steps(2) infinite;
  font-weight: 400;
  margin-left: 2px;
}

@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

.hl {
  background: linear-gradient(110deg, var(--accent) 0%, #22c55e 50%, #16a34a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hl-mono {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 600;
}

.hero-sub {
  font-size: 18px;
  color: var(--text-dim);
  margin-bottom: 32px;
  line-height: 1.6;
}

.hero-sub strong { color: var(--text); font-weight: 600; }
body[data-deep="1"] .hero-sub strong { color: var(--accent); }

.hero-cta {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.hero-trust {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-faint);
  flex-wrap: wrap;
  font-family: var(--font-mono);
}

.dot { color: var(--text-mute); margin: 0 6px; }

/* Visual */
.hero-visual {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 460px;
  margin-left: auto;
}

.hero-gif-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

body[data-deep="1"] .hero-gif-wrap {
  border-color: var(--accent);
  box-shadow: 0 0 60px var(--accent-glow);
}

.hero-gif {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.05) saturate(1.1);
}

.hero-gif-caption {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: #4ade80;
  text-shadow: 0 0 12px rgba(74, 222, 128, 0.9), 0 1px 4px rgba(0,0,0,0.8);
  letter-spacing: 0.02em;
}

.hero-gif-corner {
  position: absolute;
  top: 14px;
  right: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #ff3030;
  letter-spacing: 0.15em;
  background: rgba(0, 0, 0, 0.55);
  padding: 4px 9px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.rec-dot {
  width: 8px;
  height: 8px;
  background: #ff3030;
  border-radius: 50%;
  box-shadow: 0 0 8px #ff3030;
  animation: pulse-rec 1.5s ease infinite;
}

@keyframes pulse-rec {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ============================================
   SECTIONS
   ============================================ */
.section { padding: 80px 24px; }

.section-alt {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-inner { max-width: 1120px; margin: 0 auto; }
.section-narrow { max-width: 760px; }

.section-head {
  text-align: center;
  margin-bottom: 48px;
}

.section-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.section-title {
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 12px;
}

.section-sub {
  font-size: 17px;
  color: var(--text-dim);
}

/* ============================================
   CONFIG BLOCK (steps)
   ============================================ */
.config-block {
  margin-bottom: 24px;
}

.config-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.config-step {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.config-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.config-rows { display: flex; flex-direction: column; gap: 18px; padding: 18px 22px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); }

body[data-deep="1"] .config-rows { background: var(--bg-card); }

.quality-hint {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  margin-top: 10px;
  padding-left: 22px;
}

/* ============================================
   PRESETS (4 tailles)
   ============================================ */
.presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.preset-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 18px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.15s ease;
  color: var(--text);
}

.preset-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.preset-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

body[data-deep="1"] .preset-card.active {
  background: rgba(34, 197, 94, 0.12);
}

.preset-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  border-radius: 10px;
  color: var(--text-dim);
  transition: all 0.15s ease;
}

body[data-deep="1"] .preset-icon { background: rgba(34, 197, 94, 0.08); color: var(--accent); }

.preset-card.active .preset-icon {
  background: var(--accent);
  color: white;
}

body[data-deep="1"] .preset-card.active .preset-icon { color: #000; }

.preset-icon svg { width: 20px; height: 20px; }

.preset-card-body { flex: 1; min-width: 0; width: 100%; }

.preset-name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
  color: var(--text);
}

.preset-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.preset-card.active .preset-meta { color: var(--accent-text); }
body[data-deep="1"] .preset-card.active .preset-meta { color: var(--accent); }

.preset-tag {
  font-size: 11px;
  color: var(--text-faint);
  font-style: italic;
}

.preset-card.active .preset-tag { color: var(--accent-text); }
body[data-deep="1"] .preset-card.active .preset-tag { color: var(--accent); }

.preset-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Custom preset input */
.preset-meta-custom {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 4px;
}

.custom-input {
  width: 80px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-card);
  border: 1.5px solid var(--border-strong);
  border-radius: 6px;
  padding: 4px 8px;
  text-align: center;
  outline: none;
  transition: all 0.15s ease;
  -moz-appearance: textfield;
  appearance: textfield;
}

.custom-input::-webkit-outer-spin-button,
.custom-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.custom-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.preset-card.active .custom-input {
  border-color: var(--accent);
  background: var(--bg-card);
  color: var(--accent-text);
}

body[data-deep="1"] .custom-input {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border-strong);
}

body[data-deep="1"] .preset-card.active .custom-input {
  color: var(--accent);
}

.custom-unit {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  font-weight: 500;
}

.preset-card.active .custom-unit { color: var(--accent-text); }
body[data-deep="1"] .preset-card.active .custom-unit { color: var(--accent); }

.preset-custom .preset-icon svg circle {
  stroke-dasharray: 0;
  transition: stroke-dasharray 0.3s ease;
}

.preset-custom.active .preset-icon {
  animation: spin-once 0.5s ease;
}

@keyframes spin-once {
  from { transform: rotate(0); }
  to { transform: rotate(180deg); }
}

body[data-deep="1"] .preset-check { color: #000; }

.preset-card.active .preset-check {
  opacity: 1;
  transform: scale(1);
}

/* ============================================
   CONTROLS
   ============================================ */
.control-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.control-label {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
  min-width: 80px;
  font-family: var(--font-mono);
}

.chip-group { display: flex; gap: 6px; flex-wrap: wrap; }

.chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip:hover {
  border-color: var(--text);
  color: var(--text);
}

.chip.active {
  background: var(--text);
  border-color: var(--text);
  color: white;
}

body[data-deep="1"] .chip.active { background: var(--accent); color: #000; border-color: var(--accent); }

.chip-badge {
  background: var(--accent-soft);
  color: var(--accent-text);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
}

.chip.active .chip-badge {
  background: rgba(255,255,255,0.18);
  color: white;
}

body[data-deep="1"] .chip.active .chip-badge { background: rgba(0,0,0,0.3); color: #000; }

.chip small {
  opacity: 0.6;
  font-size: 11px;
}

.quality-val {
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 600;
  margin-left: 8px;
}

.quality-slider {
  flex: 1;
  min-width: 200px;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: linear-gradient(to right, #fca5a5 0%, #fcd34d 50%, var(--accent) 100%);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

.quality-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: white;
  border: 2.5px solid var(--accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow);
}

body[data-deep="1"] .quality-slider::-webkit-slider-thumb { background: var(--accent); border-color: var(--accent-hover); }

.quality-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: white;
  border: 2.5px solid var(--accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow);
}

/* ============================================
   DROPZONE
   ============================================ */
.dropzone {
  position: relative;
  border: 2px dashed var(--border-strong);
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
  padding: 56px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

body[data-deep="1"] .dropzone { background: rgba(34, 197, 94, 0.04); }

.dropzone:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.005);
  box-shadow: 0 12px 40px var(--accent-glow);
}

.dropzone-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  color: var(--accent);
  background: var(--bg-card);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.dropzone-icon svg { width: 28px; height: 28px; }

.dropzone-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
  color: var(--text);
}

.dropzone-sub {
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.dropzone-help {
  font-size: 12px;
  color: var(--text-faint);
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.help-mono { font-family: var(--font-mono); }
.help-mono strong { color: var(--text-dim); }

/* ============================================
   RESULTS
   ============================================ */
.results { margin-top: 40px; }

.results-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}

.summary-cell {
  background: var(--bg-card);
  padding: 20px;
  text-align: center;
}

.summary-cell-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  margin-bottom: 6px;
}

.summary-cell-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.1;
}

.summary-cell-value.green { color: var(--accent); }

.summary-cell-sub {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 4px;
  font-family: var(--font-mono);
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.results-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.muted { color: var(--text-faint); font-weight: 500; font-family: var(--font-mono); }

.results-actions { display: flex; gap: 8px; }

.results-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  gap: 16px;
  align-items: center;
  transition: all 0.15s ease;
  animation: slide-in 0.25s ease both;
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.result-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.result-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

.result-info { min-width: 0; }

.result-name {
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.result-stats {
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  font-family: var(--font-mono);
}

.result-stats .old-size {
  color: var(--text-faint);
  text-decoration: line-through;
}

.result-stats .arrow { color: var(--text-faint); }
.result-stats .new-size { color: var(--text); font-weight: 600; }

.result-stats .saving {
  background: var(--accent-soft);
  color: var(--accent-text);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
}

body[data-deep="1"] .result-stats .saving { color: var(--accent); border: 1px solid var(--accent); }

.result-stats .saving.negative {
  background: var(--red-soft);
  color: var(--red);
}

.result-stats .meta-extra {
  color: var(--text-faint);
  font-size: 12px;
}

.result-actions { display: flex; gap: 6px; }

.result-action {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.result-action:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.result-action svg { width: 16px; height: 16px; }

.result-status {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  text-align: right;
  min-width: 110px;
}

.result-status.processing {
  color: var(--accent);
}

.result-status.processing::after {
  content: '';
  animation: dots 1.2s steps(4) infinite;
}

@keyframes dots {
  0% { content: '.'; }
  33% { content: '..'; }
  66% { content: '...'; }
  100% { content: ''; }
}

.result-status.done { color: var(--accent); }
.result-status.error { color: var(--red); }

/* ============================================
   STEPS
   ============================================ */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.2s ease;
}

.step:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: 0.05em;
}

.step-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
}

.step-body {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.55;
}

.why {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.why-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--bg-card);
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.why-icon { font-size: 24px; flex-shrink: 0; }
.why-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.why-body { font-size: 14px; color: var(--text-dim); line-height: 1.5; }

/* ============================================
   FAQ
   ============================================ */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}

.faq-item:first-of-type { border-top: 1px solid var(--border); }

.faq-item summary {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  cursor: pointer;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  color: var(--accent);
  font-size: 24px;
  font-weight: 400;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.faq-item[open] summary::after { transform: rotate(45deg); }

.faq-body {
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.65;
}

.faq-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--text);
  color: #d4d4d4;
  padding: 48px 24px;
}

body[data-deep="1"] .footer { background: #000; }

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.footer-brand {
  color: white;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
}

.footer-brand .brand-name-dim { color: #a3a3a3; font-weight: 500; }

.footer-line {
  font-family: var(--font-mono);
  font-style: italic;
  font-size: 14px;
  color: #4ade80;
  text-shadow: 0 0 8px rgba(74, 222, 128, 0.4);
}

.footer-meta { font-size: 13px; color: #a3a3a3; font-family: var(--font-mono); }
.footer-meta a { color: white; text-decoration: underline; text-underline-offset: 3px; }
.footer-meta a:hover { color: var(--accent); }
.footer-meta .dot { color: #525252; }

/* ============================================
   MODAL / COMPARE
   ============================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 90vw;
  max-height: 90vh;
  width: 1000px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  z-index: 10;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.modal-close:hover { background: var(--bg-hover); }

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  padding-right: 64px;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.modal-meta { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }

.compare-wrap {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: var(--bg-soft);
  min-height: 400px;
  user-select: none;
  cursor: ew-resize;
}

.compare-after, .compare-before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.compare-before-wrap {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 50%;
  overflow: hidden;
  pointer-events: none;
}

.compare-before-wrap .compare-before {
  width: calc(100vw - 48px);
  max-width: 1000px;
}

.compare-slider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  transform: translateX(-50%);
  pointer-events: none;
}

.compare-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--accent);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
}

body[data-deep="1"] .compare-handle { background: var(--bg-card); }

.compare-label {
  position: absolute;
  top: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 6px 12px;
  background: rgba(255,255,255,0.95);
  border-radius: 999px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.compare-label-left { left: 16px; }
.compare-label-right {
  right: 16px;
  background: var(--accent);
  color: white;
}

body[data-deep="1"] .compare-label { background: rgba(0,0,0,0.85); color: var(--text); border: 1px solid var(--border); }
body[data-deep="1"] .compare-label-right { background: var(--accent); color: #000; border: none; }

/* ============================================
   TOAST
   ============================================ */
.toast-stack {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-mono);
  animation: toast-in 0.3s ease both;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: none; }
}

.toast.toast-warn { border-left-color: #f59e0b; }
.toast.toast-error { border-left-color: var(--red); }

.toast-icon { flex-shrink: 0; font-size: 16px; }

body[data-deep="1"] .toast { box-shadow: 0 0 30px var(--accent-glow); }

/* ============================================
   WHITE RABBIT EASTER EGG
   ============================================ */
.rabbit {
  position: fixed;
  bottom: 20px;
  left: -100px;
  font-size: 40px;
  z-index: 300;
  pointer-events: none;
  animation: rabbit-run 6s linear forwards;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

@keyframes rabbit-run {
  0% { left: -100px; transform: rotate(0); }
  10% { transform: rotate(-5deg); }
  20% { transform: rotate(5deg); }
  100% { left: calc(100% + 100px); transform: rotate(0); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { max-width: 360px; margin: 0 auto; }
  .presets { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .why { grid-template-columns: 1fr; }
  .results-summary { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
}

@media (max-width: 600px) {
  .hero { padding: 48px 20px 40px; }
  .section { padding: 56px 20px; }
  .nav-inner { padding: 12px 20px; gap: 12px; }
  .presets { grid-template-columns: 1fr; }
  .dropzone { padding: 48px 20px; }
  .result-item { grid-template-columns: 48px 1fr; grid-template-rows: auto auto; }
  .result-thumb { width: 48px; height: 48px; }
  .result-actions, .result-status {
    grid-column: 1 / -1;
    justify-content: flex-start;
    text-align: left;
    min-width: 0;
  }
  .control-row { gap: 10px; }
  .control-label { min-width: auto; width: 100%; }
}

::selection {
  background: var(--accent);
  color: white;
}

body[data-deep="1"] ::selection { background: var(--accent); color: #000; }
