/* Launchpad — brand-token styling (see ~/.claude/brand/nicholas-brand-design.md) */

:root {
  color-scheme: light;
  --brand-black: #000000;
  --brand-white: #ffffff;
  --brand-blue: #0174c8;
  --brand-blue-light: #2fa8f2;
  --brand-gold: #bd934f;
  --brand-gold-light: #f1d69b;
  --brand-gold-mid: #d5b273;
  --brand-gold-deep: #ad843e;
  --brand-gold-ink: #946a1f;
  --ink: #0a0a0a;
  --charcoal: #111111;
  --graphite: #242424;
  --mist: #f7f8fa;
  --line: #e6e8eb;
  --muted: #5c626a;
  --radius-sm: 4px;
  --radius-md: 8px;
  --shadow-soft: 0 16px 40px rgb(0 0 0 / 0.10);
  --shadow-blue: 0 12px 30px rgb(1 116 200 / 0.24);
  --gradient-gold: linear-gradient(135deg, #ad843e 0%, #bd934f 24%, #f1d69b 52%, #d5b273 76%, #ad843e 100%);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--mist);
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }
main.wrap { flex: 1; padding-bottom: 56px; }

/* ---------- header ---------- */
.site-header { background: var(--brand-white); border-bottom: 1px solid var(--line); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 18px 0; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.wordmark { font-weight: 800; letter-spacing: 0.12em; font-size: 17px; }
.wordmark-thin { font-weight: 400; color: var(--muted); }
.brand-divider { width: 1px; height: 26px; background: var(--gradient-gold); }
.brand-sub { font-size: 15px; color: var(--brand-gold-ink); font-weight: 600; letter-spacing: 0.04em; }
.header-tools { display: flex; align-items: center; gap: 12px; }
.search {
  width: 260px; max-width: 60vw; padding: 9px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  font-size: 14px; background: var(--mist);
}
.search:focus { outline: 2px solid var(--brand-blue); outline-offset: -1px; background: var(--brand-white); }
.admin-chip {
  font-size: 12px; font-weight: 600; color: var(--brand-gold-ink);
  border: 1px solid var(--brand-gold-mid); border-radius: 999px; padding: 4px 10px;
  background: #fdf9f1; white-space: nowrap;
}

/* ---------- add bar ---------- */
.add-bar {
  display: flex; gap: 10px; margin-top: 24px; padding: 14px;
  background: var(--brand-white); border: 1px solid var(--line);
  border-radius: var(--radius-md); box-shadow: 0 2px 10px rgb(0 0 0 / 0.04);
}
.add-bar input {
  flex: 1; padding: 10px 14px; font-size: 15px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
}
.add-bar input:focus { outline: 2px solid var(--brand-blue); outline-offset: -1px; }

/* ---------- buttons ---------- */
.btn {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  padding: 10px 18px; border-radius: var(--radius-md); white-space: nowrap;
}
.btn-primary { background: var(--brand-blue); color: var(--brand-white); border: 1px solid var(--brand-blue); box-shadow: var(--shadow-blue); }
.btn-primary:hover { background: #006bb8; border-color: #006bb8; }
.btn-primary:disabled { opacity: 0.55; cursor: default; box-shadow: none; }
.btn-secondary { background: var(--brand-white); color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover { border-color: var(--muted); }
.btn-danger { background: #c0392b; color: #fff; border: 1px solid #c0392b; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.link-btn { background: none; border: none; padding: 0; color: var(--brand-blue); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 6px; align-items: center; }
.chip {
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  padding: 7px 14px; border-radius: 999px;
  background: var(--brand-white); color: var(--ink); border: 1px solid var(--line);
}
.chip:hover { border-color: var(--brand-blue); color: var(--brand-blue); }
.chip.active { background: var(--brand-blue); border-color: var(--brand-blue); color: var(--brand-white); }
.chip .count { font-weight: 400; opacity: 0.75; margin-left: 4px; }
.chip-gear { border-style: dashed; color: var(--muted); }

/* ---------- grid + cards ---------- */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 22px; margin-top: 20px;
}
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--brand-white); border: 1px solid var(--line);
  border-radius: var(--radius-md); overflow: hidden; cursor: pointer;
  transition: box-shadow .15s ease, transform .15s ease;
}
.card::before { content: ""; display: block; height: 3px; background: var(--gradient-gold); }
.card:hover { box-shadow: var(--shadow-soft); transform: translateY(-2px); }
.card-thumb { aspect-ratio: 16 / 10; background: var(--mist); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-letter {
  font-size: 44px; font-weight: 800; color: var(--brand-gold-mid);
  background: linear-gradient(135deg, #fdfaf4, #f4ecdd);
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
}
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-size: 15.5px; font-weight: 700; line-height: 1.3; }
.card-summary { font-size: 13.5px; color: var(--muted); line-height: 1.45; flex: 1; }
.card-badge {
  align-self: flex-start; font-size: 11.5px; font-weight: 600;
  color: var(--brand-gold-ink); background: #faf5ea; border: 1px solid #eadfc6;
  border-radius: 999px; padding: 3px 9px; margin-top: 4px;
}
.card-admin { position: absolute; top: 9px; right: 8px; display: flex; gap: 6px; z-index: 2; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--line);
  background: rgb(255 255 255 / 0.92); cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { border-color: var(--brand-blue); color: var(--brand-blue); }
.empty { text-align: center; color: var(--muted); padding: 70px 0; font-size: 15px; }

/* ---------- category sections (All view) ---------- */
.grid.grouped { display: block; }
.cat-section { margin-top: 36px; }
.grid.grouped .cat-section:first-child { margin-top: 22px; }
.cat-heading {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--brand-gold-ink);
}
.cat-heading::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.cat-count { font-weight: 600; font-size: 12px; color: var(--muted); }
.cat-section .grid { margin-top: 16px; }

/* ---------- footer ---------- */
.site-footer { background: var(--brand-black); color: var(--brand-white); margin-top: 40px; }
.footer-inner { display: flex; align-items: center; gap: 18px; padding: 26px 0; flex-wrap: wrap; }
.footer-logo { height: 44px; width: auto; background: var(--brand-white); border-radius: 6px; padding: 4px 10px; }
.footer-text { font-size: 13.5px; line-height: 1.5; }
.footer-muted { color: #c7ccd1; font-size: 12.5px; }
.footer-actions { margin-left: auto; display: flex; gap: 16px; }
.footer-link {
  background: none; border: none; cursor: pointer; font: inherit;
  font-size: 13px; color: var(--brand-blue-light); padding: 0;
}
.footer-link:hover { text-decoration: underline; }

/* ---------- modals ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgb(10 10 10 / 0.45);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal {
  background: var(--brand-white); border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft); padding: 26px; width: min(680px, 100%);
  max-height: 90vh; overflow: auto;
}
.modal-sm { width: min(430px, 100%); }
.modal h2 { margin: 0 0 14px; font-size: 19px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.panel-grid { display: grid; grid-template-columns: 220px 1fr; gap: 20px; }
@media (max-width: 620px) { .panel-grid { grid-template-columns: 1fr; } }
.thumb-preview {
  aspect-ratio: 16 / 10; border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--mist); display: flex; align-items: center; justify-content: center;
}
.thumb-preview img { width: 100%; height: 100%; object-fit: cover; }
.thumb-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.upload-label { text-align: center; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; font-size: 13px; font-weight: 600; }
.field em { font-weight: 400; color: var(--muted); font-style: normal; }
.field input, .field textarea {
  font: inherit; font-weight: 400; font-size: 14px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); resize: vertical;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--brand-blue); outline-offset: -1px; }
.field-note { font-size: 12.5px; color: var(--muted); font-weight: 400; margin: 6px 0 10px; }

.cat-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.cat-chips .chip { font-size: 12.5px; padding: 6px 12px; }
.chip-new input {
  border: none; background: transparent; font: inherit; font-size: 12.5px; width: 110px; outline: none;
}

.dupe-warning {
  margin-top: 14px; padding: 10px 14px; font-size: 13.5px;
  background: #fdf6ec; border: 1px solid var(--brand-gold-mid); border-radius: var(--radius-sm);
  color: var(--brand-gold-ink);
}

.cat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cat-list li {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--mist);
}
.cat-list input { flex: 1; font: inherit; font-size: 14px; border: none; background: transparent; outline: none; }
.cat-list input:focus { background: var(--brand-white); }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast {
  background: var(--charcoal); color: var(--brand-white); font-size: 14px;
  padding: 12px 18px; border-radius: var(--radius-md); box-shadow: var(--shadow-soft);
  display: flex; align-items: center; gap: 14px;
}
.toast button {
  background: none; border: none; color: var(--brand-gold-light); font: inherit;
  font-weight: 700; cursor: pointer; padding: 0;
}

[hidden] { display: none !important; }
