:root {
  --bg-1: #fff7fb;
  --bg-2: #edf5ff;
  --card: rgba(255, 255, 255, 0.82);
  --card-solid: #ffffff;
  --text: #403243;
  --muted: #7d687f;
  --accent: #d98fbd;
  --accent-2: #9ec9ee;
  --accent-dark: #a85d91;
  --border: rgba(168, 93, 145, 0.22);
  --shadow: 0 18px 45px rgba(99, 74, 102, 0.16);
  --radius: 28px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 205, 232, 0.9), transparent 28%),
    radial-gradient(circle at 85% 0%, rgba(188, 222, 255, 0.9), transparent 32%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2));
}

.site-header {
  padding: 42px 18px 20px;
}

.header-card,
.controls-card,
.results-header,
.empty-state {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.header-card {
  text-align: center;
  padding: 34px 22px;
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--accent-dark);
  font-weight: 700;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 1;
}

.subtitle {
  margin: 0 auto;
  max-width: 620px;
  color: var(--muted);
  font-size: 1.05rem;
}

.page-shell {
  padding: 12px 0 60px;
}

.controls-card {
  padding: 20px;
  display: grid;
  gap: 18px;
}

.status-tabs,
.folder-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.status-tab,
.folder-filter,
.soft-button {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.72);
  color: var(--text);
  border-radius: 999px;
  padding: 11px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.status-tab:hover,
.folder-filter:hover,
.soft-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(99, 74, 102, 0.12);
}

.status-tab.active,
.folder-filter.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  border-color: transparent;
}

.search-row {
  display: grid;
  gap: 8px;
  max-width: 620px;
  width: 100%;
  margin: 0 auto;
}

.search-row label {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#searchInput {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 16px;
  font: inherit;
  background: rgba(255,255,255,0.88);
  color: var(--text);
  outline: none;
}

#searchInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(217, 143, 189, 0.18);
}

.results-header {
  margin-top: 18px;
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.results-header h2 { margin-bottom: 4px; }
.results-header p { margin: 0; color: var(--muted); }

.card-grid {
  width: min(1120px, calc(100% - 28px));
  margin: 18px auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.orphan-card {
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(99, 74, 102, 0.13);
  transition: transform .18s ease, box-shadow .18s ease;
}

.orphan-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 42px rgba(99, 74, 102, 0.18);
}

.orphan-image-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, rgba(217,143,189,.22), rgba(158,201,238,.22));
  overflow: hidden;
}

.orphan-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.status-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 7px 11px;
  border-radius: 999px;
  color: white;
  font-size: 0.78rem;
  font-weight: 900;
  background: var(--accent-dark);
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

.status-badge.adopted { background: #7c8aa3; }

.orphan-info {
  padding: 16px;
}

.orphan-info h3 {
  margin-bottom: 10px;
  font-size: 1.22rem;
}

.fact {
  margin: 6px 0;
  color: var(--muted);
}

.fact strong {
  color: var(--text);
}

.folder-pill {
  display: inline-block;
  margin-top: 10px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(217, 143, 189, 0.14);
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
}

.empty-state {
  margin-top: 18px;
  text-align: center;
  padding: 36px 18px;
}

.empty-state p { color: var(--muted); margin-bottom: 0; }

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(38, 28, 40, 0.82);
  z-index: 1000;
  padding: 24px;
}

.lightbox.active { display: flex; }

.lightbox img {
  max-width: min(100%, 1100px);
  max-height: 88vh;
  border-radius: 24px;
  box-shadow: 0 28px 70px rgba(0,0,0,0.35);
  background: white;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 999px;
  background: white;
  color: var(--text);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.loading-card {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}

@media (max-width: 640px) {
  .results-header {
    align-items: stretch;
    flex-direction: column;
  }

  .soft-button { width: 100%; }
}
