/* GIF Background Remove — styles
   Light surface, dark text, one blue for primary actions.
   The checkerboard is reserved for transparent previews only. */

:root {
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --text: #0B1220;
  --text-2: #344054;
  --muted: #667085;
  --border: #E4E7EC;
  --border-strong: #D0D5DD;
  --neutral-stage: #F2F4F7;
  --blue: #2563EB;
  --blue-600: #1D4ED8;
  --blue-50: #EFF4FF;
  --blue-100: #D1E0FF;
  --green: #067647;
  --red: #B42318;
  --red-50: #FEF3F2;
  --red-200: #FECDCA;
  --amber: #93370D;
  --amber-50: #FFFAEB;
  --amber-200: #FEDF89;
  --radius: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 12px 32px -12px rgba(16, 24, 40, .14);
  --ring: 0 0 0 4px rgba(37, 99, 235, .22);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, canvas, svg { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
a { color: var(--blue); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 820px; }
.center { display: flex; justify-content: center; margin-top: 40px; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--text); color: #fff; padding: 10px 14px; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: -.01em; font-size: 17px; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.site-nav { display: flex; gap: 4px; }
.site-nav a {
  color: var(--text-2); text-decoration: none; font-size: 15px; font-weight: 500;
  padding: 8px 12px; border-radius: 8px; transition: background .15s, color .15s;
}
.site-nav a:hover { background: var(--neutral-stage); color: var(--text); }
.site-nav a:focus-visible, .brand:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; line-height: 1; letter-spacing: -.005em;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .06s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-lg { height: 52px; padding: 0 24px; font-size: 16px; border-radius: 12px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .08), inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn-primary:hover { background: var(--blue-600); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: #F9FAFB; border-color: #98A2B3; }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--neutral-stage); color: var(--text); }
.btn[aria-busy="true"] { opacity: .7; pointer-events: none; }
.btn-link {
  background: none; border: 0; padding: 4px 2px; cursor: pointer;
  color: var(--blue); font-weight: 600; font-size: 15px; text-decoration: none; border-radius: 6px;
}
.btn-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn-link:focus-visible { outline: none; box-shadow: var(--ring); }
.i-stop { display: none !important; }
.is-playing .i-play { display: none !important; }
.is-playing .i-stop { display: block !important; }

/* ---------- Hero ---------- */
.hero {
  padding: 64px 0 88px;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(37, 99, 235, .08), transparent 70%),
    linear-gradient(var(--surface), var(--bg));
  border-bottom: 1px solid var(--border);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 56px;
  align-items: start;
}
.hero-copy { padding-top: 8px; }
h1 {
  font-size: clamp(2.35rem, 1.5rem + 3vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -.04em;
  font-weight: 800;
  margin-bottom: 18px;
}
.lede { font-size: clamp(1.075rem, 1rem + .3vw, 1.25rem); color: var(--text-2); max-width: 32em; margin-bottom: 28px; line-height: 1.5; }

/* ---------- Tool card ---------- */
.tool {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  outline: none;
}
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 30px 20px 28px;
  text-align: center;
  transition: border-color .15s, background-color .15s;
  cursor: pointer;
}
.dropzone:hover { border-color: #98A2B3; background: #FCFCFD; }
.dz-icon { width: 48px; height: 48px; margin: 0 auto 12px; }
.dz-title { font-size: 17px; font-weight: 600; margin-bottom: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dropzone .actions { justify-content: center; }
.facts {
  list-style: none; margin: 14px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px;
  color: var(--muted); font-size: 14px;
}
.facts li { display: inline-flex; align-items: center; gap: 6px; }
.facts li::before {
  content: ""; width: 16px; height: 16px; flex: none;
  background: no-repeat center/16px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3.5 8.3 2.8 2.8L12.5 5' fill='none' stroke='%23067647' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.hint { color: var(--muted); font-size: 14px; margin-top: 12px; }

.drop-overlay {
  position: absolute; inset: 0; border-radius: var(--radius);
  display: none; place-items: center;
  background: rgba(239, 244, 255, .94);
  border: 2px dashed var(--blue);
  color: var(--blue-600); font-weight: 700; font-size: 17px;
  pointer-events: none;
}
.tool.is-dragging .drop-overlay { display: grid; }

.file-row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; min-width: 0; }
.file-thumb {
  width: 56px; height: 56px; flex: none; border-radius: 10px; overflow: hidden;
  background: var(--neutral-stage); border: 1px solid var(--border);
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-text { min-width: 0; }
.file-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta, .result-meta { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

.status { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; margin-bottom: 14px; }
.status svg { width: 22px; height: 22px; flex: none; }
.status-success { margin-bottom: 6px; }
.result-name { font-size: 14px; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.result-meta { margin-bottom: 16px; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 2.5px solid var(--blue-100); border-top-color: var(--blue);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress { height: 10px; border-radius: 999px; background: var(--neutral-stage); overflow: hidden; }
.progress-bar {
  height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, #3B82F6, var(--blue));
  transition: width .2s ease-out;
}
.progress.is-indeterminate .progress-bar { width: 35% !important; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.progress-row { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 14px; margin: 8px 0 12px; }
.progress-pct { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--amber-50); border: 1px solid var(--amber-200); color: var(--amber);
  border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 14px;
}

.adjust { border: 1px solid var(--border); border-radius: 12px; }
.adjust summary {
  list-style: none; cursor: pointer; padding: 12px 14px; font-weight: 600; font-size: 15px;
  display: flex; justify-content: space-between; align-items: center; border-radius: 12px;
}
.adjust summary::-webkit-details-marker { display: none; }
.adjust summary::after {
  content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-2px) rotate(45deg); transition: transform .15s;
}
.adjust[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.adjust summary:focus-visible { outline: none; box-shadow: var(--ring); }
.adjust-body { padding: 0 14px 14px; display: grid; gap: 14px; }
.detected { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.detected code { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.swatch { width: 18px; height: 18px; border-radius: 5px; border: 1px solid rgba(16, 24, 40, .15); display: inline-block; }
.field { display: grid; gap: 6px; }
.field-label { font-size: 14px; font-weight: 600; }
.range-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
input[type="range"] { width: 100%; accent-color: var(--blue); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--blue); width: 16px; height: 16px; flex: none; }
.adjust-body .btn { justify-self: start; }

.error-box {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--red-50); border: 1px solid var(--red-200);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 16px;
}
.error-box svg { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.error-title { font-weight: 700; color: var(--red); margin-bottom: 2px; }
.error-msg { color: var(--text-2); font-size: 15px; overflow-wrap: anywhere; }

/* ---------- Preview ---------- */
.preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.preview-head { display: flex; align-items: center; gap: 12px; min-height: 34px; margin-bottom: 12px; }
.preview-label { font-weight: 700; font-size: 15px; margin-right: auto; }
.preview-caption { color: var(--muted); font-size: 13px; margin-top: 12px; text-align: center; }

.stage {
  --ar: 4 / 3;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  container-type: size;
  display: grid;
  place-items: center;
  background: var(--neutral-stage);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.frame {
  position: relative;
  aspect-ratio: var(--ar);
  width: min(100cqw, calc(100cqh * (var(--ar))));
  max-width: 100%;
  max-height: 100%;
}
.frame img, .frame canvas { width: 100%; height: 100%; object-fit: contain; }
.pixelated .frame img, .pixelated .frame canvas { image-rendering: pixelated; }

.checker {
  background-color: #FFFFFF;
  background-image:
    linear-gradient(45deg, #E6E9EF 25%, transparent 25%, transparent 75%, #E6E9EF 75%),
    linear-gradient(45deg, #E6E9EF 25%, transparent 25%, transparent 75%, #E6E9EF 75%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}

.inset {
  position: absolute; left: 10px; bottom: 10px; margin: 0;
  width: 23%; min-width: 82px;
  background: var(--surface); border-radius: 10px; padding: 4px;
  box-shadow: 0 4px 16px rgba(16, 24, 40, .16);
}
.inset img { width: 100%; height: auto; border-radius: 7px; }
.inset figcaption { font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; padding: 3px 0 1px; letter-spacing: .02em; }

.processing-overlay {
  position: absolute; inset: 0; display: none; place-items: center;
  background: rgba(255, 255, 255, .55);
}
.preview[data-view="processing"] .processing-overlay { display: grid; }
.scan {
  position: absolute; left: 0; right: 0; top: 0; height: 36%;
  background: linear-gradient(180deg, transparent, rgba(37, 99, 235, .14) 70%, rgba(37, 99, 235, .55) 100%);
  border-bottom: 2px solid var(--blue);
  animation: scan 1.8s ease-in-out infinite;
}
@keyframes scan { from { transform: translateY(-100%); } to { transform: translateY(280%); } }
.overlay-pct {
  position: relative; font-size: 28px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums;
  background: var(--surface); padding: 8px 16px; border-radius: 12px; box-shadow: var(--shadow);
}

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pane { margin: 0; position: relative; min-width: 0; }
.chip {
  position: absolute; z-index: 2; top: 10px; left: 10px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  background: rgba(255, 255, 255, .94); color: var(--text-2);
  padding: 4px 9px; border-radius: 999px; border: 1px solid var(--border);
}
.chip-blue { background: var(--blue); color: #fff; border-color: var(--blue); }

.segmented { display: none; background: var(--neutral-stage); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented button {
  border: 0; background: transparent; padding: 6px 14px; border-radius: 8px;
  font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented button:focus-visible { outline: none; box-shadow: var(--ring); }

.download-row { display: flex; gap: 10px; margin-top: 14px; }
.download-row .btn-primary { flex: 1 1 auto; }
.only-mob { display: none; }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 40px; }
h2 { font-size: clamp(1.8rem, 1.3rem + 1.8vw, 2.6rem); line-height: 1.12; letter-spacing: -.03em; font-weight: 800; margin-bottom: 12px; }
.section-head p { color: var(--text-2); font-size: 17px; }

.tabs {
  display: flex; justify-content: center; gap: 4px; margin: 0 auto 24px;
  background: #EAECF0; padding: 4px; border-radius: 12px; width: max-content; max-width: 100%;
}
.tabs button {
  border: 0; background: transparent; cursor: pointer; padding: 9px 16px; border-radius: 9px;
  font-size: 15px; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tabs button:focus-visible { outline: none; box-shadow: var(--ring); }

.compare-lg { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card-figure {
  margin: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow-sm);
}
.card-figure figcaption { padding: 12px 6px 4px; color: var(--muted); font-size: 15px; }
.card-figure figcaption strong { color: var(--text); margin-right: 6px; }
.example-bar { display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap; margin-top: 20px; }
.example-meta { color: var(--muted); font-size: 14px; margin-right: auto; font-variant-numeric: tabular-nums; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: s; }
.step {
  position: relative; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 24px 26px;
}
.step-num {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--blue-50); color: var(--blue); font-weight: 800; font-size: 18px; margin-bottom: 18px;
}
.step h3 { font-size: 19px; letter-spacing: -.015em; margin-bottom: 6px; }
.step p { color: var(--text-2); }

.faq { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  list-style: none; cursor: pointer; padding: 22px 44px 22px 0; position: relative; border-radius: 8px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { font-size: 18px; font-weight: 650; letter-spacing: -.01em; line-height: 1.4; }
.faq summary::before, .faq summary::after {
  content: ""; position: absolute; right: 8px; top: 50%; width: 16px; height: 2px; border-radius: 2px;
  background: var(--muted); transition: transform .2s;
}
.faq summary::after { transform: rotate(90deg); }
.faq details[open] summary::after { transform: rotate(0deg); }
.faq summary:hover h3 { color: var(--blue-600); }
.faq summary:focus-visible { outline: none; box-shadow: var(--ring); }
.faq details p { color: var(--text-2); padding: 0 44px 24px 0; font-size: 16.5px; line-height: 1.65; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 32px 0; }
.footer-inner { display: flex; align-items: center; gap: 16px 32px; flex-wrap: wrap; }
.brand-sm { font-size: 15px; }
.brand-sm .brand-mark { width: 24px; height: 24px; }
.footer-nav { display: flex; gap: 24px; margin-right: auto; }
.footer-nav a { color: var(--text-2); text-decoration: none; font-size: 15px; }
.footer-nav a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.copyright { color: var(--muted); font-size: 14px; }

/* ---------- Legal pages ---------- */
.legal { padding: 64px 0 96px; }
.legal h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem); margin-bottom: 8px; }
.legal .updated { color: var(--muted); margin-bottom: 32px; }
.legal h2 { font-size: 21px; letter-spacing: -.015em; margin: 32px 0 8px; }
.legal p, .legal li { color: var(--text-2); font-size: 16.5px; line-height: 1.7; }
.legal p + p { margin-top: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero { padding: 36px 0 56px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .hero-copy { padding-top: 0; }
  .lede { margin-bottom: 22px; }
}

@media (max-width: 720px) {
  .container { padding: 0 16px; }
  .site-nav a { padding: 8px 8px; font-size: 14px; }
  .brand span { font-size: 15px; }
  .tool { padding: 14px; border-radius: 18px; }
  .dropzone { padding: 22px 14px 20px; }
  .dropzone .dz-icon { display: none; }
  .dz-title { font-size: 16px; margin-bottom: 14px; }
  .actions .btn { flex: 1 1 auto; }
  .preview { padding: 12px; border-radius: 18px; }

  /* Before / After toggle on phones */
  .preview[data-view="compare"] .preview-label { display: none; }
  .preview[data-view="compare"] .segmented { display: inline-flex; margin-right: auto; }
  .preview[data-view="compare"] .chip { display: none; }
  .compare { grid-template-columns: 1fr; }
  .compare[data-active="after"] .pane[data-pane="before"],
  .compare[data-active="before"] .pane[data-pane="after"] { display: none; }
  .download-row { flex-direction: column; }
  .download-row .btn-primary { flex: none; }
  .only-desk { display: none; }
  .only-mob { display: inline; }

  .section { padding: 64px 0; }
  .section-head { margin-bottom: 28px; }
  .compare-lg { grid-template-columns: 1fr; gap: 14px; }
  .example-bar { flex-direction: column; align-items: stretch; text-align: center; }
  .example-meta { margin: 0; }
  .steps { grid-template-columns: 1fr; gap: 12px; }
  .tabs button { padding: 8px 12px; font-size: 14px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .site-header { position: static; }
  .header-inner { height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 6px; gap: 4px; }
  .site-nav { width: 100%; margin: 0 -8px; }
  html { scroll-padding-top: 12px; }
}
