
/*
 * Visual quality pass: keep the directory and homepage feeling premium under
 * real catalog conditions, including delayed screenshots and long editorial text.
 */
.tool-proof-card.tool-proof-card--has-screenshot:not(.is-proof-missing) .tool-proof-fallback {
  z-index: 0;
  display: grid;
  opacity: 1;
}

.o4-reveal {
  opacity: 1;
  transform: none;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.tool-proof-image {
  z-index: 1;
  background: #101217;
  filter: saturate(0.96) contrast(1.04) brightness(0.99);
}

.tool-proof-card.tool-proof-card--has-screenshot:not(.is-proof-loaded):not(.is-proof-missing) .tool-proof-image {
  opacity: 0;
}

.tool-proof-card.tool-proof-card--has-screenshot.is-proof-loaded .tool-proof-image {
  opacity: 1;
}

.tool-proof-card:hover .tool-proof-image,
.directory-tool-card:focus-within .tool-proof-image {
  filter: saturate(1) contrast(1.06) brightness(1.03);
}

.tool-proof-overlay {
  z-index: 2;
}

.tool-proof-card--archive-preview .tool-proof-surface,
.tool-proof-card--home-feature .tool-proof-surface {
  background:
    linear-gradient(rgba(238, 240, 242, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(238, 240, 242, 0.032) 1px, transparent 1px),
    radial-gradient(circle at 14% 18%, rgba(200, 184, 141, 0.12), transparent 8rem),
    #101217;
  background-size: 24px 24px, 24px 24px, auto, auto;
}

.directory-tool-card.card {
  border-color: rgba(238, 240, 242, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.024), rgba(255, 255, 255, 0.006) 48%),
    rgba(11, 13, 18, 0.96);
}

.directory-tool-card:hover,
.directory-tool-card:focus-within {
  border-color: rgba(200, 184, 141, 0.28);
}

.directory-tool-card .directory-tool-title,
.directory-tool-card .directory-tool-title a,
.featured-tool-card h3,
.featured-tool-card h3 a,
.collection-card h3,
.collection-card h3 a {
  overflow-wrap: anywhere;
}

.directory-tool-card .tool-card-summary,
.featured-tool-card .tool-card-summary,
.collection-card > p:not(.card-meta):not(.article-card-note) {
  text-wrap: pretty;
}

.directory-tool-card .tool-proof-card--archive-preview.tool-proof-card--no-screenshot .tool-proof-fallback-mark,
.section-featured .tool-proof-card--home-feature.tool-proof-card--no-screenshot .tool-proof-fallback-mark {
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.directory-tool-card .tool-proof-card--archive-preview.tool-proof-card--no-screenshot .tool-proof-fallback-identity small,
.section-featured .tool-proof-card--home-feature.tool-proof-card--no-screenshot .tool-proof-fallback-identity small {
  color: rgba(238, 240, 242, 0.68);
}

.section-collections .home-section-shell {
  padding: 0;
  border: 0;
  background: transparent;
}

.section-collections .section-head {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(238, 240, 242, 0.1);
}

.section-collections .home-collection-grid {
  overflow: hidden;
  gap: 0;
  border: 1px solid rgba(238, 240, 242, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.026), transparent 44%),
    rgba(12, 14, 18, 0.88);
}

.section-collections .collection-card,
.section-collections .collection-card.is-emphasis {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 315px;
  padding: clamp(22px, 2.4vw, 34px);
  border: 0;
  border-radius: 0;
  background: transparent;
}

.section-collections .collection-card + .collection-card {
  border-left: 1px solid rgba(238, 240, 242, 0.1);
}

.section-collections .collection-card::after {
  content: none;
  display: none;
}

.section-collections .collection-card.is-emphasis {
  color: var(--o4-premium-text);
  background:
    linear-gradient(145deg, rgba(200, 184, 141, 0.09), rgba(255, 255, 255, 0.018) 48%, transparent),
    rgba(255, 255, 255, 0.012);
}

.section-collections .collection-card.is-emphasis::after {
  content: "";
  display: block;
  position: absolute;
  inset: auto;
  top: clamp(28px, 4vw, 54px);
  right: clamp(40px, 7vw, 112px);
  z-index: 0;
  width: min(28%, 320px);
  min-width: 220px;
  height: 132px;
  border: 1px solid rgba(238, 240, 242, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(rgba(238, 240, 242, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(238, 240, 242, 0.036) 1px, transparent 1px),
    linear-gradient(112deg, transparent 0 28%, rgba(200, 184, 141, 0.46) 28.4%, transparent 29%, transparent 58%, rgba(134, 200, 157, 0.28) 58.4%, transparent 59%),
    rgba(255, 255, 255, 0.012);
  background-size: 24px 24px, 24px 24px, auto, auto;
  box-shadow: none;
  opacity: 0.46;
  pointer-events: none;
}

.section-collections .collection-card > * {
  position: relative;
  z-index: 1;
}

.section-collections .collection-card h3,
.section-collections .collection-card.is-emphasis h3 {
  max-width: 18ch;
  color: var(--o4-premium-text);
  font-size: clamp(1.34rem, 1.85vw, 1.95rem);
  line-height: 1.08;
}

.section-collections .collection-card h3 a {
  color: inherit;
}

.section-collections .collection-card > p:not(.card-meta) {
  color: rgba(238, 240, 242, 0.72);
  font-size: 0.94rem;
  line-height: 1.58;
}

.section-collections .collection-card .article-card-note {
  display: block;
  overflow: visible;
  margin-top: auto;
  color: rgba(238, 240, 242, 0.66);
  -webkit-line-clamp: unset;
}

.section-collections .collection-card .tool-card-footer {
  margin-top: 22px;
}

.section-collections .collection-card .button {
  width: 100%;
  min-height: 40px;
  border-radius: 7px;
}

@media (prefers-reduced-motion: no-preference) {
  .section-collections .collection-card,
  .directory-tool-card.card {
    transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
  }

  .section-collections .collection-card:hover,
  .section-collections .collection-card:focus-within {
    background: rgba(255, 255, 255, 0.032);
    transform: translateY(-2px);
  }
}

@media (max-width: 980px) {
  .section-collections .home-collection-grid {
    grid-template-columns: 1fr;
  }

  .section-collections .collection-card,
  .section-collections .collection-card.is-emphasis {
    min-height: 0;
  }

  .section-collections .collection-card + .collection-card {
    border-top: 1px solid rgba(238, 240, 242, 0.1);
    border-left: 0;
  }
}

@media (max-width: 760px) {
  .tool-proof-card--archive-preview .tool-proof-surface,
  .tool-proof-card--home-feature .tool-proof-surface,
  .directory-tool-card .tool-proof-surface {
    min-height: 172px;
  }

  .section-collections .section-head {
    display: grid;
    gap: 12px;
  }

  .section-collections .collection-card,
  .section-collections .collection-card.is-emphasis {
    padding: 20px;
  }

  .section-collections .collection-card.is-emphasis::after {
    display: none;
  }

  .section-collections .collection-card h3,
  .section-collections .collection-card.is-emphasis h3 {
    max-width: none;
    font-size: 1.35rem;
  }
}
