:root {
  --background: #09090b;
  --surface: #111114;
  --surface-hover: #18181c;
  --border: #27272a;

  --text: #f4f4f5;
  --muted: #a1a1aa;

  --accent: #ffffff;
  --accent-text: #09090b;

  --max-width: 1150px;
}

[data-theme="light"] {
  --background: #f8f8f8;
  --surface: #ffffff;
  --surface-hover: #f1f1f1;
  --border: #dedede;

  --text: #18181b;
  --muted: #66666f;

  --accent: #18181b;
  --accent-text: #ffffff;
}


/* =========================
   Reset
========================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;

  background: var(--background);
  color: var(--text);

  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  line-height: 1.6;
}

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

button,
input,
select {
  font: inherit;
}


/* =========================
   Accessibility
========================= */

.sr-only {
  position: absolute;

  width: 1px;
  height: 1px;

  padding: 0;
  margin: -1px;

  overflow: hidden;

  clip: rect(0, 0, 0, 0);

  white-space: nowrap;

  border: 0;
}


/* =========================
   Layout
========================= */

.container {
  width: min(
    calc(100% - 40px),
    var(--max-width)
  );

  margin: 0 auto;
}


/* =========================
   Header
========================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;

  border-bottom: 1px solid var(--border);

  background: rgba(9, 9, 11, 0.85);

  backdrop-filter: blur(16px);
}

[data-theme="light"] .site-header {
  background: rgba(248, 248, 248, 0.88);
}

.header-inner {
  min-height: 70px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 24px;
}

.logo {
  display: inline-flex;
  align-items: center;

  gap: 10px;

  font-size: 1rem;
  font-weight: 700;

  letter-spacing: -0.02em;
}

.logo-mark {
  width: 34px;
  height: 34px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid var(--border);
  border-radius: 8px;

  background: var(--surface);

  font-size: 0.8rem;
}

.nav {
  display: flex;
  align-items: center;

  gap: 22px;
}

.nav a {
  color: var(--muted);

  font-size: 0.9rem;
  font-weight: 500;

  transition: color 0.2s ease;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
}

.theme-toggle {
  width: 36px;
  height: 36px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px solid var(--border);
  border-radius: 8px;

  background: var(--surface);
  color: var(--text);

  cursor: pointer;

  transition: background 0.2s ease;
}

.theme-toggle:hover {
  background: var(--surface-hover);
}


/* =========================
   Catalog Hero
========================= */

.catalog-hero {
  padding: 90px 0 65px;

  border-bottom: 1px solid var(--border);
}

.catalog-hero .container {
  max-width: 900px;

  text-align: center;
}

.eyebrow {
  display: inline-block;

  margin-bottom: 16px;

  color: var(--muted);

  font-size: 0.72rem;
  font-weight: 700;

  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.catalog-hero h1 {
  font-size: clamp(
    3rem,
    7vw,
    5.5rem
  );

  line-height: 0.98;

  letter-spacing: -0.065em;
}

.catalog-hero p {
  max-width: 620px;

  margin: 22px auto 0;

  color: var(--muted);

  font-size: 1rem;
}


/* =========================
   Search
========================= */

.catalog-search {
  max-width: 700px;

  display: flex;

  margin: 32px auto 0;

  overflow: hidden;

  border: 1px solid var(--border);
  border-radius: 12px;

  background: var(--surface);
}

.catalog-search input {
  min-width: 0;
  flex: 1;

  padding: 16px 18px;

  border: 0;
  outline: 0;

  background: transparent;
  color: var(--text);

  font-size: 0.95rem;
}

.catalog-search input::placeholder {
  color: var(--muted);
}

.catalog-search button {
  padding: 0 24px;

  border: 0;
  border-left: 1px solid var(--border);

  background: var(--accent);
  color: var(--accent-text);

  font-weight: 700;

  cursor: pointer;

  transition: opacity 0.2s ease;
}

.catalog-search button:hover {
  opacity: 0.85;
}


/* =========================
   Sections
========================= */

.section {
  padding: 75px 0;
}


/* =========================
   Toolbar / Filters
========================= */

.catalog-toolbar {
  display: grid;

  grid-template-columns: repeat(4, 1fr);

  gap: 14px;

  margin-bottom: 65px;

  padding: 20px;

  border: 1px solid var(--border);
  border-radius: 14px;

  background: var(--surface);
}

.filter-group {
  display: flex;
  flex-direction: column;

  gap: 7px;
}

.filter-group label {
  color: var(--muted);

  font-size: 0.72rem;
  font-weight: 700;

  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.filter-group select {
  width: 100%;

  min-height: 44px;

  padding: 0 12px;

  border: 1px solid var(--border);
  border-radius: 8px;

  outline: 0;

  background: var(--background);
  color: var(--text);

  cursor: pointer;
}

.filter-group select:focus {
  border-color: var(--muted);
}


/* =========================
   Catalog Header
========================= */

.catalog-header {
  display: flex;
  align-items: end;
  justify-content: space-between;

  gap: 25px;

  margin-bottom: 30px;
}

.catalog-header h2 {
  font-size: clamp(
    2rem,
    4vw,
    3rem
  );

  line-height: 1.05;

  letter-spacing: -0.05em;
}

.catalog-header p {
  margin-top: 9px;

  color: var(--muted);

  font-size: 0.9rem;
}

.app-count {
  flex-shrink: 0;

  color: var(--muted);

  font-size: 0.82rem;
  font-weight: 600;
}


/* =========================
   Application Grid
========================= */

.app-grid {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 18px;
}


/* =========================
   Application Cards
========================= */

.app-card {
  min-height: 245px;

  padding: 24px;

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  gap: 25px;

  border: 1px solid var(--border);
  border-radius: 14px;

  background: var(--surface);

  transition:
    transform 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.app-card:hover {
  transform: translateY(-3px);

  background: var(--surface-hover);
}

.app-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 15px;
}

.app-icon {
  width: 68px;
  height: 68px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  border: 1px solid var(--border);
  border-radius: 12px;

  background: var(--background);

  font-size: 1.1rem;
  font-weight: 800;
}

.app-card-content h3 {
  font-size: 1.1rem;

  line-height: 1.25;
}

.app-card-content p {
  margin-top: 7px;

  color: var(--muted);

  font-size: 0.85rem;

  line-height: 1.5;
}

.app-meta {
  display: flex;
  flex-wrap: wrap;

  gap: 7px;

  margin-top: 17px;
}

.app-meta span {
  padding: 4px 8px;

  border: 1px solid var(--border);
  border-radius: 6px;

  color: var(--muted);

  font-size: 0.7rem;
}

.app-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 15px;

  padding-top: 16px;

  border-top: 1px solid var(--border);
}

.app-platforms {
  color: var(--muted);

  font-size: 0.75rem;
}

.app-link {
  color: var(--muted);

  font-size: 0.8rem;
  font-weight: 700;

  transition: color 0.2s ease;
}

.app-link:hover {
  color: var(--text);
}


/* =========================
   Empty State
========================= */

.empty-state {
  padding: 70px 25px;

  text-align: center;

  border: 1px solid var(--border);
  border-radius: 14px;

  background: var(--surface);
}

.empty-state[hidden] {
  display: none;
}

.empty-state h3 {
  font-size: 1.4rem;
}

.empty-state p {
  margin-top: 7px;

  color: var(--muted);

  font-size: 0.9rem;
}

.primary-button {
  min-height: 46px;

  margin-top: 22px;

  padding: 0 20px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 0;
  border-radius: 9px;

  background: var(--accent);
  color: var(--accent-text);

  font-size: 0.85rem;
  font-weight: 700;

  cursor: pointer;

  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.primary-button:hover {
  opacity: 0.86;

  transform: translateY(-1px);
}


/* =========================
   Footer
========================= */

.site-footer {
  padding: 55px 0 25px;

  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 30px;
}

.footer-inner strong {
  font-size: 0.95rem;
}

.footer-inner p {
  margin-top: 5px;

  color: var(--muted);

  font-size: 0.82rem;
}

.footer-creator {
  display: flex;
  flex-direction: column;

  text-align: right;
}

.footer-creator span {
  color: var(--muted);

  font-size: 0.75rem;
}

.footer-creator a {
  margin-top: 3px;

  color: var(--muted);

  font-size: 0.8rem;

  transition: color 0.2s ease;
}

.footer-creator a:hover {
  color: var(--text);
}

.footer-bottom {
  margin-top: 40px;
  padding-top: 20px;

  border-top: 1px solid var(--border);

  color: var(--muted);

  font-size: 0.72rem;
}


/* =========================
   Responsive
========================= */

@media (max-width: 900px) {
  .catalog-toolbar {
    grid-template-columns: repeat(2, 1fr);
  }

  .app-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


@media (max-width: 700px) {
  .header-inner {
    flex-direction: column;
    justify-content: center;

    padding: 14px 0;
  }

  .nav {
    width: 100%;

    justify-content: center;

    flex-wrap: wrap;

    gap: 14px;
  }

  .catalog-hero {
    padding: 70px 0 55px;
  }

  .catalog-toolbar {
    grid-template-columns: 1fr;

    margin-bottom: 50px;
  }

  .catalog-header {
    align-items: flex-start;

    flex-direction: column;
  }

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

  .footer-inner {
    flex-direction: column;
  }

  .footer-creator {
    text-align: left;
  }
}


@media (max-width: 500px) {
  .container {
    width: min(
      calc(100% - 28px),
      var(--max-width)
    );
  }

  .catalog-search {
    flex-direction: column;
  }

  .catalog-search button {
    min-height: 48px;

    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .catalog-toolbar {
    padding: 16px;
  }

  .app-card {
    padding: 20px;
  }
}