/* ── RESET & VARIABLES ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #141414;
  --surface: #1c1c1c;
  --surface2: #242424;
  --border: #2e2e2e;
  --accent: #e03030;
  --accent-hover: #c42828;
  --text: #ffffff;
  --muted: #888888;
  --muted2: #444444;
  --danger: #ff4747;
  --success: #2ecc71;
  --font: 'Inter', sans-serif;
}

html, body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

* { position: relative; z-index: 1; }

/* ── HEADER ── */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 48px; border-bottom: 1px solid var(--border); background: #0d0d0d;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-img { height: 28px; width: auto; flex-shrink: 0; display: block; }
.logo-name { font-size: 20px; font-weight: 800; color: #fff; letter-spacing: -0.4px; }
.logo-name span { color: var(--accent); }
.header-right { display: flex; align-items: center; gap: 20px; }
.header-link { font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; transition: color 0.15s; }
.header-link:hover { color: var(--text); }
.btn-nav { background: var(--accent); color: #fff; border: none; padding: 9px 22px; border-radius: 6px; font-size: 14px; font-weight: 700; font-family: var(--font); cursor: pointer; text-decoration: none; transition: background 0.15s; }
.btn-nav:hover { background: var(--accent-hover); }

/* ── HERO ── */
.hero { padding: 80px 48px 64px; max-width: 760px; margin: 0 auto; text-align: center; }
.hero h1 { font-size: clamp(34px, 5vw, 58px); font-weight: 900; line-height: 1.1; letter-spacing: -1.5px; margin-bottom: 18px; color: #fff; }
.hero h1 span { color: var(--accent); }
.hero p { font-size: 16px; color: var(--muted); line-height: 1.65; max-width: 500px; margin: 0 auto 10px; }
.hero-note { font-size: 14px; font-weight: 600; color: var(--text); margin-top: 6px; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(46,204,113,0.1); border: 1px solid rgba(46,204,113,0.2); color: var(--success); font-size: 12px; font-weight: 700; padding: 5px 14px; border-radius: 100px; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 0.5px; }
.hero-badge::before { content: ''; width: 6px; height: 6px; background: var(--success); border-radius: 50%; }

/* ── TOOL WRAPPER ── */
.tool-wrap { max-width: 860px; margin: 0 auto; padding: 0 48px 80px; }

/* ── DROP ZONE ── */
.drop-zone { border: 2px dashed var(--border); border-radius: 12px; padding: 56px 40px; text-align: center; cursor: pointer; background: var(--surface); transition: border-color 0.15s, background 0.15s; }
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--accent); background: rgba(224,48,48,0.04); }
.drop-icon { width: 52px; height: 52px; border-radius: 12px; background: var(--surface2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; transition: transform 0.15s; }
.drop-zone:hover .drop-icon { transform: translateY(-2px); }
.drop-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.drop-sub { font-size: 14px; color: var(--muted); }
.drop-sub span { color: var(--accent); font-weight: 600; }
#file-input { display: none; }

/* ── OPTIONS ROW ── */
.options-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.option-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.target-btn { background: var(--surface); border: 1px solid var(--border); color: var(--muted); padding: 7px 16px; border-radius: 6px; font-size: 13px; font-weight: 600; font-family: var(--font); cursor: pointer; transition: all 0.15s; }
.target-btn:hover { border-color: var(--accent); color: var(--accent); }
.target-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── SHARPEN SLIDER ── */
.sharpen-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.sharpen-label { font-size: 13px; font-weight: 600; color: var(--muted); min-width: 70px; }
.sharpen-slider { -webkit-appearance: none; appearance: none; flex: 1; max-width: 200px; height: 4px; background: var(--surface2); border-radius: 100px; outline: none; cursor: pointer; }
.sharpen-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; background: var(--accent); border-radius: 50%; cursor: pointer; }
.sharpen-slider::-moz-range-thumb { width: 14px; height: 14px; background: var(--accent); border-radius: 50%; cursor: pointer; border: none; }
.sharpen-value { font-size: 12px; font-weight: 600; color: var(--muted); min-width: 30px; }

/* ── ERROR MESSAGE ── */
.error-msg { display: none; margin-top: 12px; padding: 11px 14px; background: rgba(255,71,71,0.08); border: 1px solid rgba(255,71,71,0.2); border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--danger); }
.error-msg.visible { display: block; }

/* ── PREVIEW AREA ── */
.preview-area { display: none; margin-top: 20px; gap: 14px; grid-template-columns: 1fr 1fr; }
.preview-area.visible { display: grid; }
.preview-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.preview-card-header { padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.preview-card-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.preview-badge { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 4px; background: var(--surface2); color: var(--muted); }
.preview-badge.done { background: rgba(224,48,48,0.12); color: var(--accent); }
.preview-img-wrap { aspect-ratio: 16/9; background: #0a0a0a; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.preview-img-wrap img { width: 100%; height: 100%; object-fit: contain; }
.preview-placeholder { font-size: 13px; color: var(--muted2); font-weight: 500; }

/* ── PROGRESS AREA ── */
.process-area { display: none; margin-top: 20px; }
.process-area.visible { display: block; }
.process-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 28px; text-align: center; }
.process-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.process-sub { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.progress-track { background: var(--surface2); border-radius: 100px; height: 5px; overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 100px; width: 0%; transition: width 0.3s ease; }
.progress-text { font-size: 12px; font-weight: 600; color: var(--muted); }

/* ── BUTTONS ── */
.btn-upscale { display: block; width: 100%; margin-top: 16px; padding: 15px; background: var(--accent); color: #fff; border: none; border-radius: 8px; font-size: 15px; font-weight: 800; font-family: var(--font); cursor: pointer; text-transform: uppercase; letter-spacing: 0.5px; transition: background 0.15s; }
.btn-upscale:hover:not(:disabled) { background: var(--accent-hover); }
.btn-upscale:disabled { opacity: 0.3; cursor: not-allowed; }

.btn-row { display: flex; gap: 10px; margin-top: 12px; }
.btn-download { display: none; flex: 1; padding: 13px; background: transparent; color: var(--text); border: 1px solid var(--border); border-radius: 8px; font-size: 15px; font-weight: 700; font-family: var(--font); cursor: pointer; text-align: center; text-decoration: none; transition: border-color 0.15s, background 0.15s; }
.btn-download.visible { display: block; }
.btn-download:hover { border-color: var(--muted); background: var(--surface); }
.btn-download-jpg { display: none; flex: 1; padding: 13px; background: transparent; color: var(--muted); border: 1px solid var(--border); border-radius: 8px; font-size: 15px; font-weight: 600; font-family: var(--font); cursor: pointer; text-align: center; text-decoration: none; transition: border-color 0.15s, background 0.15s; }
.btn-download-jpg.visible { display: block; }
.btn-download-jpg:hover { border-color: var(--muted); background: var(--surface); }

.btn-reset { display: none; width: 100%; margin-top: 8px; padding: 11px; background: transparent; color: var(--muted); border: none; border-radius: 8px; font-size: 13px; font-weight: 500; font-family: var(--font); cursor: pointer; transition: color 0.15s; }
.btn-reset.visible { display: block; }
.btn-reset:hover { color: var(--text); }

/* ── SPINNER ── */
.spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,0.25); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: middle; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── SECTIONS ── */
.section { max-width: 860px; margin: 0 auto; padding: 0 48px 80px; }
.section-title { font-size: 30px; font-weight: 900; letter-spacing: -0.8px; margin-bottom: 28px; text-align: center; }
.steps-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.step-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 22px; }
.step-num { font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.step-title { font-size: 15px; font-weight: 700; margin-bottom: 7px; }
.step-desc { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* ── PROMO CARD ── */
.promo-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 56px 48px; text-align: center; }
.promo-eyebrow { font-size: 13px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 16px; }
.promo-title { font-size: clamp(26px, 4vw, 40px); font-weight: 900; letter-spacing: -1px; line-height: 1.15; margin-bottom: 16px; }
.promo-title span { color: var(--accent); }
.promo-desc { font-size: 15px; color: var(--muted); line-height: 1.65; max-width: 480px; margin: 0 auto 28px; }
.promo-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-primary { background: var(--accent); color: #fff; border: none; padding: 13px 28px; border-radius: 7px; font-size: 14px; font-weight: 700; font-family: var(--font); cursor: pointer; text-decoration: none; text-transform: uppercase; letter-spacing: 0.3px; transition: background 0.15s; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); padding: 13px 28px; border-radius: 7px; font-size: 14px; font-weight: 600; font-family: var(--font); cursor: pointer; text-decoration: none; transition: border-color 0.15s; }
.btn-outline:hover { border-color: var(--muted); }

/* ── FOOTER ── */
footer { border-top: 1px solid var(--border); padding: 22px 48px; display: flex; align-items: center; justify-content: space-between; background: #0d0d0d; flex-wrap: wrap; gap: 8px; }
.footer-left { font-size: 13px; color: var(--muted); }
.footer-left a { color: var(--accent); text-decoration: none; font-weight: 600; }
.footer-left a:hover { text-decoration: underline; }
.footer-right { font-size: 12px; color: var(--muted2); }

/* ── MISC ── */
.speed-note { font-size: 12px; color: var(--muted2); text-align: center; margin-top: 8px; }

/* ── MOBILE ── */
@media (max-width: 640px) {
  header, footer { padding: 16px 20px; }
  .hero, .tool-wrap, .section { padding-left: 20px; padding-right: 20px; }
  .steps-grid, .preview-area { grid-template-columns: 1fr; }
  .promo-card { padding: 32px 20px; }
  .header-link { display: none; }
  .btn-row { flex-direction: column; }
}
