/* Spiral Pop phone portrait layout
   Keeps the can as the hero, with glass stats overlapping the lower can area. */

@media (max-width: 699px) and (orientation: portrait) {
  #scrollArea {
    height: 440vh;
  }

  .ui-shell {
    min-height: 100vh;
    min-height: 100svh;
  }

  .ui-shell .ui-piece,
  .stat-grid,
  .stat-card,
  .progress-caption,
  .copy-stack {
    pointer-events: none;
  }

  .brand-pill,
  .feature-badges,
  .hero-actions {
    display: none !important;
  }

  .topbar {
    left: clamp(8px, 3vw, 14px);
    right: clamp(8px, 3vw, 14px);
    top: max(10px, env(safe-area-inset-top));
    justify-content: center;
  }

  .flavour-nav,
  .flavour-nav .nav-pill {
    pointer-events: auto;
  }

  .flavour-nav {
    width: min(100%, 408px);
    justify-content: center;
    flex-wrap: nowrap;
    gap: clamp(4px, 1.45vw, 7px);
  }

  .nav-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 5px;
    font-size: clamp(8px, 2.25vw, 10px);
    line-height: 1;
    white-space: nowrap;
  }

  .nav-pill-label {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero-stage {
    display: block;
    padding: 0;
  }

  .copy-stack {
    position: absolute;
    left: clamp(14px, 4vw, 20px);
    top: clamp(76px, 10vh, 104px);
    top: clamp(76px, 10svh, 104px);
    width: min(210px, 50vw);
  }

  .direction-chip {
    padding: 7px 10px;
    margin-bottom: 10px;
    font-size: 9px;
  }

  .chip-line {
    display: none;
  }

  .hero-title {
    margin-bottom: 8px;
    font-size: clamp(33px, 10.5vw, 48px);
    line-height: 0.92;
  }

  .hero-copy {
    display: block !important;
    max-width: min(24ch, 52vw);
    overflow: visible;
    color: var(--copy-color, #ffffff);
    font-size: clamp(10px, 2.85vw, 12.5px);
    line-height: 1.28;
    opacity: 0.96;
    -webkit-line-clamp: initial;
  }

  .stat-grid {
    position: absolute;
    left: clamp(12px, 4vw, 18px);
    right: max(38px, calc(env(safe-area-inset-right) + 34px));
    top: clamp(328px, 52.5vh, 430px);
    top: clamp(328px, 52.5svh, 430px);
    bottom: auto;
    justify-self: auto;
    align-self: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(6px, 1.9vw, 8px);
    padding-bottom: 0;
    z-index: 5;
  }

  .stat-card {
    min-height: clamp(132px, 18.4vh, 162px);
    min-height: clamp(132px, 18.4svh, 162px);
    border-radius: clamp(16px, 4.6vw, 20px);
    pointer-events: none;
    box-shadow: 0 18px 42px rgba(0,0,0,0.18);
  }


  .stat-card__content {
    position: relative;
    z-index: 10;
    color: var(--card-text, var(--copy-color, #ffffff));
    text-shadow: 0 1px 10px rgba(0,0,0,0.18);
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }

  .stat-card small,
  .stat-card strong,
  .stat-card span {
    color: inherit;
  }

  .stat-card__bend {
    backdrop-filter: blur(1px) saturate(126%) brightness(1.02);
    -webkit-backdrop-filter: blur(1px) saturate(126%) brightness(1.02);
  }

  .stat-card__content {
    padding: clamp(10px, 2.8vw, 12px);
  }

  .stat-card small {
    margin-bottom: 5px;
    font-size: clamp(9.5px, 2.85vw, 11.25px);
  }

  .stat-card strong {
    margin-bottom: 6px;
    font-size: clamp(18px, 5.15vw, 23px);
    line-height: 1;
  }

  .stat-card span {
    display: block !important;
    max-height: none !important;
    overflow: visible !important;
    -webkit-line-clamp: initial;
    font-size: clamp(14px, 4vw, 16.5px);
    line-height: 1.18;
    opacity: 0.98;
  }

  .side-progress {
    right: max(8px, env(safe-area-inset-right));
    top: auto;
    bottom: max(16px, env(safe-area-inset-bottom));
    height: auto;
    display: block;
    gap: 0;
    pointer-events: none;
    z-index: 7;
  }

  .progress-track {
    display: none;
  }

  .progress-caption {
    display: block;
    max-height: 42vh;
    max-height: 42svh;
    overflow: hidden;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: clamp(8px, 2.3vw, 10px);
    letter-spacing: 0.11em;
    color: var(--soft-text-color, var(--copy-color, currentColor));
    opacity: 0.86;
  }

  .snap-hint {
    display: block !important;
    left: max(14px, env(safe-area-inset-left));
    right: auto;
    bottom: max(16px, env(safe-area-inset-bottom));
    padding: 8px 11px;
    font-size: 0 !important;
    letter-spacing: 0.12em;
    color: transparent !important;
    opacity: 0.82;
    pointer-events: none;
    z-index: 7;
  }

  .snap-hint::before {
    content: "Swipe";
    color: var(--soft-text-color, var(--copy-color, currentColor));
    font-size: 10px;
  }

  canvas {
    touch-action: none;
  }
}

/* Tiny phone safety pass. */
@media (max-width: 380px) and (orientation: portrait) {
  .topbar {
    left: max(7px, env(safe-area-inset-left));
    right: max(7px, env(safe-area-inset-right));
  }

  .flavour-nav {
    width: 100%;
    gap: 4px;
  }

  .nav-pill {
    padding-inline: 4px;
    font-size: clamp(7.5px, 2.35vw, 8.8px);
    letter-spacing: 0.032em;
  }

  .copy-stack {
    left: max(12px, env(safe-area-inset-left));
    width: min(194px, 49vw);
  }

  .direction-chip {
    padding: 6px 8px;
    margin-bottom: 8px;
  }

  .hero-title {
    font-size: clamp(31px, 10.1vw, 42px);
  }

  .hero-copy {
    display: block !important;
    max-width: min(22ch, 51vw);
    font-size: clamp(9.8px, 2.75vw, 11.5px);
    line-height: 1.24;
  }

  .stat-grid {
    left: max(10px, env(safe-area-inset-left));
    right: max(34px, calc(env(safe-area-inset-right) + 32px));
    gap: 7px;
  }

  .stat-card {
    min-height: clamp(116px, 16.4vh, 138px);
    min-height: clamp(116px, 16.4svh, 138px);
  }

  .stat-card__content {
    padding: 8px;
  }

  .stat-card small {
    font-size: 8.8px;
    letter-spacing: 0.075em;
  }

  .stat-card strong {
    font-size: clamp(17px, 4.75vw, 20px);
  }

  .stat-card span {
    font-size: clamp(12.25px, 3.45vw, 14px);
    line-height: 1.16;
  }
}

/* Short phone safety pass. */
@media (max-width: 699px) and (max-height: 680px) and (orientation: portrait) {
  .copy-stack {
    top: clamp(66px, 8.8vh, 82px);
    top: clamp(66px, 8.8svh, 82px);
  }

  .direction-chip {
    display: none;
  }

  .hero-title {
    margin-bottom: 6px;
  }

  .hero-copy {
    display: block !important;
    overflow: visible;
    -webkit-line-clamp: initial;
  }

  .stat-grid {
    top: clamp(300px, 50.5vh, 360px);
    top: clamp(300px, 50.5svh, 360px);
  }

  .stat-card {
    min-height: clamp(96px, 14vh, 112px);
    min-height: clamp(96px, 14svh, 112px);
  }

  .progress-caption {
    max-height: 36vh;
    max-height: 36svh;
  }
}

@media (max-width: 340px) and (orientation: portrait) {
  .nav-pill {
    font-size: 7.5px;
    letter-spacing: 0.02em;
  }

  .hero-copy {
    display: block !important;
    max-width: min(20ch, 50vw);
    font-size: 9.5px;
    line-height: 1.18;
  }

  .stat-card span {
    display: block !important;
    max-height: none !important;
    overflow: visible !important;
    font-size: 11px;
    line-height: 1.12;
  }
}


/* Real-device text force pass
   High-specificity override because mobile Safari/hosting cache made previous card bumps hard to see. */
@media (max-width: 699px) and (orientation: portrait) {
  .stat-grid .stat-card .stat-card__content {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    padding: 12px !important;
  }

  .stat-grid .stat-card .stat-card__content > small {
    display: block !important;
    margin: 0 0 5px !important;
    color: inherit !important;
    font-size: clamp(10px, 3vw, 12px) !important;
    line-height: 1.05 !important;
  }

  .stat-grid .stat-card .stat-card__content > strong {
    display: block !important;
    margin: 0 0 7px !important;
    color: inherit !important;
    font-size: clamp(21px, 6vw, 27px) !important;
    line-height: 0.95 !important;
  }

  .stat-grid .stat-card .stat-card__content > span {
    display: block !important;
    visibility: visible !important;
    max-height: none !important;
    overflow: visible !important;
    color: inherit !important;
    font-size: clamp(16px, 4.65vw, 19px) !important;
    line-height: 1.12 !important;
    opacity: 1 !important;
    -webkit-line-clamp: initial !important;
    -webkit-box-orient: initial !important;
  }
}

@media (max-width: 380px) and (orientation: portrait) {
  .stat-grid .stat-card .stat-card__content {
    padding: 10px !important;
  }

  .stat-grid .stat-card .stat-card__content > small {
    font-size: clamp(9px, 2.75vw, 10.5px) !important;
  }

  .stat-grid .stat-card .stat-card__content > strong {
    font-size: clamp(18px, 5.35vw, 23px) !important;
  }

  .stat-grid .stat-card .stat-card__content > span {
    font-size: clamp(13.5px, 4vw, 16px) !important;
    line-height: 1.1 !important;
  }
}


/* Real-device hero subtitle force pass. */
@media (max-width: 699px) and (orientation: portrait) {
  .copy-stack .hero-copy,
  #heroCopy.hero-copy {
    display: block !important;
    visibility: visible !important;
    max-width: min(30ch, 62vw) !important;
    max-height: none !important;
    overflow: visible !important;
    color: var(--copy-color, #ffffff) !important;
    font-size: clamp(13.5px, 3.75vw, 16px) !important;
    line-height: 1.22 !important;
    opacity: 0.98 !important;
    -webkit-line-clamp: initial !important;
    -webkit-box-orient: initial !important;
  }
}

@media (max-width: 380px) and (orientation: portrait) {
  .copy-stack .hero-copy,
  #heroCopy.hero-copy {
    max-width: min(27ch, 60vw) !important;
    font-size: clamp(12px, 3.45vw, 14.5px) !important;
    line-height: 1.18 !important;
  }
}

@media (max-width: 340px) and (orientation: portrait) {
  .copy-stack .hero-copy,
  #heroCopy.hero-copy {
    display: block !important;
    max-width: min(25ch, 58vw) !important;
    font-size: 11.5px !important;
    line-height: 1.14 !important;
  }
}

