:root {
  color-scheme: light dark;
  --bg: radial-gradient(125% 125% at 12% -10%, #173d6f 0%, rgba(11, 30, 58, 0.95) 35%, #031021 80%);
  --bg-glow: radial-gradient(90% 90% at 85% 5%, rgba(31, 157, 247, 0.28) 0%, rgba(4, 17, 36, 0) 70%);
  --card-bg: rgba(7, 24, 46, 0.92);
  --card-border: rgba(136, 184, 255, 0.25);
  --surface: rgba(9, 28, 52, 0.88);
  --surface-strong: rgba(6, 20, 40, 0.95);
  --text: #f7fbff;
  --text-muted: #b5c7dc;
  --accent: #ff8c32;
  --accent-soft: rgba(255, 140, 50, 0.18);
  --accent-alt: #1f9df7;
  --shadow: 0 26px 60px rgba(1, 10, 24, 0.55);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --max-width: 1140px;
  --transition: all 0.22s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg), #02060f;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--bg-glow);
  opacity: 0.85;
  pointer-events: none;
  z-index: -2;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.hero {
  position: relative;
  padding: 76px 24px 58px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(6, 18, 38, 0.7) 0%, rgba(12, 30, 58, 0.3) 55%, rgba(20, 52, 95, 0) 100%);
  border-radius: 0 0 48px 48px;
  pointer-events: none;
}

.hero__content {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 1;
}

.hero__logo {
  width: clamp(180px, 28vw, 260px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.35));
  margin-bottom: 8px;
}

.hero__eyebrow {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-alt);
  font-weight: 600;
  margin: 0;
}

.hero__title {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}

.hero__subtitle {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 18px;
}

.hero__meta {
  position: relative;
  max-width: var(--max-width);
  margin: 36px auto 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  z-index: 1;
}

.meta-pill {
  background: var(--surface-strong);
  color: var(--text-muted);
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  font-size: 14px;
  letter-spacing: 0.02em;
  backdrop-filter: blur(18px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  border: 1px solid transparent;
  transition: var(--transition);
  cursor: pointer;
  gap: 8px;
  font-size: 15px;
  letter-spacing: 0.01em;
}

.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn--primary {
  background: linear-gradient(120deg, rgba(31, 157, 247, 0.95) 0%, rgba(255, 140, 50, 0.95) 100%);
  color: #051121;
  box-shadow: 0 16px 32px rgba(31, 157, 247, 0.28), 0 12px 24px rgba(255, 140, 50, 0.22);
}

.btn--primary:hover {
  box-shadow: 0 18px 40px rgba(31, 157, 247, 0.34), 0 16px 32px rgba(255, 140, 50, 0.26);
}

.btn--secondary {
  background: rgba(31, 157, 247, 0.18);
  border-color: rgba(31, 157, 247, 0.35);
  color: #d7e9ff;
}

.btn--secondary:hover {
  background: rgba(31, 157, 247, 0.28);
  border-color: rgba(31, 157, 247, 0.5);
}

.btn--ghost {
  background: transparent;
  border-color: rgba(241, 248, 255, 0.16);
  color: var(--text-muted);
}

.btn--ghost:hover {
  border-color: rgba(241, 248, 255, 0.28);
  color: var(--text);
}

.catalog {
  flex: 1;
  padding: 36px 24px 96px;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.catalog__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.catalog__header h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 600;
}

.catalog__controls {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.catalog__controls input,
.catalog__controls select {
  background: var(--surface);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  min-width: 220px;
  font-size: 15px;
  transition: var(--transition);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.catalog__controls input::placeholder {
  color: var(--text-muted);
}

.catalog__controls input:focus,
.catalog__controls select:focus {
  outline: none;
  border-color: rgba(31, 157, 247, 0.6);
  box-shadow: 0 0 0 3px rgba(31, 157, 247, 0.2);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 26px;
}

.service-card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 26px;
  gap: 18px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, rgba(31, 157, 247, 0.12) 0%, rgba(255, 140, 50, 0.12) 60%, transparent 85%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.service-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 140, 50, 0.45);
}

.service-card:hover::before {
  opacity: 1;
}

.service-card__icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(4, 17, 36, 0.7);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.service-card__icon--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  color: var(--accent);
}

.service-card__content h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.service-card__description {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

.service-card__tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(31, 157, 247, 0.18);
  color: #cbe4ff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.service-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.service-card__software {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
}

.service-card__software a {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: rgba(31, 157, 247, 0.16);
  color: #deeeff;
  text-decoration: none;
  transition: var(--transition);
}

.service-card__software a:hover {
  background: rgba(31, 157, 247, 0.28);
}

.service-card__author,
.service-card__license {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

.service-card__license a,
.service-card__author a {
  color: #e9f3ff;
}

.service-card__actions {
  display: flex;
  gap: 12px;
  margin-top: auto;
  flex-wrap: wrap;
}

.service-card .btn {
  flex: 1 1 auto;
  min-width: 150px;
  justify-content: center;
}

.empty-state {
  text-align: center;
  margin-top: 52px;
  color: var(--text-muted);
  background: var(--surface);
  padding: 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
}

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 32px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  background: rgba(3, 12, 26, 0.95);
  backdrop-filter: blur(12px);
}

.site-footer a {
  color: var(--accent-alt);
}

@media (max-width: 820px) {
  .hero {
    padding-top: 56px;
  }

  .hero__content {
    text-align: center;
    align-items: center;
  }

  .hero__subtitle {
    max-width: none;
  }

  .hero__meta {
    justify-content: center;
  }

  .catalog__header {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 680px) {
  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .service-card {
    padding: 22px;
  }

  .service-card__actions {
    flex-direction: column;
  }

  .catalog__controls {
    flex-direction: column;
    align-items: stretch;
  }

  .catalog__controls input,
  .catalog__controls select {
    width: 100%;
    min-width: 0;
  }
}
