/* ------------------------------------------------------- CATEGORIES */
/* Clean blue/white card grid with line-art icons. Tiles expand into
   one panel on hover (clip-path from the tile's rect). */
.dbz-cats {
  --gap: 16px;
  --radius: 18px;
  --blue: #1A56DB;
  --blue-dk: #1346B8;
  --blue-tint: #DBEAFE;
  --ink: var(--hb-text);
  --muted: var(--hb-muted);
  --ease: cubic-bezier(.22, 1, .36, 1);
  color: var(--ink);
  font-family: var(--hb-font);
}
.dbz-cats *,
.dbz-cats *::before,
.dbz-cats *::after { box-sizing: border-box; }

.dbz-cats__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.dbz-cats__title { margin: 0; font-size: clamp(28px, 4.6vw, 40px); font-weight: 800; letter-spacing: -.03em; line-height: 1.12; }
.dbz-cats__sub { margin: 10px 0 0; color: var(--muted); font-size: 16px; }
.dbz-cats__sub .t-touch { display: none; }
@media (hover: none), (pointer: coarse) {
  .dbz-cats__sub .t-hover { display: none; }
  .dbz-cats__sub .t-touch { display: inline; }
}
.dbz-cats__all {
  flex: none; font-family: var(--hb-font); font-weight: 700; font-size: 15px;
  color: var(--ink); background: #fff; cursor: pointer;
  padding: 9px 16px; border-radius: 999px; border: 1.5px solid #d9dce3;
  transition: background .2s, border-color .2s;
}
.dbz-cats__all:hover { border-color: #b9bdc8; }
.dbz-cats__all:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.dbz-cats__stage { position: relative; }

/* ---------- grid: 4 on top, 4 below ---------- */
.dbz-cats__grid {
  /* minmax(0, 1fr), not 1fr: a plain 1fr column won't shrink below its
     content, so on narrow screens the last tile ran off the screen. */
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap);
  list-style: none; margin: 0; padding: 0;
}
.dbz-cats__grid > li { display: flex; container-type: inline-size; }   /* the tile name below sizes itself to this box (cqi) */

/* ---------- tile base ---------- */
.dbz-tile {
  position: relative; display: flex; flex-direction: column;
  width: 100%; aspect-ratio: 1 / 1;   /* 4 across: square keeps two rows a sensible height */
  border: 0; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--blue) 60%, var(--blue-dk) 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, .15);
  font-family: inherit; text-align: left; cursor: pointer;
  overflow: hidden; isolation: isolate;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), opacity .3s ease;
}

/* both variants same blue */
.dbz-tile--white {
  background: linear-gradient(180deg, var(--blue) 60%, var(--blue-dk) 100%);
  color: #fff; border: 0;
  box-shadow: 0 4px 16px rgba(37, 99, 235, .15);
}

/* light card area on top with the illustration, the same on every tile */
.dbz-tile__icon {
  position: relative; z-index: 1; flex: 1; min-height: 0;
  width: calc(100% - 12px); margin: 6px 6px 0;
  background: #f0f3ff; border-radius: calc(var(--radius) - 4px);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
/* The whole picture, centred and never cropped (it was offset to the
   bottom-right and cut off). It shrinks to fit the card either way. */
.dbz-tile__icon svg {
  position: static; display: block;
  width: 80%; height: 80%; max-width: 80%; max-height: 80%;
  aspect-ratio: auto !important;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.1));
}
.dbz-tile__icon img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain; object-position: center center;
  border-radius: inherit;
  pointer-events: none;
}

/* name at bottom on blue */
.dbz-tile__name {
  position: relative; z-index: 1;
  padding: 12px 16px 14px;
  font-weight: 800; font-size: clamp(16px, 2.2vw, 32px);
  line-height: 1.1; letter-spacing: -.02em;
  white-space: nowrap;
}

/* hide the old arrow go button */
.dbz-tile__go { display: none; }

/* hover */
.dbz-tile:hover,
.dbz-tile:focus-visible { transform: translateY(-4px); }
.dbz-tile:hover { box-shadow: 0 14px 30px -10px rgba(37, 99, 235, .4); }
.dbz-tile:focus-visible { outline: 3px solid var(--blue-dk); outline-offset: 3px; }

/* no overlay pseudo-elements needed */
.dbz-tile::before,
.dbz-tile::after { display: none; }

/* other categories disappear when panel is open */
.dbz-cats__stage.is-open .dbz-tile {
  opacity: 0; transform: scale(.9); pointer-events: none;
  transition-delay: calc(var(--i) * 22ms);
}

/* ---------- expanded panel ---------- */
.dbz-panel {
  position: absolute; inset: 0; z-index: 2; overflow: hidden; cursor: pointer;
  color: #fff; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--blue), var(--blue-dk));
  visibility: hidden;
  clip-path: inset(var(--ct, 0) var(--cr, 0) var(--cb, 0) var(--cl, 0) round var(--radius));
  transition: clip-path .6s cubic-bezier(.65, 0, .35, 1), visibility 0s linear .6s;
}
.dbz-cats__stage.is-open .dbz-panel {
  visibility: visible; clip-path: inset(0 0 0 0 round var(--radius));
  transition: clip-path .6s cubic-bezier(.65, 0, .35, 1), visibility 0s;
}
.dbz-panel::before {
  content: ""; position: absolute; right: -12%; top: 50%; width: 62%; aspect-ratio: 1;
  border-radius: 50%; background: rgba(255, 255, 255, .08); transform: translateY(-50%);
}
.dbz-panel::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 10%;
  background: rgba(0, 0, 0, .06);
}

.dbz-panel__content {
  position: relative; z-index: 2; height: 100%; max-width: 56%;
  padding: clamp(20px, 4.5vw, 52px);
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
}
.dbz-panel__content > * { opacity: 0; transform: translateY(14px); transition: opacity .35s ease, transform .5s var(--ease); }
.is-open .dbz-panel__content > * { opacity: 1; transform: none; }
.is-open .dbz-panel__content > :nth-child(1) { transition-delay: .22s; }
.is-open .dbz-panel__content > :nth-child(2) { transition-delay: .28s; }
.is-open .dbz-panel__content > :nth-child(3) { transition-delay: .34s; }
.is-open .dbz-panel__content > :nth-child(4) { transition-delay: .4s; }
.is-open .dbz-panel__content > :nth-child(5) { transition-delay: .5s; }

.dbz-panel__eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.dbz-panel__name { margin: 6px 0 0; font-size: clamp(34px, 5.6vw, 72px); font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.dbz-panel__count { margin: 14px 0 0; font-size: clamp(15px, 1.6vw, 19px); font-weight: 500; }
.dbz-panel__count strong { font-size: 1.5em; font-weight: 800; font-variant-numeric: tabular-nums; margin-right: 4px; }
.dbz-panel__cta {
  margin-top: 22px; display: inline-flex; align-items: center; gap: 10px;
  background: #fff; color: var(--ink); border: 0; cursor: pointer;
  font-family: var(--hb-font); font-weight: 700; font-size: 16px;
  padding: 13px 20px; border-radius: 999px; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .4);
  transition: gap .25s var(--ease), transform .25s var(--ease);
}
.dbz-panel__cta svg { width: 18px; height: 18px; }
.dbz-panel__cta:hover { gap: 16px; }
.dbz-panel__cta:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.dbz-panel__hint { margin-top: 18px; font-size: 13px; opacity: .75; }
@media (hover: none), (pointer: coarse) { .dbz-panel__hint { display: none; } }

.dbz-panel__close {
  position: absolute; top: 14px; right: 14px; z-index: 3; width: 38px; height: 38px;
  border: 0; border-radius: 50%; cursor: pointer; background: rgba(0, 0, 0, .22); color: #fff;
  display: grid; place-items: center; transition: background .2s;
}
.dbz-panel__close:hover { background: rgba(0, 0, 0, .38); }
.dbz-panel__close:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.dbz-panel__close svg { width: 16px; height: 16px; }

/* vector slides in from the right */
.dbz-panel__art { position: absolute; right: 0; bottom: 9%; height: 74%; z-index: 1; pointer-events: none; transform: translateX(50%); }
.dbz-panel__art svg { display: block; height: 100%; width: auto; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .18)); }
.is-open .dbz-panel__art { animation: dbz-drive 1s var(--ease) .18s both; }
@keyframes dbz-drive {
  0% { transform: translateX(125%); }
  72% { transform: translateX(46%); }
  100% { transform: translateX(50%); }
}
.dbz-wheel { transform-box: fill-box; transform-origin: center; }
.is-open .dbz-wheel { animation: dbz-spin 1s var(--ease) .18s both; }
@keyframes dbz-spin { from { transform: rotate(0); } to { transform: rotate(-900deg); } }

/* ---------- tablet / mobile ---------- */
@media (max-width: 760px) {
  .dbz-cats__all { padding: 6px 12px; font-size: 14px; }
  .dbz-cats__grid {
    grid-template-columns: repeat(4, minmax(124px, 38vw)); gap: 12px;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 24px;
    scrollbar-width: none; margin: 0 -24px; padding: 0 24px 4px;
  }
  .dbz-cats__grid::-webkit-scrollbar { display: none; }
  .dbz-cats__grid > li { scroll-snap-align: start; }
  .dbz-tile__icon { margin: 5px 5px 0; }
  .dbz-tile__name { font-size: clamp(13px, 3.4vw, 18px); padding: 8px 10px 10px; }
  .dbz-panel__content { max-width: 64%; padding: 20px; }
  .dbz-panel__cta { padding: 11px 16px; font-size: 15px; margin-top: 16px; }
  .dbz-panel__art { height: 52%; bottom: 10%; }
}

@media (prefers-reduced-motion: reduce) {
  .dbz-tile,
  .dbz-panel__content > * { transition: opacity .2s ease !important; transform: none !important; }
  .dbz-panel,
  .dbz-cats__stage.is-open .dbz-panel { clip-path: none; opacity: 0; transition: opacity .2s, visibility 0s linear .2s; }
  .dbz-cats__stage.is-open .dbz-panel { opacity: 1; transition: opacity .2s, visibility 0s; }
  .is-open .dbz-panel__art,
  .is-open .dbz-wheel { animation: none; }
}
