/* Spiral Pop tablet tuning
   Laptop-sized tablets stay close to desktop. Portrait tablets use the simplified touch layout. */

@media (min-width: 900px) and (max-width: 1199px) {
  .hero-stage {
    grid-template-columns: minmax(300px, 44vw) minmax(260px, 1fr);
    padding: 12vh 6vw 8vh;
    gap: 3vw;
  }

  .hero-title {
    font-size: clamp(56px, 7.6vw, 96px);
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(132px, 176px));
    gap: 12px;
    padding-bottom: 4vh;
  }

  .stat-card {
    min-height: 100px;
  }
}

/* Portrait / touch tablet layout. */
@media (min-width: 700px) and (max-width: 899px) {
  #scrollArea {
    height: 440vh;
  }

  .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(18px, 4vw, 34px);
    right: clamp(18px, 4vw, 34px);
    top: max(16px, env(safe-area-inset-top));
    justify-content: center;
  }

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

  .flavour-nav {
    justify-content: center;
    flex-wrap: nowrap;
    max-width: calc(100vw - 36px);
    gap: 8px;
  }

  .nav-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 12px;
    font-size: 10px;
    white-space: nowrap;
  }

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

  .copy-stack {
    position: absolute;
    left: clamp(28px, 5vw, 48px);
    top: clamp(90px, 10.4vh, 120px);
    top: clamp(90px, 10.4svh, 120px);
    width: min(330px, 42vw);
  }

  .direction-chip {
    padding: 8px 12px;
    margin-bottom: 14px;
    font-size: 10px;
  }

  .hero-title {
    margin-bottom: 12px;
    font-size: clamp(42px, 9vw, 76px);
  }

  .hero-copy {
    display: block !important;
    max-width: 28ch;
    overflow: visible;
    color: var(--copy-color, #ffffff);
    font-size: 14px;
    line-height: 1.32;
    opacity: 0.96;
    -webkit-line-clamp: initial;
  }

  .stat-grid {
    position: absolute;
    left: clamp(36px, 7vw, 64px);
    right: max(70px, calc(env(safe-area-inset-right) + 58px));
    top: 56vh;
    top: 56svh;
    bottom: auto;
    justify-self: auto;
    align-self: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(10px, 1.8vw, 14px);
    padding-bottom: 0;
    z-index: 5;
  }

  .stat-card {
    min-height: clamp(148px, 18vh, 176px);
    min-height: clamp(148px, 18svh, 176px);
    border-radius: 22px;
  }

  .stat-card__content {
    padding: 12px;
  }

  .stat-card small {
    font-size: 12px;
  }

  .stat-card strong {
    font-size: 29px;
  }

  .stat-card span {
    display: block !important;
    max-height: none !important;
    overflow: visible !important;
    -webkit-line-clamp: initial;
    font-size: 18px;
    line-height: 1.22;
    opacity: 0.98;
  }

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

  .progress-track {
    display: none;
  }

  .progress-caption {
    display: block;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    max-height: 46vh;
    max-height: 46svh;
    overflow: hidden;
    color: var(--soft-text-color, var(--copy-color, currentColor));
  }

  .snap-hint {
    display: block !important;
    left: max(20px, env(safe-area-inset-left));
    right: auto;
    bottom: max(20px, env(safe-area-inset-bottom));
    font-size: 0 !important;
    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;
  }
}

/* Tablet landscape stays desktop-ish, with tighter spacing. */
@media (min-width: 900px) and (max-width: 1199px) and (orientation: landscape) {
  .topbar {
    left: clamp(18px, 2.5vw, 28px);
    right: clamp(18px, 2.5vw, 28px);
  }

  .hero-stage {
    grid-template-columns: minmax(315px, 45vw) minmax(270px, 1fr);
    padding: clamp(88px, 12vh, 126px) clamp(46px, 6vw, 76px) clamp(54px, 8vh, 86px);
    gap: clamp(28px, 3.2vw, 46px);
  }

  .copy-stack {
    width: min(540px, 100%);
  }

  .hero-copy {
    max-width: 42ch;
  }

  .feature-badges {
    gap: 8px;
    margin: 20px 0 20px;
  }

  .badge {
    min-height: 38px;
    padding: 9px 11px;
    font-size: 11px;
  }

  .hero-actions {
    gap: 10px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(124px, 168px));
    gap: 10px;
  }

  .stat-card {
    min-height: clamp(92px, 11vh, 104px);
    border-radius: 22px;
  }

  .stat-card__content {
    padding: 13px;
  }

  .stat-card strong {
    font-size: clamp(22px, 2.6vw, 25px);
  }
}

/* Portrait tablet has more breathing room than phone. */
@media (min-width: 700px) and (max-width: 899px) and (orientation: portrait) {
  .copy-stack {
    width: min(340px, 44vw);
  }

  .hero-title {
    font-size: clamp(44px, 8.5vw, 72px);
  }

  .hero-copy {
    display: block !important;
    max-width: 27ch;
    overflow: visible;
  }

  .stat-grid {
    top: clamp(500px, 55vh, 650px);
    top: clamp(500px, 55svh, 650px);
    left: clamp(34px, 6vw, 62px);
    right: max(76px, calc(env(safe-area-inset-right) + 62px));
  }

  .stat-card__content {
    padding: clamp(13px, 2vw, 16px);
  }

  .stat-card span {
    display: block !important;
    max-height: none !important;
    overflow: visible !important;
    -webkit-line-clamp: initial;
  }
}

/* Narrow portrait tablet safety. */
@media (min-width: 700px) and (max-width: 760px) and (orientation: portrait) {
  .nav-pill {
    padding-inline: 9px;
    letter-spacing: 0.055em;
  }

  .copy-stack {
    width: min(300px, 43vw);
  }

  .hero-copy {
    font-size: 13px;
  }

  .stat-grid {
    right: max(70px, calc(env(safe-area-inset-right) + 58px));
    gap: 10px;
  }
}


/* Real-device tablet text force pass. */
@media (min-width: 700px) and (max-width: 899px) {
  .stat-grid .stat-card .stat-card__content {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    padding: 14px !important;
  }

  .stat-grid .stat-card .stat-card__content > small {
    display: block !important;
    margin: 0 0 6px !important;
    color: inherit !important;
    font-size: 13px !important;
    line-height: 1.05 !important;
  }

  .stat-grid .stat-card .stat-card__content > strong {
    display: block !important;
    margin: 0 0 8px !important;
    color: inherit !important;
    font-size: 32px !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: 21px !important;
    line-height: 1.14 !important;
    opacity: 1 !important;
    -webkit-line-clamp: initial !important;
    -webkit-box-orient: initial !important;
  }
}


/* Real-device tablet hero subtitle force pass. */
@media (min-width: 700px) and (max-width: 899px) {
  .copy-stack .hero-copy,
  #heroCopy.hero-copy {
    display: block !important;
    visibility: visible !important;
    max-width: min(34ch, 52vw) !important;
    max-height: none !important;
    overflow: visible !important;
    color: var(--copy-color, #ffffff) !important;
    font-size: clamp(16px, 2.4vw, 19px) !important;
    line-height: 1.25 !important;
    opacity: 0.98 !important;
    -webkit-line-clamp: initial !important;
    -webkit-box-orient: initial !important;
  }
}

