:root {
  color-scheme: light dark;
  --bg: #e3f4ff;
  --bg-image: url('/bg-day.svg');
  --card: #ffffff;
  --ink: #222222;
  --accent: #ff5a5f;
  --shadow: rgb(0 0 0 / 0.12);
}

/* The theme always follows the system or browser setting. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141a40;
    --bg-image: url('/bg-night.svg');
    --card: #283063;
    --ink: #f4f4ff;
    --accent: #ff8a8e;
    --shadow: rgb(0 0 0 / 0.45);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg) var(--bg-image) repeat;
  background-size: 480px;
  color: var(--ink);
  font-family: system-ui, sans-serif;
}

header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
}

.logo { margin: 0; font-size: 2rem; color: var(--accent); }

.langs { display: flex; gap: 8px; }

.langs button {
  min-width: 64px;
  min-height: 48px;
  font-size: 1.25rem;
  border: 3px solid transparent;
  border-radius: 12px;
  background: var(--card);
  color: inherit;
  cursor: pointer;
}

.langs button[aria-pressed="true"] { border-color: var(--accent); }

.grid {
  display: grid;
  /* 2 columns on phones, 3 on portrait tablets, more on wider screens. */
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 40vw), 1fr));
  gap: 16px;
  padding: 0 16px 32px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 20px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 4px 12px var(--shadow);
}

.card img { width: 100%; aspect-ratio: 1; object-fit: cover; }

.card span { padding: 12px; font-size: 1.25rem; font-weight: 700; text-align: center; }

.card:active { transform: scale(0.97); }
