/* Softer typography, scoped to the homepage so editorial text stays unchanged. */
.home-page {
  --home-heading-ink: rgba(231, 226, 245, .78);
}

/* A compact, static entrance to the existing guardian atlas. */
.home-page .home-universe-cover {
  position: relative;
  display: block;
  width: min(100%, 900px);
  margin: 12px auto 0;
  color: #ffe2a6;
  background: #030510;
  line-height: 0;
  text-decoration: none;
}

.home-page .home-universe-cover > img {
  display: block;
  width: 100%;
  height: auto;
}

.home-page .home-universe-cover__arrow {
  position: absolute;
  right: clamp(12px, 2vw, 20px);
  bottom: clamp(12px, 2vw, 20px);
  width: clamp(22px, 3vw, 32px);
  height: clamp(22px, 3vw, 32px);
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .85));
}

.home-page .home-universe-cover__arrow svg {
  display: block;
  width: 100%;
  height: 100%;
}

.home-page .home-universe-cover:hover {
  color: #fff7e0;
}

.home-page .home-universe-cover:focus-visible {
  outline: 3px solid var(--mt-accent, var(--cyan, #ffe2a6));
  outline-offset: -4px;
}

/* Games and partners lead the homepage; reuse the site's existing rail controls. */
.home-page .home-game-rail {
  grid-auto-columns: calc((100% - 36px) / 3);
  align-items: start;
}

.home-page .home-game-card {
  display: block;
  min-width: 0;
  scroll-snap-align: start;
  color: inherit;
  text-align: center;
  text-decoration: none;
}

.home-page .home-game-card > img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border: 1px solid rgba(187, 130, 239, .4);
  border-radius: 14px;
  background: rgba(4, 5, 16, .8);
  box-shadow: 0 5px 18px rgba(0, 0, 0, .28);
}

.home-page .home-game-card h3 {
  margin: 10px 0 0;
  color: var(--home-heading-ink);
  font-size: clamp(.75rem, 1.5vw, 1.05rem);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.home-page .home-game-card:hover > img {
  border-color: #d3a6f1;
}

.home-page .game-public-analytics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 12px;
  margin-top: 7px;
  color: #d7dbea;
  font-size: clamp(.6rem, 2.2vw, .8rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}
.home-page .game-public-analytics .public-analytics-metric { white-space: nowrap; }

.home-page .home-game-card:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: -2px;
  border-radius: 14px;
}

.home-page .home-games .section-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.home-page .home-games .section-head h2 { margin: 0; text-align: left; }
.home-page .home-games .section-head > span { flex: 1; }
.home-page .home-games .section-head::after { display: none; }
.home-page .home-games .home-games-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  margin-left: auto;
  white-space: nowrap;
}
.home-page .home-games .home-games-all > span { width: auto; height: auto; background: none; }

/* Keep the games shortcut in the header alongside chat, including narrow phones. */
.home-page .header.site-header { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.home-page .site-header > .brand { grid-column: 1; grid-row: 1; }
.home-page .site-header > .nav { grid-column: 2; grid-row: 1; }
.home-page .site-header > .chat-launch { grid-column: 3; grid-row: 1; }
.home-page .site-header > .site-games-link { grid-column: 4; grid-row: 1; }
.home-page .site-games-link {
  position: relative;
  z-index: 1100;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid rgba(184, 126, 240, .5);
  border-radius: 12px;
  color: #eadbff;
  background: linear-gradient(145deg, rgba(141, 75, 193, .2), rgba(15, 13, 31, .9));
  box-shadow: inset 0 1px rgba(255, 255, 255, .08);
  font-size: .76rem;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}
.home-page .site-games-link svg { width: 20px; height: 20px; flex: 0 0 auto; }
.home-page .site-games-link:hover { color: #fff; border-color: #d3a6f1; }

@media (max-width: 1280px) {
  .home-page .header.site-header { grid-template-columns: minmax(0, 1fr) auto auto auto; }
  .home-page .site-header > .chat-launch { grid-column: 2; }
  .home-page .site-header > .site-games-link { grid-column: 3; }
  .home-page .site-header > .menu-button { grid-column: 4; grid-row: 1; }
}

@media (max-width: 660px) {
  .home-page #games { padding-top: 16px; }
  .home-page .home-game-rail { grid-auto-columns: calc((100% - 16px) / 3); gap: 8px; }
  .home-page .home-game-card > img { border-radius: 10px; }
  .home-page .home-game-card h3 { margin-top: 7px; font-size: clamp(.58rem, 2.5vw, .75rem); }
  .home-page .home-games .section-head h2 { font-size: clamp(1.2rem, 5.7vw, 1.55rem); }
  .home-page .home-games .home-games-all { font-size: .6rem; }
}

@media (max-width: 380px) {
  .home-page .header.site-header { gap: 6px; padding-right: 8px; padding-left: 8px; }
  .home-page .site-header > .brand { gap: 5px; font-size: 1.05rem; }
  .home-page .site-header .brand-logo { width: 28px; height: 24px; }
  .home-page .site-header > .chat-launch { min-width: 52px; padding: 0 8px; font-size: .68rem; letter-spacing: .04em; }
  .home-page .site-games-link { gap: 4px; padding: 0 8px; font-size: .68rem; }
  .home-page .site-games-link svg { width: 18px; height: 18px; }
}

.home-page [data-home-section][hidden] { display: none !important; }

.home-page .section-head h2,
.home-page .community-leaderboard__head h2,
.home-page .community-activity__head h2 {
  color: var(--home-heading-ink);
  text-shadow: 0 2px 14px rgba(2, 3, 12, .42);
}

.home-page .hero-top .eyebrow {
  color: rgba(218, 195, 238, .8);
  text-shadow: 0 2px 10px rgba(2, 3, 12, .7);
}

.home-page .hero-top .subtitle {
  color: rgba(233, 226, 245, .78);
  text-shadow: 0 2px 12px rgba(2, 3, 12, .75);
}

.home-page .home-about h2 {
  color: rgba(226, 215, 242, .72);
  text-shadow: 0 2px 20px rgba(2, 3, 12, .3);
}

.home-page .home-about h3 {
  color: var(--home-heading-ink);
}

.home-page .section-feed-toggle:hover,
.home-page .section-feed-toggle:focus-visible {
  color: rgba(241, 234, 253, .92);
  background: rgba(195, 164, 236, .04);
  text-shadow: 0 2px 14px rgba(2, 3, 12, .42);
}

.home-page .section-head > span {
  background: linear-gradient(90deg, transparent, rgba(204, 192, 230, .29));
}

.home-page .section-head::after {
  background: linear-gradient(90deg, rgba(204, 192, 230, .29), transparent);
}

/* Keep controls inside the collapsible feed, with the existing card widths. */
.home-page .rail-arrow {
  display: grid;
  place-items: center;
  top: calc(50% - 5px);
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(208, 188, 245, .34);
  border-radius: 50%;
  color: rgba(237, 228, 255, .94);
  background: linear-gradient(145deg, rgba(33, 25, 49, .78), rgba(7, 11, 26, .86));
  box-shadow: 0 4px 18px rgba(1, 3, 12, .32), inset 0 1px 0 rgba(240, 225, 255, .08);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 0;
  text-shadow: none;
  touch-action: manipulation;
  transition: color .18s ease, border-color .18s ease, background-color .18s ease, opacity .18s ease;
}

.home-page .rail-arrow.left { left: 4px; }
.home-page .rail-arrow.right { right: 4px; }
.home-page .rail-arrow[hidden] { display: none !important; }

.home-page .rail-arrow svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

@media (hover: hover) {
  .home-page .rail-arrow:not(:disabled):hover {
    color: #e4f6ff;
    border-color: rgba(159, 220, 239, .7);
    background: linear-gradient(145deg, rgba(51, 36, 72, .9), rgba(13, 26, 42, .94));
  }
}

.home-page .rail-arrow:focus-visible {
  outline: 2px solid #9cdeed;
  outline-offset: -4px;
}

.home-page .rail-arrow:disabled {
  opacity: .24;
  cursor: default;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .home-page .rail-arrow { transition: none; }
}

@media (prefers-contrast: more) {
  .home-page .section-head h2,
  .home-page .community-leaderboard__head h2,
  .home-page .community-activity__head h2,
  .home-page .hero-top .eyebrow,
  .home-page .hero-top .subtitle,
  .home-page .home-about h2,
  .home-page .home-about h3 { color: #f1edfa; }
  .home-page .rail-arrow { border-color: #d6c9ef; }
}
