/* Photo Enhancer
 *
 * Sans-serif everywhere, and every stack ends in `sans-serif` so a browser is
 * never left to pick its own default — which is how a serif sneaks into an
 * otherwise clean page. (Chip's standing rule; see the global CLAUDE.md.)
 */

:root {
  --bg: #0e1014;
  --panel: #171a21;
  --panel-2: #1e222b;
  --line: #2b313d;
  --ink: #eef1f6;
  --ink-dim: #9aa3b2;
  --ink-faint: #6c7484;
  --accent: #5aa9ff;
  --accent-2: #7ee0c0;
  --warn: #ffbf5a;
  --bad: #ff7a7a;
  --radius: 14px;
  --sans: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
          Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  padding: max(20px, env(safe-area-inset-top, 0px)) 20px
           max(28px, env(safe-area-inset-bottom, 0px));
  max-width: 1100px;
  margin: 0 auto;
}

h1, h2, h3, p, ul, pre, figure { margin: 0; font-family: var(--sans); }
button, input, select, output, textarea { font-family: var(--sans); font-size: inherit; }
[hidden] { display: none !important; }

/* ---------- header ---------- */

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 0 22px;
}

.brand { display: flex; gap: 14px; align-items: flex-start; }

.mark {
  width: 34px; height: 34px; flex: none; border-radius: 10px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 20px rgba(90, 169, 255, .28);
  margin-top: 2px;
}

h1 { font-size: 21px; font-weight: 650; letter-spacing: -.01em; }
.tag { color: var(--ink-dim); font-size: 14px; margin-top: 2px; max-width: 60ch; }

/* ---------- buttons ---------- */

button {
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 9px 16px;
  font-weight: 560;
  transition: background .14s ease, border-color .14s ease, transform .06s ease;
}
button:active { transform: translateY(1px); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.primary { background: var(--accent); color: #07121f; }
.primary:hover { background: #7cbaff; }

.ghost { background: transparent; color: var(--ink-dim); border-color: var(--line); }
.ghost:hover { background: var(--panel-2); color: var(--ink); }

/* ---------- settings ---------- */

.settings {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.setting label { display: block; font-weight: 560; font-size: 14px; margin-bottom: 6px; }
.setting input[type=range] { width: 100%; accent-color: var(--accent); }
.setting output { font-size: 13px; color: var(--accent-2); }
.setting .hint { font-size: 12.5px; color: var(--ink-faint); margin-top: 5px; }
.setting.check label { font-weight: 500; display: flex; gap: 9px; align-items: flex-start; }
.setting.check input { accent-color: var(--accent); margin-top: 3px; }

/* ---------- dropzone ---------- */

.dropzone {
  border: 2px dashed var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(30,34,43,.65), rgba(23,26,33,.65));
  padding: 46px 26px;
  text-align: center;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.dropzone:hover, .dropzone:focus-visible { border-color: #3d4557; outline: none; }
.dropzone.over {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(90,169,255,.14), rgba(30,34,43,.7));
  transform: scale(1.005);
}
.dz-inner { max-width: 54ch; margin: 0 auto; }
.dz-icon { width: 54px; height: 54px; fill: none; stroke: var(--ink-faint); stroke-width: 2.1;
           stroke-linecap: round; stroke-linejoin: round; margin-bottom: 12px; }
.dropzone.over .dz-icon { stroke: var(--accent); }
.dz-icon .arrow { stroke: var(--accent-2); }
.dz-title { font-size: 19px; font-weight: 620; letter-spacing: -.01em; }
.dz-sub { color: var(--ink-dim); font-size: 14px; margin-top: 8px; }
.dz-sub b { color: var(--ink); font-weight: 600; }
.dz-or { color: var(--ink-faint); font-size: 12px; text-transform: uppercase;
         letter-spacing: .12em; margin: 16px 0 12px; }
.dz-privacy { color: var(--ink-faint); font-size: 12.5px; margin-top: 18px; }

/* ---------- notice ---------- */

.notice {
  margin-top: 18px; padding: 16px 18px;
  background: rgba(255, 191, 90, .08);
  border: 1px solid rgba(255, 191, 90, .3);
  border-radius: var(--radius);
}
.notice p { font-size: 14px; color: #ffe0ad; }
.notice b { color: #fff3e0; }
.notice-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

/* ---------- status ---------- */

.status { margin-top: 24px; }
.status-head { display: flex; justify-content: space-between; align-items: flex-start;
               gap: 16px; margin-bottom: 10px; }
.status h2 { font-size: 16px; font-weight: 600; }
.muted { color: var(--ink-dim); font-size: 13.5px; }
.bar { height: 6px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; width: 0%; border-radius: 99px;
            background: linear-gradient(90deg, var(--accent), var(--accent-2));
            transition: width .25s ease; }

/* ---------- summary ---------- */

.summary {
  margin-top: 22px; padding: 18px 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.summary h2 { font-size: 16px; margin-bottom: 10px; }
.summary ul { list-style: none; padding: 0; display: grid; gap: 7px; }
.summary li { font-size: 13.5px; color: var(--ink-dim); display: flex; gap: 9px; }
.summary li b { color: var(--ink); font-weight: 600; }
.summary .path { color: var(--accent-2); word-break: break-all; }
.summary .caveat { margin-top: 12px; font-size: 13px; color: var(--warn); }

/* ---------- results ---------- */

.results {
  list-style: none; padding: 0; margin: 22px 0 0;
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; display: flex; flex-direction: column;
}
.card .thumb {
  aspect-ratio: 4 / 3; background: #0a0c10; display: block; width: 100%;
  object-fit: cover; cursor: zoom-in;
}
.card .thumb.placeholder { display: grid; place-items: center; color: var(--ink-faint); font-size: 12px; }
.card .meta { padding: 9px 11px 11px; }
.card .name { font-size: 12.5px; font-weight: 560; word-break: break-all; line-height: 1.35; }
.card .sub { font-size: 11.5px; color: var(--ink-faint); margin-top: 3px; }
.card .sub.ok { color: var(--accent-2); }
.card .sub.warn { color: var(--warn); }
.card .sub.err { color: var(--bad); }
.card.pending { opacity: .55; }

/* ---------- compare ---------- */

.compare {
  position: fixed; inset: 0; background: rgba(6, 8, 11, .88);
  display: grid; place-items: center; padding: 20px; z-index: 40;
  backdrop-filter: blur(3px);
}
.compare-box {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  max-width: min(1000px, 96vw); width: 100%; max-height: 92vh; overflow: auto; padding: 14px;
}
.compare-head { display: flex; justify-content: space-between; align-items: center;
                gap: 12px; margin-bottom: 10px; font-size: 13.5px; }
.compare-head span { word-break: break-all; color: var(--ink-dim); }
.compare-stage { position: relative; overflow: hidden; border-radius: 10px;
                 background: #07090c; user-select: none; touch-action: none; }
.compare-stage img { display: block; width: 100%; }
.compare-clip { position: absolute; inset: 0; width: 50%; overflow: hidden; }
.compare-clip img { position: absolute; top: 0; left: 0; height: 100%; width: auto;
                    max-width: none; }
.compare-handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px;
                  background: rgba(255,255,255,.9); cursor: ew-resize; }
.compare-handle span {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.95);
  box-shadow: 0 2px 10px rgba(0,0,0,.5);
}
.compare-legend { display: flex; justify-content: space-between;
                  font-size: 11.5px; color: var(--ink-faint); margin-top: 7px;
                  text-transform: uppercase; letter-spacing: .1em; }
.compare-report {
  margin-top: 12px; padding: 12px; background: var(--panel-2); border-radius: 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px; color: var(--ink-dim); white-space: pre-wrap; word-break: break-word;
}

/* ---------- footer ---------- */

.foot { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); }
.foot p { color: var(--ink-faint); font-size: 12.5px; max-width: 76ch; }

@media (max-width: 560px) {
  body { padding-left: 16px; padding-right: 16px; }
  .dropzone { padding: 34px 18px; }
  .results { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
