/**
 * StreamTune Additive Tablet & Mobile Responsive Layer
 * 
 * ABSOLUTE ISOLATION GUARANTEE:
 * This stylesheet contains ZERO unscoped rules and ZERO rules that apply at >= 1025px.
 * The approved desktop layout (>= 1025px) remains 100% frozen and untouched.
 */

/* ==========================================================================
   TIER 1: TABLET RESPONSIVENESS (768px to 1024px)
   Fluid, scaled layout that prevents crowding, overlapping, and clipping.
   ========================================================================== */
@media (min-width: 768px) and (max-width: 1024px) {
  /* Fluid Gutters */
  .container {
    padding-left: clamp(20px, 3.5vw, 32px);
    padding-right: clamp(20px, 3.5vw, 32px);
  }

  /* Header Clearance: Prevent desktop nav items & buttons from colliding */
  .desktop-nav {
    gap: clamp(14px, 2vw, 24px);
  }

  .nav-link {
    font-size: clamp(0.85rem, 1.1vw, 0.92rem);
  }

  .header-actions .btn {
    padding: 8px clamp(12px, 1.8vw, 18px);
    font-size: 0.86rem;
    min-height: 40px;
  }

  /* Hero Fluid Typography & Balanced Spacing */
  .hero-section {
    padding-top: clamp(48px, 6vw, 72px);
    padding-bottom: clamp(40px, 5vw, 64px);
  }

  .hero-headline {
    font-size: clamp(2.6rem, 5.2vw, 3.8rem);
  }

  .hero-subhead {
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    max-width: 580px;
  }

  .hero-grid {
    gap: clamp(24px, 4vw, 40px);
  }

  /* Filter Showcase: Proportional 2-column layout with ample panel width */
  .filter-showcase {
    grid-template-columns: minmax(240px, 270px) 1fr;
    gap: clamp(16px, 2.5vw, 28px);
  }

  .filter-tab {
    padding: 13px 15px;
    min-height: 68px;
  }

  .tab-title {
    font-size: 0.92rem;
  }

  .tab-desc {
    font-size: 0.78rem;
  }

  .filter-panel-stage {
    min-height: 400px;
    padding: clamp(22px, 2.8vw, 30px);
  }

  .panel-headline {
    font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  }

  .panel-body {
    font-size: clamp(0.92rem, 1.2vw, 1.02rem);
  }

  /* Safety Proof: Proportional 3-column timeline on tablet */
  .proof-timeline-grid {
    gap: clamp(10px, 1.6vw, 16px);
  }

  .proof-timeline-card {
    padding: 16px 14px;
  }

  .proof-state-desc {
    font-size: 0.88rem;
  }

  /* Safety Notes Grid */
  .safety-notes-grid {
    gap: clamp(12px, 2vw, 18px);
  }

  .safety-note-card {
    padding: 18px 20px;
  }

  /* Pricing Decision Block */
  .pricing-card {
    padding: clamp(24px, 3.5vw, 36px);
  }
}


/* ==========================================================================
   TIER 2: TRUE MOBILE EXPERIENCE (<= 767px)
   Deliberate single-column reflow, swipeable scroll-snap proof cards,
   tactile filter grid, safe-area padding, and 0px horizontal overflow.
   ========================================================================== */
@media (max-width: 767px) {
  /* Container & Fluid Gutters */
  .container {
    padding-left: clamp(16px, 4.5vw, 22px);
    padding-right: clamp(16px, 4.5vw, 22px);
  }

  /* Strict anti-overflow safeguard on mobile */
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* Bottom cushion so fixed mobile sticky download bar never covers footer or content */
  body {
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Mobile Header & Navigation Drawer */
  .site-header {
    background: rgba(9, 11, 15, 0.92);
  }

  .header-inner {
    height: 60px;
  }

  .mobile-menu-btn {
    min-width: 46px;
    min-height: 46px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(17, 21, 28, 0.6);
  }

  .mobile-menu-panel {
    padding: 20px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  }

  .mobile-nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 1.05rem;
    padding: 8px 4px;
  }

  /* Drawer CTA: hide trial download and show lifetime purchase on mobile */
  .desktop-only-drawer-btn {
    display: none !important;
  }

  .mobile-only-drawer-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 48px !important;
    font-weight: 700 !important;
  }

  /* Mobile Hero Reflow */
  .hero-section {
    padding-top: 36px;
    padding-bottom: 40px;
  }

  .hero-headline {
    font-size: clamp(2.1rem, 9vw, 2.75rem);
    line-height: 1.06;
    letter-spacing: -0.03em;
  }

  .hero-subhead {
    font-size: 1.02rem;
    line-height: 1.5;
    margin-bottom: 24px;
  }

  .hero-cta-cluster {
    width: 100%;
  }

  .hero-cta-row {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  /* Hide trial .exe download CTA on mobile; promote Lifetime access to full-width primary */
  .hero-cta-row .js-download-btn {
    display: none !important;
  }

  .hero-cta-row .js-buy-btn {
    display: flex !important;
    width: 100% !important;
    min-height: 52px !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    background-color: var(--signal) !important;
    color: #06090e !important;
    border-color: var(--signal) !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .hero-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  .hero-actions .btn {
    width: 100%;
    min-height: 52px;
    font-size: 1rem;
    border-radius: 12px;
  }

  .hero-trust {
    flex-wrap: wrap;
    gap: 10px 16px;
    font-size: 0.82rem;
    margin-top: 20px;
  }

  /* Signal Flow Section Mobile Reflow */
  .signal-flow-section {
    padding: 48px 0;
  }

  .section-headline {
    font-size: clamp(1.85rem, 7.5vw, 2.35rem);
    line-height: 1.15;
  }

  .section-desc {
    font-size: 0.98rem;
    line-height: 1.55;
  }

  /* Tactile 2-Column Mobile Filter Selector Grid */
  .filter-tablist {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .filter-tab {
    min-height: 74px !important;
    max-height: 90px !important;
    padding: 10px 12px !important;
    border-radius: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
  }

  .filter-tab .tab-desc {
    display: none !important;
  }

  .filter-tab .tab-title {
    font-size: 0.84rem !important;
    line-height: 1.2 !important;
    white-space: normal !important;
  }

  .filter-tab:nth-child(5) {
    grid-column: 1 / -1 !important;
    min-height: 56px !important;
    max-height: 62px !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    padding: 12px 14px !important;
  }

  .filter-tab:nth-child(5) .tab-top-row {
    margin-bottom: 0 !important;
  }

  /* Active Filter Stage Panel beneath grid */
  .filter-panel-stage {
    min-height: 360px !important;
    padding: 20px 16px 16px !important;
    border-radius: 16px !important;
    margin-top: 6px !important;
  }

  .panel-headline {
    font-size: 1.35rem !important;
    line-height: 1.25 !important;
    margin-bottom: 8px !important;
  }

  .panel-body {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
  }

  .panel-visual-canvas {
    height: 116px !important;
    margin: 12px 0 12px !important;
    border-radius: 10px !important;
  }

  .panel-summary-chips {
    gap: 6px !important;
  }

  .panel-chip {
    font-size: 0.74rem !important;
    padding: 4px 10px !important;
  }

  /* ==========================================================================
     PROOF TIMELINE: SWIPEABLE CSS SCROLL-SNAP SLIDER
     Transforms the 3 lifecycle cards into a smooth, natural touch slider.
     ========================================================================== */
  .proof-timeline-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory !important;
    scroll-behavior: smooth !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 12px !important;
    padding: 8px 18px 16px 18px !important;
    margin-left: -18px !important;
    margin-right: -18px !important;
    margin-bottom: 8px !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(69, 223, 255, 0.25) transparent !important;
  }

  .proof-timeline-grid::-webkit-scrollbar {
    height: 3px !important;
  }

  .proof-timeline-grid::-webkit-scrollbar-track {
    background: transparent !important;
  }

  .proof-timeline-grid::-webkit-scrollbar-thumb {
    background: rgba(69, 223, 255, 0.3) !important;
    border-radius: 3px !important;
  }

  .proof-timeline-card {
    flex: 0 0 84% !important;
    max-width: 310px !important;
    min-width: 250px !important;
    scroll-snap-align: center !important;
    scroll-snap-stop: always !important;
    padding: 18px 16px !important;
    border-radius: 14px !important;
    box-sizing: border-box !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25) !important;
  }

  /* Subtle swipe affordance note under slider */
  .proof-swipe-hint {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 24px;
    opacity: 0.85;
  }

  .proof-swipe-hint svg {
    opacity: 0.7;
  }

  /* Safety Notes Grid on mobile */
  .safety-notes-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .safety-note-card {
    padding: 18px 16px !important;
  }

  /* Pricing Decision Block on mobile: hide trial card, emphasize Lifetime access */
  .pricing-section {
    padding: 48px 0 !important;
  }

  .pricing-decision-block {
    border-radius: 16px !important;
  }

  .pricing-grid {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
    padding: 18px 16px !important;
  }

  /* Hide trial card and divider on mobile */
  .pricing-col-left,
  .pricing-divider {
    display: none !important;
  }

  .pricing-col-right {
    width: 100% !important;
    padding: 24px 20px !important;
  }

  .pricing-col-right .js-buy-btn {
    background-color: var(--signal) !important;
    color: #06090e !important;
    border-color: var(--signal) !important;
    font-weight: 700 !important;
  }

  .mobile-pricing-qualifier {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--paper-dim);
    background: rgba(69, 223, 255, 0.06);
    border: 1px solid rgba(69, 223, 255, 0.22);
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 14px;
    margin-bottom: 8px;
    line-height: 1.4;
  }

  .mobile-pricing-qualifier svg {
    color: var(--signal);
    flex-shrink: 0;
  }

  .pricing-card {
    padding: 20px 16px !important;
  }

  .pricing-cta .btn {
    min-height: 50px !important;
    font-size: 0.98rem !important;
  }

  /* FAQ Accordion on mobile */
  .faq-section {
    padding: 48px 0 !important;
  }

  .faq-question {
    padding: 18px 16px !important;
    font-size: 1rem !important;
    min-height: 48px !important;
  }

  .faq-answer {
    padding: 0 16px 18px !important;
    font-size: 0.92rem !important;
  }

  /* Footer on mobile */
  .site-footer {
    padding: 40px 0 32px !important;
  }

  .footer-inner {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 24px !important;
  }

  .footer-links {
    flex-direction: column !important;
    gap: 14px !important;
    width: 100% !important;
  }

  /* Hide .exe download trial link in mobile footer */
  .footer-link.js-download-btn {
    display: none !important;
  }

  .footer-link {
    min-height: 38px !important;
    display: flex !important;
    align-items: center !important;
  }

  /* Mobile Sticky Bar Safe-Area & Touch Compliance: Lifetime purchase + platform requirement */
  .mobile-sticky-bar {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 16px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    min-height: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .mobile-sticky-inner {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }

  .mobile-sticky-qualifier {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--paper-dim);
    text-align: center;
    letter-spacing: 0.015em;
    line-height: 1.3;
    opacity: 0.92;
  }

  .mobile-sticky-btn {
    min-height: 48px !important;
    font-size: 0.96rem !important;
    font-weight: 700 !important;
    width: 100% !important;
  }

  /* Utility Pages Mobile Adaptations (.legal-container, .feedback-card, .manage-container) */
  .legal-container,
  .feedback-card,
  .manage-container,
  .inspector-card {
    padding: 24px 16px !important;
    border-radius: 16px !important;
    margin: 0 auto !important;
  }
}

/* ==========================================================================
   EXTRA COMPACT SCREENS (<= 360px, e.g. 320px)
   Extra safety margin to guarantee 0px overflow on the narrowest phones.
   ========================================================================== */
@media (max-width: 360px) {
  .hero-headline {
    font-size: 1.95rem !important;
  }

  .section-headline {
    font-size: 1.7rem !important;
  }

  .filter-tab {
    padding: 8px 10px !important;
    min-height: 70px !important;
  }

  .filter-tab .tab-title {
    font-size: 0.78rem !important;
  }

  .filter-tab .tab-num {
    font-size: 0.7rem !important;
  }

  .proof-timeline-card {
    flex: 0 0 88% !important;
    min-width: 220px !important;
    padding: 16px 12px !important;
  }

  .pricing-amount {
    font-size: 2.4rem !important;
  }
}

