/* ===========================================================
   ShipKaro · Shipped Wall
   Brand tokens straight from the challenge brief
   =========================================================== */
:root {
  --purple: #9b6dff;
  --paper: #ffffff;
  --bg: #faf8f4;
  --ink: #0e0b14;
  --muted: #6b6677;
  --rule: #e8e5ee;
  --soft-purple: #f5f0ff;

  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;

  --shadow-rest: 0 1px 2px rgba(14, 11, 20, 0.04);
  --shadow-lift: 0 14px 32px rgba(155, 109, 255, 0.16);

  --font-head: "Instrument Serif", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 10;
}
.skip-link:focus { left: 0; }

/* ---------------- Hero ---------------- */
.hero {
  padding: 64px 0 28px;
  background:
    radial-gradient(120% 120% at 100% 0%, var(--soft-purple) 0%, rgba(245, 240, 255, 0) 55%),
    var(--bg);
  border-bottom: 1px solid var(--rule);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--purple);
  margin: 0 0 12px;
}

.hero h1 {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: clamp(44px, 8vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}

.lede {
  font-size: clamp(16px, 2.2vw, 19px);
  color: var(--muted);
  max-width: 56ch;
  margin: 0;
}
.count-inline { color: var(--ink); font-weight: 600; }
.count-inline #liveCount { color: var(--purple); }

/* ---------------- Toolbar ---------------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  margin: 32px 0 18px;
}

.search {
  position: relative;
  flex: 1 1 320px;
  min-width: 0;
}
.search-ico {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 52px;
  padding: 0 18px 0 46px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--paper);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  box-shadow: var(--shadow-rest);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.search input::placeholder { color: var(--muted); }
.search input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(155, 109, 255, 0.15);
}

.controls { display: flex; gap: 12px; flex-wrap: wrap; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 4px;
}
.field select {
  height: 52px;
  padding: 0 38px 0 16px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--paper)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B6677' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 14px center;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: var(--shadow-rest);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.field select:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(155, 109, 255, 0.15);
}

/* ---------------- Type pills ---------------- */
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.pill {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.16s ease;
}
.pill:hover { border-color: var(--purple); color: var(--ink); }
.pill[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.pill .pill-n { opacity: 0.55; margin-left: 6px; }

.result-line {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 18px;
}
.result-line strong { color: var(--ink); }

/* ---------------- Grid ---------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding-bottom: 56px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-rest);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  animation: rise 0.4s ease both;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-color: rgba(155, 109, 255, 0.5);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.avatar {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  font-size: 24px;
  line-height: 1;
  color: #fff;
  user-select: none;
}

.card-titles { min-width: 0; }
.card-name {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  display: inline-block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--soft-purple);
  color: var(--purple);
}

.card-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}

.builder {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 12.5px;
  color: var(--muted);
}
.builder svg { flex: 0 0 auto; opacity: 0.7; }
.builder span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--purple);
  text-decoration: none;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--soft-purple);
  transition: background 0.16s ease, transform 0.16s ease;
}
.card-link:hover { background: #ebe1ff; transform: translateX(1px); }
.card-link svg { transition: transform 0.16s ease; }
.card-link:hover svg { transform: translate(1px, -1px); }

.no-link {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  opacity: 0.6;
}

/* ---------------- Empty state ---------------- */
.empty {
  text-align: center;
  padding: 60px 20px 80px;
}
.empty-title { font-size: 18px; color: var(--ink); margin: 0 0 16px; }
.clear-btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--purple);
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 22px;
  cursor: pointer;
  transition: filter 0.16s ease, transform 0.16s ease;
}
.clear-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }

/* ---------------- Footer ---------------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 32px 0 48px;
  background: var(--paper);
}
.site-footer p { margin: 0 0 6px; font-size: 14px; color: var(--ink); }
.site-footer .mono { font-family: var(--font-mono); color: var(--purple); font-size: 13px; }
.muted-foot { color: var(--muted); font-size: 13px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 600px) {
  .hero { padding: 44px 0 24px; }
  .toolbar { align-items: stretch; }
  .controls { width: 100%; }
  .field { flex: 1 1 0; }
  .field select { width: 100%; }
  .grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
}
