:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e2e5ea;
  --text: #16191d;
  --muted: #5d6673;
  --accent: #0b6fb4;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 8px 24px rgb(16 24 40 / 6%);
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --surface: #161b22;
    --border: #2a313c;
    --text: #e7ebf0;
    --muted: #9aa5b1;
    --accent: #6cb6f5;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 30%);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    "Helvetica Neue",
    "Noto Sans JP",
    sans-serif;
  line-height: 1.6;
}

a {
  color: var(--accent);
}

/* Hero */

.hero {
  max-width: 760px;
  margin: 0 auto;
  padding: 3.5rem 1.25rem 2rem;
  text-align: center;
}

.hero__logo {
  width: 110px;
  height: auto;
}

.hero__title {
  margin: 0.75rem 0 0;
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  letter-spacing: -0.02em;
}

.hero__tagline {
  margin: 0.75rem auto 0;
  max-width: 60ch;
  color: var(--muted);
}

.hero__stats {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero__links {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  margin: 1.5rem 0 0;
}

.button {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

.button--ghost {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.button:hover {
  filter: brightness(1.07);
}

/* Toolbar */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
}

.search {
  display: block;
  max-width: 620px;
  margin: 0 auto;
}

.search__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.search__input {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.search__input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  max-width: 900px;
  margin: 0.8rem auto 0;
}

.chip {
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.chip:hover {
  color: var(--text);
}

.chip--active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

/* Sections and cards */

.content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.section {
  margin-bottom: 2.5rem;
  scroll-margin-top: 8rem;
}

.section[hidden] {
  display: none;
}

.section__title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1rem;
  font-size: 1.35rem;
}

.section__count {
  padding: 0.05rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}

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

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card[hidden] {
  display: none;
}

.card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.card__thumb {
  position: relative;
  aspect-ratio: 2 / 1;
  background: linear-gradient(
    135deg,
    hsl(var(--hue, 210) 55% 42%),
    hsl(calc(var(--hue, 210) + 40) 60% 55%)
  );
}

.card__monogram {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 2.6rem;
  font-weight: 700;
}

.card__image {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 0.9rem 1rem 1rem;
}

.card__title {
  margin: 0 0 0.35rem;
  font-size: 1.02rem;
}

.card__description {
  flex: 1;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.card__description:empty {
  display: none;
}

.card__meta {
  margin: 0.7rem 0 0;
  color: var(--accent);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.empty {
  padding: 3rem 0;
  color: var(--muted);
  text-align: center;
}

.footer {
  padding: 2rem 1.25rem 3rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.footer p {
  margin: 0.35rem 0;
}

@media (prefers-reduced-motion: reduce) {
  .card {
    transition: none;
  }

  .card:hover {
    transform: none;
  }
}
