:root {
  color-scheme: dark;
  --bg: #080a09;
  --bg-soft: #101410;
  --panel: #151915;
  --panel-strong: #1d241e;
  --text: #f7f3e8;
  --muted: #cfc7b4;
  --line: #33392f;
  --gold: #e4b45f;
  --teal: #38c8bd;
  --green: #88b96f;
  --blue: #78a9d6;
  --red: #d97868;
  --ink: #080a09;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 10, 9, 0.92);
  backdrop-filter: blur(18px);
}

.nav-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 800;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--gold);
  color: var(--ink);
  font-weight: 900;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
}

.nav a:hover,
.nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.hero {
  min-height: 560px;
  display: grid;
  align-items: end;
  background-image:
    linear-gradient(90deg, rgba(8, 10, 9, 0.95), rgba(8, 10, 9, 0.76), rgba(8, 10, 9, 0.22)),
    url("../img/banner.jpg");
  background-position: center;
  background-size: cover;
  border-bottom: 1px solid var(--line);
}

.hero__inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 92px 0 54px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-size: 4rem;
  line-height: 0.98;
}

h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.12;
}

h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
}

p,
li {
  color: var(--muted);
  font-size: 1rem;
}

.lede {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--text);
  font-size: 1.25rem;
}

.section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0;
}

.section--tight {
  padding-top: 34px;
}

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

.section-heading p {
  max-width: 620px;
  margin: 8px 0 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 640px;
  margin-top: 34px;
}

.stat {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 14px;
  background: rgba(8, 10, 9, 0.72);
}

.stat strong {
  display: block;
  color: var(--text);
  font-size: 2rem;
  line-height: 1;
}

.stat span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.88rem;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.search-field {
  min-height: 48px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d100d;
  color: var(--text);
  padding: 10px 14px;
  font: inherit;
}

.search-field::placeholder {
  color: #948e80;
}

.segmented {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 4px;
}

.segmented button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  padding: 8px 12px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.segmented button.is-active {
  background: var(--gold);
  color: var(--ink);
}

.catalog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: 22px;
  align-items: start;
}

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

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

.app-card {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

.app-card.is-selected {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.app-card__top,
.detail-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-card__status {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 800;
}

.app-card p {
  margin: 0;
}

.app-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

.app-meta span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.03);
}

.app-icon {
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-weight: 900;
}

.app-icon--image {
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
}

.app-icon--gold {
  background: var(--gold);
}

.app-icon--teal {
  background: var(--teal);
}

.app-icon--green {
  background: var(--green);
}

.app-icon--blue {
  background: var(--blue);
}

.app-icon--red {
  background: var(--red);
}

.text-link {
  color: var(--text);
  font-weight: 800;
  text-decoration-color: var(--gold);
  text-underline-offset: 4px;
}

.detail-panel {
  position: sticky;
  top: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 20px;
}

.detail-panel--static {
  position: static;
  max-width: 680px;
}

.detail-panel p {
  margin: 8px 0 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.detail-grid section,
.privacy-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
}

.definition-list {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
}

.definition-list div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  color: var(--text);
  font-weight: 750;
}

.media-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.media-gallery figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #0d100d;
}

.media-gallery img {
  width: 100%;
  aspect-ratio: 9 / 16;
  height: auto;
  object-fit: cover;
  object-position: top center;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}

.button--primary {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--ink);
}

.button--disabled {
  color: #938c7e;
  background: #111411;
}

.small-note {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 14px;
  font-size: 0.92rem;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 16px 42px;
  color: var(--muted);
}

.footer-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-inner p {
  margin: 0;
  font-size: 0.92rem;
}

@media (max-width: 980px) {
  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
  }

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

@media (max-width: 720px) {
  .nav-shell {
    min-height: auto;
    padding: 12px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }

  .hero {
    min-height: 520px;
  }

  h1 {
    font-size: 2.6rem;
  }

  h2 {
    font-size: 1.55rem;
  }

  .lede {
    font-size: 1.08rem;
  }

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

  .segmented {
    width: 100%;
    overflow-x: auto;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .definition-list div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .media-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
