/* funteas — image compressor */

:root {
  --ink: #0d1117;
  --ink-soft: #384654;
  --muted: #67757f;
  --line: #e5e9ee;
  --line-strong: #d3dae2;
  --bg: #ffffff;
  --bg-soft: #f7f9fa;
  --accent: #0b7a75;
  --accent-soft: #e6f4f2;
  --danger: #b4372c;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(13, 17, 23, .04), 0 8px 24px -12px rgba(13, 17, 23, .12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: 1020px; margin: 0 auto; padding: 0 24px; }
a { color: inherit; }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  font-size: 16px;
  letter-spacing: -.015em;
  text-decoration: none;
}

.brand-mark { color: var(--ink); display: block; }
.header-nav { display: flex; gap: 26px; }

.header-nav a {
  font-size: 14.5px;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}

.header-nav a:hover { color: var(--ink); }

/* ── Hero ───────────────────────────────────────────────── */
.hero { padding: 72px 24px 40px; max-width: 780px; }

.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(2.05rem, 5.2vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -.035em;
  font-weight: 700;
}

.accent { color: var(--accent); }

.lede {
  margin: 0 0 26px;
  font-size: clamp(1rem, 1.4vw, 1.115rem);
  color: var(--ink-soft);
  max-width: 62ch;
}

.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; }

.badge {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--ink-soft);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
}

/* ── Tool ───────────────────────────────────────────────── */
.tool { padding-bottom: 64px; }

.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-soft);
  padding: 56px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .16s, background .16s, transform .16s;
  outline: none;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone.is-drag {
  border-color: var(--accent);
  border-style: solid;
  background: var(--accent-soft);
  transform: scale(.995);
}

.dz-icon { color: var(--muted); margin-bottom: 14px; }
.dropzone:hover .dz-icon, .dropzone.is-drag .dz-icon { color: var(--accent); }
.dz-title { margin: 0 0 6px; font-weight: 600; font-size: 17px; }
.dz-sub { margin: 0; font-size: 14px; color: var(--muted); }
.dz-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.panel {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise .22s ease-out;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* presets */
.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}

.preset {
  background: #fff;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: border-color .14s, color .14s, background .14s;
}

.preset:hover { border-color: var(--muted); color: var(--ink); }

.preset[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* controls */
.controls {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr 1fr auto;
  gap: 22px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.field { min-width: 0; }

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.opt { font-weight: 500; text-transform: none; letter-spacing: 0; color: #9aa6b2; }

.input-group { display: flex; align-items: stretch; }

input[type="number"], select {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

input[type="number"] { font-variant-numeric: tabular-nums; }

input[type="number"]:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 122, 117, .13);
}

.input-group input[type="number"] {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group select {
  width: auto;
  flex: 0 0 auto;
  border-left: none;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  background: var(--bg-soft);
  cursor: pointer;
  padding-right: 30px;
}

.unit-static {
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  font-size: 14px;
  color: var(--muted);
  background: var(--bg-soft);
  border: 1px solid var(--line-strong);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.hint { margin: 7px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }

.field-action { display: flex; gap: 8px; align-items: flex-end; padding-bottom: 22px; }

button {
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 560;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
  white-space: nowrap;
}

.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #1d2833; }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }

.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line-strong); }
.btn-ghost:hover { color: var(--ink); border-color: var(--muted); }

.btn-secondary { background: var(--bg-soft); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: #eef2f5; }

/* ── Results ────────────────────────────────────────────── */
.summary {
  padding: 13px 22px;
  font-size: 14px;
  color: var(--ink-soft);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}

.summary strong { color: var(--ink); font-weight: 620; }
.summary .warn { color: var(--danger); }

.results { list-style: none; margin: 0; padding: 0; }

.result {
  display: grid;
  grid-template-columns: 52px 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
}

.result:last-child { border-bottom: none; }

.result-thumb {
  width: 52px;
  height: 52px;
  border-radius: 7px;
  object-fit: cover;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.result-name {
  min-width: 0;
  font-size: 14.5px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-meta {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.result-meta .arrow { opacity: .5; margin: 0 5px; }
.result-meta .after { color: var(--accent); font-weight: 600; }
.result-meta .fail { color: var(--danger); font-weight: 600; }

.result-save {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 9px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.result-save.pending { color: var(--muted); background: var(--bg-soft); }

.result-dl {
  font-size: 13.5px;
  font-weight: 550;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 7px 13px;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}

.result-dl:hover { background: var(--bg-soft); border-color: var(--muted); }
.result-dl[aria-disabled="true"] { opacity: .4; pointer-events: none; }

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

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

.bulk { padding: 16px 22px; border-top: 1px solid var(--line); background: var(--bg-soft); }

.privacy-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 18px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.privacy-note svg { flex: 0 0 auto; }

/* ── Sections ───────────────────────────────────────────── */
.how, .faq { padding-top: 20px; padding-bottom: 56px; }

.how h2, .faq h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  letter-spacing: -.025em;
  margin: 0 0 30px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 34px 40px;
}

.step-n {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: .06em;
  display: block;
  margin-bottom: 9px;
}

.steps h3 { margin: 0 0 7px; font-size: 15.5px; font-weight: 620; letter-spacing: -.01em; }
.steps p { margin: 0; font-size: 14.5px; line-height: 1.62; color: var(--ink-soft); }

.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }

.faq summary {
  cursor: pointer;
  padding: 15px 30px 15px 0;
  font-weight: 560;
  font-size: 15.5px;
  list-style: none;
  position: relative;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 400;
  font-size: 19px;
  color: var(--muted);
  transition: transform .18s;
}

.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }

.faq details p {
  margin: 0 0 18px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 68ch;
}

/* ── Footer ─────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); padding: 30px 0 46px; margin-top: 20px; }
.footer-inner p { margin: 0; font-size: 13.5px; color: var(--muted); }
.foot-dim { margin-top: 6px !important; font-size: 12.5px !important; opacity: .8; }

.foot-links { margin-top: 12px !important; display: flex; gap: 16px; flex-wrap: wrap; }
.foot-links a { color: var(--muted); text-decoration: none; font-size: 13px; }
.foot-links a:hover { color: var(--ink); text-decoration: underline; }

/* ── Content pages (about / privacy / contact) ──────────── */
.page { padding: 56px 0 68px; }

.page-head { max-width: 720px; margin-bottom: 36px; }

.page-head h1 {
  font-size: clamp(1.8rem, 4.2vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -.032em;
  margin: 0 0 14px;
  font-weight: 700;
}

.page-head .lede { margin: 0; max-width: 60ch; }

.prose { max-width: 720px; }

.prose h2 {
  font-size: 1.145rem;
  letter-spacing: -.015em;
  margin: 36px 0 10px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.prose h2:first-child { border-top: none; padding-top: 0; margin-top: 0; }

.prose h3 { font-size: 1rem; margin: 22px 0 8px; letter-spacing: -.01em; }

.prose p { margin: 0 0 14px; font-size: 15.5px; line-height: 1.72; color: var(--ink-soft); }
.prose ul { margin: 0 0 16px; padding-left: 20px; }
.prose li { font-size: 15.5px; line-height: 1.72; color: var(--ink-soft); margin-bottom: 7px; }
.prose a { color: var(--accent); text-underline-offset: 2px; }
.prose strong { color: var(--ink); font-weight: 620; }

.prose .updated {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: .02em;
  margin: 0 0 28px;
}

.prose .mail {
  display: inline-block;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
  margin: 6px 0 18px;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 820px) {
  .controls { grid-template-columns: 1fr 1fr; gap: 18px; }
  .field-action { grid-column: 1 / -1; padding-bottom: 0; }
  .steps { grid-template-columns: 1fr; gap: 26px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 18px; }
  .hero { padding: 46px 18px 32px; }
  .controls { grid-template-columns: 1fr; }
  .dropzone { padding: 40px 18px; }
  .presets { padding: 14px 16px; }
  .result { grid-template-columns: 44px 1fr auto; gap: 12px; padding: 13px 16px; }
  .result-thumb { width: 44px; height: 44px; }
  .result-save { display: none; }
  .header-nav { gap: 18px; }
  .header-nav a { font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
