:root {
  color-scheme: light;
  --ink: #06090c;
  --paper: #fff3cf;
  --panel: #fffaf0;
  --teal: #19c8c2;
  --teal-dark: #087a77;
  --yellow: #ffbe0b;
  --orange: #ff8a00;
  --blue: #0a66a6;
  --blue-dark: #074d7d;
  --muted: #5f6067;
  --danger: #b83232;
  --shadow: 6px 7px 0 var(--ink);
  --radius: 10px;
  --cursor-pointer: url("assets/cursor-pointer.svg") 4 3, pointer;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Nunito", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 800;
  letter-spacing: 0;
  background:
    linear-gradient(rgba(6, 9, 12, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 9, 12, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 12% 14%, rgba(25, 200, 194, 0.22) 0 90px, transparent 91px),
    radial-gradient(circle at 88% 18%, rgba(255, 190, 11, 0.26) 0 84px, transparent 85px),
    linear-gradient(135deg, #fff9e8 0%, var(--paper) 47%, #d8efff 100%);
  background-size: 30px 30px, 30px 30px, auto, auto, auto;
}

body::before {
  content: "";
  position: fixed;
  inset: auto -16vw -30vh auto;
  width: min(680px, 58vw);
  height: min(520px, 58vh);
  background:
    linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    var(--blue);
  background-size: 24px 24px;
  clip-path: polygon(18% 0, 100% 0, 100% 100%, 0 100%);
  pointer-events: none;
  z-index: 0;
}

button,
input {
  font: inherit;
}

button,
label,
.sketch-button {
  cursor: var(--cursor-pointer);
}

button:focus-visible,
.file-control:focus-within,
.sketch-button:focus-visible {
  outline: 4px solid var(--orange);
  outline-offset: 4px;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1160px, calc(100vw - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 34px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
}

.site-header {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr);
  gap: 18px;
  align-items: center;
  padding: clamp(14px, 2.3vw, 22px);
  border: 5px solid var(--ink);
  border-radius: var(--radius);
  background:
    linear-gradient(120deg, rgba(25, 200, 194, 0.14), transparent 38%),
    radial-gradient(circle at 96% 24%, var(--yellow) 0 6px, transparent 7px),
    linear-gradient(180deg, #fffdf3, #fff0c2);
  box-shadow: var(--shadow);
}

.brand-block {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}

.eyebrow,
.panel-kicker {
  margin: 0;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.brand-logo {
  width: fit-content;
  margin: 0;
  border: 4px solid var(--ink);
  border-radius: 14px;
  padding: 6px 14px 2px;
  background: #fff8df;
  color: var(--ink);
  font-family: "Baloo 2", "Nunito", system-ui, sans-serif;
  font-size: clamp(2.7rem, 7vw, 5.6rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow:
    0.045em 0.055em 0 var(--yellow),
    0.07em 0.08em 0 rgba(6, 9, 12, 0.16);
  box-shadow: 5px 6px 0 var(--ink);
  transform: rotate(-1deg);
  overflow-wrap: normal;
  word-break: normal;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  align-items: center;
  gap: 10px;
}

.browser-pill,
.count-pill {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--ink);
  border-radius: 9px;
  padding: 7px 12px;
  background: #fff;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 4px 5px 0 var(--ink);
  white-space: nowrap;
}

.browser-pill.ready {
  background: var(--teal);
}

.browser-pill.blocked {
  background: #ffd0c7;
  color: var(--danger);
}

.count-pill {
  background: var(--yellow);
}

.uploader-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.86fr) minmax(430px, 1.14fr);
  gap: 18px;
  align-items: stretch;
}

.panel {
  min-width: 0;
  border: 5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.project-panel,
.upload-panel {
  min-height: 600px;
}

.project-panel {
  display: grid;
  grid-template-rows: auto 1fr;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 5px solid var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    var(--teal);
  background-size: 18px 18px;
}

.upload-heading {
  background:
    linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    var(--blue);
  background-size: 18px 18px;
  color: #fff;
}

.upload-heading .panel-kicker {
  color: var(--yellow);
}

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

h2 {
  margin: 2px 0 0;
  font-family: "Baloo 2", "Nunito", system-ui, sans-serif;
  font-size: clamp(1.85rem, 3.3vw, 2.8rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0;
  text-transform: uppercase;
}

h3 {
  margin: 4px 0 0;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1;
  font-weight: 900;
  text-transform: uppercase;
}

.icon-button {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 4px solid var(--ink);
  border-radius: 9px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 900;
  box-shadow: 3px 4px 0 var(--ink);
}

.icon-button:hover,
.icon-button:focus-visible,
.primary:hover,
.primary:focus-visible,
.file-control:hover,
.file-control:focus-within {
  transform: translate(2px, 2px);
  box-shadow: 1px 2px 0 var(--ink);
}

.sketch-list {
  min-height: 0;
  display: grid;
  grid-auto-rows: min-content;
  gap: 10px;
  padding: 14px;
  overflow: auto;
  scrollbar-color: var(--teal-dark) #fff4d7;
}

.sketch-list::-webkit-scrollbar,
.log::-webkit-scrollbar {
  width: 14px;
}

.sketch-list::-webkit-scrollbar-track,
.log::-webkit-scrollbar-track {
  background: #fff4d7;
}

.sketch-list::-webkit-scrollbar-thumb,
.log::-webkit-scrollbar-thumb {
  border: 3px solid #fff4d7;
  border-radius: 999px;
  background: var(--teal-dark);
}

.sketch-button {
  width: 100%;
  min-height: 76px;
  border: 4px solid var(--ink);
  border-radius: 9px;
  padding: 12px 14px;
  background: #fffef7;
  color: var(--ink);
  text-align: left;
  box-shadow: 3px 4px 0 rgba(6, 9, 12, 0.95);
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.sketch-button:hover,
.sketch-button.active {
  background: linear-gradient(135deg, #ffe27b, var(--yellow));
}

.sketch-button.active {
  transform: translate(2px, 2px);
  box-shadow: 1px 2px 0 var(--ink);
}

.sketch-button strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1rem;
  line-height: 1.05;
  font-weight: 900;
  text-transform: uppercase;
}

.sketch-button span {
  display: block;
  color: #31323a;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.3;
}

.empty {
  margin: 0;
  padding: 14px;
  color: var(--muted);
}

.upload-panel {
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
}

.selected {
  margin: 18px;
  padding: 18px;
  border: 4px solid var(--ink);
  border-radius: 9px;
  background:
    radial-gradient(circle at 100% 0%, rgba(25, 200, 194, 0.24) 0 84px, transparent 85px),
    linear-gradient(135deg, #fff 0%, #fff1bd 100%);
}

.selected p:last-child {
  margin: 8px 0 0;
  color: #33353b;
  font-size: 1rem;
  font-weight: 800;
}

.selected-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.selected-badges span {
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 4px 9px;
  background: #fff;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.primary,
.file-control {
  min-height: 54px;
  border: 4px solid var(--ink);
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 4px 5px 0 var(--ink);
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.primary {
  margin: 0 18px 18px;
  background: linear-gradient(135deg, #66dfd9, var(--teal));
  color: var(--ink);
}

.primary:disabled {
  background: #d4d0c4;
  color: #5d5a51;
  transform: none;
  box-shadow: 4px 5px 0 var(--ink);
}

.primary .button-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
}

body.is-uploading .primary .button-icon {
  animation: pulse-dot 780ms ease-in-out infinite alternate;
}

.file-control {
  position: relative;
  min-width: 148px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
}

.file-control input {
  width: 1px;
  height: 1px;
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

.progress-wrap {
  margin: 0 18px 18px;
  display: grid;
  gap: 8px;
}

.progress-bar {
  height: 18px;
  border: 4px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: repeating-linear-gradient(45deg, var(--yellow) 0 12px, var(--orange) 12px 24px);
  transition: width 160ms ease;
}

body.is-uploading .progress-fill {
  animation: belt 700ms linear infinite;
  background-size: 34px 34px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: uppercase;
}

.console-frame {
  min-height: 0;
  margin: 0 18px 18px;
  display: grid;
  grid-template-rows: auto 1fr;
  border: 4px solid var(--ink);
  border-radius: 9px;
  overflow: hidden;
  background: #071014;
  box-shadow: inset 0 0 0 2px rgba(156, 248, 243, 0.08);
}

.console-tabs {
  display: flex;
  gap: 7px;
  padding: 9px;
  border-bottom: 4px solid var(--ink);
  background: var(--blue-dark);
}

.console-tabs span {
  width: 14px;
  height: 14px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
}

.console-tabs span:nth-child(2) {
  background: var(--teal);
}

.console-tabs span:nth-child(3) {
  background: #fff;
}

.log {
  min-height: 190px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  background: #071014;
  color: #9cf8f3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 3;
  border: 4px solid var(--ink);
  border-radius: 9px;
  padding: 12px;
  background: #ffd0c7;
  color: var(--ink);
  font-weight: 900;
}

@keyframes pulse-dot {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.12);
  }
}

@keyframes belt {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 34px 0;
  }
}

@media (max-width: 900px) {
  body::before {
    display: none;
  }

  .site-header,
  .uploader-grid {
    grid-template-columns: 1fr;
  }

  .brand-block {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-row {
    justify-content: start;
  }

  .project-panel,
  .upload-panel {
    min-height: auto;
  }

  .sketch-list {
    max-height: 520px;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100vw - 16px, 520px);
    padding: 10px 0 22px;
  }

  .site-header,
  .panel {
    border-width: 4px;
    box-shadow: 4px 5px 0 var(--ink);
  }

  .site-header {
    padding: 16px;
  }

  .brand-logo {
    font-size: clamp(2.55rem, 15vw, 4.8rem);
    padding: 5px 10px 1px;
  }

  .panel-heading {
    padding: 12px;
  }

  .upload-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .file-control {
    width: 100%;
  }

  .sketch-list {
    max-height: 360px;
  }

  .selected,
  .primary,
  .progress-wrap,
  .console-frame {
    margin-left: 12px;
    margin-right: 12px;
  }
}
