/**
 * Gamers Arena homepage storefront
 * Dials: VARIANCE 8 / MOTION 7 / DENSITY 4
 * Stack: Blade + CSS (existing Laravel theme). Teal accent on charcoal.
 */

.storefront-home.ga-home {
  --ga-accent: rgb(var(--primary-color, 45, 196, 184));
  --ga-accent-ink: #0c0f15;
  --ga-surface: var(--bg-color2, #12161e);
  --ga-surface-2: var(--bg-color3, #1a2030);
  --ga-page: var(--bg-color1, #0c0f15);
  --ga-text: rgb(var(--heading-color, 244, 246, 250));
  --ga-muted: var(--body-color, #b4bac8);
  --ga-border: var(--border-color1, rgba(244, 246, 250, 0.1));
  --ga-radius: 16px;
  --ga-radius-sm: 12px;
  --smm-accent: var(--ga-accent);
  --smm-accent-strong: var(--ga-accent);
  --smm-focus: var(--ga-accent);
  --smm-chip: color-mix(in srgb, var(--ga-accent) 18%, transparent);
  font-family: var(--body-font, "Outfit", "Segoe UI", sans-serif);
  padding: 1.25rem 0 4.5rem;
  color: var(--ga-muted);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, color-mix(in srgb, var(--ga-accent) 16%, transparent), transparent 55%),
    radial-gradient(ellipse 50% 40% at 95% 5%, rgba(255, 184, 77, 0.07), transparent 50%),
    var(--ga-page);
}

body.light-theme .storefront-home.ga-home {
  --ga-accent-ink: #ffffff;
}

body.light-theme .ga-btn-primary {
  color: #ffffff;
}

/* ---------- Hero (asymmetric split) ---------- */
.ga-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  min-height: min(72dvh, 640px);
  padding: 1rem 0 2.5rem;
}

.ga-hero-copy h1 {
  font-family: var(--heading-font, "Outfit", sans-serif);
  font-size: clamp(2rem, 4.5vw, 3.35rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
  color: var(--ga-text);
  margin: 0 0 0.85rem;
  max-width: 14ch;
  text-wrap: balance;
}

.ga-hero-copy p {
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 34ch;
  margin: 0 0 1.35rem;
  color: var(--ga-muted);
}

.ga-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ga-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.25rem;
  border-radius: var(--ga-radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s ease, background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.ga-btn:active {
  transform: scale(0.98);
}

.ga-btn-primary {
  background: var(--ga-accent);
  color: var(--ga-accent-ink);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--ga-accent) 28%, transparent);
}

.ga-btn-primary:hover {
  transform: translateY(-1px);
  color: var(--ga-accent-ink);
  filter: brightness(1.05);
}

.ga-btn-ghost {
  border: 1px solid var(--ga-border);
  background: color-mix(in srgb, var(--ga-surface) 70%, transparent);
  color: var(--ga-text);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.ga-btn-ghost:hover {
  border-color: color-mix(in srgb, var(--ga-accent) 45%, transparent);
  color: var(--ga-accent);
}

.ga-hero-visual {
  position: relative;
  isolation: isolate;
  min-height: 320px;
}

.ga-hero-glow {
  position: absolute;
  inset: 12% 8% auto 8%;
  height: 55%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--ga-accent) 35%, transparent), transparent 70%);
  filter: blur(28px);
  z-index: 0;
  pointer-events: none;
}

.ga-hero-mosaic {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.25fr 0.85fr 0.9fr;
  grid-template-rows: 1.15fr 0.85fr;
  gap: 0.75rem;
  height: clamp(280px, 42vw, 460px);
}

.ga-mosaic-tile {
  margin: 0;
  overflow: hidden;
  border-radius: var(--ga-radius);
  border: 1px solid var(--ga-border);
  background: var(--ga-surface-2);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.ga-mosaic-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.ga-mosaic-tile:hover img {
  transform: scale(1.04);
}

.ga-mosaic-tile-1 {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.ga-mosaic-tile-2 {
  grid-column: 2;
  grid-row: 1;
}

.ga-mosaic-tile-3 {
  grid-column: 3;
  grid-row: 1;
}

.ga-mosaic-tile-4 {
  grid-column: 2;
  grid-row: 2;
}

.ga-mosaic-tile-5,
.ga-mosaic-tile-6 {
  grid-column: 3;
  grid-row: 2;
}

.ga-mosaic-tile-5 + .ga-mosaic-tile-6 {
  display: none;
}

/* ---------- Shared section chrome ---------- */
.ga-section {
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

.ga-section-head {
  margin-bottom: 1.25rem;
  max-width: 40rem;
}

.ga-section-head h2,
.ga-section-head-inline h2 {
  font-family: var(--heading-font, "Outfit", sans-serif);
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ga-text);
  margin: 0 0 0.35rem;
  text-wrap: balance;
}

.ga-section-head p {
  margin: 0;
  color: var(--ga-muted);
  max-width: 42ch;
  line-height: 1.5;
}

.ga-section-head-inline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: none;
  margin-bottom: 1.15rem;
}

.ga-link {
  color: var(--ga-accent);
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.ga-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Platforms rail ---------- */
.ga-platform-rail {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.35rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.ga-platform-chip {
  scroll-snap-align: start;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.65rem;
  row-gap: 0.15rem;
  align-items: center;
  min-width: 148px;
  padding: 0.85rem 1rem;
  border-radius: var(--ga-radius-sm);
  border: 1px solid var(--ga-border);
  background: var(--ga-surface);
  color: var(--ga-text);
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.ga-platform-chip:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--ga-accent) 40%, transparent);
  background: var(--ga-surface-2);
}

.ga-platform-icon {
  grid-row: 1 / span 2;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--ga-accent) 16%, transparent);
  color: var(--ga-accent);
  font-size: 1.1rem;
}

.ga-platform-label {
  font-weight: 650;
  font-size: 0.92rem;
}

.ga-platform-count {
  font-size: 0.75rem;
  color: var(--ga-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Service asymmetric grid ---------- */
.ga-service-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1fr;
  grid-auto-rows: minmax(140px, auto);
  gap: 0.85rem;
}

.ga-service-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.1rem;
  border-radius: var(--ga-radius);
  border: 1px solid var(--ga-border);
  background: var(--ga-surface);
  color: inherit;
  text-decoration: none;
  min-height: 100%;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}

.ga-service-card.is-featured {
  grid-row: span 2;
  justify-content: flex-end;
  background:
    linear-gradient(165deg, color-mix(in srgb, var(--ga-accent) 18%, transparent), transparent 55%),
    var(--ga-surface-2);
  padding: 1.4rem;
}

.ga-service-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--ga-accent) 40%, transparent);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  color: inherit;
}

.ga-service-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.ga-service-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--ga-accent) 16%, transparent);
  color: var(--ga-accent);
}

.ga-service-type {
  font-size: 0.72rem;
  color: var(--ga-muted);
  text-transform: capitalize;
}

.ga-service-card h3 {
  font-size: 0.98rem;
  line-height: 1.45;
  margin: 0;
  color: var(--ga-text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ga-service-card.is-featured h3 {
  font-size: 1.25rem;
  -webkit-line-clamp: 4;
}

.ga-service-price {
  margin-top: auto;
  font-weight: 750;
  color: var(--ga-accent);
  font-variant-numeric: tabular-nums;
}

/* ---------- Top-up grid ---------- */
.ga-topup-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.85rem;
}

.ga-topup-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}

.ga-topup-media {
  aspect-ratio: 1;
  border-radius: var(--ga-radius);
  overflow: hidden;
  border: 1px solid var(--ga-border);
  background: var(--ga-surface-2);
  display: block;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.ga-topup-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.ga-topup-card:hover .ga-topup-media {
  border-color: color-mix(in srgb, var(--ga-accent) 40%, transparent);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.ga-topup-card:hover .ga-topup-media img {
  transform: scale(1.05);
}

.ga-topup-name {
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--ga-text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Gift card rail ---------- */
.ga-card-rail {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.35rem;
  -webkit-overflow-scrolling: touch;
}

.ga-gift-card {
  scroll-snap-align: start;
  flex: 0 0 min(260px, 78vw);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.ga-gift-media {
  aspect-ratio: 16 / 10;
  border-radius: var(--ga-radius);
  overflow: hidden;
  border: 1px solid var(--ga-border);
  background: var(--ga-surface-2);
  display: block;
}

.ga-gift-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.ga-gift-card:hover .ga-gift-media img {
  transform: scale(1.04);
}

.ga-gift-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ga-gift-name {
  font-weight: 650;
  color: var(--ga-text);
  font-size: 0.95rem;
}

.ga-gift-price {
  font-weight: 750;
  color: var(--ga-accent);
  font-variant-numeric: tabular-nums;
}

/* ---------- Closing CTA ---------- */
.ga-cta-band {
  margin-top: clamp(3rem, 6vw, 5rem);
}

.ga-cta-inner {
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border-radius: calc(var(--ga-radius) + 4px);
  border: 1px solid var(--ga-border);
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--ga-accent) 14%, transparent), transparent 45%),
    var(--ga-surface);
}

.ga-cta-inner h2 {
  font-size: clamp(1.4rem, 2.8vw, 1.9rem);
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ga-text);
  margin: 0 0 0.45rem;
  max-width: 18ch;
  text-wrap: balance;
}

.ga-cta-inner p {
  margin: 0 0 1.15rem;
  max-width: 42ch;
  color: var(--ga-muted);
}

/* ---------- Reveal motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .ga-hero-copy,
  .ga-hero-visual,
  .ga-section {
    animation: ga-rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .ga-hero-visual {
    animation-delay: 0.08s;
  }

  .ga-platforms { animation-delay: 0.04s; }
  .ga-services { animation-delay: 0.08s; }
  .ga-topups { animation-delay: 0.1s; }
  .ga-cards { animation-delay: 0.12s; }
  .ga-cta-band { animation-delay: 0.14s; }

  .ga-mosaic-tile {
    animation: ga-rise 0.75s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .ga-mosaic-tile-1 { animation-delay: 0.12s; }
  .ga-mosaic-tile-2 { animation-delay: 0.18s; }
  .ga-mosaic-tile-3 { animation-delay: 0.22s; }
  .ga-mosaic-tile-4 { animation-delay: 0.26s; }
  .ga-mosaic-tile-5 { animation-delay: 0.3s; }
}

@keyframes ga-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ga-hero-copy,
  .ga-hero-visual,
  .ga-section,
  .ga-mosaic-tile {
    animation: none !important;
  }

  .ga-mosaic-tile img,
  .ga-topup-media img,
  .ga-gift-media img,
  .ga-service-card,
  .ga-platform-chip,
  .ga-btn {
    transition: none !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
  .ga-service-grid {
    grid-template-columns: 1.2fr 1fr 1fr;
  }

  .ga-topup-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .ga-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 1.75rem;
    padding-top: 0.5rem;
  }

  .ga-hero-copy h1 {
    max-width: 16ch;
  }

  .ga-hero-mosaic {
    height: 280px;
    grid-template-columns: 1.2fr 1fr 1fr;
  }

  .ga-service-grid {
    grid-template-columns: 1fr 1fr;
  }

  .ga-service-card.is-featured {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

@media (max-width: 767px) {
  .storefront-home.ga-home {
    padding-top: 0.5rem;
  }

  .ga-topup-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ga-hero-mosaic {
    height: 240px;
    gap: 0.5rem;
  }

  .ga-service-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575px) {
  .ga-topup-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ga-hero-copy h1 {
    font-size: clamp(1.75rem, 8vw, 2.15rem);
  }
}

/* Legacy storefront overrides kept compatible */
.storefront-home .storefront-actions .is-primary,
.storefront-home .smm-submit {
  background: var(--ga-accent, #2dc4b8);
  color: var(--ga-accent-ink, #0c0f15);
}

.storefront-home .smm-price,
.storefront-home .smm-chip:hover,
.storefront-home .smm-chip.is-active {
  color: var(--ga-accent, #2dc4b8);
}

.storefront-home .smm-platform {
  background: color-mix(in srgb, var(--ga-accent, #2dc4b8) 16%, transparent);
  color: var(--ga-accent, #2dc4b8);
}
