:root {
  color-scheme: light;
  --ink: #101623;
  --muted: #667085;
  --line: #d8dee8;
  --paper: #ffffff;
  --wash: #f4f7fb;
  --brand: #0a7c72;
  --brand-dark: #075f58;
  --accent: #c9432f;
  --gold: #b7791f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 16px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(16, 22, 35, 0.1);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

#localeSelect {
  width: auto;
  min-width: 68px;
  padding: 9px 30px 9px 10px;
}

.brand {
  font-weight: 800;
  font-size: 20px;
}

nav {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

nav a,
.footer a {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 14px;
}

nav a:hover,
.footer a:hover {
  color: var(--ink);
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  padding: 11px 15px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.primary-action {
  background: var(--brand);
  white-space: nowrap;
}

.primary-action:hover,
button:hover,
.button:hover {
  background: var(--brand-dark);
}

.hero {
  min-height: 520px;
  display: grid;
  align-items: center;
  padding: 72px clamp(18px, 5vw, 72px) 42px;
  background:
    linear-gradient(90deg, rgba(3, 18, 32, 0.82), rgba(3, 18, 32, 0.32)),
    url("/assets/hero.svg") center / cover no-repeat;
  color: #fff;
}

.hero-inner {
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 16px;
  color: #d7f4f0;
  font-weight: 700;
}

h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(42px, 8vw, 82px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero p {
  max-width: 650px;
  font-size: 19px;
  line-height: 1.55;
  color: #e7edf5;
}

.searchbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  max-width: 680px;
  margin-top: 26px;
  padding: 8px;
  background: #fff;
  border-radius: 8px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.searchbar input {
  border: 0;
}

.section {
  padding: 46px clamp(18px, 5vw, 72px);
}

.section.alt {
  background: var(--wash);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
}

.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.screenshot {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #edf2f7;
}

.card-body {
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  padding: 16px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.card h3 {
  margin: 12px 0 6px;
  font-size: 19px;
}

.card p {
  display: -webkit-box;
  min-height: 66px;
  margin: 0 0 14px;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.tags {
  min-height: 26px;
  margin-bottom: 14px;
}

.signal {
  color: var(--gold);
  font-weight: 700;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.secondary {
  background: #eef4f8;
  color: var(--ink);
  text-align: center;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.category-tile {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
  font-weight: 800;
}

.category-tile strong {
  color: var(--brand);
}

.page-title,
.detail-title {
  max-width: none;
  color: var(--ink);
  font-size: 42px;
  line-height: 1.1;
}

.detail-title {
  margin-top: 22px;
}

.detail-description,
.prose p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.detail aside .button,
.detail aside button {
  width: 100%;
}

.detail dl {
  margin: 24px 0;
}

.detail dt {
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.detail dd {
  margin: 3px 0 0;
  font-weight: 700;
}

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 26px;
  align-items: start;
}

.detail aside {
  border-left: 1px solid var(--line);
  padding-left: 24px;
}

.empty {
  padding: 30px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
}

.empty .retry {
  margin-left: 16px;
}

.text-link {
  color: var(--brand-dark);
  font-weight: 800;
  white-space: nowrap;
}

.ecosystem-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 36px clamp(18px, 5vw, 72px);
  color: #fff;
  background: #0a7c72;
}

.ecosystem-band p {
  max-width: 760px;
  margin-bottom: 0;
  color: #e3f6f3;
}

.ecosystem-band button {
  color: var(--ink);
  background: #fff;
  white-space: nowrap;
}

.page-search {
  margin-bottom: 24px;
}

.search-results {
  margin-top: 20px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 28px;
}

.page-control {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-weight: 700;
}

.page-control.disabled {
  color: #98a2b3;
  background: var(--wash);
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.skeleton-card {
  min-height: 360px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.skeleton-card::before,
.skeleton-card span {
  display: block;
  content: '';
  height: 18px;
  margin-bottom: 14px;
  background: #e9edf2;
}

.skeleton-card::before {
  height: 180px;
  margin: -16px -16px 20px;
}

.skeleton-card span:nth-child(2) {
  width: 82%;
}

.skeleton-card span:nth-child(3) {
  width: 64%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 28px;
  border-top: 1px solid var(--line);
  background: #fff;
}

@media (max-width: 820px) {
  .site-header {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .site-header > *,
  .detail > * {
    min-width: 0;
  }

  nav {
    justify-content: start;
    width: 100%;
  }

  .hero {
    min-height: 500px;
  }

  .searchbar,
  .detail {
    grid-template-columns: 1fr;
  }

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

  .ecosystem-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail aside {
    border-left: 0;
    padding-left: 0;
  }
}

@media (max-width: 520px) {
  .site-header,
  .section {
    padding-left: 20px;
    padding-right: 20px;
  }

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

  nav a {
    padding: 7px 4px;
  }

  .page-title,
  .detail-title {
    max-width: 100%;
    font-size: 38px;
    overflow-wrap: anywhere;
  }

  .section-head {
    display: block;
  }

  .card-actions {
    grid-template-columns: 1fr;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .pagination {
    gap: 8px;
  }

  h1 {
    font-size: 42px;
  }
}
