:root {
  --walnut: #3e2f24;
  --walnut-dark: #2a1f18;
  --cream: #faf6f0;
  --cream-2: #f2eade;
  --brass: #c9a35c;
  --brass-dark: #a9803c;
  --forest: #2f5d3a;
  --forest-dark: #234a2c;
  --ink: #2e2620;
  --muted: #7a6f63;
  --line: #e4d9c9;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(46,38,32,0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
}

h1, h2, h3 {
  font-family: 'Bitter', Georgia, serif;
  color: var(--walnut-dark);
  margin: 0 0 0.5rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--walnut);
  color: var(--cream);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-mark {
  width: 40px; height: 40px;
  border: 2px solid var(--brass);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bitter', serif;
  font-weight: 700;
  color: var(--brass);
}
.brand-name { font-family: 'Bitter', serif; font-weight: 700; font-size: 1.05rem; }
.brand-sub { font-size: 0.8rem; color: #cfc2b0; }

.site-header .btn-ghost {
  background: transparent;
  color: var(--cream);
  border: 1px solid #6b5847;
}
.site-header .btn-ghost:hover { background: rgba(255,255,255,0.08); }

main { max-width: 1100px; margin: 0 auto; padding: 2rem 1.25rem 6rem; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.intro-card { max-width: 560px; margin: 3rem auto; text-align: left; }
.lead { color: var(--muted); line-height: 1.5; }
.field-label { display: block; font-weight: 600; margin-top: 1.25rem; margin-bottom: 0.35rem; }

input[type="text"] {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}

.btn {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.2rem;
  cursor: pointer;
  font-size: 0.95rem;
}
.btn-primary { background: var(--forest); color: #fff; }
.btn-primary:hover { background: var(--forest-dark); }
.btn-primary:disabled { background: #b9c4ba; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--walnut); border: 1px solid var(--line); }
.btn-ghost:hover { background: #f2ecdf; }

#start-btn { margin-top: 1.25rem; }
.hint { font-size: 0.82rem; color: var(--muted); margin-top: 0.75rem; }

.browse-toolbar {
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.muted { color: var(--muted); margin: 0.15rem 0 0; }
.toolbar-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.toggle { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; cursor: pointer; }

.filter-bar {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.filter-chip {
  border: 1px solid var(--line); background: #fff; color: var(--walnut);
  border-radius: 999px; padding: 0.4rem 0.9rem;
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.filter-chip:hover { background: #f2ecdf; }
.filter-chip.active { background: var(--walnut); color: #fff; border-color: var(--walnut); }
.filter-chip.divider { border: none; background: none; width: 1px; padding: 0; cursor: default; }

.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.model-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: opacity 0.2s;
}
.model-card.passed { opacity: 0.45; }

.model-img-wrap { position: relative; aspect-ratio: 1/1; background: #eee5d5; }
.model-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }

.zoom-hint {
  position: absolute; bottom: 0.6rem; right: 0.6rem;
  background: var(--cream); color: var(--walnut);
  width: 26px; height: 26px; border-radius: 6px;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(46,38,32,0.18);
}

.source-link {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.78rem; font-weight: 600; color: var(--forest-dark);
  text-decoration: none; width: fit-content;
}
.source-link:hover { text-decoration: underline; }
.source-link svg { flex-shrink: 0; }

.lightbox {
  position: fixed; inset: 0; background: rgba(20,16,12,0.92);
  z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 2rem; touch-action: pinch-zoom;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; border-radius: 4px;
}
.lightbox-close {
  position: absolute; top: 1rem; right: 1.25rem;
  background: rgba(255,255,255,0.12); color: #fff; border: none;
  width: 40px; height: 40px; border-radius: 50%;
  font-size: 1.1rem; cursor: pointer;
}
.lightbox-close:hover { background: rgba(255,255,255,0.22); }
.rec-badge {
  position: absolute; top: 0.5rem; left: 0.5rem;
  background: var(--brass); color: var(--walnut-dark);
  font-size: 0.7rem; font-weight: 700; padding: 3px 8px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.approx-note {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(46,38,32,0.75); color: #fff;
  font-size: 0.72rem; padding: 4px 8px;
}

.model-body { padding: 0.9rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.model-name { font-family: 'Bitter', serif; font-weight: 700; font-size: 1.05rem; }
.model-cat { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.decision-row { display: flex; gap: 0.5rem; }
.decision-row .btn { flex: 1; padding: 0.5rem; font-size: 0.85rem; }
.btn-like { background: var(--forest); color: #fff; }
.btn-like.active { background: var(--forest-dark); box-shadow: inset 0 0 0 2px var(--brass); }
.btn-pass { background: #efe6d8; color: var(--walnut); }
.btn-pass.active { background: #d8c9ac; }

.swatch-panel { border-top: 1px dashed var(--line); padding-top: 0.6rem; display: flex; flex-direction: column; gap: 0.5rem; }
.swatch-group-label { font-size: 0.75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.swatch-options { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.swatch-chip {
  border: 1px solid var(--line); background: #fff;
  border-radius: 6px; padding: 0.3rem 0.6rem;
  font-size: 0.8rem; cursor: pointer;
}
.swatch-chip.selected { background: var(--walnut); color: #fff; border-color: var(--walnut); }
.swatch-chip:disabled { opacity: 0.35; cursor: not-allowed; text-decoration: line-through; }

.liked-combo-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.liked-combo-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: #eaf1ec; color: var(--forest-dark);
  border: 1px solid #cfe0d3; border-radius: 999px;
  padding: 0.2rem 0.4rem 0.2rem 0.7rem;
  font-size: 0.78rem; font-weight: 600;
}
.liked-combo-remove {
  background: none; border: none; color: var(--forest-dark);
  cursor: pointer; font-size: 0.75rem; padding: 0.15rem 0.4rem;
  border-radius: 50%;
}
.liked-combo-remove:hover { background: rgba(47,93,58,0.15); }

.shortlist-actions { display: flex; justify-content: space-between; margin-top: 1.5rem; }

.final-pick-radio {
  position: absolute; top: 0.5rem; right: 0.5rem;
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff; border: 2px solid var(--brass);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.9rem; color: transparent;
}
.final-pick-radio.selected { background: var(--forest); color: #fff; border-color: var(--forest); }

.modal {
  position: fixed; inset: 0; background: rgba(46,38,32,0.55);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal[hidden] { display: none; }
.modal-card {
  background: #fff; border-radius: var(--radius); padding: 1.75rem;
  max-width: 420px; width: 90%; box-shadow: var(--shadow);
}
.resume-link-row { display: flex; gap: 0.5rem; margin: 1rem 0; }
.resume-link-row input { flex: 1; }

@media (max-width: 640px) {
  main { padding: 1.25rem 0.9rem 6rem; }
  .browse-toolbar { flex-direction: column; align-items: flex-start; }
}
