/* Reusable category and portal cards. Shared screenshots keep their full 16:10 ratio. */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.category-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 25px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(155deg, var(--surface) 35%, var(--tint));
  box-shadow: var(--shadow-sm);
  transition: box-shadow .3s, border-color .3s, translate .3s var(--ease);
}

.category-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 25px;
  height: 3px;
  width: 44px;
  border-radius: 0 0 3px 3px;
  background: var(--accent);
}

.card-eyebrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.card-number {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--accent);
}

.category-card h3 {
  font-size: clamp(23px, 2.2vw, 29px);
}

.stretched-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--radius);
}

.category-card:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.stretched-link:focus-visible {
  outline: none;
}

.category-image {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #121e30;
}

.category-image img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  transition: transform .6s var(--ease);
}

.preview-corner {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--surface);
  color: var(--accent);
  border-radius: 50%;
  transform: rotate(-38deg);
  transition: transform .3s;
}

.preview-corner .icon {
  width: 17px;
  height: 17px;
}

.card-description {
  font-size: 14px;
  line-height: 1.75;
}

.category-card .card-description {
  margin-top: 12px;
  margin-bottom: 16px;
  flex: 1;
}

.category-bottom {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.category-bottom > span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 750;
  color: var(--accent);
}

.category-bottom .icon {
  width: 17px;
  height: 17px;
}

.category-bottom small {
  color: var(--muted);
  font-size: 10px;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.portal-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .3s, border-color .3s;
}

.portal-heading {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 26px 26px 22px;
  background: linear-gradient(120deg, var(--tint), var(--surface));
}

.portal-heading > div {
  min-width: 0;
}

.portal-heading h2 {
  font-size: clamp(21px, 2.1vw, 28px);
  margin-top: 6px;
}

.portal-heading .eyebrow {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: .075em;
}

.portal-preview {
  padding: 0 14px;
}

.screenshot-link {
  display: block;
  overflow: hidden;
  position: relative;
  border-radius: 13px;
  background: #152038;
  border: 1px solid var(--border);
}

.screenshot-link img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
}

.image-action {
  position: absolute;
  bottom: 11px;
  right: 11px;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 35px;
  padding: 7px 10px;
  border: 1px solid #ffffff44;
  border-radius: 9px;
  background: #0c1425dc;
  color: #fff;
  font-size: 10px;
  font-weight: 650;
  backdrop-filter: blur(5px);
  transition: background .2s;
}

.image-action .icon {
  width: 15px;
  height: 15px;
}

.portal-preview figcaption {
  padding: 10px 10px 0;
  font-size: 10px;
  color: var(--subtle);
}

.portal-body {
  padding: 21px 26px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.check-list {
  padding: 0;
  list-style: none;
  margin: 19px 0 23px;
  font-size: 13px;
  color: var(--muted);
}

.check-list li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 9px;
}

.check-list li::before {
  content: "✓";
  font-size: 12px;
  font-weight: 750;
  color: var(--accent);
  position: absolute;
  top: 0;
  left: 0;
}

.portal-body .tags {
  margin-top: auto;
}

.portal-bottom {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 0 26px 26px;
}

.domain {
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.portal-bottom .button {
  width: 100%;
}

@media (hover: hover) and (pointer: fine) {
  .category-card:hover {
    translate: 0 -7px;
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
  }
  .category-card:hover .preview-corner {
    transform: rotate(0);
  }
  .category-card:hover .category-image img {
    transform: scale(1.025);
  }
  .portal-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
  }
  .screenshot-link:hover .image-action {
    background: #215bd7;
  }
}

@media (min-width: 681px) and (max-width: 1000px) {
  .category-grid {
    gap: 16px;
  }
  .category-card {
    padding: 20px;
  }
  .category-card .card-description {
    font-size: 13px;
  }
}

@media (max-width: 900px) {
  .portal-grid {
    gap: 20px;
  }
  .portal-heading {
    padding: 20px 18px;
    gap: 12px;
  }
  .portal-body {
    padding: 18px;
  }
  .portal-bottom {
    padding: 0 18px 20px;
  }
  .portal-heading h2 {
    font-size: 22px;
  }
  .portal-heading .icon-tile {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 680px) {
  .category-grid, .portal-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  /* Phone: each category is one short row (icon, name, apps inside, arrow). */
  .category-grid {
    gap: 10px;
  }
  .category-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 14px;
    row-gap: 6px;
    padding: 14px 16px;
    border-radius: 18px;
  }
  .category-card::before {
    display: none;
  }
  .card-eyebrow {
    grid-row: 1 / span 2;
    margin: 0;
  }
  .card-number, .category-card .card-description, .category-bottom > span {
    display: none;
  }
  .category-card h3 {
    grid-column: 2;
    font-size: 18px;
    letter-spacing: -.02em;
  }
  .category-card .tags {
    grid-column: 2;
    gap: 5px;
  }
  .category-card .tag {
    padding: 3px 8px;
    font-size: 10px;
  }
  .category-bottom {
    grid-column: 3;
    grid-row: 1 / span 2;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .category-bottom small {
    display: grid;
    place-items: center;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--tint);
    color: var(--accent);
    font-size: 11px;
    font-weight: 750;
  }
  .portal-heading {
    padding: 22px 20px;
  }
  .portal-body {
    padding: 20px;
  }
  .portal-bottom {
    padding: 0 20px 23px;
  }
  .portal-preview {
    padding: 0 10px;
  }
}
