/* Oz design system — tokens per docs/DESIGN.md */
:root {
  /* Palette · 01 Pegasus */
  --deep:      #07111C;
  --bg-1:      #0B1827;
  --bg-2:      #122336;
  --line:      #1C3146;
  --line-soft: #14253A;
  --ink:       #EEF3F9;
  --ink-2:     #C8D3E0;
  --mute:      #6B7D92;
  --mute-2:    #4A5A6E;

  --signal: #5DE5EC; /* ciano — marca, foco, decisão */
  --heat:   #FF2E7E; /* magenta — ênfase pontual */
  --soft:   #C77BDC; /* lavanda */

  --font-display: "DM Serif Display", "Times New Roman", serif;
  --font-sans:    "Outfit", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;

  --r-sm: 4px;
  --r-md: 6px;
  --r-full: 9999px;

  --border:      1px solid var(--line);
  --border-soft: 1px solid var(--line-soft);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--deep);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 500;
}

/* ── header / brandmark ────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  border-bottom: var(--border);
}
.brand { display: flex; flex-direction: column; gap: 5px; }
.brandmark {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}
.brandmark .mid {
  margin: 0 0.28em;
  font-weight: 400;
  /* nudge the middle dot to optical center of the cap height */
  vertical-align: 0.04em;
}
.brandmark .mid-1 { color: var(--signal); }
.brandmark .mid-2 { color: var(--heat); }
.brandmark .mid-3 { color: var(--soft); }
.version {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--mute-2);
}

/* ── buttons ───────────────────────────────────────────── */
button {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg-2);
  border: var(--border);
  border-radius: var(--r-md);
  padding: 6px 12px;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
button:hover { border-color: var(--signal); }
button:focus-visible { outline: 2px solid var(--signal); outline-offset: 1px; }
button:disabled { opacity: .4; cursor: not-allowed; border-color: var(--line); }
button.ghost { background: transparent; color: var(--ink-2); }

/* ── layout ────────────────────────────────────────────── */
main {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  align-items: start;
}
@media (max-width: 900px) { main { grid-template-columns: 1fr; padding: var(--space-3); } }

/* ── upload ────────────────────────────────────────────── */
.upload { margin-bottom: var(--space-3); }
.drop {
  display: block;
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  padding: var(--space-4);
  text-align: center;
  color: var(--mute);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color .12s ease, color .12s ease, background .12s ease;
}
.drop:hover, .drop.dragging { border-color: var(--signal); color: var(--ink-2); }
.drop.dragging { background: rgba(93, 229, 236, .06); }
.drop input { display: none; }
.htmx-indicator { color: var(--signal); margin-left: var(--space-1); opacity: 0; font-family: var(--font-mono); font-size: 12px; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* ── grid ──────────────────────────────────────────────── */
.grid-controls {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-3);
}
.grid-controls > span { font-family: var(--font-mono); font-size: 12px; color: var(--mute); letter-spacing: 0.03em; }
.grid-controls .btns { display: flex; gap: var(--space-1); }
.empty {
  color: var(--mute); padding: var(--space-6) 0; text-align: center;
  font-family: var(--font-mono); font-size: 13px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-2);
}
.card {
  background: var(--bg-1);
  border: var(--border);
  border-radius: var(--r-sm);
  padding: var(--space-1);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.card img {
  width: 100%;
  aspect-ratio: 63 / 88;
  object-fit: cover;
  border-radius: var(--r-sm);
  background: var(--deep);
}
.card-name {
  font-size: 11px;
  color: var(--mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.counter { display: flex; align-items: center; gap: 4px; }
.counter button { padding: 4px 9px; }
.counter input {
  width: 100%;
  text-align: center;
  background: var(--deep);
  border: var(--border);
  color: var(--ink);
  border-radius: var(--r-md);
  padding: 5px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.counter input:focus-visible { outline: none; border-color: var(--signal); }
.counter .del { margin-left: auto; color: var(--mute); }
.counter .del:hover { border-color: var(--heat); color: var(--heat); }

/* ── sidebar ───────────────────────────────────────────── */
.right {
  position: sticky;
  top: var(--space-3);
  background: var(--bg-1);
  border: var(--border);
  border-radius: var(--r-md);
  padding: var(--space-3);
}
.preview-wrap {
  background: var(--deep);
  border: var(--border-soft);
  border-radius: var(--r-sm);
  padding: var(--space-1);
  margin-bottom: var(--space-3);
}
#preview { width: 100%; display: block; border-radius: 2px; }

.options { display: flex; flex-direction: column; gap: var(--space-2); }
.options h2 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 500;
  margin: 0;
}
.options label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-2); }
.options label.check { flex-direction: row; align-items: center; gap: var(--space-1); }
.options select, .options input[type=text] {
  background: var(--deep);
  border: var(--border);
  color: var(--ink);
  border-radius: var(--r-md);
  padding: 7px 9px;
  font-family: var(--font-sans);
  font-size: 14px;
}
.options select:focus-visible, .options input[type=text]:focus-visible {
  outline: none; border-color: var(--signal);
}
.options input[type=checkbox] { accent-color: var(--signal); width: 16px; height: 16px; }
.options .colors { display: flex; gap: var(--space-2); }
.options .colors label { flex: 1; }
.options input[type=color] {
  width: 100%; height: 34px; padding: 2px;
  background: var(--deep); border: var(--border); border-radius: var(--r-md);
}

.generate { margin-top: var(--space-3); }
.generate button {
  width: 100%;
  background: var(--signal);
  color: var(--deep);
  border: 1px solid var(--signal);
  padding: 11px;
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--r-md);
}
.generate button:hover:not(:disabled) { background: var(--soft); border-color: var(--soft); }
.generate button:disabled { background: var(--bg-2); color: var(--mute); border-color: var(--line); }
