:root {
  --bg: #f4f2ed;
  --surface: #ffffff;
  --ink: #171717;
  --muted: #6a675f;
  --line: #d9d5ca;
  --accent: #d9480f;
  --accent-rgb: 217 72 15;
  --accent-ink: #ffffff;
  --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 8px 24px rgb(0 0 0 / 6%);
  --check-a: #e7e3da;
  --check-b: #ffffff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141412;
    --surface: #1d1d1a;
    --ink: #f1efe9;
    --muted: #a09c90;
    --line: #34332e;
    --accent: #ff7a3d;
    --accent-rgb: 255 122 61;
    --accent-ink: #141412;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 30%);
    --check-a: #2a2a26;
    --check-b: #33332e;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.muted { color: var(--muted); font-size: 0.9rem; }
[hidden] { display: none !important; }

/* header and privacy strip */
.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1040px; margin: 0 auto; padding: 18px 20px;
}
.brand { font: italic 700 1.5rem/1 ui-serif, Georgia, serif; letter-spacing: -0.02em; text-decoration: none; }
.brand::after { content: "."; color: var(--accent); }
.top nav { display: flex; align-items: center; gap: 14px; }
.top nav a { color: var(--muted); font-size: 0.9rem; }
.lang-links { font-size: 0.9rem; }
.lang-links a { color: var(--muted); text-decoration: none; }
.lang-links a[aria-current] { color: var(--ink); font-weight: 600; }
.strip {
  margin: 0; padding: 10px 20px; text-align: center; font-size: 0.875rem;
  background: var(--ink); color: var(--bg);
}
.strip a { opacity: 0.8; }

main { max-width: 1040px; margin: 0 auto; padding: 32px 20px 56px; }
h1 {
  margin: 0 0 28px; text-align: center;
  font: 700 clamp(1.9rem, 5vw, 3rem)/1.1 ui-serif, Georgia, serif; letter-spacing: -0.02em;
}
.foot { max-width: 1040px; margin: 0 auto; padding: 24px 20px 40px; color: var(--muted); font-size: 0.875rem; text-align: center; }

/* buttons and inputs */
button, select, input[type="url"] {
  font: inherit; color: inherit; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; min-height: 40px;
}
button { cursor: pointer; }
button:hover:not(:disabled), select:hover { border-color: var(--muted); }
button:focus-visible, select:focus-visible, input:focus-visible, .swatch:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
button:disabled { opacity: 0.5; cursor: default; }
button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.primary:hover:not(:disabled) { filter: brightness(1.07); border-color: var(--accent); }
.link { background: none; border: 0; padding: 0; min-height: 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* messages */
#message {
  max-width: 640px; margin: 0 auto 20px; padding: 12px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
}
#message[data-kind="error"] { border-color: var(--accent); }
.busy { text-align: center; margin: 0 0 20px; color: var(--muted); }

/* intake */
#intake { max-width: 640px; margin: 0 auto; }
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 100%; min-height: 240px; padding: 24px; text-align: center;
  border: 2px dashed var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow);
}
.drop:hover:not(:disabled), .drop.over { border-color: var(--accent); }
.drop-title { font-size: 1.15rem; font-weight: 600; }
.drop-hint { color: var(--muted); font-size: 0.9rem; }
.url-form { display: flex; gap: 8px; margin-top: 16px; }
.url-form input { flex: 1; min-width: 0; }
.note { margin: 20px 0 0; text-align: center; color: var(--muted); font-size: 0.9rem; }

/* editor */
.stage { display: flex; justify-content: center; }
.frame { position: relative; overflow: hidden; max-width: 100%; border-radius: 12px; box-shadow: var(--shadow); }
.frame canvas#view, .frame .before { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.frame.comparable { cursor: ew-resize; touch-action: none; }
canvas#view {
  background: conic-gradient(var(--check-a) 25%, var(--check-b) 0 50%, var(--check-a) 0 75%, var(--check-b) 0) 0 0 / 20px 20px;
}
.before { object-fit: fill; }

/* before/after compare slider */
.compare-labels { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 1; display: flex; justify-content: space-between; pointer-events: none; }
.compare-labels span { padding: 3px 10px; border-radius: 999px; background: rgb(0 0 0 / 55%); color: #fff; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.03em; }
.handle { position: absolute; top: 0; bottom: 0; left: 50%; z-index: 2; width: 2px; background: #fff; transform: translateX(-50%); box-shadow: 0 0 0 1px rgb(0 0 0 / 25%); }
.handle i {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--ink);
  box-shadow: 0 2px 10px rgb(0 0 0 / 35%);
}
.handle:focus-visible i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* processing scanner */
#processing-status { margin: 16px 0 0; text-align: center; }
.scanner { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.scanner::before {
  content: ""; position: absolute; left: 0; right: 0; top: -30%; height: 30%;
  background: linear-gradient(to bottom, rgb(var(--accent-rgb) / 0) 0%, rgb(var(--accent-rgb) / 0.45) 70%, rgb(var(--accent-rgb) / 0.9) 100%);
  animation: scan 1.8s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
@keyframes scan {
  0% { top: -30%; }
  100% { top: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .scanner::before { top: 35%; animation: none; }
}

#editor.processing .tools, #editor.processing .session { display: none; }

.crop {
  position: absolute; border: 2px solid #fff; cursor: move; touch-action: none;
  box-shadow: 0 0 0 100vmax rgb(0 0 0 / 50%);
}
/* L-shaped corner brackets: two thick borders, the rest of the box stays a transparent hit area */
.crop i {
  position: absolute; width: 24px; height: 24px; border: 0 solid #1d1d1a;
  filter: drop-shadow(0 0 1px rgb(0 0 0 / 60%));
}
/* handles sit inside the box so they are never clipped by the frame at the image edge */
.crop i[data-h="nw"] { left: -2px; top: -2px; border-width: 4px 0 0 4px; cursor: nwse-resize; }
.crop i[data-h="ne"] { right: -2px; top: -2px; border-width: 4px 4px 0 0; cursor: nesw-resize; }
.crop i[data-h="sw"] { left: -2px; bottom: -2px; border-width: 0 0 4px 4px; cursor: nesw-resize; }
.crop i[data-h="se"] { right: -2px; bottom: -2px; border-width: 0 4px 4px 0; cursor: nwse-resize; }

.tools { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 20px; }
.group {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 14px 12px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
}
.group legend { padding: 0 6px; color: var(--muted); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; }
.inline { display: inline-flex; gap: 8px; }
.swatches { display: flex; align-items: center; gap: 8px; }
.swatch { width: 34px; height: 34px; min-height: 0; padding: 0; border-radius: 50%; }
.swatch[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.swatch.checker { background: conic-gradient(#cfcabf 25%, #fff 0 50%, #cfcabf 0 75%, #fff 0) 0 0 / 12px 12px; }
.swatch[data-bg="#ffffff"] { background: #ffffff; }
.swatch[data-bg="#000000"] { background: #000000; }
input[type="color"] { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: none; cursor: pointer; }
input[type="color"].active { box-shadow: 0 0 0 2px var(--accent); }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.session { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 20px; }

/* consent banner */
.consent {
  position: fixed; inset: auto 16px 16px 16px; z-index: 10; max-width: 560px; margin: 0 auto;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow);
  font-size: 0.9rem;
}
.consent p { margin: 0 0 12px; }
body.has-consent { padding-bottom: 14rem; }
.consent-actions { display: flex; gap: 8px; }
.consent-actions button { flex: 1; font-weight: 600; }

/* privacy page */
.prose { max-width: 720px; }
.prose h1 { text-align: left; font-size: 2.2rem; margin-bottom: 8px; }
.prose h2 { margin: 32px 0 8px; font-size: 1.15rem; }
.prose p, .prose li { color: var(--ink); }
.warn { color: var(--accent); }

/* SEO content sections: how it works, why Clearcut, good for, FAQ */
.content-section { margin-top: 72px; }
.content-section h2 {
  margin: 0 0 28px; text-align: center;
  font: 700 1.75rem/1.2 ui-serif, Georgia, serif; letter-spacing: -0.01em;
}
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; counter-reset: step; max-width: 640px; margin-inline: auto; }
.steps li { position: relative; padding-left: 44px; counter-increment: step; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--bg);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem;
}
.steps h3, .card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.steps p, .card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.card { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.faq-list { display: grid; gap: 10px; max-width: 720px; margin-inline: auto; }
.faq-list details { padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.faq-list summary { cursor: pointer; font-weight: 600; }
.faq-list p { margin: 10px 0 0; color: var(--muted); }
.cta { margin-top: 72px; text-align: center; font-size: 1.1rem; }
.cta a { font-weight: 600; }

@media (max-width: 520px) {
  .url-form { flex-direction: column; }
  .group { width: 100%; flex-wrap: wrap; }
}
