/* SUNDEX landing mobile composition pass — p77 */

@keyframes sundex-mobile-partner-loop {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

@keyframes sundex-mobile-card-breathe {
  from { transform: translate3d(0, -3px, 0); }
  to { transform: translate3d(0, 4px, 0); }
}

@media (max-width: 760px) {
  :root {
    --sundex-mobile-gutter: clamp(18px, 5.1vw, 24px);
    --sundex-mobile-canvas: #03060a;
  }

  /* Hero: center the physical card while preserving a strict left text edge. */
  body.sundex-premium-landing .smi-hero-image {
    background-position: 47% 31% !important;
  }

  .smi-hero-image-reveal {
    --smi-x: 55% !important;
    --smi-y: 39% !important;
  }

  .smi-hero-content {
    right: auto;
    width: 100%;
    align-items: start;
    gap: 18px;
    padding-right: var(--sundex-mobile-gutter);
    padding-left: var(--sundex-mobile-gutter);
    text-align: left;
  }

  .smi-hero h1,
  .smi-hero-description {
    width: 100%;
    max-width: 100%;
    margin-right: 0;
    margin-left: 0;
    text-align: left;
    text-wrap: pretty;
  }

  .smi-hero h1 {
    max-width: 9.5ch;
    font-size: clamp(2.45rem, 11.5vw, 3.35rem);
  }

  .smi-hero-description {
    max-width: 34rem;
    font-size: 0.88rem;
  }

  /* Market: make the opening read as an editorial lead, then reveal the terminal. */
  .sundex-market-explorer.sme-market-aperture-v2,
  .sme-market-aperture-v2 .sma-shell {
    min-height: 0;
    background: var(--sundex-mobile-canvas);
  }

  .sme-market-aperture-v2 .sma-shell {
    grid-template-rows: auto minmax(510px, 64svh);
    padding: 76px 0 0;
  }

  .sme-market-aperture-v2 .sma-title {
    width: 100%;
    margin: 0 0 30px;
    padding: 0 var(--sundex-mobile-gutter);
    text-align: left;
  }

  .sme-market-aperture-v2 .sma-title h2 {
    max-width: 7.8ch;
    font-size: clamp(3.45rem, 15.5vw, 4.55rem);
    line-height: 0.9;
    text-align: left;
    text-wrap: balance;
  }

  .sme-market-aperture-v2 .sma-title p {
    max-width: 22rem;
    margin: 20px 0 0;
    font-size: 0.95rem;
    line-height: 1.52;
    text-align: left;
    text-wrap: pretty;
  }

  .sme-market-aperture-v2 .sma-aperture {
    min-height: 510px;
    background: var(--sundex-mobile-canvas);
  }

  .sme-market-aperture-v2 .sma-terminal-image {
    width: 920px;
    transform: translate3d(-53%, -53%, 0) scale(1.02);
  }

  /* Cards: replace the desktop cylinder with a compact, legible mobile deck. */
  .sundex-card-story {
    min-height: 0;
    background:
      linear-gradient(180deg, #03060a 0%, rgba(3, 6, 10, 0.98) 14%, transparent 34%),
      radial-gradient(ellipse 74% 44% at 50% 72%, rgba(65, 78, 112, 0.13), transparent 74%),
      #03060a;
  }

  .sundex-card-story::before {
    height: 118px;
  }

  .scc-shell {
    grid-template-rows: auto 430px;
    gap: 6px;
    padding: 78px var(--sundex-mobile-gutter) 42px;
  }

  .scc-copy {
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .scc-copy h2 {
    max-width: 8.2ch;
    font-size: clamp(3.3rem, 14.6vw, 4.2rem);
    line-height: 0.91;
  }

  .scc-copy > p:not(.scc-kicker) {
    max-width: 23rem;
  }

  .scc-stage {
    height: 430px;
    min-height: 430px;
    overflow: hidden;
    clip-path: none;
    perspective: 1000px;
  }

  .scc-halo {
    left: 50%;
    width: 118%;
    height: 64%;
    opacity: 0.54;
  }

  .scc-camera {
    transform: none !important;
  }

  .scc-cylinder-card {
    top: 53%;
    left: 50%;
    width: min(304px, 82vw);
    opacity: 1 !important;
    will-change: auto !important;
  }

  .scc-cylinder-card:nth-child(1) {
    z-index: 30 !important;
    transform: translate(-50%, -50%) translate3d(0, 54px, 90px) rotateX(0deg) rotateY(0deg) rotateZ(-2deg) !important;
  }

  .scc-cylinder-card:nth-child(2) {
    z-index: 20 !important;
    transform: translate(-50%, -50%) translate3d(13px, -42px, 15px) rotateX(0deg) rotateY(0deg) rotateZ(3.5deg) scale(0.94) !important;
  }

  .scc-cylinder-card:nth-child(3) {
    z-index: 10 !important;
    transform: translate(-50%, -50%) translate3d(-9px, -125px, -45px) rotateX(0deg) rotateY(0deg) rotateZ(-4deg) scale(0.88) !important;
  }

  .scc-cylinder-card:nth-child(n + 4) {
    display: none !important;
  }

  .scc-cylinder-card .scc-card-front {
    opacity: 1 !important;
  }

  .scc-cylinder-card .scc-card-back {
    opacity: 0 !important;
  }

  .scc-cylinder-card .scc-card-body {
    transform: none !important;
    animation: sundex-mobile-card-breathe 6.8s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate;
  }

  .scc-cylinder-card:nth-child(2) .scc-card-body { animation-delay: -2.2s; }
  .scc-cylinder-card:nth-child(3) .scc-card-body { animation-delay: -4.1s; }

  /* Exchange: one continuous composition, with the calculator immediately following the promise. */
  .sps-trade-stage.sps-exchange-stage,
  .sps-exchange-shell {
    background: var(--sundex-mobile-canvas);
  }

  .sps-exchange-shell {
    grid-template-rows: auto auto;
  }

  .sps-exchange-visual,
  .sps-exchange-copy {
    height: 316px;
    min-height: 316px;
  }

  .sps-exchange-visual img {
    object-position: 26% center;
    filter: saturate(0.2) brightness(0.42) contrast(1.22);
  }

  .sps-exchange-visual span {
    background:
      linear-gradient(180deg, rgba(3, 6, 10, 0.36), rgba(3, 6, 10, 0.1) 40%, #03060a 100%),
      linear-gradient(90deg, rgba(3, 6, 10, 0.34), rgba(3, 6, 10, 0.1));
  }

  .sps-exchange-copy {
    justify-content: flex-end;
    padding: 52px var(--sundex-mobile-gutter) 28px;
  }

  .sps-section .sps-exchange-copy h2 {
    max-width: 8ch;
    font-size: clamp(3.3rem, 14.5vw, 4.2rem);
    line-height: 0.91;
  }

  .sps-exchange-copy p {
    max-width: 20rem;
  }

  .sps-exchange-panel {
    padding: 18px var(--sundex-mobile-gutter) 62px;
  }

  .sps-exchange-row {
    min-height: 136px;
  }

  .sps-exchange-amount input,
  .sps-exchange-output {
    font-size: clamp(3.15rem, 14vw, 4rem);
  }

  /* Mobile install: heading, product, explanation and QR form a single reading sequence. */
  .sundex-mobile-install {
    min-height: 0;
    background:
      radial-gradient(ellipse 72% 34% at 50% 48%, rgba(190, 205, 225, 0.045), transparent 72%),
      var(--sundex-mobile-canvas);
  }

  .sis-shell {
    display: flex;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 86px var(--sundex-mobile-gutter) 78px;
  }

  .sis-copy {
    display: contents;
    width: auto;
    padding: 0;
    opacity: 1 !important;
    transform: none !important;
    text-align: center;
  }

  .sis-kicker {
    order: 1;
    margin: 0 0 18px;
  }

  .sis-copy h2 {
    order: 2;
    max-width: 7.8ch;
    margin: 0 auto;
    font-size: clamp(3.8rem, 18vw, 5.25rem);
    line-height: 0.88;
  }

  .sis-device-stage {
    order: 3;
    width: 100%;
    min-height: clamp(420px, 118vw, 520px);
    margin: 24px auto 0;
  }

  .sis-device-aura {
    left: 50%;
    width: min(112vw, 470px);
    opacity: 0.42;
  }

  .sis-device-image {
    left: 50%;
    width: min(106%, 370px);
    max-width: none;
    max-height: 100%;
  }

  .sis-description {
    order: 4;
    max-width: 23rem;
    margin: 4px auto 0;
    font-size: 0.96rem;
    text-align: center;
  }

  .sis-guide {
    order: 5;
    width: min(100%, 320px);
    margin: 24px auto 0;
  }

  .sis-qr-link {
    order: 6;
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 16px;
    width: min(100%, 320px);
    margin: 18px auto 0;
    padding: 10px 14px 10px 10px;
    border-radius: 20px;
    text-align: left;
  }

  .sis-qr-frame { padding: 6px; border-radius: 12px; }
  .sis-qr-copy strong { font-size: 0.98rem; }
  .sis-qr-copy small { font-size: 0.78rem; }

  /* Final CTA: remove the clipped shader edge and keep a complete premium rim. */
  .sps-final-cta,
  .sps-final-shell {
    min-height: 680px;
  }

  .sps-final-shell {
    padding: 92px var(--sundex-mobile-gutter) 72px;
  }

  .sps-final-actions {
    gap: 12px;
  }

  .sps-final-actions > .scc-card-cta.sundex-liquid-metal {
    min-height: 50px;
    overflow: hidden !important;
    border: 1px solid transparent !important;
    border-radius: 999px !important;
    color: #f2f5fa !important;
    background:
      linear-gradient(180deg, #0b0f16, #05070b) padding-box,
      linear-gradient(122deg, rgba(255,255,255,.88), rgba(112,126,148,.54) 32%, rgba(244,247,251,.82) 68%, rgba(92,106,128,.48)) border-box !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 10px 28px rgba(0,0,0,.3) !important;
  }

  .sps-final-actions > .scc-card-cta.sundex-liquid-metal::before {
    inset: 1px !important;
    border-radius: inherit;
    background: linear-gradient(180deg, #0d1118, #05070b) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05) !important;
  }

  .sps-final-actions > .scc-card-cta.sundex-liquid-metal > canvas {
    display: none !important;
  }

  .sps-partner-marquee {
    width: 100vw;
    margin-top: 58px;
  }

  .sps-partner-viewport {
    overflow: hidden !important;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent) !important;
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent) !important;
    touch-action: pan-y;
  }

  .sps-partner-track {
    display: flex !important;
    width: max-content;
    will-change: transform !important;
  }

  .sps-partner-set[aria-hidden="true"] {
    display: flex !important;
  }
}

@media (max-width: 390px) {
  .smi-actions { gap: 8px; }
  .smi-actions .smi-button { padding-inline: 10px; font-size: 0.74rem; }
  .sme-market-aperture-v2 .sma-title h2 { font-size: clamp(3.2rem, 15.5vw, 4rem); }
  .scc-cylinder-card { width: min(286px, 82vw); }
  .sps-exchange-asset { grid-template-columns: 44px minmax(0, auto) auto 14px; gap: 10px; }
  .sps-exchange-mark,
  .sps-exchange-mark-fiat { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) and (max-width: 760px) {
  .scc-cylinder-card .scc-card-body,
  .sps-partner-track {
    animation: none !important;
    transform: none;
  }

  .sps-partner-viewport {
    overflow-x: auto !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }

  .sps-partner-set[aria-hidden="true"] { display: none !important; }
}
