:root {
  --bg: #0b1022;
  /* Cards: see-through midnight blue, so the background glows show through. */
  --card: rgba(22, 30, 60, 0.6);
  --card-top: rgba(36, 48, 90, 0.6);
  --card-hover: rgba(46, 61, 112, 0.66);
  --card-solid: #141c38;
  --line: rgba(148, 170, 255, 0.13);
  --text: #e6e6e6;
  --title: #f4f5f8;
  --muted: #a7b0c6;
  --faint: #7c86a0;
  --accent: #5ea1ff;
  --gold: #f3c766;
  --silver: #d8e2ec;
  color-scheme: dark;
}

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-header,
main,
.footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--gold), var(--silver));
  color: #14120b;
  font-size: 16px;
}

.header-link {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.header-link:hover {
  color: var(--title);
  border-color: rgba(148, 170, 255, 0.3);
}

.intro {
  padding: 28px 0 6px;
}

.intro h1 {
  margin: 0 0 8px;
  color: var(--title);
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  letter-spacing: -0.02em;
}

.intro p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.5;
}

/* Category chips stick to the top while scrolling. The bar is see-through until it
   sticks (script.js adds .is-stuck); then it gets a backdrop across the whole window
   width — the spread shadow paints the sides and clip-path keeps it to the bar height. */
.chips {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 18px -16px 4px;
  padding: 10px 16px;
  transition: background-color 150ms ease, box-shadow 150ms ease;
}

.chips.is-stuck {
  background-color: rgba(11, 16, 34, 0.94);
  box-shadow: 0 0 0 100vmax rgba(11, 16, 34, 0.94);
  clip-path: inset(0 -100vmax);
}

/* The tabs sit in one dark track, like a segmented control, so they read as a switcher.
   The active tab is solid silver (same family as the home page button). */
.chips-inner {
  display: flex;
  gap: 2px;
  width: fit-content;
  max-width: 100%;
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  border: 1px solid rgba(148, 170, 255, 0.18);
  border-radius: 999px;
  background: rgba(6, 10, 26, 0.6);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.04);
}

.chips-inner::-webkit-scrollbar {
  display: none;
}

/* When the track scrolls sideways (phones), its edges fade to show there is more. */
.chips-inner.can-scroll-right {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent);
}

.chips-inner.can-scroll-left {
  -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 44px), transparent);
  mask-image: linear-gradient(to left, #000 calc(100% - 44px), transparent);
}

.chips-inner.can-scroll-left.can-scroll-right {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent);
}

.chips a {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 8px 14px 8px 12px;
  border-radius: 999px;
  color: #c3cbe0;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.chips a svg {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}

.chips a:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.chips a.is-active {
  background: linear-gradient(180deg, #f1f5f9, #cbd5e1);
  color: #0b1022;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 2px 10px rgba(148, 163, 184, 0.35);
}

.chips a.is-active svg {
  opacity: 1;
}

.category {
  padding: 22px 0 8px;
  scroll-margin-top: 64px;
}

.category h2 {
  margin: 0 0 14px;
  color: var(--title);
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

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

.app {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--card-top), var(--card));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 24px rgba(3, 6, 20, 0.3);
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.app:hover {
  border-color: rgba(94, 161, 255, 0.5);
  background: linear-gradient(180deg, var(--card-hover), var(--card-top));
  transform: translateY(-1px);
}

.app img {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 14px rgba(3, 6, 20, 0.4);
}

.app-short {
  display: none;
}

.app-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.app-name {
  color: var(--title);
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.25;
}

.app-desc {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.app-platforms {
  margin-top: 2px;
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin-top: 40px;
  padding: 26px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

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

/* Platform picker */
.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 20, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.modal-panel {
  position: relative;
  width: min(360px, 100%);
  padding: 28px 22px 24px;
  border: 1px solid rgba(148, 170, 255, 0.18);
  border-radius: 22px;
  background: linear-gradient(180deg, #1b2547, var(--card-solid));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 24px 70px rgba(3, 6, 20, 0.6);
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--title);
}

.modal-icon {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 17px;
}

.modal-panel h3 {
  margin: 0 0 6px;
  color: var(--title);
  font-size: 1.15rem;
}

.modal-note {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.modal-badges {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.store-badge[hidden] {
  display: none;
}

.store-badge img {
  display: block;
  width: 180px;
  height: auto;
}

/* Phones: a 3-column icon grid with short names, like an app shelf.
   The full name, description and platforms stay in the page for screen readers and search. */
@media (max-width: 600px) {
  .app-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px 8px;
  }

  .app,
  .app:hover {
    border: 0;
    background: none;
    box-shadow: none;
    transform: none;
  }

  .app {
    grid-template-columns: 1fr;
    justify-items: center;
    align-content: start;
    gap: 8px;
    padding: 0;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
  }

  .app img {
    width: 72px;
    height: 72px;
    border-radius: 17px;
    transition: transform 120ms ease;
  }

  .app:active img {
    transform: scale(0.94);
  }

  .app-short {
    display: block;
    color: var(--title);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.25;
  }

  .app-body {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app,
  .chips a {
    transition: none;
  }

  .app:hover {
    transform: none;
  }
}
