/* ImageCompressorNow — shared styles. Orange-to-red brand. */
:root {
  --orange: #ff7a18;
  --orange-deep: #ea580c;
  --red: #dc2626;
  --grad: linear-gradient(135deg, #ff8a1f 0%, #f4511e 55%, #e11d2a 100%);
  --grad-btn: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
  --grad-soft: linear-gradient(135deg, #fff4e8 0%, #ffe9e4 100%);
  --ink: #1c1917;
  --ink-2: #57534e;
  --ink-3: #78716c;
  --line: #ece7e2;
  --bg: #fffdfb;
  --card: #ffffff;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(220, 70, 20, 0.12);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
}
img, svg { max-width: 100%; }
a { color: var(--orange-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

/* ---------- Header / footer ---------- */
.site-header { border-bottom: 1px solid var(--line); background: rgba(255, 253, 251, 0.92); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav { display: flex; gap: 4px 18px; flex-wrap: wrap; }
.nav a { color: var(--ink-2); text-decoration: none; font-size: 0.95rem; font-weight: 600; padding: 6px 2px; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--red); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--orange); }

.site-footer { margin-top: 80px; border-top: 1px solid var(--line); background: #fff8f3; }
.site-footer .wrap { padding-top: 32px; padding-bottom: 32px; display: flex; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; align-items: center; }
.site-footer p { margin: 0; color: var(--ink-3); font-size: 0.9rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-nav a { color: var(--ink-2); font-size: 0.92rem; text-decoration: none; font-weight: 600; }
.footer-nav a:hover { color: var(--red); }

/* ---------- Hero ---------- */
.hero { background: var(--grad); color: #fff; padding: 56px 0 120px; text-align: center; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: auto -10% -60% -10%; height: 70%; background: radial-gradient(closest-side, rgba(255,255,255,.18), transparent); pointer-events: none; }
.hero h1 { margin: 0 0 14px; font-size: clamp(2.3rem, 6vw, 3.6rem); line-height: 1.08; letter-spacing: -0.03em; font-weight: 850; }
.hero p.lead { margin: 0 auto; max-width: 620px; font-size: clamp(1.02rem, 2.4vw, 1.2rem); opacity: 0.96; }
.hero-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; margin-top: 22px; padding: 0; list-style: none; }
.hero-badges li { background: rgba(255, 255, 255, 0.18); border: 1px solid rgba(255, 255, 255, 0.35); padding: 5px 14px; border-radius: 999px; font-size: 0.88rem; font-weight: 600; }

/* ---------- Tool card ---------- */
.tool { margin-top: -84px; position: relative; z-index: 2; }
.tool-card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 22px; }
.drop { display: block; width: 100%; border: 2px dashed #f3b48a; border-radius: var(--radius); background: var(--grad-soft); padding: 42px 18px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; font: inherit; color: inherit; }
.drop:hover, .drop.over { border-color: var(--red); background: #ffefe6; }
.drop.over { transform: scale(1.01); }
.drop .icon { width: 58px; height: 58px; margin: 0 auto 10px; display: block; }
.drop strong { display: block; font-size: 1.25rem; margin-bottom: 4px; }
.drop span { color: var(--ink-2); font-size: 0.95rem; }
.drop span.btn { margin-top: 16px; pointer-events: none; color: #fff; font-size: 1rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 22px; font: inherit; font-weight: 700; font-size: 1rem; color: #fff; background: var(--grad-btn); cursor: pointer; text-decoration: none; box-shadow: 0 6px 16px rgba(220, 60, 30, 0.28); transition: transform .12s, box-shadow .12s, opacity .12s; }
.btn:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 9px 22px rgba(220, 60, 30, 0.36); }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }
.btn.ghost { background: #fff; color: var(--ink-2); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { color: var(--red); border-color: #f3b48a; box-shadow: none; }
.btn.small { padding: 8px 14px; font-size: 0.9rem; border-radius: 10px; }

.controls { display: grid; gap: 18px 28px; grid-template-columns: 1fr; margin-top: 20px; }
@media (min-width: 760px) { .controls { grid-template-columns: 1.2fr 1fr 1fr; } }
.field label, .field .label { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 8px; color: var(--ink); }
.field output { color: var(--red); font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-block; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.9rem; font-weight: 600; color: var(--ink-2); background: #fff; }
.chip input:checked + span { background: var(--grad-btn); color: #fff; border-color: transparent; }
.chip input:focus-visible + span { outline: 3px solid #1d4ed8; outline-offset: 2px; }
.chip input:disabled + span { opacity: .45; text-decoration: line-through; }
input[type="range"] { width: 100%; accent-color: var(--red); }
input[type="number"] { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.hint { margin: 6px 0 0; font-size: 0.82rem; color: var(--ink-3); }

/* ---------- Results ---------- */
.results { margin-top: 22px; display: grid; gap: 12px; }
.results[hidden], .summary[hidden] { display: none; }
.row { display: grid; grid-template-columns: 64px 1fr; gap: 6px 14px; align-items: center; border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: #fff; }
.row .thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: #f5f0eb; grid-row: span 2; }
.row .name { font-weight: 700; font-size: 0.95rem; overflow-wrap: anywhere; line-height: 1.3; }
.row .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 0.9rem; color: var(--ink-2); }
.row .meta s { color: var(--ink-3); }
.row .meta b { color: var(--ink); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-weight: 800; font-size: 0.82rem; background: var(--ok-bg); color: var(--ok); }
.badge.none { background: #f1ede9; color: var(--ink-3); }
.row .actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
@media (min-width: 640px) {
  .row { grid-template-columns: 64px 1fr auto; }
  .row .thumb { grid-row: auto; }
  .row .actions { grid-column: auto; }
}
.row.err { border-color: #fca5a5; background: #fef2f2; }
.row .state { font-size: 0.9rem; color: var(--ink-3); }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid #f3b48a; border-top-color: var(--red); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.x { border: 0; background: #f5f0eb; color: var(--ink-3); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 1.1rem; line-height: 1; }
.x:hover { background: #fee2e2; color: var(--red); }

.summary { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; margin-top: 18px; padding: 16px 18px; background: var(--grad-soft); border-radius: 14px; }
.summary p { margin: 0; font-weight: 600; }
.summary p b { color: var(--red); }
.summary .btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Content sections ---------- */
section.block { padding-top: 72px; }
h2 { font-size: clamp(1.6rem, 4vw, 2.1rem); line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 14px; }
h3 { font-size: 1.15rem; margin: 0 0 6px; }
.sub { color: var(--ink-2); max-width: 680px; margin: 0 0 28px; }
.steps, .features { display: grid; gap: 16px; grid-template-columns: 1fr; padding: 0; list-style: none; margin: 0; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } .features { grid-template-columns: repeat(2, 1fr); } }
.steps li, .features li { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: #fff; }
.steps li p, .features li p { margin: 0; color: var(--ink-2); font-size: 0.97rem; }
.steps .n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--grad-btn); color: #fff; font-weight: 800; margin-bottom: 10px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; min-width: 560px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #fff4ec; font-size: 0.85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
tr:last-child td { border-bottom: 0; }

.faq details { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 0 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 15px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--red); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 16px; color: var(--ink-2); }

.cta { margin-top: 72px; background: var(--grad); color: #fff; border-radius: 24px; padding: 40px 24px; text-align: center; }
.cta h2 { color: #fff; margin-bottom: 8px; }
.cta p { margin: 0 auto 20px; max-width: 520px; opacity: .95; }
.cta .btn { background: #fff; color: var(--red); box-shadow: none; }
.cta .btn:hover { color: var(--red); }

/* ---------- Article / legal pages ---------- */
.page-head { background: var(--grad-soft); border-bottom: 1px solid var(--line); padding: 48px 0 40px; }
.page-head h1 { margin: 0 0 10px; font-size: clamp(1.9rem, 5vw, 2.8rem); line-height: 1.15; letter-spacing: -0.025em; }
.page-head p { margin: 0; color: var(--ink-2); max-width: 640px; }
.crumbs { font-size: 0.88rem; color: var(--ink-3); margin-bottom: 14px; }
.crumbs a { color: var(--ink-2); }
.byline { margin-top: 14px; font-size: 0.9rem; color: var(--ink-3); }
.prose { padding-top: 40px; }
.prose h2 { margin-top: 44px; font-size: clamp(1.4rem, 3.4vw, 1.75rem); }
.prose h3 { margin-top: 26px; }
.prose p, .prose li { color: #2b2724; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 6px; }
.prose .callout { border-left: 4px solid var(--orange); background: #fff4ec; padding: 14px 18px; border-radius: 0 12px 12px 0; margin: 22px 0; }
.prose .callout p { margin: 0; }
.prose code { background: #f5f0eb; padding: 1px 6px; border-radius: 6px; font-size: 0.92em; }
.prose .table-wrap { margin: 22px 0; }

.post-list { display: grid; gap: 18px; padding: 40px 0 0; }
@media (min-width: 720px) { .post-list { grid-template-columns: 1fr 1fr; } }
.post-card { border: 1px solid var(--line); border-radius: 18px; background: #fff; padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.post-card h2 { font-size: 1.3rem; margin: 0; }
.post-card h2 a { color: var(--ink); text-decoration: none; }
.post-card h2 a:hover { color: var(--red); }
.post-card p { margin: 0; color: var(--ink-2); font-size: 0.97rem; }
.post-card .tag { align-self: flex-start; font-size: 0.78rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--orange-deep); }
.post-card .more { margin-top: auto; font-weight: 700; text-decoration: none; }

.tldr { border: 1px solid #f6c7a6; background: var(--grad-soft); border-radius: 16px; padding: 16px 20px; margin: 0 0 22px; }
.tldr strong { display: block; font-size: 0.8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--orange-deep); margin-bottom: 4px; }
.tldr p { margin: 0; font-size: 1.04rem; }
.toc { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 14px 20px; margin: 0 0 12px; }
.toc strong { display: block; margin-bottom: 6px; font-size: 0.95rem; }
.toc ol { margin: 0; padding-left: 1.3em; columns: 1; }
.toc li { margin: 2px 0; font-size: 0.95rem; }
.toc a { text-decoration: none; }
.prose h2[id] { scroll-margin-top: 90px; }

.contact-card { border: 1px solid var(--line); border-radius: 18px; background: #fff; padding: 26px; margin-top: 28px; }
.contact-card h2 { margin-top: 0; font-size: 1.3rem; }

@media (max-width: 520px) {
  body { font-size: 16.5px; }
  .tool-card { padding: 16px; }
  .drop { padding: 32px 12px; }
  .hero { padding-bottom: 110px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
