/* KépNagyító – stílus. Rendszerfontok (nincs külső betöltés), világos/sötét téma. */
:root {
  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-2: #eef0f8;
  --text: #14161f;
  --muted: #5a6074;
  --border: #dfe2ee;
  --accent: #4f46e5;
  --accent-2: #0ea5e9;
  --accent-ink: #ffffff;
  --ok: #16a34a;
  --warn-bg: #fff7e6;
  --warn-border: #f5d58a;
  --warn-text: #6b4a00;
  --danger: #dc2626;
  --shadow: 0 1px 2px rgba(20, 22, 31, .06), 0 8px 28px rgba(20, 22, 31, .07);
  --radius: 16px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1117;
    --surface: #171a23;
    --surface-2: #1e2230;
    --text: #eceef6;
    --muted: #a0a7bd;
    --border: #2a2f42;
    --accent: #818cf8;
    --accent-2: #38bdf8;
    --accent-ink: #0f1117;
    --warn-bg: #2b2412;
    --warn-border: #5b4a1c;
    --warn-text: #f3d891;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 28px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img, canvas { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 5.2vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3.4vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* Fejléc */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.15rem; }
.brand-mark { color: var(--accent); display: inline-flex; }
.header-nav { display: flex; gap: 18px; }
.header-nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.header-nav a:hover { color: var(--text); }

/* Hero */
.hero { padding: 44px 0 20px; text-align: center; }
.hero .lead { max-width: 640px; margin: 0 auto; color: var(--muted); font-size: 1.1rem; }
.accent { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Kártyák */
.tool { padding: 12px 0 28px; display: grid; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.note { background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-text); border-radius: 12px; padding: 12px 16px; font-size: .95rem; }
.note.info { background: var(--surface-2); border-color: var(--border); color: var(--muted); }

/* Dropzone */
.dropzone {
  display: grid; place-items: center; gap: 8px; text-align: center;
  padding: 44px 20px; border: 2px dashed var(--border); border-radius: 14px;
  background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s, transform .15s;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface-2)); }
.dropzone:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 2px; }
.dz-icon { color: var(--accent); }

/* Beállítások */
.settings-grid { display: grid; grid-template-columns: minmax(0, 340px) 1fr; gap: 24px; align-items: start; }
.preview { margin: 0; }
.preview img { width: 100%; max-height: 320px; object-fit: contain; border-radius: 12px; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0/16px 16px; border: 1px solid var(--border); }
.preview figcaption { margin-top: 8px; font-size: .875rem; word-break: break-word; }
.scale-picker { border: 0; padding: 0; margin: 0 0 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.scale-picker legend { font-weight: 600; margin-bottom: 8px; padding: 0; width: 100%; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-block; min-width: 76px; text-align: center; padding: 10px 18px; border: 2px solid var(--border); border-radius: 12px; font-weight: 700; background: var(--surface); }
.chip input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); }
.chip input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 2px; }
.chip.wide span { min-width: 0; text-align: left; padding: 9px 16px; line-height: 1.25; }
.chip.wide small { display: block; font-weight: 500; font-size: .78rem; color: var(--muted); }
.chip input:disabled + span { opacity: .5; cursor: not-allowed; }
.profile-picker { margin-bottom: 6px; }
.out-info { font-weight: 600; margin: 0 0 14px; }
.limit-bad { color: var(--danger); }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.btn {
  appearance: none; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 11px 20px; border-radius: 12px; font: inherit; font-weight: 600; cursor: pointer;
  transition: transform .08s, box-shadow .15s, background .15s, border-color .15s;
}
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.ghost { background: transparent; }
.btn.small { padding: 7px 14px; font-size: .9rem; }

.progress-wrap { margin: 4px 0 8px; }
.progress { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .2s ease; }
.progress.indeterminate .progress-fill { width: 35%; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
.status { min-height: 1.6em; margin: 0; color: var(--muted); font-size: .95rem; }
.status.error { color: var(--danger); font-weight: 600; }
.status.ok { color: var(--ok); font-weight: 600; }

/* Eredmény + összehasonlító */
.result-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.result-head h3 { margin: 0; }
.compare-scroller { overflow: auto; border-radius: 12px; border: 1px solid var(--border); background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0/16px 16px; max-height: 80vh; }
.compare { position: relative; width: 100%; margin-inline: auto; user-select: none; --pos: 50%; }
.compare.actual { width: var(--out-w, 100%); max-width: none; margin-inline: 0; }
.compare .layer { position: absolute; inset: 0; }
.compare .layer-result canvas, .compare .layer-original img { width: 100%; height: 100%; display: block; }
.compare .layer-original { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare .layer-original img { object-fit: fill; }
.handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 0; pointer-events: none; }
.handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .3); }
.handle span { position: absolute; top: 50%; left: 0; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.handle span::before, .handle span::after { content: ""; position: absolute; top: 50%; width: 0; height: 0; margin-top: -6px; border: 6px solid transparent; }
.handle span::before { left: 6px; border-right-color: #333; border-left-width: 0; }
.handle span::after { right: 6px; border-left-color: #333; border-right-width: 0; }
.tag { position: absolute; top: 10px; padding: 3px 10px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font-size: .78rem; font-weight: 600; pointer-events: none; }
.tag-left { left: 10px; }
.tag-right { right: 10px; }

.slider { width: 100%; margin: 14px 0 6px; accent-color: var(--accent); }
.download-row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-top: 12px; }
.select-label { display: grid; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.select-label select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }

/* Tartalmi szakaszok */
.prose { padding: 28px 0; max-width: 780px; }
.prose p, .prose li { color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
.steps { padding-left: 1.2em; }
.steps li { margin-bottom: .6em; }
details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 16px; margin-bottom: 10px; }
summary { cursor: pointer; font-weight: 600; padding: 14px 0; }
details[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 12px; }

/* Hirdetési helyek */
.ad-slot { margin: 16px auto; min-height: 100px; text-align: center; }
.ad-slot ins { display: block; }

/* Lábléc */
.site-footer { border-top: 1px solid var(--border); margin-top: 24px; padding: 24px 0 40px; color: var(--muted); font-size: .92rem; }
.footer-inner { display: grid; gap: 8px; }
.footer-inner nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-inner p { margin: 0; }

/* Adatvédelmi oldal */
.doc { max-width: 780px; padding: 36px 0 20px; }
.doc h1 { font-size: 2rem; }
.doc h2 { font-size: 1.3rem; margin-top: 1.6em; }

@media (max-width: 760px) {
  .settings-grid { grid-template-columns: 1fr; }
  .header-nav { display: none; }
  .hero { padding-top: 28px; }
  .card { padding: 14px; }
  .dropzone { padding: 32px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
