/* Image4k.org — styles */
:root {
  --bg: #111111;
  --bg-2: #161616;
  --card: #1c1c1c;
  --card-2: #232323;
  --card-3: #2b2b2b;
  --line: #2f2f2f;
  --line-2: #3a3a3a;
  --text: #ffffff;
  --text-2: #c9c9cf;
  --muted: #8d8d96;
  --accent: #f43ff5;
  --accent-hover: #ff62fb;
  --accent-ink: #1a0019;
  --accent-soft: rgba(244, 63, 245, 0.14);
  --accent-soft-2: rgba(244, 63, 245, 0.26);
  --violet: #8b3dff;
  --ok: #3ddc97;
  --warn: #ffb547;
  --err: #ff5f6d;
  --radius: 22px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --font: 'Urbanist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
}
html { overflow-x: hidden; overflow-x: clip; }
img, canvas, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 32px; } }

/* glows */
.glow { position: relative; isolation: isolate; overflow-x: clip; }
.glow::before {
  content: ''; position: absolute; inset: -10% -20% auto; height: 900px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 50% at 70% 60%, rgba(120, 72, 40, 0.30), transparent 70%),
    radial-gradient(35% 40% at 25% 30%, rgba(139, 61, 255, 0.16), transparent 70%);
}

/* ---------- promo strip & header ---------- */
.promo {
  background: linear-gradient(90deg, #3a0a46, #a312a8 50%, #3a0a46);
  font-size: 14px; font-weight: 600; text-align: center; padding: 8px 16px;
}
.promo b { color: #fff; }
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(17, 17, 17, 0.82);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.nav { display: flex; align-items: center; gap: 24px; height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 24px; color: #fff; letter-spacing: -0.02em; }
.logo:hover { color: #fff; }
.logo-mark {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  color: #fff; font-size: 13px; font-weight: 900; letter-spacing: 0;
}
.logo small { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: -4px; }
.nav-links { display: none; gap: 22px; margin: 0; padding: 0; list-style: none; }
.nav-links a { color: #fff; font-weight: 600; font-size: 15px; }
.nav-links a:hover { color: var(--accent); }
.nav-cta { margin-left: auto; }
@media (min-width: 900px) { .nav-links { display: flex; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; line-height: 1; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .1s, opacity .15s;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn-ghost { background: var(--card-3); color: #fff; }
.btn-ghost:hover { background: #363636; color: #fff; }
.btn-outline { border-color: var(--accent); color: var(--accent); background: transparent; }
.btn-outline:hover { background: var(--accent-soft); color: var(--accent-hover); }
.btn-lg { min-height: 54px; padding: 14px 28px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 8px 14px; font-size: 14px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); border: 0; color: #fff;
}
.icon-btn:hover { background: var(--err); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- hero ---------- */
.hero { padding: 48px 0 56px; text-align: center; }
.hero h1 {
  font-size: clamp(32px, 5.4vw, 64px); line-height: 1.08; letter-spacing: -0.03em;
  font-weight: 600; margin: 0 auto 18px; max-width: 1100px;
}
.hero h1 .grad { background: linear-gradient(90deg, var(--accent), #b77bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { color: var(--text-2); font-size: clamp(16px, 1.6vw, 18px); max-width: 860px; margin: 0 auto 28px; }

.tools {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
  max-width: 780px; margin: 0 auto 32px; padding: 6px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
}
.tool-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 8px 10px; border-radius: 999px; border: 0;
  background: transparent; color: var(--text-2); font-weight: 700; font-size: 15px;
  transition: background .15s, color .15s;
}
.tool-btn svg { width: 20px; height: 20px; flex: none; }
.tool-btn:hover { color: #fff; background: var(--card-3); }
.tool-btn[aria-selected='true'] { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 600px) {
  .tools { border-radius: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-btn { flex-direction: column; gap: 4px; font-size: 13px; border-radius: 16px; min-height: 60px; }
}

.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; text-align: left; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1fr 1fr; } }

/* before/after demo */
.ba {
  position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 3 / 2;
  background: var(--card); user-select: none; -webkit-user-select: none; touch-action: pan-y;
}
.ba > img, .ba > canvas, .ba > .ba-layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba .ba-before { clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0); }
.ba-handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 3px; margin-left: -1.5px;
  background: #fff; pointer-events: none;
}
.ba-handle::after {
  content: '‹ ›'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 34px; height: 34px; border-radius: 50%; background: #fff; color: #111;
  display: grid; place-items: center; font-weight: 900; font-size: 15px; letter-spacing: -1px;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.ba { cursor: ew-resize; }
.ba img { -webkit-user-drag: none; user-select: none; pointer-events: none; }
.ba.ba-demo { aspect-ratio: 5 / 4; }
.ba-range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; pointer-events: none; }
.ba:focus-within .ba-handle::after { box-shadow: 0 0 0 3px var(--accent), 0 4px 14px rgba(0,0,0,.4); }
.ba.dragging .ba-handle::after { transform: translate(-50%, -50%) scale(1.12); }
.ba-tag {
  position: absolute; top: 14px; padding: 4px 12px; border-radius: 999px;
  background: rgba(30, 30, 30, .75); color: #fff; font-size: 14px; font-weight: 600; pointer-events: none;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.ba-tag.l { left: 14px; } .ba-tag.r { right: 14px; }

/* upload card */
.upload-card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 12px; min-height: 100%;
}
.dropzone {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: 8px; padding: 36px 16px; min-height: 300px; border-radius: 16px;
  border: 1.5px dashed var(--line-2); background: var(--card);
  transition: border-color .15s, background .15s;
}
.dropzone.drag { border-color: var(--accent); background: #26172a; }
.dz-icon {
  width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
  background: #3a1d3c; color: var(--accent); margin-bottom: 10px;
}
.dz-icon svg { width: 30px; height: 30px; }
.dropzone h2 { font-size: 22px; font-weight: 600; margin: 0; }
.dropzone p { color: var(--text-2); margin: 0 0 14px; }
.dz-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.dz-meta { color: var(--muted); font-size: 13px; margin-top: 12px !important; }
.upload-note { text-align: center; color: var(--muted); font-size: 13px; margin: 0; }

/* ---------- workspace ---------- */
.workspace { padding: 8px 0 72px; scroll-margin-top: 80px; }
.ws-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 1060px) { .ws-grid { grid-template-columns: minmax(0, 1fr) 390px; } }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
}
@media (min-width: 768px) { .panel { padding: 24px; } }
.panel + .panel { margin-top: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.step-no {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-soft-2); color: var(--accent); font-size: 14px; font-weight: 800; flex: none;
}
.panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.side { position: relative; }
@media (min-width: 1060px) { .side { position: sticky; top: 88px; } }
.side .panel { padding: 20px; }

/* file grid */
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
@media (min-width: 640px) { .files { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } }
.file {
  position: relative; display: flex; flex-direction: column; background: var(--card-2);
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
}
.file.done { border-color: rgba(61, 220, 151, .35); }
.file.error { border-color: rgba(255, 95, 109, .5); }
.file-thumb {
  position: relative; aspect-ratio: 4 / 3; background:
    repeating-conic-gradient(#2a2a2a 0% 25%, #222 0% 50%) 50% / 16px 16px;
}
.file-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.file-thumb .icon-btn { position: absolute; top: 8px; right: 8px; }
.file-badge {
  position: absolute; left: 8px; top: 8px; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: rgba(0,0,0,.65); color: #fff;
}
.file-badge.ok { background: var(--ok); color: #00321d; }
.file-badge.err { background: var(--err); color: #2b0005; }
.file-badge.busy { background: var(--accent); color: var(--accent-ink); }
.file-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.file-name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.file-out { font-size: 12.5px; color: var(--text-2); line-height: 1.4; }
.file-out b { color: #fff; }
.file-out .gain { color: var(--ok); font-weight: 700; }
.file-out .loss { color: var(--warn); font-weight: 700; }
.file-err { color: var(--err); font-size: 12.5px; }
.file-actions { display: flex; gap: 6px; margin-top: 8px; }
.file-actions .btn { flex: 1; min-height: 34px; padding: 6px 10px; font-size: 13px; }
.progress-line { height: 3px; background: transparent; position: absolute; left: 0; right: 0; bottom: 0; overflow: hidden; }
.file.busy .progress-line::after {
  content: ''; position: absolute; inset: 0; width: 40%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: slide 1.1s linear infinite;
}
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.add-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 180px; border-radius: 16px; border: 1.5px dashed var(--line-2); background: transparent;
  color: var(--text-2); font-weight: 700;
}
.add-tile:hover { border-color: var(--accent); color: var(--accent); }
.add-tile svg { width: 26px; height: 26px; }

/* chips / segmented */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.label span { color: var(--muted); font-weight: 600; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 40px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--card-2); color: var(--text-2); font-weight: 700; font-size: 14px; line-height: 1.15;
  transition: border-color .15s, background .15s, color .15s;
}
.chip small { font-weight: 600; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.chip:hover { border-color: #555; color: #fff; }
.chip[aria-checked='true'] { border-color: var(--accent); background: var(--accent-soft); color: #fff; }
.chip[aria-checked='true'] small { color: #f5b8f5; }
.chip[disabled] { opacity: .35; cursor: not-allowed; }
.chips.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.chips.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chips.grid4 .chip, .chips.grid3 .chip { padding: 8px 6px; }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; padding: 12px 14px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); }
.toggle-text { display: flex; flex-direction: column; font-weight: 700; font-size: 14px; }
.toggle-text small { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #444; transition: background .15s; pointer-events: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.input, .select {
  width: 100%; min-height: 42px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--card-2); color: #fff; font-weight: 600;
}
.input:focus, .select:focus { outline: none; border-color: var(--accent); }
.select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, #aaa 50%), linear-gradient(135deg, #aaa 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; min-width: 0; }
.row .lock { flex: none; }
.input-unit { position: relative; }
.input-unit .input { padding-right: 36px; }
.input-unit em { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-style: normal; font-size: 13px; pointer-events: none; }
.lock { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card-2); display: grid; place-items: center; color: var(--muted); }
.lock[aria-pressed='true'] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.lock svg { width: 18px; height: 18px; }

input[type='range'] { width: 100%; accent-color: var(--accent); height: 26px; margin: 0; }
.color-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.color-row input[type='color'] { width: 42px; height: 34px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--card-2); padding: 2px; }
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.hint.warn { color: var(--warn); }

/* colour palette */
.palette-wrap { margin-top: 12px; }
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 8px; }
.swatch {
  position: relative; width: 100%; aspect-ratio: 1; border-radius: 50%; padding: 0; cursor: pointer;
  background: var(--sw); border: 1px solid rgba(255,255,255,.18);
  transition: transform .12s;
}
.swatch:hover { transform: scale(1.1); }
.swatch[aria-checked='true'] { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accent); }
.swatch-custom {
  display: block; overflow: hidden;
  background: conic-gradient(#f43f5e, #f59e0b, #facc15, #22c55e, #06b6d4, #3b82f6, #a855f7, #ec4899, #f43f5e);
}
.swatch-custom input { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); opacity: 0; cursor: pointer; border: 0; padding: 0; }
.color-row .input { max-width: 140px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: lowercase; }
.color-preview { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line-2); flex: none; }

/* presets */
.preset-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; align-items: center; }
.preset-tools .input { flex: 1 1 200px; max-width: 320px; }
.cat-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1 1 100%; padding-bottom: 2px; }
.cat-chips::-webkit-scrollbar { display: none; }
.cat-chips .chip { flex: none; min-height: 34px; padding: 6px 12px; border-radius: 999px; font-size: 13px; }
.presets {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px;
  max-height: 560px; overflow-y: auto; padding: 2px 4px 2px 2px; overscroll-behavior: contain;
}
@media (min-width: 640px) { .presets { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } }
.preset {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  min-height: 140px; padding: 14px 8px 12px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--card-2); color: #fff; transition: border-color .15s, background .15s, transform .15s;
}
.preset:hover { border-color: #4a4a4a; background: #282828; }
.preset[aria-checked='true'] { border-color: var(--accent); background: #2a1a2c; box-shadow: 0 0 0 1px var(--accent) inset; }
.preset-icon { height: 44px; display: grid; place-items: center; }
.preset-shape {
  display: grid; place-items: center; border: 1.6px solid var(--c); border-radius: 4px;
  color: var(--c); font-size: 9px; font-weight: 800; line-height: 1; overflow: hidden;
  box-shadow: 0 0 12px color-mix(in srgb, var(--c) 35%, transparent);
}
.preset-name { font-weight: 700; font-size: 14px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.preset-dim { color: var(--muted); font-size: 13px; font-weight: 600; }
.presets-empty { grid-column: 1 / -1; color: var(--muted); text-align: center; padding: 24px; }

/* output summary + run */
.summary {
  background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
  font-size: 14px; color: var(--text-2); margin-bottom: 14px;
}
.summary b { color: #fff; }
.summary .hint { display: block; margin-top: 6px; }
.summary .big { font-size: 18px; color: #fff; font-weight: 800; display: block; margin-top: 2px; }
.progress { margin-top: 12px; }
.bar { height: 8px; border-radius: 999px; background: var(--card-3); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--violet)); transition: width .25s; }
.progress p { margin: 6px 0 0; font-size: 13px; color: var(--text-2); }
.after-run { display: grid; gap: 10px; margin-top: 12px; }
.privacy-line { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; margin: 14px 0 0; }
.privacy-line svg { width: 16px; height: 16px; color: var(--ok); flex: none; }

/* ---------- sections ---------- */
.section { padding: 72px 0; }
.section-title { text-align: center; font-size: clamp(28px, 4vw, 44px); line-height: 1.12; letter-spacing: -0.02em; font-weight: 600; margin: 0 0 14px; }
.section-sub { text-align: center; color: var(--text-2); max-width: 720px; margin: 0 auto 40px; }
.feature-grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .feature-grid { grid-template-columns: repeat(3, 1fr); } }
.feature {
  background: var(--card); border-radius: var(--radius); padding: 28px 24px; text-align: center;
  border: 1px solid rgba(255,255,255,.03);
}
.feature .dz-icon { width: 64px; height: 64px; margin: 0 auto 16px; }
.feature .dz-icon svg { width: 26px; height: 26px; }
.feature h3 { font-size: 20px; font-weight: 600; margin: 0 0 8px; }
.feature p { color: var(--text-2); margin: 0; }

.howto {
  border-radius: 28px; overflow: hidden; padding: 40px 24px;
  background:
    radial-gradient(60% 70% at 30% 0%, rgba(162, 30, 170, .55), transparent 70%),
    radial-gradient(50% 60% at 90% 100%, rgba(139, 61, 255, .25), transparent 70%),
    #050505;
  border: 1px solid #1f1f1f;
}
@media (min-width: 768px) { .howto { padding: 64px 72px; } }
.eyebrow { text-transform: uppercase; font-weight: 700; font-size: 14px; letter-spacing: .04em; color: #fff; margin: 0 0 18px; }
.steps { display: grid; gap: 16px; counter-reset: s; margin: 0; padding: 0; list-style: none; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li { background: rgba(28, 28, 28, .7); border: 1px solid rgba(255,255,255,.06); border-radius: 20px; padding: 22px; }
.steps li::before {
  counter-increment: s; content: counter(s); display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 50%; border: 1.5px solid #fff; font-weight: 700; margin-bottom: 16px;
}
.steps h3 { margin: 0 0 6px; font-size: 20px; font-weight: 600; }
.steps p { margin: 0; color: var(--text-2); font-size: 15px; }
.howto .btn { margin-top: 28px; }

.tool-cards { display: grid; gap: 16px; }
@media (min-width: 760px) { .tool-cards { grid-template-columns: repeat(3, 1fr); } }
.tool-card { background: var(--card); border-radius: var(--radius); padding: 28px 24px; border: 1px solid rgba(255,255,255,.04); display: flex; flex-direction: column; gap: 10px; }
.tool-card h3 { margin: 0; font-size: 22px; font-weight: 600; }
.tool-card p { margin: 0 0 8px; color: var(--text-2); flex: 1; }
.tool-card ul { margin: 0 0 12px; padding-left: 18px; color: var(--text-2); }
.tool-card .btn { align-self: flex-start; }

.faq { max-width: 880px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { background: var(--card); border-radius: 18px; border: 1px solid rgba(255,255,255,.04); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 22px; font-weight: 700; font-size: 17px; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 24px; font-weight: 400; color: var(--accent); flex: none; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0; padding: 0 22px 20px; color: var(--text-2); }

.site-footer { border-top: 1px solid var(--line); padding: 40px 0; color: var(--muted); font-size: 14px; }
.foot { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; }
.foot nav { display: flex; flex-wrap: wrap; gap: 18px; }
.foot nav a { color: var(--text-2); }
.foot nav a:hover { color: var(--accent); }
.builder {
  display: flex; flex-wrap: wrap; gap: 16px 24px; justify-content: space-between; align-items: center;
  margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line);
}
.builder-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.builder-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.builder-name {
  font-size: 20px; font-weight: 800; letter-spacing: -0.01em;
  background: linear-gradient(90deg, var(--accent), #b77bff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.builder-role { color: var(--text-2); font-size: 14px; }
.social { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.social a {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: var(--card-3); color: var(--text-2); border: 1px solid var(--line-2);
  transition: background .15s, color .15s, transform .15s, border-color .15s;
}
.social a:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: translateY(-2px); }
.social svg { width: 19px; height: 19px; }

/* ---------- compare dialog ---------- */
dialog.compare {
  width: min(1100px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); color: #fff; box-shadow: var(--shadow);
}
dialog.compare::backdrop { background: rgba(0, 0, 0, .75); }
.cmp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cmp-head h2 { margin: 0; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-head .row { flex: none; gap: 8px; }
.cmp-stage { position: relative; overflow: auto; max-height: calc(100dvh - 190px); background: repeating-conic-gradient(#cfcfcf 0% 25%, #fff 0% 50%) 50% / 20px 20px; }
.cmp-stage .ba { aspect-ratio: auto; border-radius: 0; margin: 0 auto; background: transparent; }
.cmp-stage .ba img { object-fit: fill; }
.cmp-stage.zoom .ba { max-width: none; }
.cmp-foot { padding: 10px 16px; color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- mobile action bar ---------- */
.mbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; align-items: center; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(22, 22, 22, .94); border-top: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.mbar-text { flex: 1; min-width: 0; font-size: 13px; color: var(--text-2); line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mbar-text b { color: #fff; }
.mbar .btn { flex: none; }
@media (min-width: 1060px) { .mbar { display: none !important; } }
body.has-mbar .site-footer { padding-bottom: 96px; }
body.has-mbar .toast { bottom: 84px; }
.flash { animation: flash 1.2s ease 2; }
@keyframes flash { 50% { box-shadow: 0 0 0 3px var(--accent); } }
.stale { color: var(--warn); }

.cmp-bg { display: inline-flex; align-items: center; gap: 6px; }
.cmp-bg button { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line-2); padding: 0; }
.cmp-bg button[data-bg='checker'] { background: repeating-conic-gradient(#bbb 0% 25%, #fff 0% 50%) 50% / 10px 10px; }
.cmp-bg button[data-bg='white'] { background: #fff; }
.cmp-bg button[data-bg='black'] { background: #000; }
.cmp-bg button[aria-checked='true'] { box-shadow: 0 0 0 2px var(--accent); }
.cmp-stage.bg-white { background: #fff; }
.cmp-stage.bg-black { background: #000; }
.cmp-note { margin: 0; padding: 0 16px 12px; color: var(--ok); font-size: 13px; }
.file-tag { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: rgba(0,0,0,.7); color: var(--ok); }

dialog.speed {
  width: min(460px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-2); color: #fff; box-shadow: var(--shadow);
}
dialog.speed::backdrop { background: rgba(0, 0, 0, .7); }
dialog.speed h2 { margin: 0 0 8px; font-size: 21px; }
dialog.speed p { color: var(--text-2); margin: 0 0 16px; font-size: 15px; }
.speed-actions { display: grid; gap: 10px; margin-bottom: 12px; }
.speed-actions .btn { white-space: normal; text-align: center; line-height: 1.25; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); z-index: 100;
  max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 14px; background: #2b2b2b; color: #fff;
  border: 1px solid var(--line-2); box-shadow: var(--shadow); font-weight: 600; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: var(--err); }

/* page drop overlay */
.drop-overlay {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; pointer-events: none;
  background: rgba(17, 6, 18, .82); border: 3px dashed var(--accent); opacity: 0; transition: opacity .15s;
  font-size: 28px; font-weight: 700;
}
.drop-overlay.show { opacity: 1; }

/* legal pages */
.legal { max-width: 820px; margin: 0 auto; padding: 56px 16px 80px; }
.legal h1 { font-size: clamp(30px, 4vw, 44px); font-weight: 600; letter-spacing: -0.02em; margin: 0 0 8px; }
.legal h2 { font-size: 22px; font-weight: 700; margin: 32px 0 8px; }
.legal p, .legal li { color: var(--text-2); }

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