/* Mobile viewport containment; source equivalent lives in src/styles/global.css. */
html,
body,
#root,
main {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* The hero-in entrance animation's fill-mode: both permanently locks transform
   to its "to" keyframe (transform: none) after it finishes, which overrides the
   translateX/scale centering set in the responsive rules below. Dropping the
   forwards half lets the normal cascade (and its transform) apply once the
   animation completes. */
.hero-copy,
.hero-visual {
  animation-fill-mode: backwards;
}

/* .hero-visual has a fixed width (e.g. 420px) at narrow breakpoints. As a
   bare "1fr" track, .hero-inner's single column grows to fit that width
   instead of the actual container, pushing hero-copy/h1 past the right edge
   (grid blowout). minmax(0, 1fr) caps the track at the container's size. */
@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
  }
}

html,
body {
  overflow-x: hidden;
}

#root,
main {
  position: relative;
  overflow-x: hidden;
  overflow-x: clip;
}

.section {
  max-width: 100vw;
  overflow: hidden;
  overflow: clip;
}

@media (max-width: 620px) {
  .container,
  .header-inner {
    margin-right: auto;
    margin-left: auto;
  }

  .hero-inner,
  .hero-copy,
  .hero-visual {
    min-width: 0;
  }

  .hero-inner {
    justify-items: center;
  }

  .hero-copy,
  .section-heading,
  .about-heading,
  .process-heading,
  .contact-copy,
  .product-copy,
  .game-content,
  .process-step,
  .vision-copy,
  .footer-brand {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    text-align: center;
  }

  .section-heading,
  .process-heading,
  .contact-copy > p,
  .product-copy > p,
  .vision-copy p,
  .footer-brand p {
    margin-right: auto;
    margin-left: auto;
  }

  .section-label,
  .eyebrow,
  .product-kicker,
  .game-status,
  .tags,
  .feature-list li,
  .vision-actions,
  .contact-actions,
  .socials {
    justify-content: center;
  }

  .hero h1 {
    overflow-wrap: anywhere;
  }

  .hero-eyebrow {
    max-width: 100%;
    justify-content: center;
    white-space: normal;
    line-height: 1.4;
  }

  .hero-visual {
    max-width: none;
  }

  .world-card {
    align-items: center;
    text-align: center;
  }

  .product-demo {
    padding-right: 0;
    padding-left: 0;
  }

  .footer-links {
    justify-items: center;
  }

  .footer-bottom {
    align-items: center;
    text-align: center;
  }

  .footer-bottom p {
    width: 100%;
  }

  .contact-card,
  .contact-actions {
    min-width: 0;
  }

  .contact-card {
    align-items: center;
    text-align: center;
  }

  .contact-card > div:first-child {
    width: auto;
    max-width: 100%;
    min-width: 0;
    grid-template-columns: auto minmax(0, 1fr);
    text-align: left;
  }

  .contact-actions .button {
    min-width: 0;
  }

  .contact-card a:not(.button) {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 480px) {
  .dashboard-visual {
    position: relative;
    left: 50%;
    transform: translateX(-50%) scale(.74);
    transform-origin: center;
  }
}

@media (max-width: 380px) {
  .hero-visual {
    transform: translateX(-50%) scale(.68);
  }

  .dashboard-visual {
    transform: translateX(-50%) scale(.64);
  }
}

@media (max-width: 340px) {
  .hero-visual {
    transform: translateX(-50%) scale(.62);
  }

  .dashboard-visual {
    transform: translateX(-50%) scale(.52);
  }
}
