body {
  font-family: system-ui, -apple-system, sans-serif;
  max-width: 500px;
  margin: 40px auto;
  padding: 0 20px;
  background: #d08494;
}

.grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  background: white;
  border-radius: 24px;
  border: 1px solid #e4e4e7;
  view-transition-name: grid;
}

.grid-item {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: white;
  border-radius: 16px;
  border: 1px solid #e4e4e7;
  cursor: pointer;
  transition: transform 0.2s;

  .item {
    display: flex;
    gap: 8px;

    .chevron {
      display: none;
    }
  }

  .item-content {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    overflow: clip;

    .item-title {
      font-weight: bold;
    }
  }
}


.grid-item.expanded {
  flex-direction: column;

  & > .chevron {
    display: none;
  }

  .content {
    order: 0;
    flex-direction: row;
    justify-content: space-between;

    .close-icon {
      display: flex;
    }
  }

  .icon-grid {
    order: 1;
  }

  .item-content {
    display: flex;
    flex-grow: 1;
  }

  .item {
    width: 100%;

    .chevron {
      display: block;
    }
  }

  .icon {
    background: #f4f4f5;
    width: 50px;
    height: 50px;
    color: inherit;

    svg {
      width: 24px;
      height: 24px;
    }
  }

  .count {
    display: none;
  }
}

.icon-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 90px;
  .item {
    width: fit-content;
    height: fit-content;
  }
}

.expanded .icon-grid {
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.close-icon {
  width: 24px;
  height: 24px;
  background: #f4f4f5;
  border-radius: 50%;
  justify-content: center;
  align-items: center;
  display: none;

  svg {
    width: 16px;
    height: 16px;
  }
}

.icon {
  width: 32px;
  height: 32px;
  background: #f4f4f5;
  border-radius: 50%;
  display: grid;
  place-items: center;

  svg {
    width: 16px;
    height: 16px;
  }
}

.content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  flex: 1;
}

.title {
  font-size: 16px;
  font-weight: 500;
  color: #27272a;
  width: fit-content;
  height: fit-content;
}

.count {
  font-size: 14px;
  color: #71717a;
}

.chevron {
  align-self: center;
  color: #71717a;
}

.expanded .chevron {
  display: none;
}

.logo-badge {
  display: block;
  margin: 24px auto 12px auto;
  max-width: 120px; /* Slightly larger now that it’s cropped */
  height: auto;
  opacity: 0.8;
  transition: opacity 0.3s ease;
  animation: badgeIntro 0.6s ease-out 0.2s both;
}

.logo-badge:hover {
  opacity: 1;
}

@keyframes badgeIntro {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 0.8;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes fade-out {
  0% {
    opacity: 1;
  }
  10% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

@keyframes slide-down {
  from {
    opacity: 0;
    margin-top: -30px;
  }
  to {
    opacity: 1;
    margin-top: 0;
  }
}

::view-transition-group(*) {
  pointer-events: none !important;
  animation-duration: 0.6s;
  animation-timing-function: linear(0, 0.186 3.5%, 0.352 7.1%, 0.496 10.8%, 0.623 14.7%, 0.679 16.7%, 0.732 18.8%, 0.78 20.9%, 0.821 23%, 0.86 25.2%, 0.895 27.5%, 0.925 29.8%, 0.951 32.2%, 0.97 34.2%, 0.986 36.3%, 1 38.5%, 1.012 40.7%, 1.021 43%, 1.028 45.4%, 1.033 48%, 1.036 50.7%, 1.037 54.8%, 1.034 59.6%, 1.012 76.6%, 1.004 84.2%, 1.001 91.3%, 1);
}

::view-transition-old(*),
::view-transition-new(*) {
  height: 100%;
}

html:active-view-transition-type(expand) {
  .grid-item:nth-child(2).active {   
    .item-title {
      view-transition-class: item-title-expand;
    }

    .item-price {
      view-transition-class: item-price-expand;
    }
  }

  .grid-item:nth-child(3).active {
    .item-title {
      view-transition-class: item-title-expand-slide-down;
    }

    .item-price {
      view-transition-class: item-price-expand-slide-down;
    }
  }

  &::view-transition-group(item-title-6),
  &::view-transition-group(item-price-6) {
    animation-duration: 1s !important;
  }

  &::view-transition-group(item-title-7),
  &::view-transition-group(item-price-7) {
    animation-duration: 1.2s !important;
  }

  &::view-transition-group(item-title-9),
  &::view-transition-group(item-price-9) {
    animation-duration: 1s !important;
  }

  &::view-transition-group(item-title-10),
  &::view-transition-group(item-price-10) {
    animation-duration: 1.2s !important;
  }

  &::view-transition-group(item-title-11),
  &::view-transition-group(item-price-11) {
    animation-duration: 1.4s !important;
  }
}

html:active-view-transition-type(collapse) {
  .grid-item.active {
    .item-title {
      view-transition-class: item-title-collapse;
    }

    .item-price {
      view-transition-class: item-price-collapse;
    }
  }
}

::view-transition-group(.item-title-collapse),
::view-transition-group(.item-price-collapse) {
  animation-name: fade-out;
}

::view-transition-group(.item-title-expand),
::view-transition-group(.item-price-expand) {
  animation-name: fade-in;
  animation-delay: 0.2s;
  animation-duration: 0.6s;
}

::view-transition-group(.item-title-expand-slide-down),
::view-transition-group(.item-price-expand-slide-down) {
  animation-name: slide-down;
  animation-delay: 0.2s;
  animation-duration: 0.6s;
}

.grid-item:not(.expanded) .icon img {
  filter: grayscale(100%) brightness(0.85) sepia(0.1);
  transition: filter 0.3s ease;
}

.grid-item.expanded .icon img {
  filter: none;
}

.item {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
}

.item:visited {
  color: inherit;
}

.item:hover .item-title {
  text-decoration: underline; /* Optional hover feedback */
}

.item-title {
  font-weight: 500;
  font-size: 16px;
  color: #27272a; /* Customize as needed */
}

.icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.grid-item.expanded .icon img {
  filter: none !important;
  width: 42px;
  height: 42px;
}

.item:hover .icon img {
  filter: brightness(1.1);
  transition: filter 0.3s;
}

.grid-item.expanded .icon {
  width: 50px;
  height: 50px;
}

@media (max-width: 600px) {
  .icon img {
    width: 24px;
    height: 24px;
  }

  .grid-item:not(.expanded) .icon img {
    width: 24px;
    height: 24px;
  }

  .grid-item.expanded .icon img {
    width: 34px;
    height: 34px;
  }

  .grid-item.expanded .icon {
    width: 40px;
    height: 40px;
  }
}

.site-footer {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-align: center;
  color: #f9f9f9;
  padding: 16px 16px;
  margin-top: 64px;
  line-height: 1.4;
  letter-spacing: 0.03em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.footer-bunny {
  width: 36px;
  height: auto;
}
