/* Software catalog — modern card grid */

.sw-page,
.sw-detail-page {
  --sw-accent: #1a6270;
  --sw-accent-2: #1a5c94;
  --sw-accent-soft: color-mix(in srgb, var(--sw-accent) 10%, var(--color-bg));
  --sw-line: color-mix(in srgb, var(--color-border) 58%, transparent);
  --sw-mono: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace;
  --sw-radius: 14px;
}

#main-content:has(.sw-page),
#main-content:has(.sw-detail-page) {
  background:
    radial-gradient(ellipse 72% 48% at 6% 0%, rgba(var(--rgb-blue), 0.09), transparent 55%),
    radial-gradient(ellipse 58% 40% at 96% 8%, rgba(var(--rgb-green), 0.06), transparent 50%),
    linear-gradient(180deg, var(--sw-accent-soft) 0%, var(--color-bg) 24%, var(--color-bg) 100%);
}

.sw-page,
.sw-detail-page {
  background: transparent;
  padding-bottom: 2.5rem;
}

/* —— List hero —— */
.sw-hero {
  padding: clamp(1.5rem, 4vw, 2.5rem) 0 0.5rem;
}

.sw-hero__label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sw-accent);
  margin-bottom: 0.6rem;
}

.sw-hero__label::before {
  content: '';
  width: 1.75rem;
  height: 1px;
  background: currentColor;
  opacity: 0.45;
}

.sw-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.2vw, 2.75rem);
  font-weight: 500;
  line-height: 1.1;
  margin: 0 0 0.65rem;
  max-width: 20ch;
}

.sw-hero__lead {
  margin: 0;
  max-width: 50ch;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--color-text-soft);
}

.sw-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  list-style: none;
  margin: 1.35rem 0 0;
  padding: 0;
}

.sw-hero__stats li {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 7.5rem;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--sw-line);
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
}

.sw-hero__stats strong {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}

.sw-hero__stats span {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* Notice */
.sw-notice {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin: 1.5rem 0 1.75rem;
  padding: 1rem 1.15rem;
  border-radius: var(--sw-radius);
  border: 1px solid var(--sw-line);
  background: color-mix(in srgb, var(--color-surface) 90%, transparent);
  box-shadow: var(--color-shadow);
}

.sw-notice__icon {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.1rem;
  color: var(--sw-accent);
}

.sw-notice__body {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--color-text-soft);
}

.sw-notice__body strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text);
}

/* Featured */
.sw-featured {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1.25rem 1.75rem;
  align-items: center;
  padding: 1.5rem 1.65rem;
  margin-bottom: 2.25rem;
  border-radius: calc(var(--sw-radius) + 2px);
  border: 1px solid color-mix(in srgb, var(--sw-accent-2) 22%, var(--sw-line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--sw-accent-2) 8%, var(--color-surface)), var(--color-surface));
  text-decoration: none;
  color: inherit;
  box-shadow: var(--color-shadow-lg);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.sw-featured:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--sw-accent) 35%, var(--sw-line));
  box-shadow: 0 14px 36px color-mix(in srgb, var(--sw-accent) 12%, transparent);
}

.sw-featured:has(.sw-featured__media) {
  grid-template-columns: minmax(160px, 240px) auto minmax(0, 1fr) auto;
}

.sw-featured__media {
  align-self: stretch;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-bg-alt);
}

.sw-featured__cover {
  width: 100%;
  height: 100%;
  min-height: 7.5rem;
  object-fit: cover;
  display: block;
}

.sw-featured__visual {
  padding: 0.35rem;
  border-radius: 12px;
  background: var(--color-bg-alt);
}

.sw-featured__logo {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 12px;
  object-fit: contain;
  display: block;
}

.sw-featured__badge {
  display: inline-block;
  margin-bottom: 0.45rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--theme-green-dark);
}

.sw-featured__body h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 500;
  margin: 0 0 0.4rem;
  line-height: 1.2;
}

.sw-featured__body p {
  margin: 0.5rem 0 0;
  color: var(--color-text-soft);
  font-size: 0.98rem;
  line-height: 1.5;
  max-width: 54ch;
}

.sw-featured__cta {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--sw-accent);
  white-space: nowrap;
}

/* Chips */
.sw-chip {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  color: var(--sw-accent);
  background: var(--sw-accent-soft);
}

.sw-chip--soft {
  color: var(--color-muted);
  background: color-mix(in srgb, var(--color-bg-alt) 80%, var(--color-surface));
}

/* Section */
.sw-section-head {
  margin-bottom: 1.15rem;
}

.sw-section-head h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  margin: 0 0 0.3rem;
}

.sw-section-head p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--color-muted);
  max-width: 52ch;
}

/* Card grid */
.sw-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
}

.sw-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  padding: 1.15rem 1.2rem 1rem;
  border-radius: var(--sw-radius);
  border: 1px solid var(--sw-line);
  background: var(--color-surface);
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.sw-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--sw-accent) 28%, var(--sw-line));
  box-shadow: var(--color-shadow-lg);
}

.sw-card:has(.sw-card__media) {
  padding-top: 0;
}

.sw-card__media {
  margin: 0 -1.2rem 0.85rem;
  overflow: hidden;
  border-radius: var(--sw-radius) var(--sw-radius) 0 0;
}

.sw-card__media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.sw-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.sw-card__logo {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 10px;
  object-fit: cover;
  background: var(--color-bg-alt);
}

.sw-card__title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 500;
  margin: 0 0 0.35rem;
  line-height: 1.25;
}

.sw-card__summary {
  flex: 1;
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.48;
  color: var(--color-muted);
}

.sw-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--sw-line);
}

.sw-card__link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sw-accent);
}

.sw-version {
  font-family: var(--sw-mono);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: var(--sw-accent);
  background: var(--sw-accent-soft);
  letter-spacing: 0.02em;
}

.sw-empty {
  padding: 2.5rem 0;
  text-align: center;
  color: var(--color-muted);
}

.sw-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.5rem 0 0;
  padding: 1.35rem 1.5rem;
  border-radius: var(--sw-radius);
  border: 1px dashed var(--sw-line);
  background: color-mix(in srgb, var(--color-surface) 70%, transparent);
}

.sw-cta h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  margin: 0 0 0.25rem;
}

.sw-cta p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-soft);
}

@media (max-width: 960px) {
  .sw-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .sw-featured {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .sw-featured__cta {
    justify-self: start;
  }

  .sw-grid {
    grid-template-columns: 1fr;
  }
}

/* —— Detail —— */
.sw-detail-page {
  padding-bottom: 3rem;
}

.sw-detail-hero {
  padding: 0 0 1.5rem;
}

.sw-detail-cover {
  margin: 0 0 1.35rem;
  border-radius: calc(var(--sw-radius) + 2px);
  overflow: hidden;
  border: 1px solid var(--sw-line);
  box-shadow: var(--color-shadow);
}

.sw-detail-cover img {
  width: 100%;
  max-height: 22rem;
  object-fit: cover;
  display: block;
}

.sw-back {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--sw-accent);
  text-decoration: none;
}

.sw-back:hover {
  text-decoration: underline;
}

.sw-detail-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.25rem 1.5rem;
  align-items: start;
}

.sw-detail-head__logo {
  width: 5rem;
  height: 5rem;
  border-radius: 12px;
  object-fit: contain;
  background: var(--color-surface);
  border: 1px solid var(--sw-line);
  padding: 0.55rem;
}

.sw-detail-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3.5vw, 2.35rem);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 0.45rem;
}

.sw-detail-head__lead {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--color-text-soft);
}

.sw-detail-head__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.sw-tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.22rem 0.55rem;
  border-radius: 4px;
  color: var(--theme-green-dark);
  background: color-mix(in srgb, var(--theme-green) 14%, var(--color-surface));
}

.sw-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 2.5rem 3rem;
  align-items: start;
}

@media (max-width: 860px) {
  .sw-detail-layout {
    grid-template-columns: 1fr;
  }
}

.sw-detail-main .prose {
  font-size: 1rem;
  line-height: 1.7;
}

.sw-features {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--sw-line);
}

.sw-features h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0 0 0.75rem;
}

.sw-legal {
  margin-top: 2rem;
  padding: 1rem 1.1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--color-muted);
  background: color-mix(in srgb, var(--color-bg-alt) 70%, transparent);
  border: 1px solid var(--sw-line);
}

.sw-aside {
  position: sticky;
  top: 6rem;
}

.sw-aside__block {
  padding: 1.15rem;
  border-radius: var(--sw-radius);
  border: 1px solid var(--sw-line);
  background: var(--color-surface);
  margin-bottom: 1rem;
}

.sw-aside__block h3 {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0 0 0.75rem;
}

.sw-aside__links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sw-aside__links a {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Related tools — mini cards */
.sw-related-grid {
  display: grid;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.sw-related-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.55rem 0.6rem;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.sw-related-card:hover {
  background: var(--sw-accent-soft);
}

.sw-related-card__logo {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 6px;
  object-fit: contain;
  background: var(--color-bg-alt);
}

.sw-related-card__title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.25;
}

.sw-related-card__arrow {
  font-size: 0.9rem;
  color: var(--color-muted);
}
