@font-face {
  font-family: "Press Start 2P";
  src: url("../assets/fonts/PressStart2P-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #080912;
  --panel: #0e101b;
  --panel-2: #131625;
  --line: #2b3047;
  --line-bright: #6761a6;
  --cream: #f4e8c7;
  --muted: #aaa6b5;
  --purple: #9b88ff;
  --cyan: #77e4ff;
  --amber: #ff9a26;
  --green: #63ed91;
  --red: #ff7272;
  --shadow: rgba(0, 0, 0, 0.52);
  --pixel: "Press Start 2P", ui-monospace, monospace;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  min-height: 100%;
  color-scheme: dark;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--cream);
  background:
    radial-gradient(circle at 14% -4%, rgba(104, 81, 201, 0.22), transparent 28rem),
    radial-gradient(circle at 92% 22%, rgba(37, 143, 172, 0.11), transparent 24rem),
    linear-gradient(180deg, #090a13, #05060a 74%);
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1.55;
}

button, select, input { font: inherit; }

button, .drop-zone, select { -webkit-tap-highlight-color: transparent; }

a { color: inherit; }

.signal-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(119, 228, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(119, 228, 255, 0.025) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  min-height: 4.25rem;
  padding: 0.75rem max(1rem, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(155, 136, 255, 0.34);
  background: rgba(8, 9, 18, 0.86);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  color: var(--cyan);
  font-family: var(--pixel);
  font-size: 0.66rem;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  color: var(--bg);
  background: var(--amber);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 800;
  clip-path: polygon(20% 0, 100% 0, 100% 80%, 80% 100%, 0 100%, 0 20%);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.breadcrumb a { color: var(--purple); text-decoration: none; }
.breadcrumb a:hover { color: var(--cyan); }

.shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4.6rem) 0 4rem;
}

.intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.eyebrow, .section-kicker {
  margin: 0 0 0.65rem;
  color: var(--amber);
  font-family: var(--pixel);
  font-size: 0.58rem;
  line-height: 1.8;
  letter-spacing: 0.04em;
}

h1, h2, p { margin-top: 0; }

h1 {
  margin-bottom: 0;
  color: var(--cream);
  font-family: var(--pixel);
  font-size: clamp(1.65rem, 4.6vw, 3.35rem);
  font-weight: 400;
  line-height: 1.25;
  text-shadow: 0 0 28px rgba(155, 136, 255, 0.26);
}

.privacy-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.62rem 0.85rem;
  color: #c8c6d1;
  border: 1px solid #31364b;
  background: #0c0e17;
  font-size: 0.82rem;
  white-space: nowrap;
}

.privacy-dot {
  width: 0.58rem;
  height: 0.58rem;
  border: 1px solid var(--green);
  background: rgba(99, 237, 145, 0.22);
  box-shadow: 0 0 10px rgba(99, 237, 145, 0.42);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(18rem, 0.7fr);
  gap: 1rem;
  align-items: start;
}

.workspace-main { display: grid; gap: 1rem; min-width: 0; }

.drop-zone,
.queue-panel,
.control-panel,
.facts article {
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(155, 136, 255, 0.045), transparent 44%),
    rgba(13, 15, 25, 0.94);
  box-shadow: 0 18px 45px var(--shadow);
}

.drop-zone {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.1rem;
  min-height: 12rem;
  padding: clamp(1.25rem, 3vw, 2.1rem);
  overflow: hidden;
  border-style: dashed;
  border-color: #4f5271;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.drop-zone::before,
.control-panel::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 5rem;
  height: 2px;
  content: "";
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(119, 228, 255, 0.65);
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--cyan);
  background: linear-gradient(135deg, rgba(119, 228, 255, 0.09), rgba(13, 15, 25, 0.96) 48%);
  transform: translateY(-1px);
}

.drop-zone:focus-visible,
button:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 4.25rem;
  height: 4.25rem;
  color: var(--cyan);
  border: 1px solid #405265;
  background: #0a1018;
}

.drop-icon svg { width: 2.5rem; fill: none; stroke: currentColor; stroke-width: 2; }

.drop-copy h2,
.section-heading h2,
.control-panel h2,
.facts h2 {
  margin-bottom: 0.35rem;
  color: var(--cream);
  font-family: var(--pixel);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.65;
}

.drop-copy p { margin: 0; color: var(--muted); font-size: 0.9rem; }

.format-strip {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin-top: 0.25rem;
}

.format-strip span {
  padding: 0.28rem 0.45rem;
  color: #8d8ca0;
  border: 1px solid #2f3348;
  background: rgba(3, 4, 9, 0.45);
  font-size: 0.72rem;
}

.button {
  min-height: 2.8rem;
  padding: 0.7rem 1rem;
  border: 1px solid transparent;
  border-radius: 0;
  cursor: pointer;
  font-weight: 700;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: 0.42; }

.button-secondary {
  color: var(--cyan);
  border-color: #3d6570;
  background: #0b161c;
}

.button-secondary:hover { border-color: var(--cyan); background: #10242d; }

.queue-panel { padding: clamp(1.1rem, 2.5vw, 1.6rem); }

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.section-heading h2, .control-panel h2 { margin: 0; }

.count {
  display: inline-grid;
  place-items: center;
  min-width: 1.8rem;
  height: 1.45rem;
  margin-left: 0.45rem;
  color: var(--bg);
  background: var(--purple);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.text-button {
  padding: 0.4rem;
  color: var(--muted);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 0.82rem;
}

.text-button:hover:not(:disabled) { color: var(--red); }
.text-button:disabled { opacity: 0.35; cursor: not-allowed; }

.empty-state {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 6.5rem;
  color: var(--muted);
}

.empty-state p { margin: 0; font-size: 0.88rem; }

.empty-index {
  color: #31354c;
  font-family: var(--pixel);
  font-size: 1.45rem;
}

.file-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }

.file-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.85rem;
  min-height: 4rem;
  border-bottom: 1px solid #24283a;
}

.file-row:last-child { border-bottom: 0; }

.file-format {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 2rem;
  color: var(--purple);
  border: 1px solid #48436f;
  background: #121223;
  font-size: 0.7rem;
  font-weight: 800;
}

.file-copy { min-width: 0; }
.file-name { overflow: hidden; color: #e7dec5; font-size: 0.88rem; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { color: #77788a; font-size: 0.74rem; }

.file-status { color: var(--muted); font-size: 0.76rem; white-space: nowrap; }
.file-status.is-working { color: var(--amber); }
.file-status.is-success { color: var(--green); }
.file-status.is-error { color: var(--red); }

.icon-button {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  color: #8f90a2;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
}

.icon-button:hover { color: var(--cream); border-color: #464b63; background: #171a28; }

.download-one { color: var(--cyan); text-decoration: none; font-size: 0.74rem; }

.control-panel {
  position: sticky;
  top: 1rem;
  padding: 1.5rem;
  overflow: hidden;
}

.control-panel-header { padding-bottom: 1.15rem; border-bottom: 1px solid var(--line); }

.field-label {
  display: block;
  margin: 1.25rem 0 0.55rem;
  color: #c8c2b0;
  font-size: 0.82rem;
  font-weight: 700;
}

.select-wrap { position: relative; }

.select-wrap select {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.7rem 2.5rem 0.7rem 0.85rem;
  color: var(--cream);
  border: 1px solid #42465d;
  border-radius: 0;
  appearance: none;
  background: #090b13;
  font-size: 0.9rem;
  cursor: pointer;
}

.select-wrap > span {
  position: absolute;
  top: 50%;
  right: 0.9rem;
  color: var(--amber);
  pointer-events: none;
  transform: translateY(-50%);
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 1.1rem 0;
  cursor: pointer;
}

.check-row input { position: absolute; opacity: 0; }

.check-box {
  position: relative;
  flex: 0 0 1.15rem;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  border: 1px solid #5b5f78;
  background: #090b13;
}

.check-row input:checked + .check-box { border-color: var(--cyan); background: var(--cyan); }
.check-row input:checked + .check-box::after { position: absolute; inset: 0; display: grid; place-items: center; color: #061016; content: "✓"; font-size: 0.85rem; font-weight: 900; }
.check-row input:focus-visible + .check-box { outline: 2px solid var(--amber); outline-offset: 3px; }

.check-row strong { display: block; color: #ddd5be; font-size: 0.84rem; }
.check-row small { display: block; margin-top: 0.18rem; color: #747687; font-size: 0.72rem; }

.memory-card {
  display: flex;
  gap: 0.8rem;
  margin: 1rem 0 1.25rem;
  padding: 0.9rem;
  border: 1px solid #254535;
  background: rgba(44, 106, 69, 0.1);
}

.memory-card svg { flex: 0 0 1.35rem; width: 1.35rem; fill: none; stroke: var(--green); stroke-width: 1.7; }
.memory-card strong { color: var(--green); font-size: 0.8rem; }
.memory-card p { margin: 0.3rem 0 0; color: #87978d; font-size: 0.73rem; line-height: 1.55; }

.button-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  color: #070811;
  background: var(--amber);
  border-color: var(--amber);
}

.button-primary:hover:not(:disabled) { background: #ffb14e; }

.button-download, .button-quiet { width: 100%; margin-top: 0.65rem; }
.button-download { color: #071016; border-color: var(--cyan); background: var(--cyan); }
.button-quiet { color: var(--cyan); border-color: #376573; background: transparent; }

.progress-wrap { margin-top: 1rem; }
.progress-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.74rem; }
.progress-track { height: 0.35rem; margin-top: 0.45rem; overflow: hidden; background: #24283a; }
.progress-track span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--purple), var(--cyan)); transition: width 180ms ease; }

.compatibility-note { margin: 1rem 0 0; color: #666879; font-size: 0.7rem; line-height: 1.55; }

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.facts article { position: relative; min-height: 9.25rem; padding: 1.2rem; box-shadow: none; }
.facts article > span { color: #3f435e; font-family: var(--pixel); font-size: 0.65rem; }
.facts h2 { margin-top: 1.2rem; font-size: 0.66rem; }
.facts p { margin: 0; color: #898999; font-size: 0.8rem; }

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 20;
  max-width: min(26rem, calc(100vw - 2rem));
  padding: 0.85rem 1rem;
  color: var(--cream);
  border: 1px solid #4c5270;
  background: #111421;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.56);
  font-size: 0.82rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.75rem);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.is-error { border-color: #794347; color: #ffd0d0; }

[hidden] { display: none !important; }

@media (max-width: 860px) {
  .workspace { grid-template-columns: 1fr; }
  .control-panel { position: relative; top: auto; }
  .facts { grid-template-columns: 1fr; }
  .facts article { min-height: 0; }
}

@media (max-width: 620px) {
  .topbar { align-items: flex-start; flex-direction: column; gap: 0.55rem; padding-block: 0.8rem; }
  .breadcrumb { font-size: 0.75rem; }
  .shell { width: min(100% - 1rem, 1180px); padding-top: 1.5rem; }
  .intro { align-items: flex-start; flex-direction: column; }
  .privacy-chip { font-size: 0.76rem; }
  .drop-zone { grid-template-columns: auto minmax(0, 1fr); min-height: 0; }
  .drop-zone .button { grid-column: 1 / -1; width: 100%; }
  .drop-icon { width: 3.5rem; height: 3.5rem; }
  .drop-copy h2 { font-size: 0.68rem; }
  .drop-copy p { font-size: 0.8rem; }
  .file-row { grid-template-columns: auto minmax(0, 1fr) auto; padding: 0.6rem 0; }
  .file-status { grid-column: 2; }
  .file-row .icon-button { grid-column: 3; grid-row: 1 / span 2; }
  .download-one { grid-column: 2; }
}

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