/* Dedicated mobile stylesheet.
   All mobile responsive rules are centralized here to keep desktop styles in styles.css. */

/* Hidden by default; enabled only for mint mobile as a separate screen under intro text. */
body[data-page="mint-nft"] .mintIntroMediaScreen {
  display: none;
}

/* ===== Base / Global ===== */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero__right { order: -1; }
  .cardsGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stackGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav { display: none; }
}

@media (max-width: 900px) {
  html,
  body,
  html[data-device="mobile"],
  html[data-device="mobile"] body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
  }

  :root,
  html[data-device="mobile"] {
    --mobile-gutter: 14px;
    --mobile-section-gap: 22px;
    --mobile-card-radius: 14px;
  }

  .container,
  html[data-device="mobile"] .container {
    width: min(1120px, calc(100% - (var(--mobile-gutter) * 2)));
  }

  .top__bar,
  html[data-device="mobile"] .top__bar {
    height: 64px;
    padding: 0;
  }

  .brand__logoSvg,
  html[data-device="mobile"] .brand__logoSvg {
    height: 35px;
  }

  .section,
  html[data-device="mobile"] .section {
    padding-top: var(--mobile-section-gap);
    padding-bottom: var(--mobile-section-gap);
  }

  .section,
  .container,
  main,
  .top,
  .servicesStory,
  .processStory,
  .stackOrbital,
  .footerMega {
    max-width: 100%;
    overflow-x: clip;
  }

  .sectionHead {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .sectionHead__right {
    width: 100%;
    justify-content: flex-start;
  }

  .chip {
    max-width: 100%;
  }

  .chip__text {
    white-space: normal;
  }

  body[data-page="mint-nft"] .introMedia,
  html[data-device="mobile"] body[data-page="mint-nft"] .introMedia {
    display: none !important;
  }

  body[data-page="mint-nft"] .mintIntroMediaScreen,
  html[data-device="mobile"] body[data-page="mint-nft"] .mintIntroMediaScreen {
    display: block;
    padding: 8px 0 18px;
  }

  body[data-page="mint-nft"] .mintIntroMediaScreen__frame,
  html[data-device="mobile"] body[data-page="mint-nft"] .mintIntroMediaScreen__frame {
    min-height: calc(100svh - var(--topbar, 72px) - 16px);
    width: min(1120px, calc(100% - (var(--mobile-gutter) * 2)));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  body[data-page="mint-nft"] .mintIntroMediaScreen__card,
  html[data-device="mobile"] body[data-page="mint-nft"] .mintIntroMediaScreen__card {
    width: min(368px, 80%);
    min-height: 0;
    margin: 0;
    padding: 0;
    border-radius: 16px;
    border: 0;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none;
    overflow: hidden;
  }

  body[data-page="mint-nft"] .mintIntroMediaScreen__card > .stackCard__gl,
  html[data-device="mobile"] body[data-page="mint-nft"] .mintIntroMediaScreen__card > .stackCard__gl {
    z-index: 4;
    opacity: 0.96;
    mix-blend-mode: screen;
  }

  body[data-page="mint-nft"] .mintIntroMediaScreen__img,
  html[data-device="mobile"] body[data-page="mint-nft"] .mintIntroMediaScreen__img {
    display: block;
    width: 100%;
    max-height: calc(100svh - var(--topbar, 72px) - 32px);
    height: auto;
    object-fit: contain;
    margin: 0 auto;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
  }

  body[data-page="mint-nft"] .fallback__code,
  html[data-device="mobile"] body[data-page="mint-nft"] .fallback__code {
    color: #ffffff;
    font-weight: 800;
  }

  body[data-page="mint-nft"] .fallback__code code,
  html[data-device="mobile"] body[data-page="mint-nft"] .fallback__code code {
    font-weight: 800;
  }
}

@media (max-width: 640px) {
  .container { width: min(1120px, calc(100% - 26px)); }
  .top__bar { height: 64px; padding: 0; }
  .hero { padding: 24px 0 90px; }
  .hero__meta { grid-template-columns: 1fr; }
  .cardsGrid { grid-template-columns: 1fr; }
  .stackGrid { grid-template-columns: 1fr; }
  .pipeline__list { margin-left: 18px; }
  .pipeline__rail { left: 16px; }
}

/* ===== Services ===== */
@media (max-width: 900px) {
  html[data-device="mobile"] .servicesStory__sticky,
  .servicesStory__sticky {
    height: calc(100svh - var(--topbar, 72px));
  }

  html[data-device="mobile"] .servicesStory__cols {
    grid-template-columns: 1fr;
    gap: var(--mobile-section-gap);
    padding-top: 44px;
  }

  html[data-device="mobile"] .servicesStory__right {
    padding-top: 0;
  }

  html[data-device="mobile"] .servicesStory__stack {
    width: 100%;
    height: 380px;
  }

  html[data-device="mobile"] .servicesStory__list,
  .servicesStory__list {
    gap: 8px;
  }

  html[data-device="mobile"] .servicesStory__item,
  .servicesStory__item {
    font-size: clamp(22px, 6.3vw, 30px);
    line-height: 1.02;
    letter-spacing: -0.012em;
  }

  html[data-device="mobile"] .card,
  html[data-device="mobile"] .stackCard,
  html[data-device="mobile"] .svcPanel {
    border-radius: var(--mobile-card-radius);
  }

  .servicesStory__track { height: 360vh; }
  .servicesStory__cols { grid-template-columns: 1fr; gap: 22px; padding-top: 44px; }
  .servicesStory__right { padding-top: 0; }
  .servicesStory__stack { width: 100%; height: 380px; }
  .scrollHint { bottom: 14px; }

  body[data-page="mint-nft"] .servicesStory__stack,
  html[data-device="mobile"] body[data-page="mint-nft"] .servicesStory__stack {
    width: min(460px, 100%);
    aspect-ratio: 1 / 1;
    height: auto !important;
    margin-inline: auto;
  }

  /* Mobile: disable full Stack section with 9 panels entirely (desktop only feature). */
  #stack.section--stack,
  section#stack {
    display: none !important;
  }

  /* Stack section on mobile: show all 9 panels in a normal vertical flow */
  #stack .servicesStory__track {
    height: auto !important;
  }
  #stack .servicesStory__sticky,
  html[data-device="mobile"] #stack .servicesStory__sticky {
    position: static;
    top: auto;
    height: auto;
    display: block;
    padding-top: 0;
  }
  #stack .servicesStory__cols,
  html[data-device="mobile"] #stack .servicesStory__cols {
    display: block;
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 0;
  }
  #stack .servicesStory__left {
    margin-bottom: 12px;
  }
  #stack .servicesStory__headline {
    transform: none;
    margin: 0 0 12px;
  }
  #stack .scrollHint {
    display: none;
  }
  #stack .servicesStory__right,
  html[data-device="mobile"] #stack .servicesStory__right {
    padding-top: 0;
  }
  #stack .servicesStory__stack,
  html[data-device="mobile"] #stack .servicesStory__stack {
    width: 100%;
    height: auto !important;
    margin-top: 0;
    margin-left: 0;
    perspective: none;
    perspective-origin: initial;
  }
  #stack .stackNav,
  #stack .servicesStory__list--ghost {
    display: none !important;
  }
  #stack .svcPanel {
    position: relative;
    inset: auto;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: auto !important;
    margin: 0 0 14px;
  }
  #stack .svcPanel > .stackCard__gl {
    display: none !important;
  }
  #stack .svcPanel:last-child {
    margin-bottom: 0;
  }
  #stack .svcPanel.card {
    min-height: 0;
  }
  #stack .svcPanel .card__title,
  #stack .svcPanel .card__desc,
  #stack .svcPanel .card__gridCols,
  #stack .svcPanel .card__body {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  #stack .svcPanel .card__title {
    white-space: normal !important;
    margin-right: 0 !important;
    text-indent: 0;
  }
  #stack .svcPanel .card__gridCols {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }
  #stack .svcPanel[data-svc-panel="6"] .card__deviceParagraphs {
    grid-template-columns: 1fr !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  #stack .svcPanel[data-svc-panel="3"] .card__tradingParagraph,
  #stack .svcPanel[data-svc-panel="4"] .card__tradingParagraph {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

/* ===== Process ===== */
@media (max-width: 900px) {
  .section--process,
  .section--stack {
    position: relative;
  }

  .section--stack {
    z-index: 2;
  }

  .section--process,
  html[data-device="mobile"] .section--process {
    padding-top: 16px;
    padding-bottom: 12px;
    overflow: clip;
  }

  .processStory__track,
  html[data-device="mobile"] .processStory__track { height: 190vh; }

  .processStory__sticky,
  html[data-device="mobile"] .processStory__sticky {
    padding-top: 10px;
  }

  .gantt,
  html[data-device="mobile"] .gantt {
    margin-top: 12px;
    padding: 12px 10px 10px;
  }

  .gantt__header,
  html[data-device="mobile"] .gantt__header {
    grid-template-columns: minmax(92px, 30vw) 1fr;
    gap: 6px;
    margin-bottom: 5px;
  }

  .gantt__labelHead,
  html[data-device="mobile"] .gantt__labelHead {
    font-size: 10px;
    letter-spacing: .06em;
  }

  .gantt__scale,
  html[data-device="mobile"] .gantt__scale {
    display: grid;
    gap: 2px;
    font-size: 10px;
  }

  .gantt__scale span::after,
  html[data-device="mobile"] .gantt__scale span::after {
    bottom: -6px;
    height: 6px;
  }

  .gantt__row,
  html[data-device="mobile"] .gantt__row {
    grid-template-columns: minmax(92px, 30vw) 1fr;
    gap: 6px;
    padding: 6px 0;
  }

  .gantt__idx,
  html[data-device="mobile"] .gantt__idx { font-size: 10px; }
  .gantt__title,
  html[data-device="mobile"] .gantt__title { font-size: 13px; }
  .gantt__desc,
  html[data-device="mobile"] .gantt__desc { font-size: 11px; line-height: 1.32; }

  .gantt__track,
  html[data-device="mobile"] .gantt__track {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 2px;
  }

  .gantt__task,
  html[data-device="mobile"] .gantt__task {
    width: auto;
    min-height: 18px;
    padding: 3px 4px 6px;
  }

  .gantt__taskTitle,
  html[data-device="mobile"] .gantt__taskTitle { font-size: 9px; line-height: 1.12; }
  .gantt__taskMeta,
  html[data-device="mobile"] .gantt__taskMeta { font-size: 8px; margin-top: 2px; }
}

/* ===== Stack ===== */
@media (max-width: 980px) {
  .section--cardInterface .processStory--single .processStory__sticky {
    padding-top: 10px;
  }
  .section--cardInterface .cardSceneSingle__stack {
    --panel-h: clamp(280px, 52vh, 460px);
    margin-top: 12px;
  }

  .section--cardInterface .cardScene__track { height: 700vh; }
  .section--cardInterface .cardScene__titleArea {
    top: calc(var(--topbar, 72px) + 10px);
    left: 0;
    right: 0;
    width: auto;
  }
  .section--cardInterface .cardScene__icons {
    left: 50%;
    top: auto;
    bottom: 16px;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    overflow-x: visible;
    transform: translate3d(calc(-50% + var(--iconsShift, 0px)), 0, 0);
  }
  .section--cardInterface .cardScene__icon {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
  }
  .section--cardInterface .cardScene__stage {
    width: calc(100vw - 24px);
    height: min(76vh, 760px);
    min-height: 520px;
  }
  .section--cardInterface .cardSceneCard__name {
    font-size: clamp(24px, 7.4vw, 34px);
  }
  .section--cardInterface .cardSceneCard__desc {
    max-width: none;
    font-size: 14px;
    line-height: 1.52;
  }

  .stackOrbital { height: 64vh; min-height: 440px; }
  .stackOrbital__center { width: 111px; height: 111px; }
  .orbitLabel { font-size: 13px; }
  .orbitTag { font-size: 10px; padding: 7px 10px; }
  html[data-device="mobile"] .introMediaCard > .stackOrbital{
    height: 100%;
    min-height: 0;
    margin-top: 0;
  }
}

@media (max-width: 640px) {
  .section--cardInterface .cardSceneSingle__stack {
    --panel-h: clamp(260px, 48vh, 400px);
    margin-top: 10px;
  }

  .section--cardInterface .cardScene__titleArea { top: calc(var(--topbar, 72px) + 8px); }
  .section--cardInterface .cardScene__icons { bottom: 12px; }
  .section--cardInterface .cardScene__stage {
    min-height: 560px;
    height: min(80vh, 860px);
  }
  .section--cardInterface .cardSceneCard {
    padding: 14px;
  }
  .section--cardInterface .cardSceneCard__desc {
    font-size: 13px;
    line-height: 1.45;
  }

  .stackOrbital { height: 58vh; min-height: 360px; }
  .stackOrbital__center { width: 94px; height: 94px; font-size: 11px; }
}

/* ===== Footer ===== */
@media (max-width: 980px) {
  .footerMega__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .footerMega { min-height: auto; padding: 54px 0 76px; }
  .footerMega__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .footerMega__brand { grid-column: 1 / -1; }
  .footerMega__bottom {
    left: var(--mobile-gutter, 14px);
    right: var(--mobile-gutter, 14px);
    bottom: 12px;
    padding: 0;
    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 0;
  }
  .footerMega__bottom::before {
    bottom: 24px;
  }
  .footerMega__copy {
    margin: 0;
  }
}
