/* ============================================================
   SPORTS REPACK — MOBILE + GLOBAL PERF
   Loaded last so it overrides per-page styles.
   ============================================================ */

/* === GLOBAL PERF: skip rendering off-screen sections === */
section {
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
}
/* Above-the-fold + pinned sections paint immediately */
section.hero,
section.sr-wall,           /* homepage video wall hero */
section.sr-gateway,        /* legacy gateway (if present) */
section.centerpiece,       /* story.html father-son centerpiece */
section.sr-cp,             /* page centerpieces */
[data-pin], .top-strip, .nav, footer, .footer {
  content-visibility: visible !important;
  contain-intrinsic-size: none !important;
}

/* Section active state — used by cinema.js for spotlight effect */
section.sr-section-active::after {
  content: ''; position: absolute; inset: 0;
  pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(168,85,247,0.06), transparent 60%);
  opacity: 0; animation: sr-spot-fade 1.4s ease-out forwards;
}
@keyframes sr-spot-fade { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  section.sr-section-active::after { animation: none; opacity: 1; }
}


/* === GLOBAL TIGHTENING === */
@media (max-width: 1024px) {
  body { overflow-x: hidden !important; }
  section, .section { padding-left: 24px !important; padding-right: 24px !important; }
}

/* === MY STORY NAV LINK — glow treatment to draw the eye === */
.nav-links a[href="story.html"] {
  position: relative;
  background: linear-gradient(120deg, #00c8ff 0%, #a855f7 35%, #ec4899 65%, #ffd700 100%);
  background-size: 220% 220%;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  font-weight: 800 !important;
  text-shadow: 0 0 18px rgba(236,72,153,0.55);
  animation: nav-story-shimmer 4.5s ease-in-out infinite;
  padding-left: 14px !important;
}
.nav-links a[href="story.html"]::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ec4899, #ffd700);
  box-shadow:
    0 0 8px rgba(236,72,153,0.95),
    0 0 18px rgba(168,85,247,0.7);
  animation: nav-story-dot 1.6s ease-in-out infinite;
}
.nav-links a[href="story.html"]:hover {
  background-position: 100% 100%;
  filter: brightness(1.2);
}
.nav-links a[href="story.html"]:hover::before {
  box-shadow: 0 0 14px rgba(236,72,153,1), 0 0 30px rgba(168,85,247,1);
}
/* When on the story page, link is active — keep the glow but lock the dot */
.nav-links a[href="story.html"].active {
  text-shadow: 0 0 22px rgba(255,215,0,0.7);
}
@keyframes nav-story-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
@keyframes nav-story-dot {
  0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
  50%      { opacity: 0.55; transform: translateY(-50%) scale(0.7); }
}
@media (prefers-reduced-motion: reduce) {
  .nav-links a[href="story.html"] { animation: none; }
  .nav-links a[href="story.html"]::before { animation: none; }
}

/* === STANDARDIZED NAV — same on every page, every viewport === */

/* Strip + nav locked to one consistent visual */
.top-strip {
  background: linear-gradient(90deg, #ec4899, #a855f7, #3b82f6) !important;
  color: #fff !important;
  padding: 11px 24px !important;
  text-align: center !important;
  font-size: 12px !important;
  letter-spacing: 4px !important;
  text-transform: uppercase !important;
  font-weight: 700 !important;
  font-family: 'JetBrains Mono', monospace !important;
}
.top-strip .ts-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: #fff !important;
  border-radius: 50%;
  margin-right: 10px;
  box-shadow: 0 0 10px rgba(255,255,255,0.95);
  animation: ts-blink 1.4s ease-in-out infinite;
  vertical-align: middle;
}
@keyframes ts-blink { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* === Tablet (≤1100): tighter spacing === */
@media (max-width: 1100px) {
  .nav { padding: 14px 22px !important; gap: 12px !important; flex-wrap: nowrap !important; }
  .nav-left, .nav-right { gap: 18px !important; }
  .nav-links { gap: 20px !important; }
  .nav-links a { font-size: 11px !important; letter-spacing: 1.5px !important; }
  .logo .wordmark { font-size: 16px !important; letter-spacing: 2px !important; }
}

/* === Below 950px: hide nav links, keep logo + CTA === */
@media (max-width: 950px) {
  .nav-links { display: none !important; }
  .social-icon { display: none !important; }
}

/* === Mobile (≤768) === */
@media (max-width: 768px) {
  .nav {
    padding: 12px 16px !important;
    gap: 10px !important;
  }
  .nav-left, .nav-right { gap: 10px !important; }
  .logo img { height: 38px !important; }
  .logo .wordmark { font-size: 14px !important; letter-spacing: 1.5px !important; }
  .nav-cta {
    padding: 9px 16px !important;
    font-size: 10px !important;
    letter-spacing: 1.8px !important;
  }
  .cart-pill { padding: 8px 12px !important; font-size: 10px !important; }
  .top-strip {
    padding: 8px 12px !important;
    font-size: 9px !important;
    letter-spacing: 2px !important;
  }
  .top-strip .ts-dot { width: 6px !important; height: 6px !important; margin-right: 8px !important; }
}

/* === Smallest phones (≤380): even tighter === */
@media (max-width: 380px) {
  .nav { padding: 10px 12px !important; }
  .logo img { height: 32px !important; }
  .logo .wordmark { font-size: 12px !important; letter-spacing: 1.2px !important; }
  .nav-cta { padding: 8px 12px !important; font-size: 9px !important; }
  .top-strip { font-size: 8px !important; padding: 7px 10px !important; }
}

/* === HEROES === */
@media (max-width: 768px) {
  .hero, section.hero {
    padding: 50px 18px 40px !important; min-height: auto !important;
    overflow-x: hidden !important;
  }
  .hero-title {
    font-size: 11vw !important; line-height: 0.95 !important;
    letter-spacing: 0 !important;
    word-break: break-word !important; overflow-wrap: anywhere !important;
    padding: 0 4px !important; max-width: 100% !important;
  }
  .hero-tagline, .hero-subtitle {
    font-size: 15px !important; line-height: 1.55 !important;
    padding: 0 4px !important; max-width: 100% !important;
  }
  .hero-eyebrow { font-size: 10px !important; letter-spacing: 4px !important; margin-bottom: 14px !important; }
  .hero-cta-row { flex-direction: column !important; gap: 10px !important; padding: 0 4px; }
  .hero-cta-row button, .hero-cta-row a { width: 100% !important; }
  .btn-primary, .btn-secondary, .mega-cta, .ballers-cta {
    padding: 14px 22px !important; font-size: 12px !important; letter-spacing: 2px !important;
    width: 100% !important; box-sizing: border-box;
  }
  .hero-grid { grid-template-columns: 1fr !important; gap: 32px !important; padding: 0 !important; }
}
@media (max-width: 480px) {
  .hero-title {
    font-size: 26px !important;
    letter-spacing: 0 !important;
    line-height: 1.05 !important;
    text-wrap: balance;
  }
  .hero-subtitle { font-size: 20px !important; }
  /* Long compound words split nicely */
  .hero-title, .hero-subtitle, .opening-title, .section-title, .traj-title {
    hyphens: auto !important; -webkit-hyphens: auto !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }
  /* Ensure forced breaks <br> still work, and allow extra wrap */
  .hero-title br { display: inline; }
  .hero-title br::before { content: " "; }
}
@media (max-width: 380px) {
  .hero-title { font-size: 23px !important; }
}

/* === ALIEN CARD CHASE — disable on small (purely decorative + crowds) === */
@media (max-width: 768px) {
  .alien-chase { display: none !important; }
}

/* === PRODUCT GRID / PACK CARDS === */
@media (max-width: 900px) {
  .product-grid, .catalog-grid { grid-template-columns: 1fr !important; gap: 22px !important; }
  .ballers-hero { grid-template-columns: 1fr !important; gap: 30px !important; padding: 36px 24px !important; }
  .ballers-hero-text h2 { font-size: 60px !important; }
}
@media (max-width: 720px) {
  .pack-pair { grid-template-columns: 1fr !important; gap: 12px !important; }
  .pack-pair .pack-side-video, .pack-pair > .pack-side-video {
    aspect-ratio: 16 / 9 !important; max-height: 220px !important;
  }
}
@media (max-width: 768px) {
  /* Floating video accents on baller hero (decorative, overflow on mobile) */
  .hero-pack > div[style*="position:absolute"][style*="aspect-ratio"] {
    display: none !important;
  }
}

/* === SECTION TYPOGRAPHY === */
@media (max-width: 768px) {
  .section-title, .opening-title, .traj-title { font-size: 38px !important; line-height: 1.05 !important; }
  .section-eyebrow, .opening-eyebrow, .traj-eyebrow { font-size: 10px !important; letter-spacing: 4px !important; }
  .section-sub, .opening-sub, .traj-sub { font-size: 15px !important; line-height: 1.55; padding: 0 8px; }
  h1, h2 { word-break: break-word; }
}

/* === CENTERPIECE (story.html father-son) === */
@media (max-width: 768px) {
  .centerpiece { padding: 24px 16px 40px !important; }
  .centerpiece h2 { font-size: 38px !important; }
  .centerpiece p.lede { font-size: 16px !important; }
  .centerpiece-sound-btn { padding: 8px 12px !important; font-size: 10px !important; letter-spacing: 1.5px !important; top: 10px !important; right: 10px !important; }
  .centerpiece-caption { font-size: 15px !important; padding: 0 14px; }
}

/* === ROADMAP GRID === */
@media (max-width: 600px) {
  .city-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .city-card { padding: 16px 14px !important; }
  .city-card .city-name { font-size: 22px !important; }
  .city-card .city-state { font-size: 9px !important; }
  .city-card .city-year { font-size: 9px !important; letter-spacing: 2px !important; }
}

/* === VIDEO GRIDS === */
@media (max-width: 600px) {
  .sr-video-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .sr-video-tile .sr-video-label { font-size: 9px !important; letter-spacing: 1.5px !important; }
  .sr-video-tile .sr-video-badge { font-size: 8px !important; padding: 3px 6px !important; }
  .sr-video-tile .sr-rec-text { font-size: 8px !important; left: 26px !important; }
}

/* === COMMUNITY HOF GRID === */
@media (max-width: 768px) {
  .hof-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
}

/* === FAMILY GRID / FEED GRID (homepage) === */
@media (max-width: 768px) {
  .family-grid, .feed-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
  .platform-tabs { gap: 6px !important; flex-wrap: wrap !important; padding: 0 8px !important; }
  .platform-tab { font-size: 11px !important; padding: 8px 12px !important; }
}
@media (max-width: 480px) {
  .feed-grid { grid-template-columns: 1fr 1fr !important; }
}

/* === MARQUEE === */
@media (max-width: 768px) {
  .marquee { font-size: 14px !important; padding: 14px 0 !important; }
  .marquee .item { padding: 0 18px !important; }
}

/* === STORY DUAL CARDS / TRAJECTORY === */
@media (max-width: 900px) {
  .dual-grid { grid-template-columns: 1fr !important; gap: 22px !important; }
}
@media (max-width: 768px) {
  .dual-card { padding: 26px 22px !important; }
  .dual-card h3 { font-size: 38px !important; }
  .traj-table { font-size: 14px !important; }
  .traj-row { grid-template-columns: 60px 1fr !important; gap: 8px !important; padding: 14px 12px !important; }
  .traj-row > div:nth-child(3), .traj-row > div:nth-child(4) { grid-column: 1 / -1; padding-left: 60px; font-size: 12px; opacity: 0.7; }
  .traj-row.head > div:nth-child(3), .traj-row.head > div:nth-child(4) { display: none; }
  .opening-content, .why-text, .author-text { padding: 0 6px !important; }
  .opening-content p, .author-text p, .why-text p { font-size: 16px !important; line-height: 1.65; }
}

/* === FOUNDER + AUTHOR PHOTOS (image + text two-column → stack) === */
@media (max-width: 900px) {
  .why-grid, .author-grid, .founder, .scene { grid-template-columns: 1fr !important; gap: 24px !important; }
  .founder-photo, .why-photo, .author-cover { max-width: 360px !important; margin: 0 auto !important; }
}

/* === LEARN PAGE INSIDE GRID === */
@media (max-width: 900px) {
  .inside-grid { grid-template-columns: 1fr !important; gap: 18px !important; }
}

/* === DROPS / FORMATS / WHATNOT GRIDS === */
@media (max-width: 768px) {
  .drops-grid, .how-grid, .mechanics-grid, .schedule-grid, .impact-bar .impact-row,
  .pull-stats, .proof-grid, .lang-grid, .partner-grid, .donate-options, .trust-row,
  .three-rules, .hit-grid, .traj-row.head ~ .traj-row, .stats-row, .math-row {
    grid-template-columns: 1fr !important; gap: 14px !important;
  }
}
@media (max-width: 600px) {
  .math-row { grid-template-columns: repeat(2, 1fr) !important; }
  .math-cell { padding: 18px 14px !important; }
  .math-cell .num { font-size: 38px !important; }
}

/* === FORMS === */
@media (max-width: 768px) {
  input, textarea, select, button { font-size: 16px !important; /* prevents iOS zoom-on-focus */ }
  form { padding: 18px !important; }
  .submit-section .form-grid, .contact-form .form-grid { grid-template-columns: 1fr !important; }
}

/* === PILLS / FILTER ROW === */
@media (max-width: 768px) {
  .filter-bar, .filter-row, .wish-filters { flex-wrap: wrap !important; gap: 8px !important; padding: 14px 16px !important; }
  .filter-pill { font-size: 11px !important; padding: 7px 12px !important; }
}

/* === COSMIC ALIEN BUDDY (bottom right) — keep but smaller === */
@media (max-width: 480px) {
  .cs-alien-buddy { width: 60px !important; height: 60px !important; bottom: 14px !important; right: 14px !important; }
  .cs-rocket, .repack-rocket { width: 70px !important; }
  .cs-rocket-2, .repack-rocket-2 { width: 60px !important; }
  /* UFOs less in the way */
  .cs-ufo { transform: scale(0.7) !important; }
}

/* === FOOTER === */
@media (max-width: 768px) {
  .footer { padding: 24px 18px !important; font-size: 11px !important; line-height: 1.7 !important; text-align: center; }
  .footer .gold { display: block; margin-bottom: 6px; }
}

/* === FINAL CTA === */
@media (max-width: 768px) {
  .final-cta, .final-cta-inner { padding: 36px 22px !important; }
  .final-quote { font-size: 22px !important; line-height: 1.5 !important; }
}

/* === FIRST-RETAIL CARD (story.html Kiss and Tell) === */
@media (max-width: 768px) {
  .first-retail { padding: 28px 22px !important; }
  .first-retail h3 { font-size: 36px !important; }
  .first-retail p.lede { font-size: 15px !important; }
  .first-retail .pill { font-size: 10px !important; padding: 6px 10px !important; }
}

/* === GIVE BACK section (Little Hits / Pack-It-Forward) — stack on mobile === */
@media (max-width: 768px) {
  .give-grid {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
    max-width: 100% !important;
    padding: 0 4px !important;
  }
  .give-card { padding: 28px 22px !important; }
  .give-card h3 { font-size: 38px !important; }
  .give-card .desc { font-size: 14px !important; line-height: 1.55 !important; }
  .give-card .stats-row {
    flex-direction: column !important;
    gap: 10px !important;
    text-align: left !important;
  }
  .give-card .stat-block .num { font-size: 28px !important; }
  .give-card .stat-block .label { font-size: 9px !important; letter-spacing: 1.5px !important; }
}

/* === VIDEO WALL HERO — mobile fixes === */
@media (max-width: 768px) {
  /* Make wall as tall as content needs (no min-height clipping) */
  .sr-wall {
    height: auto !important;
    min-height: 100vh !important;
    display: flex;
    flex-direction: column;
  }
  /* 2-col grid with auto rows so all 11 tiles fit (no empty corners) */
  .sr-wall-grid {
    position: relative !important;
    inset: auto !important;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: none !important;
    grid-auto-rows: 28vw !important;
    gap: 4px !important;
    height: auto !important;
    flex: 1;
  }
  .sr-wall-tile.feature { grid-column: span 2 !important; grid-row: span 1 !important; }
  .sr-wall-tile { aspect-ratio: auto !important; }
  /* Vignette + text overlay sit on top of the FIRST viewport area only */
  .sr-wall-vignette {
    position: absolute !important;
    top: 0 !important; left: 0 !important; right: 0 !important;
    height: 100vh !important;
    bottom: auto !important;
  }
  .sr-wall-text {
    position: absolute !important;
    top: 0 !important; left: 0 !important; right: 0 !important;
    height: 100vh !important;
    bottom: auto !important;
    padding: 0 16px !important;
  }
  .sr-wall-eyebrow {
    font-size: 9px !important;
    letter-spacing: 4px !important;
    text-align: center;
    padding: 0 18px;
    line-height: 1.6;
  }
  .sr-wall-title {
    font-size: clamp(48px, 14vw, 88px) !important;
    letter-spacing: 2px !important;
    text-align: center;
  }
  .sr-wall-sub {
    font-size: 13px !important;
    margin-top: 16px !important;
    padding: 0 22px !important;
  }
  .sr-wall-cue {
    position: absolute !important;
    top: calc(100vh - 60px) !important;
    bottom: auto !important;
    font-size: 9px !important;
    letter-spacing: 3px !important;
  }
  .sr-wall-cue::after { height: 24px !important; }
}

/* === RIP-TO-REVEAL "PACK IT BACK" BUTTON — mobile visibility === */
@media (max-width: 768px) {
  .sr-rip-reset {
    /* Top-right placement, bright pink-purple, big tap target.
       z-index 50 so it sits above floating rockets/SVGs. */
    background: linear-gradient(135deg, #ec4899, #a855f7) !important;
    color: #fff !important;
    border: 1.5px solid rgba(255,255,255,0.55) !important;
    padding: 12px 18px !important;
    font-size: 11px !important;
    letter-spacing: 1.8px !important;
    font-weight: 800 !important;
    box-shadow: 0 10px 26px -6px rgba(236,72,153,0.85), 0 0 0 1px rgba(255,255,255,0.18) inset !important;
    top: 12px !important; right: 12px !important;
    bottom: auto !important; left: auto !important;
    z-index: 50 !important;
  }
  .sr-rip-reset svg { width: 12px !important; height: 12px !important; stroke-width: 3 !important; }
}

/* === SPORT-SELECTOR + CHANNELS sections — mobile cleanup === */
@media (max-width: 768px) {
  /* Selector / channels sections were leaving big gaps because cosmic
     SVGs (planet, alien-peek) overlapped the layout. Tighten them. */
  section.selector, section.channels {
    padding-top: 50px !important;
    padding-bottom: 50px !important;
    min-height: auto !important;
  }
  /* Hide decorative cosmic creatures inside content sections on mobile */
  section.selector .scroll-creature,
  section.channels .scroll-creature,
  section.selector > svg.scroll-creature,
  section.channels > svg.scroll-creature {
    display: none !important;
  }
  /* Channels — actual class is .channel-row */
  .channels .channel-row {
    grid-template-columns: 1fr 1fr !important;
    display: grid !important;
    gap: 12px !important;
    max-width: 100% !important;
    flex-wrap: wrap !important;
  }
  .channels .channel-pill {
    padding: 18px 14px !important;
    text-align: center !important;
  }
  .channels .ch-name { font-size: 22px !important; }
  .channels .ch-tag  { font-size: 9px !important; letter-spacing: 1.5px !important; }
  .channels .ch-arrow { font-size: 10px !important; letter-spacing: 1.5px !important; margin-top: 8px; }
  /* "Four Doors. One Empire." was clipping — already handled by clamp,
     but force-cap it on the smallest viewports */
  .channels .section-title, .selector .section-title { padding: 0 8px; }
}
