@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap");

:root {
  --bg-0: #f2f7f5;
  --bg-1: #ffffff;
  --ink-0: #0f2f2a;
  --ink-1: #32534f;
  --ink-2: #5c7a76;
  --line: #d5e3e0;
  --accent-0: #f97316;
  --accent-1: #1b9aaa;
  --accent-2: #ffd7b5;
  --chip: #e7f4f2;
  --chip-active: #d5ebe7;
  --shadow: 0 16px 36px rgba(15, 47, 42, 0.08);
  --radius-lg: 18px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink-0);
  background:
    radial-gradient(circle at 12% -4%, rgba(27, 154, 170, 0.18), transparent 40%),
    radial-gradient(circle at 92% 2%, rgba(249, 115, 22, 0.18), transparent 30%),
    linear-gradient(180deg, #f7fcfb 0%, #eff6f3 100%);
}

.page-shell {
  width: min(1140px, calc(100% - 3rem));
  margin: 2.25rem auto 3rem;
}

.hero {
  background: linear-gradient(135deg, rgba(255, 215, 181, 0.86), rgba(214, 238, 236, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
  padding: 2rem 2.2rem;
  margin-bottom: 1.25rem;
  animation: rise-in 480ms ease both;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-2);
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.hero h1 {
  margin: 0;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: clamp(2.1rem, 5vw, 2.9rem);
  line-height: 1.06;
}

.hero-copy {
  margin: 0.75rem 0 0;
  max-width: 760px;
  color: var(--ink-1);
}

.controls {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 0.95rem;
  animation: rise-in 540ms ease both;
}

.control {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.8rem 0.9rem;
}

.control span {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--ink-2);
}

input,
select,
button {
  font: inherit;
  color: var(--ink-0);
}

input,
select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.68rem;
  outline: none;
  background: #fff;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input:focus,
select:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(27, 154, 170, 0.12);
}

.facet-panel {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  margin-bottom: 1rem;
  animation: rise-in 600ms ease both;
}

.facet-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.facet-header h2 {
  margin: 0;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: 1rem;
}

.results-meta {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.88rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.72rem;
}

.chip {
  background: var(--chip);
  border: 1px solid #d4e8e5;
  color: var(--ink-1);
  border-radius: 999px;
  padding: 0.38rem 0.72rem;
  cursor: pointer;
  transition: background 140ms ease, transform 140ms ease, border-color 140ms ease;
}

.chip:hover {
  transform: translateY(-1px);
  border-color: #bddbd6;
}

.chip.active {
  background: var(--chip-active);
  border-color: var(--accent-1);
  color: var(--ink-0);
}

.status-text {
  margin: 0 0 0.9rem;
  color: var(--ink-2);
}

.status-text.error {
  color: #9b2c2c;
}

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

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-1);
  padding: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
  min-height: 230px;
  box-shadow: 0 4px 18px rgba(15, 47, 42, 0.06);
  animation: rise-in 260ms ease both;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
}

.card h3 {
  margin: 0;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: 1.03rem;
  line-height: 1.24;
}

.card-author {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.84rem;
}

.star-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid #f4cfb1;
  background: #fff4e8;
  color: #9a4d10;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.58rem;
  height: fit-content;
}

.card-description {
  margin: 0;
  color: var(--ink-1);
  line-height: 1.46;
  font-size: 0.92rem;
}

.card-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.36rem;
}

.card-categories span {
  font-size: 0.76rem;
  border: 1px solid #d6e6e2;
  border-radius: 999px;
  background: #f7fcfb;
  color: #385a56;
  padding: 0.2rem 0.52rem;
}

.card-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.updated-at {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.78rem;
}

.links {
  display: inline-flex;
  gap: 0.4rem;
}

.links a {
  text-decoration: none;
  color: var(--accent-1);
  border: 1px solid rgba(27, 154, 170, 0.2);
  padding: 0.28rem 0.5rem;
  border-radius: 9px;
  font-size: 0.8rem;
  transition: background 120ms ease, border-color 120ms ease;
}

.links a:hover {
  background: rgba(27, 154, 170, 0.08);
  border-color: rgba(27, 154, 170, 0.5);
}

.load-more {
  margin: 1rem auto 0;
  min-width: 170px;
  display: block;
  border: 1px solid var(--accent-1);
  border-radius: 999px;
  background: #ebf7f9;
  color: #075f6a;
  font-weight: 600;
  padding: 0.62rem 0.95rem;
  cursor: pointer;
}

.load-more:hover {
  background: #def2f5;
}

.load-more:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

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

@media (max-width: 930px) {
  .page-shell {
    width: min(1140px, calc(100% - 1.5rem));
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 1.45rem;
  }
}
