:root {
  color-scheme: dark;
  --paper: #000;
  --ink: #f4f0e8;
  --muted: #a5a29b;
  --line: #ffffff30;
  --red: #e34d32;
  --mono: "DM Mono", monospace;
  --sans: "DM Sans", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); font-family: var(--sans); text-shadow: 0 0 9px rgba(238,244,255,.16); }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.shell { position: relative; z-index: 1; width: min(1000px, calc(100% - 48px)); margin-inline: auto; }
.ripple-background { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; opacity: .16; pointer-events: none; mix-blend-mode: difference; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.wordmark { display: inline-flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 700; }
.wordmark > span span { color: var(--red); }
.ascii-logo { flex: none; margin: 0; overflow: hidden; color: var(--ink); font: clamp(.5px, .07vw, 1px)/1 var(--mono); white-space: pre; opacity: .9; }
.back-link { color: var(--muted); font: 10px var(--mono); text-transform: uppercase; }
.back-link:hover, .back-link:focus-visible { color: var(--ink); }
main { padding: clamp(48px, 9vh, 96px) 0 80px; }
.intro { margin-bottom: 32px; }
.eyebrow { margin: 0 0 16px; color: var(--red); font: 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(48px, 9vw, 92px); font-weight: 500; letter-spacing: -.06em; line-height: .95; }
.subtitle { max-width: 500px; margin: 18px 0 0; color: var(--muted); line-height: 1.6; }
.editor { max-width: 720px; padding: 22px; border: 1px solid var(--line); background: #101012; }
.upload { position: relative; min-height: 210px; padding: 24px; border: 1px dashed #ffffff55; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; cursor: pointer; transition: background .2s ease, border-color .2s ease; }
.upload:hover, .upload.dragging { border-color: var(--red); background: #e34d3210; }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload:focus-within { outline: 2px solid var(--red); outline-offset: 4px; }
.upload-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-size: 26px; }
.upload small, .status, .progress-wrap > span { color: var(--muted); }
button, .download-button { display: inline-flex; justify-content: center; align-items: center; min-height: 46px; margin-top: 16px; padding: 12px 18px; border: 1px solid var(--ink); background: var(--ink); color: #080808; font: 500 11px var(--mono); letter-spacing: .04em; text-transform: uppercase; cursor: pointer; }
button:disabled { opacity: .4; cursor: not-allowed; }
.status { min-height: 20px; margin: 14px 0 0; font-size: 13px; }
.server-note { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.server-note code { color: var(--ink); font-family: var(--mono); }
.progress-wrap { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 12px; }
.progress-track { flex: 0 0 90px; height: 3px; overflow: hidden; background: #ffffff24; }
.progress-bar { width: 40%; height: 100%; background: var(--red); animation: progress-slide 1.2s ease-in-out infinite alternate; }
.result { margin-top: 24px; }
.result video { display: block; width: 100%; max-height: 480px; background: #000; }
.download-button { margin-top: 14px; }
@keyframes progress-slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (max-width: 560px) {
  .shell { width: calc(100% - 36px); }
  .editor { padding: 14px; }
  .upload { min-height: 180px; }
  .progress-wrap { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
