/* =========================================================
   JPG Reduce — Stylesheet
   ========================================================= */

:root {
  --bg: #ffffff;
  --surface: #f6f6f8;
  --surface-2: #f0f0f3;
  --border: #e4e4e9;
  --text: #16161a;
  --text-muted: #6b6b76;
  --text-faint: #9a9aa5;
  --accent: #2b52e0;
  --accent-dark: #1f3fc0;
  --accent-soft: #eef1fd;
  --success: #1a8a5f;
  --success-soft: #e9f7f1;
  --danger: #c93838;
  --danger-soft: #fbeaea;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(16, 16, 20, 0.05);
  --shadow-md: 0 8px 24px rgba(16, 16, 20, 0.08);
  --max-width: 1160px;
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.mono { font-family: var(--font-mono); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.section-head {
  max-width: 620px;
  margin: 0 0 48px;
}

.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.section-head h2 {
  font-size: clamp(26px, 3.6vw, 36px);
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}

.section-head p {
  color: var(--text-muted);
  font-size: 16px;
  margin: 0;
}

section { padding: 88px 0; }

.section-alt { background: var(--surface); }

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 15px;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover { background: var(--accent-dark); }

.btn-primary:disabled {
  background: var(--text-faint);
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover { border-color: var(--text-faint); background: var(--surface); }

.btn-block { width: 100%; }

.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------------- Header ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

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

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.main-nav a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.main-nav a:hover { color: var(--text); }

.nav-cta { display: flex; align-items: center; gap: 20px; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle svg { width: 24px; height: 24px; }

/* ---------------- Hero ---------------- */

.hero {
  padding: 96px 0 80px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(32px, 5.4vw, 56px);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 22px;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}

.hero h1 span { color: var(--accent); }

.hero p.lead {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 36px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

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

.hero-stats .stat strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 26px;
  letter-spacing: -0.02em;
}

.hero-stats .stat span {
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------------- Tool section ---------------- */

.tool-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px;
}

.tool-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.tool-top h3 { margin: 0 0 6px; font-size: 20px; }
.tool-top p { margin: 0; color: var(--text-muted); font-size: 14.5px; }

.tool-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: 999px;
}

.tool-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

/* Dropzone */

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 56px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  background: var(--surface);
}

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

.dropzone-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 20px;
  color: var(--accent);
}

.dropzone h4 {
  margin: 0 0 8px;
  font-size: 17px;
}

.dropzone p {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.dropzone .browse-btn {
  display: inline-flex;
}

.dropzone-meta {
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}

#file-input { display: none; }

/* Preview panels */

.panel-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: start;
}

.preview-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.info-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
  margin: 0 0 24px;
}

.info-item {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.info-item .label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-item .value {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
}

.result-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--success-soft);
  color: var(--success);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
}

.result-banner svg { width: 18px; height: 18px; flex-shrink: 0; }

.result-banner strong { font-family: var(--font-mono); }

.control-block {
  margin: 28px 0;
}

.control-block label.control-label {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

.control-block label.control-label span.val {
  font-family: var(--font-mono);
  color: var(--accent);
}

input[type="range"] {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  background: var(--border);
  border-radius: 999px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px var(--accent);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px var(--accent);
}

.range-scale {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 8px;
  font-family: var(--font-mono);
}

.preset-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.preset-btn {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.preset-btn:hover { border-color: var(--accent); color: var(--accent); }
.preset-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.tool-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.error-box {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 14px;
  margin-bottom: 20px;
  display: none;
}

.error-box.show { display: block; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.hidden { display: none !important; }

/* ---------------- Benefits ---------------- */

.benefit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.benefit-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 30px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.benefit-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-2px); }

.benefit-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.benefit-icon svg { width: 22px; height: 22px; }

.benefit-card h3 {
  font-size: 17px;
  margin: 0 0 8px;
}

.benefit-card p {
  font-size: 14.5px;
  color: var(--text-muted);
  margin: 0;
}

/* ---------------- How it works ---------------- */

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  position: relative;
}

.step-card { position: relative; }

.step-number {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  background: var(--accent-soft);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 20px;
}

.step-card h3 {
  font-size: 17px;
  margin: 0 0 10px;
}

.step-card p {
  font-size: 14.5px;
  color: var(--text-muted);
  margin: 0;
}

/* ---------------- FAQ ---------------- */

.faq-list {
  max-width: 760px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: none;
  border: none;
  text-align: left;
  padding: 22px 4px;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.faq-question svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.faq-item.open .faq-question svg { transform: rotate(180deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.faq-answer-inner {
  padding: 0 4px 22px;
  color: var(--text-muted);
  font-size: 14.5px;
  max-width: 660px;
}

/* ---------------- Footer ---------------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer p {
  color: var(--text-faint);
  font-size: 13.5px;
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 22px;
}

.footer-links a {
  font-size: 13.5px;
  color: var(--text-muted);
}

.footer-links a:hover { color: var(--text); }

/* ---------------- Responsive ---------------- */

@media (max-width: 900px) {
  .benefit-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: 1fr; gap: 28px; }
  .panel-grid { grid-template-columns: 1fr; }
  .preview-frame { aspect-ratio: 16 / 10; }
}

@media (max-width: 720px) {
  .main-nav, .nav-cta .btn-secondary { display: none; }
  .nav-toggle { display: inline-flex; }
  section { padding: 64px 0; }
  .hero { padding: 56px 0 48px; }
  .tool-card { padding: 24px; }
  .benefit-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 28px; }
  .info-list { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .info-list { grid-template-columns: 1fr; }
  .tool-actions { flex-direction: column; }
  .tool-actions .btn { width: 100%; }
}
