:root {
  --bg: oklch(98.5% 0.006 95);
  --bg-elev: oklch(100% 0 0);
  --ink: oklch(22% 0.02 60);
  --ink-soft: oklch(48% 0.02 60);
  --line: oklch(88% 0.012 80);
  --accent: oklch(60% 0.16 160);
  --accent-ink: oklch(99% 0 0);
  --accent-soft: oklch(94% 0.05 160);
  --danger: oklch(58% 0.19 25);
  --radius: 14px;
  --measure: 62ch;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --text-hero: clamp(2.2rem, 1.2rem + 4vw, 4.2rem);
  --space-section: clamp(3rem, 2rem + 4vw, 6rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(17% 0.012 70);
    --bg-elev: oklch(22% 0.014 70);
    --ink: oklch(94% 0.01 80);
    --ink-soft: oklch(70% 0.015 80);
    --line: oklch(32% 0.014 70);
    --accent: oklch(72% 0.15 160);
    --accent-ink: oklch(18% 0.03 160);
    --accent-soft: oklch(28% 0.06 160);
  }
}
* { box-sizing: border-box; }
html { color-scheme: light dark; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem); line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(100% - 2rem, 68rem); margin-inline: auto; }
.site-header { padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { font-weight: 800; letter-spacing: -0.02em; text-decoration: none; display: inline-flex; align-items: center; gap: .5rem; }
.brand::before { content: ""; width: .8em; height: .8em; border-radius: 3px; background: var(--accent); transform: rotate(45deg); }
.site-nav { display: flex; gap: clamp(.75rem, 2vw, 1.5rem); font-size: .95em; }
.site-nav a { text-decoration: none; color: var(--ink-soft); }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--ink); }

.hero { padding: var(--space-section) 0 2rem; display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.hero h1 { font-size: var(--text-hero); line-height: 1.02; letter-spacing: -0.035em; margin: 0; max-width: 14ch; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { margin: .75rem 0 0; color: var(--ink-soft); max-width: 40ch; }
.hero .tag { font-family: var(--mono); font-size: .8rem; color: var(--ink-soft); border: 1px solid var(--line); padding: .35rem .6rem; border-radius: 999px; white-space: nowrap; }
@media (max-width: 720px) { .hero { grid-template-columns: 1fr; } .hero .tag { justify-self: start; } }

.tool { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); margin-bottom: var(--space-section); }
@media (max-width: 860px) { .tool { grid-template-columns: 1fr; } }
.drop {
  position: relative; display: grid; place-items: center; text-align: center; min-height: 16rem; padding: 2rem;
  border: 2px dashed var(--line); border-radius: var(--radius); background: var(--bg-elev);
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .3s var(--ease); cursor: pointer;
}
.drop:hover, .drop.is-over, .drop:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.drop.is-over { transform: scale(1.01); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop strong { font-size: 1.25rem; letter-spacing: -0.01em; }
.drop small { color: var(--ink-soft); display: block; margin-top: .35rem; }
.panel { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; display: grid; gap: 1rem; align-content: start; }
.panel h2 { margin: 0; font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.presets { display: grid; gap: .5rem; }
.presets label { display: grid; grid-template-columns: auto 1fr; gap: .75rem; align-items: baseline; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: border-color .15s, background .15s; }
.presets label:hover { border-color: var(--accent); }
.presets label:has(:checked) { border-color: var(--accent); background: var(--accent-soft); }
.presets input { accent-color: var(--accent); }
.presets b { display: block; }
.presets span { color: var(--ink-soft); font-size: .9em; }
.btn { appearance: none; border: 0; border-radius: 10px; padding: .85rem 1.2rem; font: inherit; font-weight: 700; background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; text-align: center; transition: transform .15s var(--ease), filter .15s; }
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); color: var(--accent-ink); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; filter: none; }

.status { font-family: var(--mono); font-size: .85rem; color: var(--ink-soft); min-height: 1.4em; }
.status.is-error { color: var(--danger); }
.progress { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); transition: transform .25s linear; }
.result { display: none; gap: .75rem; }
.result.is-ready { display: grid; }
.sizes { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .5rem; font-family: var(--mono); font-size: .95rem; }
.sizes b { font-size: 1.4rem; letter-spacing: -0.02em; display: block; }
.sizes .arrow { color: var(--accent); font-size: 1.4rem; }
.saved { color: var(--accent); font-weight: 700; }
video { width: 100%; border-radius: 10px; background: #000; }

.samples { margin-bottom: var(--space-section); }
.samples h2 { margin: 0 0 .25rem; letter-spacing: -0.02em; }
.samples p { margin: 0 0 1rem; color: var(--ink-soft); }
.samples ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.samples a { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; background: var(--bg-elev); transition: border-color .15s; }
.samples a:hover { border-color: var(--accent); }
.samples code { font-family: var(--mono); font-size: .85em; color: var(--ink-soft); }

.prose { max-width: var(--measure); padding: var(--space-section) 0; }
.prose h1 { font-size: clamp(1.9rem, 1.2rem + 2.5vw, 3rem); letter-spacing: -0.03em; line-height: 1.05; margin: 0 0 1.5rem; }
.prose h2 { margin-top: 2rem; letter-spacing: -0.02em; }
.prose .lede { font-size: 1.15em; color: var(--ink-soft); }
.prose dt { font-weight: 700; margin-top: 1.25rem; }
.prose dd { margin: .35rem 0 0; color: var(--ink-soft); }

.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 3rem; color: var(--ink-soft); font-size: .9em; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; }
.site-footer nav { display: flex; gap: 1.25rem; }
.site-footer a { text-decoration: none; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
