/* games.geniesolos.com: landing page and shared games-site chrome.
   Loads after css/style.css and css/cover-art.css, so every token, .btn,
   .shead, .wrap and .section rule already exists; this file only adds what
   the games site needs on top of them. Dark theme is a token remap on
   :root[data-theme="dark"] the same way the main site is (see style.css
   ~line 1356); the rules below that are dark-only lean into an arcade feel
   (phosphor glow, a scanline hint) rather than just recoloring shapes. */

/* ── Hero ───────────────────────────────────────────────────────── */
.games-hero {
  position: relative;
  overflow: clip;
  /* Bottom padding is small on purpose: the games-grid section right after
     it (below) carries its own full .section top padding, and stacking a
     second big gap on top of that is what left ~150px of dead air between
     the hero and "01 / All games" at 1280. */
  padding: calc(var(--nav-h) + clamp(40px, 7vw, 84px)) 0 clamp(16px, 2vw, 28px);
}

/* Fades the blob background into the page canvas instead of letting
   overflow: clip cut it off in a hard horizontal line at the section
   boundary. Sits above the blobs (z-index: 0, same stacking context, later
   in paint order) and below the hero content (z-index: 1). var(--cream) is
   the exact color both this section and the next one sit on, in either
   theme, so the seam is invisible. */
.games-hero::after {
  content: '';
  position: absolute; z-index: 0; inset: auto 0 0 0;
  height: min(220px, 40%);
  background: linear-gradient(to bottom, transparent, var(--cream));
  pointer-events: none;
}

.games-hero__blob {
  position: absolute; z-index: 0; pointer-events: none;
  filter: blur(60px);
  animation: blobMorph 26s ease-in-out infinite;
}
.games-hero__blob--a {
  top: -160px; right: -120px; width: min(520px, 60vw); aspect-ratio: 1;
  background: linear-gradient(135deg, rgba(46, 212, 127, .38), rgba(255, 201, 51, .3));
  border-radius: var(--blob-a);
}
.games-hero__blob--b {
  bottom: -200px; left: -160px; width: min(560px, 65vw); aspect-ratio: 1;
  background: linear-gradient(315deg, rgba(167, 139, 250, .34), rgba(46, 212, 127, .2));
  border-radius: var(--blob-c);
  animation-name: blobMorph;
  animation-duration: 32s;
  animation-direction: reverse;
}

.games-hero__inner {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(240px, .8fr);
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
}
/* Grid items default to min-width: auto, which floors them at their
   content's min-content size. A long, large headline can then force the
   track wider than the viewport even after the 880px breakpoint below
   collapses this to one column. min-width: 0 lets text wrap instead. */
.games-hero__inner > * { min-width: 0; }

.games-hero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12.5px; font-weight: 700;
  letter-spacing: .22em; color: var(--violet-deep);
}
.games-hero__eyebrow::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green-bright);
  box-shadow: 0 0 0 4px rgba(46, 212, 127, .18);
}

.games-hero__title {
  margin-top: 18px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(38px, 6.4vw, 74px);
  line-height: 1.02;
  letter-spacing: -.02em;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.games-hero__pitch {
  margin-top: 20px;
  max-width: 46ch;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.55;
  color: var(--ink-2);
}

.games-hero__actions {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: clamp(26px, 3.4vw, 36px);
}

/* Featured spotlight card: a gcard-scale surface that always exists (one
   game or ten), so the hero reads as "here's what's featured right now"
   rather than being welded to a single title. js/games.js re-renders its
   contents from whichever games.json entry is featured. */
.games-hero__spot {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  gap: 12px;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(24px, 3vw, 36px);
  box-shadow: var(--shadow-lg);
}
.games-hero__spot-label {
  align-self: flex-start;
  font-family: var(--mono); font-size: 11.5px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--violet-deep);
}
.games-hero__art { width: 100%; max-width: 300px; margin-inline: auto; }
.games-hero__spot-title {
  font-family: var(--sans); font-weight: 700;
  font-size: clamp(20px, 2.2vw, 26px);
  letter-spacing: -.01em; color: var(--ink);
}
.games-hero__spot-pitch {
  max-width: 36ch;
  font-size: 14.5px; line-height: 1.55; color: var(--ink-2);
}
.games-hero__spot-actions {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
  margin-top: 4px;
}

/* ── Game grid section ─────────────────────────────────────────── */
.games-grid {
  /* Overrides just the top of the inherited .section padding: the hero
     above already stopped short (see .games-hero), so this is now the
     only real gap between them. */
  padding-top: clamp(28px, 4vw, 56px);
}

.ggrid {
  display: grid;
  /* auto-fit, not auto-fill: with one or a few cards, auto-fill still
     reserves empty tracks for however many minmax(240px,...) columns
     could theoretically fit (4 at 1280 for 3 cards), leaving a visible
     dead column. auto-fit collapses tracks nothing is placed in, so the
     1fr on the remaining tracks fills the full row instead. */
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(18px, 2.6vw, 28px);
}

.gcard {
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
}
.gcard:hover, .gcard:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(124, 58, 237, .25);
  box-shadow: var(--shadow-lg);
}
:root[data-theme="dark"] .gcard:hover,
:root[data-theme="dark"] .gcard:focus-visible {
  border-color: rgba(0, 255, 156, .4);
}

/* Full-width banner at the top of the card, edge to edge; overflow:
   hidden on .gcard clips its square corners to the card's own radius. The
   2:1 aspect ratio and the sizing itself come from .cover--card in
   css/cover-art.css, so this just adds the wash it sits on. */
.gcard__cover {
  background: linear-gradient(140deg, rgba(46, 212, 127, .14), rgba(255, 201, 51, .12) 55%, rgba(167, 139, 250, .14));
}

.gcard__body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: clamp(18px, 2.2vw, 24px); }

.gcard__head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
}
.gcard__title {
  font-family: var(--sans); font-weight: 700;
  font-size: clamp(17px, 1.6vw, 19px);
  letter-spacing: -.01em;
}

.gcard__pitch {
  font-size: 14.5px; line-height: 1.55;
  color: var(--ink-2);
}

.gchips { display: flex; flex-wrap: wrap; gap: 6px; }
.gchip {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--cream-2);
  color: var(--muted);
}
.gchip--new {
  border-color: transparent;
  background: var(--sun);
  color: #4A3200;
  font-weight: 800;
}
:root[data-theme="dark"] .gchip--new { color: #120d00; box-shadow: 0 0 16px -4px rgba(255, 214, 10, .65); }

.gcard__best {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  color: var(--green-deep);
}

.gcard__play {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: auto;
  font-family: var(--mono); font-size: 12.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--violet-deep);
}
.gcard__play::after {
  content: '\2192';
  transition: transform .25s var(--ease);
}
.gcard:hover .gcard__play::after,
.gcard:focus-visible .gcard__play::after { transform: translateX(4px); }

/* Dark theme: phosphor glow around the whole card, plus a faint scanline
   texture on the cover, kept subtle so it reads as a hint, not a filter. */
:root[data-theme="dark"] .gcard { box-shadow: var(--shadow-md); }
:root[data-theme="dark"] .gcard::after {
  content: '';
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  border-radius: inherit;
  background: repeating-linear-gradient(
    to bottom, rgba(0, 255, 156, .05) 0px, rgba(0, 255, 156, .05) 1px,
    transparent 1px, transparent 3px
  );
  opacity: .5;
  mix-blend-mode: screen;
}
:root[data-theme="dark"] .gcard > * { position: relative; z-index: 1; }

/* ── Coming soon ────────────────────────────────────────────────── */
.gcard--soon {
  align-items: center; justify-content: center;
  text-align: center;
  gap: 8px;
  padding: clamp(18px, 2.2vw, 24px);
  background: transparent;
  border: 1.5px dashed var(--line);
  box-shadow: none;
  color: var(--muted);
  min-height: 200px;
}
.gcard--soon:hover { transform: none; box-shadow: none; border-color: var(--violet); }
.gcard__soon-badge {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--violet-deep);
}
.gcard__soon-text {
  font-family: var(--serif); font-style: italic; font-size: 16px;
  color: var(--ink-2);
}
.gcard--soon::before {
  content: '';
  position: absolute; inset: -40% -60%;
  background: linear-gradient(100deg, transparent 40%, rgba(124, 58, 237, .12) 50%, transparent 60%);
  animation: soonShimmer 4.5s ease-in-out infinite;
}
@keyframes soonShimmer {
  0%, 100% { transform: translateX(-30%); }
  50%      { transform: translateX(30%); }
}
:root[data-theme="dark"] .gcard--soon::before {
  background: linear-gradient(100deg, transparent 40%, rgba(0, 255, 156, .14) 50%, transparent 60%);
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 880px) {
  .games-hero__inner { grid-template-columns: 1fr; text-align: center; }
  .games-hero__pitch { margin-inline: auto; }
  .games-hero__actions { justify-content: center; }
  .games-hero__eyebrow { justify-content: center; width: 100%; }
  .games-hero__spot { max-width: 420px; margin-inline: auto; }
  .games-hero__art { max-width: 240px; }
  .games-hero__spot-label { align-self: center; }
}

@media (max-width: 400px) {
  .games-hero { padding-top: calc(var(--nav-h) + 28px); }
  .games-hero__actions,
  .games-hero__spot-actions { flex-direction: column; align-items: stretch; }
  .games-hero__actions .btn,
  .games-hero__spot-actions .btn { justify-content: center; }
  .ggrid { grid-template-columns: 1fr; }
}

/* ── Reduced motion / print ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .games-hero__blob, .gcard--soon::before { animation: none; }
}

@media print {
  .games-hero__blob, .gcard--soon::before, .gcard::after { display: none !important; }
  .gcard { box-shadow: none; border: 1px solid #ccc; break-inside: avoid-page; }
}
