/**
 * NovaSphere Gaming Inc. — Mobile Styles
 * 仅在 viewport ≤ 1199px 时加载，不影响 PC 端样式
 * 适配主流设备：iPhone SE ~ Pro Max、Android 360~428px 等
 */

/* ── Tablet & Mobile (≤1199px) ── */
@media only screen and (max-width: 1199px) {
  :root {
    --header-height: 64px;
    --hero-height: min(85svh, 640px);
    --section-padding-y: 56px;
    --section-padding-x: 1.25rem;
    --hero-padding-x: 1.25rem;
  }

  html {
    scroll-padding-top: calc(var(--header-height) + 8px);
  }

  /* Header — grid 保证窄屏汉堡按钮始终可见 */
  .site-header {
    padding-top: env(safe-area-inset-top);
    overflow: visible;
  }

  .site-header__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "logo menu";
    align-items: center;
    column-gap: 0.75rem;
    padding-inline: 1rem;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
  }

  .site-logo {
    grid-area: logo;
    min-width: 0;
    overflow: hidden;
  }

  .site-logo img {
    height: 36px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: left center;
  }

  .site-nav,
  .btn-cta--header {
    display: none !important;
  }

  .menu-toggle {
    grid-area: menu;
    display: flex !important;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    margin-left: 0;
  }

  /* Hero */
  .hero {
    margin-top: var(--header-height);
  }

  .hero__slides,
  .hero__slide {
    height: var(--hero-height);
  }

  /* 移动端专用 Banner 背景图 */
  .hero__slide[data-slide="0"] .hero__bg {
    background-image: url("../images/banner1-2.jpg") !important;
  }

  .hero__slide[data-slide="1"] .hero__bg {
    background-image: url("../images/banner2-2.jpg") !important;
  }

  .hero__slide[data-slide="2"] .hero__bg {
    background-image: url("../images/banner3-2.jpg") !important;
  }

  .hero__slide[data-slide="3"] .hero__bg {
    background-image: url("../images/banner4-2.jpg") !important;
  }

  .hero__slide[data-slide="4"] .hero__bg {
    background-image: url("../images/banner5-2.jpg") !important;
  }

  .hero__content {
    padding-inline: 1.25rem;
    justify-content: flex-end;
    padding-top: 0;
    padding-bottom: 4.5rem;
    height: 100%;
    box-sizing: border-box;
  }

  .hero__content--left,
  .hero__content--center {
    align-items: center;
    text-align: center;
  }

  .hero__content--left .hero__content-inner,
  .hero__content--center .hero__content-inner {
    flex: none;
    min-height: 50%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    overflow: visible;
  }

  .hero__content-inner .btn-cta,
  .hero__content--left .hero__content-inner .btn-cta,
  .hero__content--center .hero__content-inner .btn-cta {
    align-self: center;
    margin-top: auto;
    flex-shrink: 0;
  }

  .hero__content--left .hero__content-inner,
  .hero__content--left .hero__title,
  .hero__content--left .hero__desc,
  .hero__content--center .hero__title,
  .hero__content--center .hero__desc {
    max-width: 100%;
  }

  .hero__title {
    font-size: clamp(1.625rem, 6.5vw, 2.25rem);
    line-height: 1.12;
    flex-shrink: 0;
    width: 100%;
    margin: 0;
  }

  .hero__desc {
    font-size: 0.875rem;
    line-height: 1.5;
    flex: 1;
    width: 100%;
    margin: 10px 0 0;
    overflow: visible;
  }

  /* 五个 Banner：底部向上渐变，上方露出底图 */
  .hero__overlay,
  .hero__slide--left .hero__overlay,
  .hero__slide:not(.hero__slide--left) .hero__overlay {
    opacity: 1;
    background: linear-gradient(
      180deg,
      rgba(10, 14, 26, 0) 0%,
      rgba(10, 14, 26, 0.12) 22%,
      rgba(10, 14, 26, 0.5) 48%,
      rgba(10, 14, 26, 0.82) 68%,
      rgba(10, 14, 26, 0.95) 85%,
      #0a0e1a 100%
    );
  }

  .hero__dots {
    bottom: max(1.25rem, env(safe-area-inset-bottom));
    gap: 6px;
  }

  .hero__dot {
    width: 5px;
    height: 5px;
    padding: 0;
  }

  .hero__dot.is-active {
    width: 7px;
    height: 7px;
  }

  .btn-cta--lg {
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    min-height: 44px;
  }

  /* Sections */
  .section {
    padding-block: var(--section-padding-y);
  }

  .section-title {
    font-size: clamp(1.5rem, 5vw, 1.875rem);
  }

  .section-title--lg {
    font-size: clamp(1.75rem, 6vw, 2.25rem);
  }

  .mb-section-title {
    margin-bottom: 2rem;
  }

  /* About */
  .about-section {
    height: auto;
    min-height: 520px;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.25rem;
    background-position: center;
  }

  .about-section::before {
    background: linear-gradient(
      180deg,
      rgba(10, 14, 26, 0.2) 0%,
      rgba(10, 14, 26, 0.88) 65%,
      #0a0e1a 100%
    );
  }

  .about-section__content {
    max-width: 100%;
    margin-left: 0;
    margin-inline: auto;
    align-items: center;
    text-align: center;
  }

  .about-section__title {
    font-size: clamp(1.75rem, 6vw, 2.25rem);
  }

  .about-section__body {
    font-size: 1rem;
  }

  /* Vision */
  .vision-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .vision-card {
    padding: 1.5rem;
    align-items: center;
    text-align: center;
  }

  .vision-card:hover {
    transform: none;
  }

  /* What We Do */
  .whatwedo-header {
    margin-bottom: 2rem;
  }

  .whatwedo-header .section-title {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }

  .whatwedo-header p {
    font-size: 0.9375rem;
    padding-inline: 0.5rem;
  }

  .services-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .service-card {
    padding: 1.5rem;
    min-height: auto;
    align-items: center;
    text-align: center;
  }

  .service-card:hover {
    transform: none;
  }

  /* Featured Product */
  .featured {
    gap: 2rem;
  }

  .featured__image {
    order: -1;
  }

  .featured__title {
    font-size: clamp(1.75rem, 6vw, 2.25rem);
    align-self: center;
    text-align: center;
    width: 100%;
  }

  .featured__content > .section-label {
    align-self: center;
    text-align: center;
    width: 100%;
  }

  .featured__desc {
    align-self: center;
    text-align: center;
    width: 100%;
  }

  .featured__content .feature-list {
    align-self: center;
    width: fit-content;
    max-width: 100%;
  }

  .featured__btn {
    align-self: center;
  }

  .featured__content {
    gap: 1.25rem;
  }

  /* Why Choose */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 1rem;
  }

  .stat-item__number {
    font-size: clamp(1.75rem, 6vw, 2.25rem);
  }

  .stat-item__label {
    font-size: 0.875rem;
  }

  /* Technology */
  .tech-section {
    gap: 2rem;
  }

  .tech-section > div:first-child {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .tech-section .section-title {
    text-align: center;
    width: 100%;
  }

  .tech-section .tech-list {
    width: fit-content;
    max-width: 100%;
  }

  .tech-illustration {
    order: -1;
  }

  .tech-illustration img {
    max-height: 280px;
    object-fit: contain;
    margin-inline: auto;
  }

  .tech-list li {
    font-size: 1rem;
  }

  /* Values */
  .values-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 1rem;
  }

  .value-item__icon {
    width: 60px;
    height: 60px;
  }

  .value-item__label {
    font-size: 1rem;
  }

  /* Responsible */
  .responsible-card {
    padding: 1.5rem;
  }

  .responsible-card__title {
    font-size: clamp(1.375rem, 5vw, 1.75rem);
  }

  /* Footer */
  .site-footer {
    padding-block: 3rem 2rem;
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }

  .footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-brand__logo {
    height: 48px;
    margin-inline: auto;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-brand p {
    max-width: 100%;
  }

  .footer-col {
    text-align: center;
  }

  .footer-col ul {
    align-items: center;
  }

  .footer-contact-item {
    justify-content: center;
    text-align: center;
  }

  .footer-copyright {
    text-align: center;
  }

  /* Back to top */
  .back-to-top {
    right: max(0.75rem, env(safe-area-inset-right));
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    width: 44px;
    height: 44px;
    z-index: 1060;
  }

  /* Legal pages */
  .legal-main {
    padding-top: calc(var(--header-height) + 1.5rem);
    padding-bottom: 3rem;
  }

  .legal-page-header {
    margin-bottom: 1.5rem;
  }

  .legal-page-title {
    font-size: clamp(1.625rem, 6vw, 2rem);
  }

  .legal-content {
    padding: 1.25rem;
  }

  .legal-content h2 {
    font-size: 1.125rem;
    margin-top: 1.5rem;
  }

  .legal-content p,
  .legal-content li {
    font-size: 0.875rem;
  }

  /* Mobile nav drawer */
  .mobile-nav {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .mobile-nav a {
    font-size: 1.125rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .mobile-nav .btn-cta {
    min-width: 200px;
    min-height: 48px;
  }

  /* Touch: disable hover lift */
  @media (hover: none) {
    .vision-card:hover,
    .service-card:hover {
      transform: none;
      border-color: var(--border-subtle);
    }

    .btn-cta:hover {
      transform: none;
    }
  }
}

/* ── Small phones (≤575px) ── */
@media only screen and (max-width: 575px) {
  :root {
    --hero-height: min(82svh, 540px);
    --section-padding-y: 48px;
    --section-padding-x: 1rem;
    --hero-padding-x: 1rem;
  }

  .site-header__inner {
    padding-inline: 0.75rem;
    column-gap: 0.5rem;
  }

  .site-logo img {
    height: 32px;
  }

  .menu-toggle {
    width: 40px;
    height: 40px;
    padding: 6px;
  }

  .back-to-top {
    right: max(0.625rem, env(safe-area-inset-right));
    bottom: max(0.625rem, env(safe-area-inset-bottom));
    width: 40px;
    height: 40px;
  }

  .hero__content {
    padding-inline: 1rem;
    padding-bottom: 4rem;
  }

  .hero__content--left .hero__content-inner,
  .hero__content--center .hero__content-inner {
    min-height: 52%;
  }

  .hero__title {
    font-size: 1.5rem;
    line-height: 1.1;
  }

  .hero__desc {
    font-size: 0.8125rem;
    line-height: 1.45;
    margin-top: 8px;
  }

  .about-section {
    min-height: 480px;
    padding: 3rem 1rem;
  }

  .stats-grid {
    gap: 1.25rem 0.75rem;
  }

  .stat-item__label {
    font-size: 0.8125rem;
  }

  .values-grid {
    gap: 1.25rem 0.75rem;
  }

  .value-item__icon {
    width: 52px;
    height: 52px;
  }

  .ns-container {
    padding-inline: 1rem;
  }
}

/* ── Landscape phones ── */
@media only screen and (max-width: 1199px) and (orientation: landscape) {
  :root {
    --hero-height: min(92svh, 480px);
  }

  .hero__content {
    padding-bottom: 3.5rem;
  }

  .hero__content--left .hero__content-inner,
  .hero__content--center .hero__content-inner {
    min-height: 58%;
  }

  .hero__title {
    font-size: 1.375rem;
    line-height: 1.1;
  }

  .hero__desc {
    font-size: 0.8125rem;
    line-height: 1.45;
    margin-top: 8px;
  }
}
