/* ---------------------------------------------------------------------
   ansify demo: calm, bright pastel theme. Minimal, functional UI.
   Soft warm-white surfaces, a periwinkle accent, gentle pastel fills.
--------------------------------------------------------------------- */

:root {
  --bg: #f9f7f4;
  --surface: #ffffff;
  --surface-soft: #f4f2fb;
  --border: #e8e4ee;
  --border-strong: #d8d2e4;

  --text: #3a3745;
  --muted: #8b8797;
  --faint: #b4b0bd;

  --accent: #7b74d4;        /* periwinkle */
  --accent-hover: #6a63c9;
  --accent-soft: #eeecfb;

  --ok: #3f9e6a;
  --err: #d76a63;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", "Fira Code",
    Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

code {
  font-family: var(--mono);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.4em;
  color: var(--accent-hover);
  font-size: 0.88em;
  word-break: break-word;
}

/* ---------------------------- header ---------------------------- */

.site-head {
  padding: 64px 0 36px;
  text-align: center;
}

.wordmark {
  margin: 0;
  font-size: clamp(38px, 8vw, 60px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.tagline {
  max-width: 500px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.repo-link {
  margin: 16px 0 0;
  font-size: 14px;
}

/* ---------------------------- layout ---------------------------- */

main.wrap { padding-top: 8px; }

.stack {
  display: grid;
  /* minmax(0, 1fr) keeps the column from growing to fit wide output;
     the art scrolls inside the screen instead of stretching the cards. */
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 1px 2px rgba(58, 55, 69, 0.04);
}

.card-label {
  margin: 0 0 16px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.card-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.card-label-row .card-label { margin: 0; }

.out-stats {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------ dropzone ------------------------------ */

.dropzone {
  padding: 10px;
  display: block;
  position: relative;
  height: 260px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  overflow: hidden;
  background: var(--surface-soft);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dz-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  gap: 4px;
  padding: 0 16px;
}

.dz-glyph {
  margin: 0 0 8px;
  font-size: 28px;
}

.dz-main {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.dz-hint {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--faint);
}

.dz-preview {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--surface-soft);
}

/* Once an image is chosen, swap the empty prompt for its preview. */
.dropzone.has-image .dz-empty { display: none; }
.dropzone.has-image .dz-preview { display: block; }

/* ------------------------------ controls ------------------------------ */

.field { margin-top: 20px; }

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 14px;
}

.field-row label {
  color: var(--text);
  font-weight: 500;
}

.field-value { color: var(--muted); font-size: 13px; }
#width-out {
  color: var(--accent-hover);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 3px solid var(--surface);
  box-shadow: 0 1px 3px rgba(58, 55, 69, 0.25);
}
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 3px solid var(--surface);
  box-shadow: 0 1px 3px rgba(58, 55, 69, 0.25);
}
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
}
.btn:not(:disabled):active { transform: translateY(1px); }
.btn:disabled { cursor: not-allowed; opacity: 0.5; }

.btn-primary {
  margin-top: 20px;
  width: 100%;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  padding: 13px 18px;
}
.btn-primary:not(:disabled):hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-ghost:not(:disabled):hover {
  border-color: var(--accent);
  color: var(--accent-hover);
  background: var(--accent-soft);
}

.status-line {
  margin: 14px 0 0;
  font-size: 13px;
  min-height: 18px;
  color: var(--muted);
}
.status-line.is-error { color: var(--err); }
.status-line.is-ok { color: var(--ok); }

/* ------------------------------ screen ------------------------------ */

.screen {
  position: relative;
  height: 300px;
  max-width: 100%;
  overflow: auto;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.screen-empty {
  margin: 0;
  color: var(--faint);
  font-size: 14px;
}

.ansi-art {
  margin: 0;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 8px;
  white-space: pre;
}

.out-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.out-actions .btn { flex: 1 1 140px; }

/* ------------------------------ how it works ------------------------------ */

.how {
  margin: 56px auto 0;
}

.section-label {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 16px;
}

.how ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.how li {
  display: flex;
  gap: 14px;
  align-items: baseline;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.how .idx {
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-weight: 700;
  font-size: 12px;
  align-self: flex-start;
}

/* ------------------------------ footer ------------------------------ */

.site-foot {
  margin-top: 64px;
  padding: 28px 0 56px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.site-foot p {
  margin: 0;
  font-size: 13px;
  color: var(--faint);
}
