/* slop.speak // a cheerful industrial accident */
:root {
  --ink: #17151a;
  --cream: #fff8e8;
  --paper: #fffdf7;
  --acid: #b8ff3d;
  --slime: #71f5a1;
  --purple: #7357ff;
  --purple-dark: #3c2673;
  --pink: #ff78b8;
  --orange: #ff8b48;
  --blue: #4cdae4;
  --muted: #776f82;
  --line: #d9cfe2;
  --shadow: 10px 12px 0 var(--ink);
  --round: "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--sans);
  background-color: #f0e9ff;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(23, 21, 26, .1) 1.2px, transparent 0);
  background-size: 24px 24px;
}
button, textarea { font: inherit; }
button { color: inherit; }
.fatal-note {
  margin: 14px; padding: 12px 14px; border: 3px solid var(--ink); border-radius: 12px;
  background: #ffb4d5; color: #7f123f; font: 800 12px/1.4 var(--mono); box-shadow: 4px 4px 0 var(--ink);
}
button:focus-visible, textarea:focus-visible {
  outline: 4px solid var(--blue);
  outline-offset: 3px;
}

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.ambient { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.blob { position: absolute; border: 3px solid var(--ink); opacity: .9; }
.blob-a {
  width: 340px; height: 290px; left: -100px; top: 8%;
  border-radius: 57% 43% 39% 61% / 46% 58% 42% 54%;
  background: var(--pink); transform: rotate(-14deg);
  animation: drift-a 14s ease-in-out infinite;
}
.blob-b {
  width: 380px; height: 340px; right: -150px; top: 34%;
  border-radius: 41% 59% 64% 36% / 58% 38% 62% 42%;
  background: var(--acid); transform: rotate(22deg);
  animation: drift-b 17s ease-in-out infinite;
}
.blob-c {
  width: 240px; height: 170px; left: 12%; bottom: -80px;
  border-radius: 65% 35% 48% 52% / 39% 58% 42% 61%;
  background: var(--blue); transform: rotate(9deg);
}
.squiggle {
  position: absolute; right: 5%; top: 8%; color: var(--purple);
  font: 900 90px/1 var(--round); letter-spacing: -22px;
  transform: rotate(8deg); opacity: .72;
}
@keyframes drift-a { 50% { transform: translate(25px, 18px) rotate(-8deg) scale(1.04); } }
@keyframes drift-b { 50% { transform: translate(-30px, -20px) rotate(14deg) scale(.96); } }

.page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 32px 0 28px; }

/* hero */
.hero { position: relative; min-height: 146px; padding-bottom: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark {
  display: grid; place-items: center; width: 58px; height: 58px;
  border: 3px solid var(--ink); border-radius: 18px; background: var(--ink);
  box-shadow: 4px 4px 0 var(--purple);
  transform: rotate(-4deg);
}
.brand-mark svg { width: 48px; height: 48px; overflow: visible; animation: wobble 3s ease-in-out infinite; }
.goo-body { fill: var(--acid); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.goo-shine { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; opacity: .7; }
.goo-bubble { fill: var(--purple); stroke: var(--ink); stroke-width: 2; }
.brand-type { font: 900 27px/1 var(--round); letter-spacing: -1.5px; }
.brand-type span { color: var(--purple); }
@keyframes wobble {
  0%, 100% { transform: scale(1); }
  32% { transform: scale(1.07, .94) rotate(2deg); }
  68% { transform: scale(.95, 1.06) rotate(-2deg); }
}

.hero-sticker {
  position: absolute; right: 10px; top: 4px;
  width: 126px; height: 126px; display: flex; align-items: center; justify-content: center; gap: 7px;
  border: 3px solid var(--ink); border-radius: 50%; background: var(--orange);
  box-shadow: 5px 5px 0 var(--ink); transform: rotate(9deg);
  text-transform: uppercase;
}
.hero-sticker::before {
  content: ""; position: absolute; inset: 7px; border: 2px dashed var(--ink); border-radius: 50%;
}
.hero-sticker strong { font: 900 27px/1 var(--round); z-index: 1; }
.hero-sticker span { font: 900 10px/1.05 var(--mono); z-index: 1; }
/* the machine */
.machine {
  position: relative; overflow: hidden;
  border: 3px solid var(--ink); border-radius: 28px; background: var(--ink);
  box-shadow: var(--shadow);
}
.machine-cap {
  min-height: 46px; display: flex; align-items: center; gap: 14px;
  padding: 9px 16px; color: var(--cream); background: var(--purple-dark);
  border-bottom: 3px solid var(--ink); font: 800 11px/1 var(--mono); letter-spacing: 1.3px;
}
.machine-lights { display: flex; gap: 6px; }
.machine-lights i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ink); background: var(--pink); }
.machine-lights i:nth-child(2) { background: var(--orange); }
.machine-lights i:nth-child(3) { background: var(--acid); box-shadow: 0 0 10px var(--acid); }
.machine-serial { margin-left: auto; color: #c6b8ef; }

.bay-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch; background: var(--ink);
}
.bay { min-width: 0; display: flex; flex-direction: column; background: var(--paper); }
.bay-output { background: #efffd7; border-left: 3px solid var(--ink); }
.bay-head {
  height: 86px; flex: none; display: flex; align-items: center; gap: 12px;
  padding: 15px 17px; border-bottom: 3px solid var(--ink);
}
.step {
  display: grid; place-items: center; width: 41px; height: 41px; flex: none;
  border: 2px solid var(--ink); border-radius: 50%; background: var(--pink);
  font: 900 13px/1 var(--mono); box-shadow: 2px 2px 0 var(--ink);
}
.bay-output .step { background: var(--acid); }
.bay-head h2 { margin: 0 0 4px; font: 900 18px/1 var(--round); text-transform: uppercase; letter-spacing: -.3px; }
.bay-head p { margin: 0; color: var(--muted); font: 700 11px/1.2 var(--mono); }
.bay-status { margin-left: auto; padding: 5px 7px; border: 2px solid var(--ink); border-radius: 6px; background: var(--cream); font: 900 10px/1 var(--mono); transform: rotate(-3deg); }
.bay-status.hot { background: var(--acid); transform: rotate(3deg); }

#src, .out {
  width: 100%; height: 292px; min-height: 292px; max-height: 292px;
  padding: 22px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--purple) transparent;
}
#src {
  display: block; resize: none; border: 0; outline: 0; background: var(--paper);
  color: var(--ink); font: 650 17px/1.62 var(--sans); caret-color: var(--purple);
}
#src::placeholder { color: #a39aa9; }
.out {
  position: relative; color: #251b32; font: 700 15px/1.72 var(--mono);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.empty-state { color: #7e8e68; font-style: italic; font-weight: 600; }
.thinking { display: inline-flex; align-items: center; gap: 8px; color: var(--purple-dark); }
.thinking::before { content: ""; width: 12px; height: 12px; border: 3px solid var(--purple); border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.dots::after { content: ""; animation: dots 1.2s steps(4,end) infinite; }
.err { color: #9c174c; font-weight: 800; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes dots { 25% { content: "."; } 50% { content: ".."; } 75%, 100% { content: "..."; } }
.bay-output.success .out { animation: slop-in .48s cubic-bezier(.2,.9,.3,1.3); }
@keyframes slop-in { 0% { opacity: 0; transform: translateY(10px) scale(.98); } 70% { transform: translateY(-2px) scale(1.01); } }

.bay-foot {
  min-height: 50px; display: flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-top: 3px solid var(--ink); background: #f5edff;
}
.count, .shortcut { color: var(--muted); font: 700 10px/1 var(--mono); }
.shortcut { margin-left: auto; }
.output-actions { justify-content: flex-end; background: #dcff9f; }
.mini-action {
  border: 2px solid var(--ink); border-radius: 999px; background: var(--paper);
  padding: 6px 10px; font: 800 10px/1 var(--mono); cursor: pointer; box-shadow: 2px 2px 0 var(--ink);
  transition: transform .12s, background .12s;
}
.mini-action:hover:not(:disabled) { background: var(--pink); transform: translate(-1px,-1px); }
.mini-action:active:not(:disabled) { transform: translate(1px,1px); box-shadow: none; }
.mini-action:disabled { opacity: .38; cursor: not-allowed; box-shadow: none; }

.sample-tray {
  display: flex; align-items: center; gap: 13px; min-height: 62px;
  padding: 11px 16px; border-top: 3px solid var(--ink); background: var(--cream);
}
.sample-tray-mobile { display: none; }
.tray-label { flex: none; font: 900 10px/1 var(--mono); text-transform: uppercase; letter-spacing: 1px; }
.chips { display: flex; align-items: center; gap: 7px; min-width: 0; overflow-x: auto; padding: 3px 2px 5px; }
.chip {
  flex: none; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 2px solid var(--ink); border-radius: 8px; background: #fff; padding: 7px 10px;
  font: 750 11px/1 var(--mono); cursor: pointer; box-shadow: 2px 2px 0 var(--ink);
  transition: transform .12s, background .12s;
}
.chip:nth-child(2n) { background: #e7ddff; transform: rotate(1deg); }
.chip:nth-child(3n) { background: #ffd5e9; transform: rotate(-1deg); }
.chip:hover { background: var(--acid); transform: translateY(-2px) rotate(0); }

.machine-controls {
  min-height: 93px; display: flex; align-items: center; gap: 16px;
  padding: 14px 18px; border-top: 3px solid var(--ink); background: var(--orange);
}
.status { flex: 1; min-width: 0; font: 800 12px/1.35 var(--mono); }
.go {
  position: relative; flex: none; display: inline-flex; align-items: center; gap: 11px;
  min-width: 250px; justify-content: center; border: 3px solid var(--ink); border-radius: 17px;
  background: var(--acid); padding: 10px 14px; cursor: pointer;
  font: 900 18px/1 var(--round); text-transform: uppercase; letter-spacing: .2px;
  box-shadow: 6px 6px 0 var(--ink); transition: transform .12s, box-shadow .12s, filter .12s;
}
.go:hover:not(:disabled) { transform: translate(-2px,-2px) rotate(-.5deg); box-shadow: 8px 8px 0 var(--ink); filter: saturate(1.2); }
.go:active:not(:disabled) { transform: translate(4px,4px); box-shadow: 2px 2px 0 var(--ink); }
.go:disabled { cursor: wait; filter: grayscale(.25); }
.button-goo { display: grid; place-items: center; width: 37px; height: 37px; border: 2px solid var(--ink); border-radius: 11px; background: var(--purple-dark); }
.button-goo svg { width: 32px; height: 32px; }
.go.loading .button-goo svg { animation: wobble .55s ease-in-out infinite; }
.go-arrow { margin-left: 7px; font-size: 26px; }

.page-foot {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px;
  margin-top: 30px; font: 800 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .8px;
}
.foot-dot { color: var(--purple); }
.page-foot a {
  color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 3px;
  transition: color .12s, background .12s;
}
.page-foot a:hover { color: var(--purple-dark); background: var(--acid); }

@media (max-width: 820px) {
  .page-shell { width: min(100% - 24px, 680px); padding-top: 18px; }
  .hero-sticker { width: 92px; height: 92px; right: 3px; }
  .hero-sticker strong { font-size: 20px; }
  .hero-sticker span { font-size: 8px; }
  .hero { min-height: 116px; }
  .bay-grid { grid-template-columns: minmax(0, 1fr); }
  .bay-output { border-left: 0; border-top: 3px solid var(--ink); }
  .sample-tray { align-items: flex-start; flex-direction: column; gap: 7px; }
  .sample-tray-desktop { display: none; }
  .sample-tray-mobile { display: flex; }
  .chips { width: 100%; }
  .machine-controls { align-items: stretch; flex-direction: column-reverse; }
  .go { width: 100%; min-width: 0; }
  .status:empty { display: none; }
}

@media (max-width: 520px) {
  .brand-mark { width: 48px; height: 48px; }
  .brand-mark svg { width: 40px; height: 40px; }
  .brand-type { font-size: 23px; }
  .hero-sticker { display: none; }
  .hero { min-height: 78px; }
  .machine { border-radius: 20px; box-shadow: 6px 7px 0 var(--ink); }
  .machine-cap { font-size: 9px; }
  .machine-serial { display: none; }
  #src, .out { height: 250px; min-height: 250px; max-height: 250px; padding: 17px; }
  .bay-head { height: 78px; padding: 12px; }
  .bay-head h2 { font-size: 16px; }
  .bay-head p { font-size: 9px; }
  .step { width: 36px; height: 36px; }
  .output-actions { justify-content: center; }
  .shortcut { display: none; }
  .page-foot { line-height: 1.6; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
