:root {
  color-scheme: light;
  --ink: #17130f;
  --paper: #f6f1e5;
  --tile: #fffaf0;
  --line: #211a12;
  --amber: #f4b23f;
  --blue: #154e7a;
  --green: #3c7d5b;
  --red: #c94a3a;
  --shadow: 8px 8px 0 #211a12;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(33, 26, 18, .06) 1px, transparent 1px),
    linear-gradient(rgba(33, 26, 18, .06) 1px, transparent 1px),
    var(--paper);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

.shell {
  width: min(1160px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 42px 0;
}

.intro {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 28px;
}

.intro-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 8px 12px;
  border: 2px solid var(--line);
  background: var(--amber);
  box-shadow: 4px 4px 0 var(--line);
  font: 700 14px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
}

.brand-mark {
  width: 14px;
  height: 14px;
  background: var(--blue);
  box-shadow:
    14px 0 0 var(--green),
    0 14px 0 var(--red),
    14px 14px 0 var(--line);
}

.github-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  min-height: 40px;
  padding: 8px 12px;
  border: 2px solid var(--line);
  background: var(--ink);
  color: #fff9e8;
  box-shadow: 4px 4px 0 var(--line);
  font: 900 14px/1 ui-sans-serif, system-ui, sans-serif;
  text-decoration: none;
}

.github-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex: 0 0 auto;
}

.github-link:hover,
.github-link:focus-visible {
  background: var(--blue);
  outline: none;
  transform: translate(-1px, -1px);
}

h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(48px, 8vw, 112px);
  line-height: .86;
  letter-spacing: 0;
}

.intro p {
  max-width: 660px;
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
}

.server-mode {
  width: fit-content;
  max-width: 760px;
  border: 2px solid var(--line);
  background: #fffdfa;
  padding: 10px 12px;
  box-shadow: 4px 4px 0 var(--line);
  font: 800 14px/1.35 ui-sans-serif, system-ui, sans-serif;
}

.server-mode.ok {
  background: #dcefd1;
}

.server-mode.warn {
  background: #ffe0c7;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, .72fr);
  gap: 28px;
  align-items: start;
}

.panel,
.status {
  border: 3px solid var(--line);
  background: var(--tile);
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
  display: grid;
  gap: 16px;
}

.dropzone {
  position: relative;
  min-height: 250px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 24px;
  border: 3px dashed var(--line);
  background: #fdf4d4;
  text-align: center;
  cursor: pointer;
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone strong {
  font-size: 28px;
}

.dropzone small,
label,
.fineprint,
.stage small,
.result p {
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.drop-art {
  display: grid;
  grid-template-columns: repeat(3, 32px);
  gap: 8px;
}

.drop-art span {
  width: 32px;
  height: 32px;
  border: 3px solid var(--line);
  background: var(--green);
}

.drop-art span:nth-child(2) {
  background: var(--amber);
  transform: translateY(-8px);
}

.drop-art span:nth-child(3) {
  background: var(--red);
}

.preview-wrap {
  border: 3px solid var(--line);
  background: #ffffff;
  padding: 8px;
}

.preview-wrap img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

input[type="text"],
textarea {
  width: 100%;
  border: 2px solid var(--line);
  background: #fffdfa;
  color: var(--ink);
  padding: 12px 13px;
  font: 600 16px/1.3 ui-sans-serif, system-ui, sans-serif;
  outline: none;
}

input[type="text"]:focus,
textarea:focus {
  box-shadow: 0 0 0 4px rgba(244, 178, 63, .45);
}

.primary,
.download {
  border: 3px solid var(--line);
  background: var(--blue);
  color: #fff9e8;
  box-shadow: 5px 5px 0 var(--line);
  padding: 14px 18px;
  font: 900 16px/1 ui-sans-serif, system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.primary:disabled {
  background: #777;
  cursor: progress;
}

.fineprint {
  margin: 0;
  color: #5a4b3c;
  font-size: 13px;
}

.status {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.stage {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 2px solid var(--line);
  background: #fffdfa;
  opacity: .55;
}

.stage.active,
.stage.done {
  opacity: 1;
}

.stage.active {
  background: #e9f2de;
}

.stage.done {
  background: #f8d77a;
}

.stage span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid var(--line);
  background: var(--ink);
  color: #fff;
  font: 900 18px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.stage strong {
  display: block;
  font-size: 18px;
}

.result,
.error {
  margin-top: 8px;
  border: 2px solid var(--line);
  padding: 14px;
  background: #fffdfa;
}

.result h2 {
  margin: 0 0 8px;
  font-size: 30px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 14px 0;
}

.result-actions a:not(.download) {
  color: var(--blue);
  font: 800 15px/1 ui-sans-serif, system-ui, sans-serif;
}

.install-box {
  display: grid;
  gap: 7px;
  padding: 12px;
  background: #f3ead8;
  border: 2px solid var(--line);
}

.prompt-box {
  display: grid;
  gap: 9px;
  margin-top: 12px;
  padding: 12px;
  background: #e9f2de;
  border: 2px solid var(--line);
}

.prompt-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.prompt-head button {
  border: 2px solid var(--line);
  background: var(--amber);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--line);
  padding: 8px 10px;
  font: 900 13px/1 ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
}

.prompt-box textarea {
  min-height: 132px;
  resize: vertical;
  font: 600 13px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
}

.error {
  background: #ffe3da;
  color: #7b2016;
  font: 800 14px/1.4 ui-sans-serif, system-ui, sans-serif;
}

@media (max-width: 860px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .shell {
    padding: 24px 0;
  }

  .dropzone {
    min-height: 210px;
  }

  .intro-top {
    align-items: stretch;
  }
}
