:root {
  --bg: #0b1220;
  --surface: #121a2b;
  --surface-2: #1a2438;
  --text: #e8eef9;
  --muted: #9aabc8;
  --accent: #3dff9a;
  --accent-dim: #1f9a5c;
  --warn: #ffc857;
  --danger: #ff6b6b;
  --border: #2a3854;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 600px at 10% -10%, #16304f 0%, transparent 55%),
    radial-gradient(900px 500px at 90% 0%, #0f3d2e 0%, transparent 45%), var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
}

header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 0;
  gap: 1rem;
}

.logo {
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.logo span {
  color: var(--accent);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  justify-content: flex-end;
}

nav a {
  color: var(--muted);
  margin-left: 0;
  font-size: 0.9rem;
}

code {
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}

nav a:hover {
  color: var(--text);
}

.hero {
  padding: 2.5rem 0 1.5rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
}

.hero p {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0 auto 1.5rem;
  max-width: 38rem;
}

.search-box {
  display: flex;
  gap: 0.6rem;
  max-width: 640px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.4rem 0.4rem 1.1rem;
  box-shadow: var(--shadow);
}

.search-box input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 1.05rem;
  min-width: 0;
}

.search-box button,
.btn {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #2bcf7e);
  color: #042015;
  font-weight: 700;
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  font-size: 0.95rem;
}

.btn.secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn:hover {
  filter: brightness(1.05);
}

.section {
  padding: 2rem 0 3rem;
}

.section h2 {
  margin: 0 0 1rem;
  font-size: 1.35rem;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.card .meta {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 0.7rem;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #163528;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.badge.paid {
  background: #3a2d12;
  color: var(--warn);
}

.price {
  font-weight: 700;
  font-size: 1.15rem;
}

.price small {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.8rem;
}

.savings {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

.alt-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.alt-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.alt-row .rank {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 0.2rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.chip {
  font-size: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  color: var(--muted);
}

.form {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.form input,
.form select,
.form textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 0.7rem 0.8rem;
  font: inherit;
}

.form textarea {
  min-height: 110px;
  resize: vertical;
}

footer.site {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

footer.site .foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

footer.site a {
  color: var(--muted);
}

#search-results:empty {
  display: none;
}

#search-results {
  max-width: 640px;
  margin: 1rem auto 0;
  text-align: left;
}

.legal {
  max-width: 720px;
  color: var(--muted);
}

.legal h1 {
  color: var(--text);
}

.muted {
  color: var(--muted);
}

@media (max-width: 640px) {
  nav a {
    margin-left: 0.65rem;
  }
  .alt-row {
    grid-template-columns: 1fr;
  }
}
