/* ascii.kituwa.com — one job: an image in, ASCII art out.
   Light paper for the landing, ink-black stage for the art, one lime accent. */

:root {
  --paper: #f4f3ec;
  --surface: #ffffff;
  --ink: #0b0f0d;
  --muted: #5b625c;
  --line: #dcd9cc;
  --accent: #c8ff3d;
  --accent-deep: #2f6a1e;
  --accent-ink: #0b0f0d;
  --stage: #08090a;
  --stage-line: #2a2d2e;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  --radius: 14px;
}

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

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid var(--accent-deep); outline-offset: 3px; }
.stage :focus-visible { outline-color: var(--accent); }

/* ---------- landing ---------- */

.home {
  flex: 1;
  width: min(760px, 100% - 40px);
  margin: 0 auto;
  padding: clamp(28px, 9vh, 96px) 0 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(24px, 5vh, 44px);
  text-align: center;
}

.headline {
  margin: 0;
  font-size: clamp(29px, 4.6vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 650;
  max-width: 18ch;
}

.drop {
  width: 100%;
  min-height: clamp(200px, 34vh, 300px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 24px;
  border: 2px dashed #b9b6a6;
  border-radius: 20px;
  background:
    repeating-linear-gradient(135deg, transparent 0 9px, rgba(11, 15, 13, .028) 9px 10px),
    var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
}

.drop:hover, .drop:focus-visible { border-color: var(--ink); }
.drop[data-active="true"] {
  border-color: var(--accent-deep);
  border-style: solid;
  background-color: #f7ffe9;
  transform: scale(1.005);
}

.drop-icon { width: 46px; height: 46px; color: #8b8a7e; margin-bottom: 4px; }
.drop[data-active="true"] .drop-icon { color: var(--accent-deep); }

.drop-title { font-weight: 600; font-size: clamp(17px, 2vw, 20px); letter-spacing: -0.01em; }
.drop-hint { color: var(--muted); font-size: 14px; max-width: 46ch; }

.error {
  margin: 0;
  padding: 12px 16px;
  border-radius: 10px;
  background: #fdeaea;
  border: 1px solid #e6b6b6;
  color: #7d1c1c;
  font-size: 15px;
  text-align: left;
}

.status { margin: 0; min-height: 1.5em; color: var(--muted); font-size: 14px; }

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: center;
  align-items: center;
  padding: 22px 20px 28px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
}
.foot nav { display: flex; gap: 16px; }
.foot a { color: var(--muted); text-decoration: none; border-bottom: 1px solid transparent; }
.foot a:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- stage ---------- */

.stage {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--stage);
  overflow: hidden;
}
.stage[hidden] { display: none; }

#art { display: block; width: 100%; height: 100%; }

.toolbar {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  z-index: 3;
}

.tool {
  appearance: none;
  border: 1px solid var(--stage-line);
  background: rgba(18, 20, 20, .82);
  backdrop-filter: blur(8px);
  color: #e9ede6;
  font: 500 13px/1 var(--font);
  padding: 10px 13px;
  min-height: 38px;
  border-radius: 9px;
  cursor: pointer;
  transition: background-color .14s ease, border-color .14s ease;
}
.tool:hover { background: #1d2120; border-color: #47504c; }
.tool:active { transform: translateY(1px); }
.tool-strong { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 650; }
.tool-strong:hover { background: #d6ff69; border-color: #d6ff69; }

.panel {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(980px, calc(100% - 24px));
  max-height: min(56vh, 420px);
  display: flex;
  flex-direction: column;
  z-index: 2;
  background: rgba(14, 16, 16, .9);
  backdrop-filter: blur(14px);
  border: 1px solid var(--stage-line);
  border-radius: 16px;
  color: #e9ede6;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--stage-line);
}
.panel-grip { width: 26px; height: 3px; border-radius: 2px; background: #4c5451; }
.panel-title { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #9aa49c; }
.panel-toggle {
  margin-left: auto;
  appearance: none;
  background: none;
  border: 1px solid var(--stage-line);
  color: #cbd3cb;
  font: 500 12px/1 var(--font);
  padding: 6px 10px;
  border-radius: 7px;
  cursor: pointer;
}
.panel-toggle:hover { border-color: #47504c; color: #fff; }

.panel-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: 10px 14px;
  padding: 10px 12px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.panel[data-collapsed="true"] .panel-body { display: none; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label, .field .label {
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #99a29a;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}
.field output { font-family: var(--mono); font-size: 12px; color: #e9ede6; letter-spacing: 0; text-transform: none; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  background: transparent;
  accent-color: var(--accent);
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px; background: #363d3a;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px; margin-top: -6px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #0b0f0d;
}
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: #363d3a; }
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border: 2px solid #0b0f0d; border-radius: 50%; background: var(--accent);
}

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  appearance: none;
  border: 1px solid var(--stage-line);
  background: #141817;
  color: #b9c2ba;
  font: 500 12px/1 var(--font);
  padding: 5px 8px;
  min-height: 28px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .13s ease, color .13s ease, border-color .13s ease;
}
.chip:hover { border-color: #4d5652; color: #fff; }
.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
}
.chip:disabled { opacity: .38; cursor: not-allowed; }

.field .check, .check {
  justify-content: flex-start;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  color: #cfd7cf;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  min-height: 30px;
}
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.status-stage { position: absolute; top: 14px; left: 16px; color: #7f8880; font-size: 12px; margin: 0; max-width: 40ch; }

@media (max-width: 640px) {
  .panel { max-height: 64vh; bottom: 8px; width: calc(100% - 16px); }
  .panel-body { grid-template-columns: 1fr 1fr; }
  .toolbar { top: 8px; right: 8px; gap: 6px; }
  .tool { padding: 9px 11px; font-size: 12px; }
  .status-stage { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
