/* Soft 2D categories page — matches home shell, no purple */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=Syne:wght@700;800&display=swap');

.bm-cats-page {
  --ink: #14181c;
  --muted: #6b746e;
  --paper: #f3f4f1;
  --panel: #fffcf8;
  --line: rgba(20, 24, 28, 0.08);
  --crimson: #b01d22;
  --soft-rose: #f6e8e9;
  --soft-sage: #e7efe8;
  --soft-sand: #efebe3;
  --radius: 22px;
  --max: 1100px;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 10% -10%, #f6e8e9 0%, transparent 55%),
    radial-gradient(700px 380px at 100% 0%, #e7efe8 0%, transparent 50%),
    var(--paper);
  min-height: 70vh;
  padding: 2.5rem 0 4rem;
}

.bm-cats-page * { box-sizing: border-box; }

.bm-cats-page__wrap {
  width: min(100% - 1.75rem, var(--max));
  margin: 0 auto;
}

.bm-cats-hero {
  text-align: center;
  margin-bottom: 2.5rem;
  animation: bmCatsRise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.bm-cats-hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--soft-rose);
  color: var(--crimson);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.bm-cats-hero h1 {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: clamp(1.9rem, 4.5vw, 2.75rem);
  letter-spacing: -0.03em;
  margin: 0.85rem 0 0.55rem;
  line-height: 1.1;
}

.bm-cats-hero p {
  margin: 0 auto;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.bm-cats-search {
  margin: 1.5rem auto 0;
  max-width: 420px;
  position: relative;
}

.bm-cats-search input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 252, 248, 0.92);
  border-radius: 999px;
  padding: 0.85rem 1.15rem 0.85rem 2.75rem;
  font: inherit;
  color: var(--ink);
  outline: 0;
  box-shadow: 0 10px 30px rgba(20, 24, 28, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bm-cats-search input:focus {
  border-color: rgba(176, 29, 34, 0.35);
  box-shadow: 0 12px 32px rgba(176, 29, 34, 0.1);
}

.bm-cats-search__icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

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

.bm-cat-tile {
  --tile-bg: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  padding: 1.25rem;
  background: var(--tile-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  min-width: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(20, 24, 28, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  animation: bmCatsRise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.bm-cat-tile::before {
  content: "";
  position: absolute;
  inset: auto -20% -35% auto;
  width: 140px;
  height: 140px;
  border-radius: 40% 60% 55% 45%;
  background: rgba(176, 29, 34, 0.06);
  pointer-events: none;
}

.bm-cat-tile:nth-child(3n) { --tile-bg: #fffaf7; }
.bm-cat-tile:nth-child(3n+1) { --tile-bg: #fbfcf9; }
.bm-cat-tile:nth-child(3n+2) { --tile-bg: #f8faf8; }
.bm-cat-tile:nth-child(4n) { --tile-bg: #fbf8f4; }

.bm-cat-tile:hover {
  transform: translateY(-5px);
  border-color: rgba(176, 29, 34, 0.28);
  box-shadow: 0 18px 40px rgba(176, 29, 34, 0.1);
  color: inherit;
}

.bm-cat-tile__top {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  position: relative;
  z-index: 1;
}

.bm-cat-tile__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(145deg, #fff, var(--soft-sand));
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.bm-cat-tile__icon img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.bm-cat-tile__icon i {
  color: var(--crimson);
  font-size: 1.2rem;
}

.bm-cat-tile__meta {
  min-width: 0;
  flex: 1;
}

.bm-cat-tile__name {
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.25;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.bm-cat-tile__count {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: rgba(20, 24, 28, 0.04);
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
}

.bm-cat-tile__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
  position: relative;
  z-index: 1;
}

.bm-cat-tile__list a {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.5rem;
  border-radius: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s ease, color 0.15s ease;
}

.bm-cat-tile__list a:hover {
  background: var(--soft-rose);
  color: var(--crimson);
}

.bm-cat-tile__foot {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
  position: relative;
  z-index: 1;
}

.bm-cat-tile__more {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--crimson);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.bm-cat-tile__more:hover { color: #7e1418; }

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

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

.bm-cat-tile:nth-child(1) { animation-delay: 0.02s; }
.bm-cat-tile:nth-child(2) { animation-delay: 0.05s; }
.bm-cat-tile:nth-child(3) { animation-delay: 0.08s; }
.bm-cat-tile:nth-child(4) { animation-delay: 0.11s; }
.bm-cat-tile:nth-child(5) { animation-delay: 0.14s; }
.bm-cat-tile:nth-child(6) { animation-delay: 0.17s; }
.bm-cat-tile:nth-child(n+7) { animation-delay: 0.2s; }

.bm-cat-tile.is-hidden { display: none; }

@media (max-width: 640px) {
  .bm-cats-page { padding-top: 1.5rem; }
  .bm-cats-grid { grid-template-columns: 1fr; gap: 0.9rem; }
  .bm-cat-tile { padding: 1.05rem; }
}
