:root {
  --bg: #0f1222;
  --bg-soft: #161a30;
  --card: #1b2038;
  --card-2: #20264a;
  --line: #2a3157;
  --text: #eef1ff;
  --muted: #a3abce;
  --muted-2: #79829f;
  --accent: #6c8bff;
  --accent-2: #5cd6c0;
  --accent-grad: linear-gradient(135deg, #6c8bff 0%, #8a7bff 50%, #5cd6c0 100%);
  --good: #44d39b;
  --danger: #ff6b8a;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.65);
  --maxw: 1080px;
}

* { box-sizing: border-box; }

/* The HTML [hidden] attribute must win over display rules from .control/.summary */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(108, 139, 255, 0.18), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(92, 214, 192, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(15, 18, 34, 0.72);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { color: var(--accent); display: grid; place-items: center; }
.brand-name { font-weight: 800; font-size: 1.18rem; letter-spacing: -0.02em; }
.brand-accent { color: var(--accent); }
.nav { display: flex; align-items: center; gap: 26px; }
.nav a { color: var(--muted); font-weight: 500; font-size: 0.95rem; transition: color 0.15s; }
.nav a:hover { color: var(--text); }
.nav-cta {
  background: var(--card-2); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 999px; color: var(--text) !important;
}
.nav-cta:hover { border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 30px; text-align: center; }
.eyebrow {
  display: inline-block; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--accent-2);
  background: rgba(92, 214, 192, 0.1); border: 1px solid rgba(92, 214, 192, 0.25);
  padding: 6px 14px; border-radius: 999px;
}
.hero h1 {
  font-size: clamp(2.1rem, 5.4vw, 3.6rem); line-height: 1.06; margin: 22px 0 18px;
  font-weight: 800; letter-spacing: -0.03em;
}
.hero .sub { max-width: 660px; margin: 0 auto; color: var(--muted); font-size: 1.12rem; }
.hero .sub strong { color: var(--text); }
.hero-stats { display: flex; justify-content: center; gap: 44px; margin-top: 34px; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.7rem; font-weight: 800; }
.hero-stats span { color: var(--muted-2); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- Ads ---------- */
.ad-wrap { margin: 26px auto; }
.ad-slot {
  min-height: 90px; border: 1px dashed var(--line); border-radius: var(--radius-sm);
  display: grid; place-items: center; color: var(--muted-2); font-size: 0.78rem;
  position: relative; overflow: hidden;
}
.ad-slot:empty::after { content: attr(data-label); letter-spacing: 0.1em; text-transform: uppercase; }
.ad-slot:not(:has(*)) { background: rgba(255,255,255,0.015); }

/* ---------- Tool ---------- */
.tool { padding: 18px 0 20px; }
.tool-card {
  background: linear-gradient(180deg, var(--card) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.dropzone {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 48px 20px; text-align: center; cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
  background: rgba(255, 255, 255, 0.012);
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); background: rgba(108, 139, 255, 0.06); outline: none; }
.dropzone.dragover { border-color: var(--accent-2); background: rgba(92, 214, 192, 0.09); transform: scale(1.005); }
.dz-icon { color: var(--accent); display: flex; justify-content: center; margin-bottom: 12px; }
.dz-title { font-size: 1.15rem; font-weight: 600; margin: 0 0 6px; }
.dz-link { color: var(--accent); text-decoration: underline; }
.dz-hint { color: var(--muted-2); font-size: 0.88rem; margin: 0; }

.controls {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 22px;
}
.control { display: flex; flex-direction: column; gap: 8px; }
.control label { font-size: 0.85rem; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.control select, .control input[type="number"] {
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--text);
  padding: 11px 12px; border-radius: var(--radius-sm); font-size: 0.95rem; font-family: inherit;
  width: 100%;
}
.control select:focus, .control input:focus { outline: none; border-color: var(--accent); }
.pill {
  background: var(--card-2); border: 1px solid var(--line); color: var(--accent-2);
  font-size: 0.74rem; padding: 2px 9px; border-radius: 999px; font-weight: 700;
}
.dim-row { display: flex; align-items: center; gap: 8px; }
.dim-row span { color: var(--muted-2); }

input[type="range"] {
  -webkit-appearance: none; appearance: none; height: 6px; border-radius: 999px;
  background: var(--card-2); outline: none; cursor: pointer; width: 100%;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); border: 3px solid #fff2; box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid #fff2;
}

/* ---------- Summary ---------- */
.summary {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  margin-top: 22px; padding: 16px 18px;
  background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.summary-stat { display: flex; flex-direction: column; }
.summary-stat span { font-weight: 800; font-size: 1.15rem; }
.summary-stat small { color: var(--muted-2); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.summary-stat.saved span { color: var(--good); }
.summary-actions { margin-left: auto; display: flex; gap: 10px; }

.btn {
  font-family: inherit; font-weight: 600; font-size: 0.92rem; cursor: pointer;
  padding: 11px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  transition: transform 0.12s, filter 0.15s, background 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent-grad); color: #0b0e1c; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--muted-2); }

/* ---------- File list ---------- */
.file-list { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.file-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.file-thumb {
  width: 50px; height: 50px; border-radius: 9px; object-fit: cover; flex-shrink: 0;
  background: var(--card-2); border: 1px solid var(--line);
}
.file-meta { min-width: 0; flex: 1; }
.file-name { font-weight: 600; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-sizes { font-size: 0.82rem; color: var(--muted-2); margin-top: 2px; }
.file-sizes .arrow { color: var(--muted); margin: 0 6px; }
.file-sizes .new { color: var(--text); font-weight: 600; }
.badge { font-size: 0.74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge.saved { background: rgba(68, 211, 155, 0.14); color: var(--good); }
.badge.grew { background: rgba(255, 107, 138, 0.14); color: var(--danger); }
.badge.working { background: rgba(108, 139, 255, 0.14); color: var(--accent); }
.badge.error { background: rgba(255, 107, 138, 0.14); color: var(--danger); }
.file-actions { display: flex; gap: 6px; flex-shrink: 0; }
.icon-btn {
  background: var(--card-2); border: 1px solid var(--line); color: var(--muted);
  width: 36px; height: 36px; border-radius: 9px; cursor: pointer; display: grid; place-items: center;
  transition: color 0.15s, border-color 0.15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); }

.privacy-note { text-align: center; color: var(--muted-2); font-size: 0.9rem; margin-top: 18px; }

/* ---------- Features ---------- */
.features { padding: 60px 0 30px; }
.features h2, .faq h2 { text-align: center; font-size: clamp(1.6rem, 3.5vw, 2.2rem); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 34px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; transition: transform 0.18s, border-color 0.18s;
}
.feature:hover { transform: translateY(-3px); border-color: var(--accent); }
.feature-ic { font-size: 1.7rem; margin-bottom: 10px; }
.feature h3 { margin: 0 0 8px; font-size: 1.08rem; }
.feature p { margin: 0; color: var(--muted); font-size: 0.94rem; }

/* ---------- FAQ ---------- */
.faq { padding: 40px 0 70px; }
.faq details {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 4px 18px; margin-bottom: 12px; max-width: 760px; margin-left: auto; margin-right: auto;
}
.faq summary {
  cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none; position: relative; padding-right: 28px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 2px; top: 12px; font-size: 1.3rem; color: var(--accent); transition: transform 0.2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 16px; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 38px 0 26px; margin-top: 20px; background: rgba(0,0,0,0.18); }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-tag { color: var(--muted-2); font-size: 0.9rem; margin: 6px 0 0; }
.footer-nav { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.footer-nav a { color: var(--muted); font-size: 0.92rem; }
.footer-nav a:hover { color: var(--text); }
.footer-bottom { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted-2); }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .controls { grid-template-columns: 1fr 1fr; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .nav a:not(.nav-cta) { display: none; }
  .controls { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 20px; }
  .hero-stats { gap: 28px; }
  .summary-actions { margin-left: 0; width: 100%; }
  .summary-actions .btn { flex: 1; }
}
