:root {
  --ink: #202328;
  --muted: #687076;
  --paper: #fffdf8;
  --surface: #fff;
  --line: #dfdcd4;
  --blue: #2667ff;
  --blue-pale: #e7edff;
  --yellow: #ffd84d;
  --danger: #b93631;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.wrap { width: min(760px, calc(100% - 48px)); margin: auto; }
header { display: flex; justify-content: space-between; align-items: center; padding: 26px 0; }
.brand { color: var(--ink); font-size: 1.05rem; font-weight: 800; letter-spacing: -.04em; text-decoration: none; }
.brand i { display: inline-block; width: 10px; height: 10px; margin-right: 7px; border: 1px solid var(--ink); border-radius: 50%; background: var(--yellow); }
.back { color: var(--muted); font-size: .84rem; text-decoration: none; }
.back:hover { color: var(--ink); text-decoration: underline; }
main { padding: 48px 0 56px; }
.eyebrow { display: inline-block; padding: 6px 10px; border: 1px solid var(--ink); border-radius: 999px; background: var(--yellow); font-size: .74rem; font-weight: 800; }
h1 { max-width: 680px; margin: 16px 0 12px; font-size: clamp(2.65rem, 8vw, 4.7rem); line-height: .96; letter-spacing: -.07em; }
.intro { max-width: 580px; margin: 0 0 28px; color: var(--muted); font-size: 1.03rem; line-height: 1.65; }
.privacy { display: flex; gap: 9px; align-items: flex-start; padding: 13px 15px; margin-bottom: 18px; border: 1px solid #b7c8ff; border-radius: 12px; background: var(--blue-pale); font-size: .84rem; line-height: 1.5; }
.privacy b { white-space: nowrap; }
.card { padding: 24px; border: 1.5px solid var(--ink); border-radius: 18px; background: var(--surface); box-shadow: 5px 5px 0 var(--ink); }
.drop { position: relative; display: grid; min-height: 230px; padding: 28px; place-items: center; border: 2px dashed #aaa9a4; border-radius: 13px; text-align: center; transition: border-color .15s, background .15s; cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--blue); background: #f7f9ff; }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop-icon { font-size: 2.4rem; }
.drop strong { display: block; margin: 12px 0 5px; font-size: 1rem; }
.drop span { display: block; max-width: 490px; color: var(--muted); font-size: .83rem; line-height: 1.5; }
.file { display: none; align-items: center; gap: 11px; margin-top: 16px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #faf9f6; }
.file.show { display: flex; }
.file-icon { font-size: 1.35rem; }
.file-meta { flex: 1; min-width: 0; }
.file-name { overflow: hidden; font-size: .88rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.file-size { margin-top: 3px; color: var(--muted); font-size: .76rem; }
.remove { border: 0; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 1.1rem; }
.remove:hover { color: var(--danger); }
.settings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.settings.image { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: block; margin-bottom: 6px; color: var(--muted); font-size: .73rem; font-weight: 800; letter-spacing: .04em; }
select, input[type="range"] { width: 100%; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; font: inherit; font-size: .85rem; }
select:focus, input:focus, .action:focus-visible, .remove:focus-visible, .back:focus-visible, .brand:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.action { width: 100%; margin-top: 18px; padding: 13px 16px; border: 1.5px solid var(--ink); border-radius: 10px; color: #fff; background: var(--blue); box-shadow: 3px 3px 0 var(--ink); cursor: pointer; font: inherit; font-weight: 800; transition: transform .15s, box-shadow .15s; }
.action:hover:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.action:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.progress, .message, .result { display: none; margin-top: 16px; }
.progress.show, .message.show, .result.show { display: block; }
.progress-row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; color: var(--muted); font-size: .8rem; }
.track { height: 7px; overflow: hidden; border-radius: 99px; background: var(--line); }
.fill { width: 0; height: 100%; border-radius: inherit; background: var(--blue); transition: width .15s; }
.message { padding: 11px 13px; border: 1px solid #e8b6b2; border-radius: 10px; color: var(--danger); background: #fff3f2; font-size: .82rem; line-height: 1.5; }
.result { padding: 14px; border: 1px solid #a9c1ff; border-radius: 11px; background: var(--blue-pale); }
.result-name { margin-bottom: 8px; overflow: hidden; font-size: .86rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.download { display: inline-block; padding: 8px 11px; border-radius: 8px; color: #fff; background: var(--blue); font-size: .8rem; font-weight: 800; text-decoration: none; }
.note { margin: 22px 4px 0; color: var(--muted); font-size: .77rem; line-height: 1.65; }
footer { padding: 10px 0 36px; color: var(--muted); font-size: .75rem; }
[hidden] { display: none !important; }
.stack { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
textarea, output.code-output { width: 100%; min-height: 210px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fff; font: .85rem/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; resize: vertical; }
textarea:focus { outline: 3px solid var(--blue); outline-offset: 2px; }
.two-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.secondary { width: 100%; margin-top: 18px; padding: 13px 16px; border: 1.5px solid var(--ink); border-radius: 10px; color: var(--ink); background: #fff; cursor: pointer; font: inherit; font-weight: 800; }
.secondary:hover { background: var(--blue-pale); }
.file-list { display: grid; gap: 8px; margin-top: 14px; }
.file-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #faf9f6; font-size: .83rem; }
.result-copy { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.result-copy code { overflow-wrap: anywhere; font-size: .78rem; }

@media (max-width: 700px) {
  .wrap { width: min(100% - 32px, 760px); }
  .settings { grid-template-columns: 1fr; }
  .settings.image { grid-template-columns: 1fr; }
  .two-actions { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  header { padding: 18px 0; }
  .brand { font-size: 1rem; }
  .back { font-size: .8rem; }
  main { padding: 30px 0 42px; }
  h1 { font-size: clamp(2.45rem, 14vw, 3.35rem); }
  .intro { margin-bottom: 22px; font-size: .96rem; }
  .privacy { display: block; padding: 12px; font-size: .8rem; }
  .privacy b { display: block; margin-bottom: 3px; }
  .card { padding: 14px; border-radius: 15px; box-shadow: 3px 3px 0 var(--ink); }
  .drop { min-height: 205px; padding: 20px 14px; }
  .drop strong { font-size: .94rem; }
  .drop span { font-size: .78rem; }
  .file { padding: 11px; }
  .result { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
