*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --surface2: #1a1a24;
  --border: #ffffff10;
  --border2: #ffffff20;
  --accent: #7c6ff7;
  --accent2: #a78bfa;
  --green: #22d3a0;
  --text: #f0eeff;
  --muted: #8882aa;
  --danger: #f07878;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: "DM Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.4;
}
.glow {
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(ellipse, #7c6ff722 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

main {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

/* ── HEADER NAV ── */
.topnav {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  max-width: 1160px;
  margin: 0 auto;
}
.logo-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: "IBM Plex Serif", serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.2px;
}
.logo-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-icon svg {
  width: 32px;
  height: 32px;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 100px;
  transition: all 0.2s;
}
.nav-link:hover {
  color: var(--text);
  background: var(--surface2);
}
.nav-link.active {
  color: var(--accent2);
}
.nav-compress {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  padding: 8px 18px;
  border-radius: 100px;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 3px 16px #7c6ff740;
}
.nav-compress:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px #7c6ff760;
}
.nav-compress svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── BANNER ── */
.home__banner {
  text-align: center;
  padding: 52px 0 40px;
}
h1 {
  font-family: "IBM Plex Serif", serif;
  font-size: clamp(30px, 5vw, 50px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1px;
  color: var(--text);
  margin-bottom: 14px;
}
h1 span {
  background: linear-gradient(135deg, var(--accent2), var(--green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitle {
  font-size: 17px;
  color: var(--muted);
  font-weight: 300;
  max-width: 480px;
  margin: 0 auto 32px;
  line-height: 1.6;
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.badge {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  padding: 5px 12px;
  border-radius: 100px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--muted);
}
.badge.green {
  background: #22d3a015;
  border-color: #22d3a030;
  color: var(--green);
}

/* ── DROP ZONE ── */
.drop-zone {
  background: var(--surface);
  border: 2px dashed var(--border2);
  border-radius: 24px;
  padding: 56px 32px;
  text-align: center;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  margin-top: 40px;
}
.drop-zone::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, #7c6ff708 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.drop-zone.drag-over::before {
  opacity: 1;
}
.drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--surface2);
  border-style: solid;
  transform: scale(1.01);
}
.upload-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--accent) 22, var(--accent2) 22);
  border: 1px solid var(--border2);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--accent2);
  stroke-width: 1.5;
  fill: none;
}
.drop-title {
  font-family: "IBM Plex Serif", serif;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}
.drop-sub {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* The label IS the button — most reliable cross-browser approach */
.upload-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  padding: 12px 28px;
  border-radius: 100px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 24px #7c6ff740;
  font-family: "DM Sans", sans-serif;
  user-select: none;
}
.upload-label:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px #7c6ff760;
}
.upload-label:active {
  transform: translateY(0);
}
#file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.formats {
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.format-pill {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* ── QUALITY ── */
.quality-section {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 24px;
}
.quality-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}
.quality-label strong {
  font-family: "IBM Plex Serif", serif;
  font-size: 15px;
  color: var(--text);
}
.quality-value {
  font-family: "IBM Plex Serif", serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent2);
}
input[type="range"] {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(
    to right,
    var(--accent) 0%,
    var(--accent) var(--pct, 70%),
    var(--surface2) var(--pct, 70%),
    var(--surface2) 100%
  );
  border-radius: 100px;
  outline: none;
  cursor: pointer;
  border: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 2px 8px #7c6ff750;
  cursor: pointer;
}
.quality-hints {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
  margin-bottom: 24px;
}
.quality-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.5;
  padding: 12px 12px;
  background: var(--surface2);
  border-radius: 8px;
  border-left: 2px solid var(--accent);
}

/* ── PROCESSING OVERLAY ── */
.processing-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
}
.processing-overlay.active {
  display: flex;
}
.proc-box {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 24px;
  padding: 40px 48px;
  text-align: center;
  max-width: 360px;
  width: 90%;
}
.proc-ring {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  position: relative;
}
.proc-ring svg {
  width: 72px;
  height: 72px;
  transform: rotate(-90deg);
}
.proc-ring circle {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
}
.proc-ring .track {
  stroke: var(--surface2);
}
.proc-ring .fill {
  stroke: var(--accent2);
  stroke-dasharray: 188;
  stroke-dashoffset: 188;
  transition: stroke-dashoffset 0.3s ease;
}
.proc-title {
  font-family: "IBM Plex Serif", serif;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}
.proc-sub {
  font-size: 13px;
  color: var(--muted);
}
.proc-files {
  font-size: 12px;
  color: var(--accent2);
  margin-top: 8px;
  font-weight: 500;
}

/* ── DONE TOAST ── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  z-index: 200;
  background: var(--green);
  color: #0a1a14;
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 32px #22d3a050;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
}
.toast svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ── RESULTS ── */
.results {
  display: none;
  margin-top: 32px;
  scroll-margin-top: 24px;
}
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.results-title {
  font-family: "IBM Plex Serif", serif;
  font-size: 18px;
  font-weight: 600;
}
.clear-btn {
  font-size: 12px;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: "DM Sans", sans-serif;
}
.clear-btn:hover {
  color: var(--danger);
  border-color: var(--danger) 40;
}
.cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.img-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 16px;
  align-items: center;
  animation: slideIn 0.35s ease;
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.img-thumb {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.img-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
  margin-bottom: 4px;
}
.img-stats {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}
.stat-arrow {
  color: var(--muted);
  font-size: 10px;
}
.size-after {
  color: var(--green);
  font-weight: 500;
}
.saving-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 100px;
  background: #22d3a015;
  color: var(--green);
  border: 1px solid #22d3a030;
}
.saving-badge.warn {
  background: #f07878 15;
  color: var(--danger);
  border-color: #f0787830;
}
.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: "DM Sans", sans-serif;
}
.dl-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px #7c6ff740;
}

.summary-bar {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  display: none;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}
.sum-item {
  text-align: center;
}
.sum-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}
.sum-val {
  font-family: "IBM Plex Serif", serif;
  font-size: 20px;
  font-weight: 700;
}
.sum-val.green {
  color: var(--green);
}
.sum-val.purple {
  color: var(--accent2);
}

.dl-all-wrap {
  margin-top: 20px;
  text-align: center;
  display: none;
}
.dl-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  padding: 12px 28px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 24px #7c6ff740;
  font-family: "DM Sans", sans-serif;
  user-select: none;
}
.dl-all-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px #7c6ff760;
}
.dl-all-btn:active {
  transform: translateY(0);
}
.dl-all-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── FEATURES ── */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 60px;
}
.feat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}
.feat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
}
.feat-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.5;
  fill: none;
}
.feat h2 {
  font-family: "IBM Plex Serif", serif;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
.feat p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* ── FOOTER ── */
footer {
  text-align: center;
  margin-top: 64px;
  padding-bottom: 32px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 32px;
}
footer a {
  color: var(--accent2);
  text-decoration: none;
}
footer a:hover {
  text-decoration: underline;
}
.footer-links {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

