:root {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #22c55e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: linear-gradient(120deg, #0f172a, #1d4ed8);
  color: var(--text);
  min-height: 100vh;
}

.hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: 2.2rem;
}

.hero p {
  margin: 0;
  color: var(--muted);
}

.menu-home-link {
  display: inline-block;
  margin-top: 0.8rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.1);
  font-weight: 600;
}

.menu-home-link:hover {
  background: rgba(15, 23, 42, 0.2);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}

.search-panel {
  margin: 0 auto 1.5rem;
  max-width: 680px;
  display: grid;
  gap: 0.5rem;
}

.search-label {
  font-weight: 600;
}

.search-input {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
  font-size: 1rem;
}

.search-input::placeholder {
  color: var(--muted);
}

.search-input:focus-visible {
  outline: 3px solid rgba(34, 197, 94, 0.35);
  outline-offset: 2px;
  border-color: rgba(34, 197, 94, 0.75);
}

.search-results-count,
.empty-state {
  margin: 0;
  color: var(--muted);
}

.empty-state {
  text-align: center;
  padding: 2rem 1rem;
}

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

.card {
  background: rgba(30, 41, 59, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card-cover-link {
  display: block;
  border-radius: 10px;
}

.card-cover-link:focus-visible {
  outline: 3px solid rgba(34, 197, 94, 0.9);
  outline-offset: 4px;
}

.card-cover-link:hover .card-cover,
.card-cover-link:focus-visible .card-cover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
}

.card-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card h2 {
  margin: 0;
  font-size: 1.1rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.button {
  margin-top: auto;
  text-decoration: none;
  text-align: center;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  background: var(--accent);
  color: #052e16;
  font-weight: 600;
}

.article {
  max-width: 900px;
  margin: 2rem auto;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  padding: 2rem;
}

.article a {
  color: #86efac;
}

html[data-theme="light"] {
  --bg: #e3ebf5;
  --card: #f8fbff;
  --text: #0f172a;
  --muted: #3b4a5f;
  --accent: #10b981;
}

html[data-theme="dark"] {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #22c55e;
}

body {
  background: var(--bg);
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 12% 10%, rgba(16, 185, 129, 0.16), transparent 38%),
    radial-gradient(circle at 88% 0%, rgba(59, 130, 246, 0.16), transparent 42%),
    linear-gradient(165deg, #e3ebf5 0%, #dbe6f3 55%, #d3e2f1 100%);
}

html[data-theme="light"] .card {
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .search-input {
  background: rgba(248, 251, 255, 0.95);
  border-color: rgba(59, 130, 246, 0.25);
}

html[data-theme="light"] .button {
  background: linear-gradient(135deg, #10b981, #22c55e);
  color: #032212;
}

html[data-theme="light"] .button:hover {
  filter: brightness(1.03);
}

html[data-theme="light"] .hero {
  background: #0f274d;
  border: 1px solid #123160;
  border-top: none;
  border-radius: 0 0 24px 24px;
  box-shadow: none;
}

html[data-theme="light"] .hero h1 {
  background: none;
  color: #ffffff;
}

html[data-theme="light"] .grid .card {
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

html[data-theme="light"] .grid .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .grid .card:nth-child(3n + 1) {
  border-top: 3px solid rgba(14, 165, 233, 0.5);
}

html[data-theme="light"] .grid .card:nth-child(3n + 2) {
  border-top: 3px solid rgba(16, 185, 129, 0.45);
}

html[data-theme="light"] .grid .card:nth-child(3n + 3) {
  border-top: 3px solid rgba(99, 102, 241, 0.42);
}

.card {
  background: var(--card);
}

.actions {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.theme-button {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.theme-toggle-button {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 20;
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  background: var(--accent);
  color: #052e16;
  font-weight: 700;
  cursor: pointer;
}
