/* Home screen: category bars that open to show their islands */
.cats { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.cat { scroll-margin-top: 12px; }
.cat-head { display: flex; align-items: center; gap: 18px; width: 100%; min-height: 104px; padding: 16px 22px; border: 4px solid #fff; border-radius: 28px; color: var(--tinta); text-align: left; box-shadow: 0 8px 22px rgba(120,90,160,.15); transition: transform .12s ease, box-shadow .12s ease; }
.cat-head:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(120,90,160,.2); }
.cat-head:active { transform: translateY(2px); }
.cat-icon { flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 72px; height: 72px; background: rgba(255,255,255,.85); border-radius: 24px; font-size: 42px; line-height: 1; animation: catBob 3.4s ease-in-out infinite; }
.cat:nth-child(2n) .cat-icon { animation-delay: -1.7s; }
.cat-head:hover .cat-icon, .cat.open .cat-icon { animation: catWiggle .6s ease; }
.cat-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cat-tx b { font-family: var(--display); font-size: clamp(22px, 3vw, 30px); font-weight: 800; line-height: 1.1; }
.cat-tx span { font-family: var(--ui); font-size: 15px; line-height: 1.4; color: #3C4860; }
.cat-count { flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; background: rgba(255,255,255,.85); border-radius: 999px; font-family: var(--display); font-size: 15px; font-weight: 700; white-space: nowrap; }
.cat-count::after { content: ""; width: 9px; height: 9px; margin-top: -4px; border-right: 3px solid var(--tinta); border-bottom: 3px solid var(--tinta); transform: rotate(45deg); transition: transform .2s ease; }
.cat.open .cat-count::after { margin-top: 4px; transform: rotate(-135deg); }
.c-nature { background: linear-gradient(120deg, #D3F5E7, #D5ECFF); }
.c-sky { background: linear-gradient(120deg, #E6DEFF, #D5ECFF); }
.c-bansa { background: linear-gradient(120deg, #FFF2C2, #FFE3D3); }
.c-science { background: linear-gradient(120deg, #D5ECFF, #E6DEFF 60%, #FFD9EA); }
.c-life { background: linear-gradient(120deg, #FFD9EA, #FFE3D3 60%, #FFF2C2); }
.c-more { background: linear-gradient(120deg, #D3F5E7, #FFF2C2); }

.cat > .grid { display: none; margin: 12px 0 6px; }
.cat.open > .grid { display: grid; }
.cat.open > .grid > .island { animation: catIn .35s ease both; }
.cat.open > .grid > .island:nth-child(2) { animation-delay: .05s; }
.cat.open > .grid > .island:nth-child(3) { animation-delay: .1s; }
.cat.open > .grid > .island:nth-child(4) { animation-delay: .15s; }
/* Inside an open category the island tiles are plain white, so the page stays calm */
.cat .island { background: #fff !important; }
.cat .island::before { background: var(--mint); }

@keyframes catBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes catWiggle { 0%, 100% { transform: rotate(0) scale(1); } 30% { transform: rotate(-12deg) scale(1.12); } 70% { transform: rotate(12deg) scale(1.12); } }
@keyframes catIn { from { opacity: 0; transform: translateY(-8px) scale(.97); } to { opacity: 1; transform: none; } }

@media (max-width: 560px) {
  .cat-head { gap: 14px; min-height: 92px; padding: 14px 16px; border-radius: 24px; }
  .cat-icon { width: 60px; height: 60px; border-radius: 20px; font-size: 34px; }
  .cat-tx span { font-size: 14px; }
  .cat-count { padding: 8px 10px; font-size: 0; gap: 0; }
}
@media (prefers-reduced-motion: reduce) { .cat-icon, .cat.open > .grid > .island { animation: none !important; } .cat-head { transition: none; } }
