:root {
  color-scheme: dark;
  --ink: #f4f2ea;
  --muted: #a9b2b5;
  --surface: #121719;
  --surface-raised: #1a2022;
  --line: #354044;
  --acid: #d8ff62;
  --acid-ink: #172000;
  --coral: #ff8f70;
  --sky: #93ddeb;
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 280px;
  margin: 0;
  background:
    radial-gradient(circle at 88% 4%, rgb(147 221 235 / 10%), transparent 28rem),
    radial-gradient(circle at 10% 20%, rgb(216 255 98 / 8%), transparent 25rem),
    #0b0f10;
  color: var(--ink);
  font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: var(--sky); }

.skip-link {
  position: fixed;
  z-index: 20;
  top: 8px;
  left: 8px;
  transform: translateY(-150%);
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--acid);
  color: var(--acid-ink);
}

.skip-link:focus { transform: translateY(0); }

.site-header,
main,
footer {
  width: min(1160px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-decoration: none;
}

.brand span { margin-left: .18rem; color: var(--acid); }

.beta-badge,
.trust-strip span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  color: var(--muted);
  font-size: .78rem;
  letter-spacing: .04em;
}

main { padding-block: 64px 84px; }

.hero { max-width: 850px; padding-block: 40px 68px; }

.eyebrow {
  margin: 0 0 14px;
  color: var(--acid);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1, h2, p { overflow-wrap: anywhere; }

h1 {
  margin: 0;
  font-size: clamp(3.3rem, 11vw, 8.8rem);
  line-height: .86;
  letter-spacing: -.075em;
}

.lede {
  max-width: 700px;
  margin: 32px 0 24px;
  color: #d5d9d7;
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
}

.trust-strip { display: flex; flex-wrap: wrap; gap: 8px; }

.trust-strip span::before {
  content: "•";
  margin-right: 7px;
  color: var(--acid);
}

.workspace { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 18px; }

.panel {
  margin-bottom: 18px;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(18 23 25 / 88%);
  box-shadow: 0 18px 60px rgb(0 0 0 / 16%);
}

.source-panel,
.variants-panel,
.export-panel,
.help-panel { grid-column: 1 / -1; }

.section-heading { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 24px; }

.section-heading h2,
.help-panel h2 { margin: 0; font-size: clamp(1.3rem, 3vw, 1.8rem); letter-spacing: -.025em; }

.section-heading p { margin: 3px 0 0; color: var(--muted); }

.step {
  flex: 0 0 auto;
  color: var(--acid);
  font: 700 .78rem/1.8 ui-monospace, SFMono-Regular, Menlo, monospace;
}

button,
input,
select,
.file-label,
summary {
  min-height: 44px;
  font: inherit;
}

button,
select,
input[type="number"] {
  border: 1px solid #4b585c;
  border-radius: 10px;
  background: #20282b;
  color: var(--ink);
}

button {
  padding: 10px 15px;
  cursor: pointer;
  font-weight: 720;
}

button:hover:not(:disabled) { border-color: var(--acid); }
button:disabled { cursor: not-allowed; opacity: .45; }
button.primary { border-color: var(--acid); background: var(--acid); color: var(--acid-ink); }

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
}

.file-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 18px 20px;
  border: 1px dashed #6e7b7e;
  border-radius: 12px;
  background: var(--surface-raised);
  cursor: pointer;
  font-weight: 780;
}

.file-label:hover { border-color: var(--acid); }
.file-label small { color: var(--muted); font-weight: 500; }
#source-file { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.support-line,
.microcopy { color: var(--muted); font-size: .87rem; }

.status-card,
.notice {
  margin-top: 15px;
  padding: 12px 14px;
  border-left: 3px solid var(--sky);
  border-radius: 4px 10px 10px 4px;
  background: #151d20;
}

.notice.error { border-left-color: var(--coral); color: #ffd5c9; }

video { display: block; width: 100%; max-height: 440px; margin-top: 20px; border-radius: 12px; background: #000; }

.time-fields {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.time-fields legend { margin-bottom: 12px; font-weight: 750; }
.time-fields label { grid-column: 1 / -1; color: var(--muted); font-size: .9rem; }
.time-fields label span { font-size: .75rem; }
.time-fields input { width: 100%; min-width: 0; padding: 10px 12px; }

.variant-grid,
.download-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.variant-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-raised);
}

.variant-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.variant-heading h3 { margin: 0; font-size: 1.14rem; }
.dimensions { color: var(--muted); font: 600 .74rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }

.framing-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}

.framing-fields legend { width: 100%; margin-bottom: 5px; color: var(--muted); font-size: .82rem; }
.choice { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; cursor: pointer; }
.choice input { width: 18px; height: 18px; accent-color: var(--acid); }
.add-range { width: 100%; }

.variant-ranges {
  display: grid;
  gap: 9px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.variant-ranges li {
  display: grid;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.range-time { font: 600 .78rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.range-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.range-actions button { padding: 7px 8px; font-size: .78rem; }
.empty-item { color: var(--muted); font-size: .85rem; }
.variant-summary { margin: 16px 0 0; color: var(--muted); font-size: .82rem; }

.range-list { margin: 16px 0 0; padding-left: 24px; }
.range-list li { margin: 9px 0; }
.range-list button { min-width: 44px; margin-left: 6px; padding: 6px 10px; }

.export-actions { display: flex; flex-wrap: wrap; gap: 8px; }
progress { width: 100%; height: 12px; margin-top: 18px; accent-color: var(--acid); }

.download-card {
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid var(--sky);
  border-radius: 10px;
  background: rgb(147 221 235 / 8%);
  font-weight: 760;
  text-decoration: none;
}

.download-card:hover { background: rgb(147 221 235 / 14%); }

.help-panel { margin-top: 48px; }
details { border-top: 1px solid var(--line); }
summary { display: flex; align-items: center; cursor: pointer; font-weight: 740; }
details p { max-width: 780px; margin-top: 0; color: var(--muted); }
.third-party { font-size: .85rem; }

footer { padding-block: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }

[hidden] { display: none !important; }

@media (max-width: 760px) {
  .site-header, main, footer { width: min(100% - 20px, 1160px); }
  main { padding-block: 28px 56px; }
  .hero { padding-block: 34px 48px; }
  .workspace, .variant-grid, .download-grid { grid-template-columns: 1fr; }
  .source-panel, .variants-panel, .export-panel, .help-panel { grid-column: auto; }
  .panel { padding: 20px 16px; border-radius: 14px; }
  .file-label { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
