:root {
  --bg0: #0c1210;
  --bg1: #14201a;
  --ink: #e8f0ea;
  --muted: #9bb0a2;
  --accent: #3dd68c;
  --accent-dim: #1f8f5a;
  --line: rgba(232, 240, 234, 0.12);
  --danger: #ff7b72;
  --font-display: "Syne", sans-serif;
  --font-body: "DM Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg0);
  line-height: 1.5;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(61, 214, 140, 0.18), transparent 60%),
    radial-gradient(700px 420px at 90% 10%, rgba(40, 120, 90, 0.22), transparent 55%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 45%, #0a0f0d);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift {
  from { filter: hue-rotate(0deg) saturate(1); }
  to { filter: hue-rotate(12deg) saturate(1.1); }
}

.site-header {
  padding: 2.5rem clamp(1.25rem, 4vw, 3rem) 1rem;
  max-width: 960px;
  margin: 0 auto;
  animation: rise 0.7s ease both;
}
.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.03em;
}
.brand span { color: var(--accent); }
.tagline {
  margin: 0.4rem 0 0;
  color: var(--muted);
  max-width: 36rem;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem) 3rem;
  display: grid;
  gap: 1.75rem;
}

.panel {
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
  animation: rise 0.8s ease both;
}
.panel:nth-child(2) { animation-delay: 0.08s; }
.panel:nth-child(3) { animation-delay: 0.16s; }

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

h1, h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}
h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
h2 { font-size: 1.25rem; }
.lede { margin: 0 0 1rem; color: var(--muted); }

.search-form, .seed-form {
  display: grid;
  gap: 0.75rem;
}
input[type="search"],
input[type="text"],
input[type="number"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px rgba(61, 214, 140, 0.15);
}
.filters, .seed-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}
.filters label, .seed-form label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.filters input, .seed-form input[type="number"] { width: 7rem; }
.seed-form input[type="text"] { flex: 1 1 220px; }

button {
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 10px;
  padding: 0.85rem 1.25rem;
  background: var(--accent);
  color: #062216;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
button:hover { background: #62e3a5; transform: translateY(-1px); }
button:active { transform: none; }
button:disabled { opacity: 0.55; cursor: wait; }

.meta { color: var(--muted); font-size: 0.9rem; }
.results {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.results li {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 0.2rem;
  animation: rise 0.35s ease both;
}
.results a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.results .title { font-size: 1.05rem; }
.results .about {
  color: var(--muted);
  font-size: 0.92rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.results .subs { font-variant-numeric: tabular-nums; color: var(--ink); }
.empty, .error { margin-top: 1rem; }
.error { color: var(--danger); }

.seed-out {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  overflow: auto;
  font-size: 0.85rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 0;
}
.stats div {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.stats dt { color: var(--muted); font-size: 0.85rem; }
.stats dd {
  margin: 0.2rem 0 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
}

footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem clamp(1.25rem, 4vw, 3rem) 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 640px) {
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .filters button { grid-column: 1 / -1; }
}
