/* ═══════════════════════════════════════════════════════════════════
   AstroKamya™ — MOBILE RESPONSIVE FIXES v4 (2026-05-08)
   1. Hardens hero compaction (no blank space below trust row)
   2. Tablet (768–1024) responsive polish
   3. Cinematic planet orbital animation for mobile + tablet
   4. Section-level overflow safety net (no internal horizontal scroll)
   Loads LAST — overrides everything with !important where needed.
   ═══════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════════════
   1) HERO V9 — bulletproof compaction (mobile + tablet)
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  #hero-v9 {
    display: block !important;
    grid-template-columns: none !important;
    min-height: 0 !important;
    height: auto !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    gap: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  /* hero-right is purely decorative on mobile/tablet — must not reserve flow space */
  .h9-hero-right {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    z-index: 0 !important;
  }

  .h9-hero-left {
    position: relative !important;
    z-index: 2 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    align-self: stretch !important;
  }

  /* Heavy WebGL / SVG ornaments hidden — animation handled by .h9-mobile-anim */
  #h9-planets-gl,
  .h9-orbit-rings,
  .h9-zodiac-ring,
  .h9-stage,
  .h9-scanner-hud,
  .h9-particle-canvas,
  .h9-scan-beam,
  .h9-scroll-hint {
    display: none !important;
  }

  .h9-grain { opacity: .06 !important; }

  .h9-ephemeris-bar {
    margin-top: 0 !important;
    width: 100% !important;
    overflow: hidden !important;
  }
}

/* ════════════════════════════════════════════════════════════════════
   2) TABLET (768–1024) — cleaner spacing, larger anim
   ════════════════════════════════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1024px) {
  #hero-v9 {
    padding: 28px 32px 0 !important;
  }
  .h9-hero-left {
    max-width: 720px !important;
    margin: 0 auto !important;
    gap: 18px !important;
  }
  .h9-hero-title {
    font-size: clamp(48px, 7.4vw, 78px) !important;
    line-height: 1.0 !important;
  }
  .h9-cta-row {
    flex-direction: row !important;
    gap: 14px !important;
  }
  .h9-btn-primary, .h9-btn-secondary {
    width: auto !important;
    flex: 1 1 auto !important;
  }

  .h9-mobile-anim {
    width: 460px !important;
    height: 460px !important;
    top: 50% !important;
    left: auto !important;
    right: -80px !important;
    transform: translateY(-50%) !important;
    opacity: .55 !important;
  }
}

/* ════════════════════════════════════════════════════════════════════
   3) ENHANCED PLANET ORBIT — mobile + tablet
   Visible cinematic Navagraha animation. Layers:
      • ma-center-star  → glowing sun core + halo
      • ma-ring-3       → inner orbit (Chandra moon dot)
      • ma-ring-2       → mid orbit (Mangal/violet planet)
      • ma-ring-1       → outer orbit (Shani teal planet)
      • .h9-mobile-anim::before → outermost wide ring
      • .h9-mobile-anim::after  → soft starfield halo
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .h9-mobile-anim {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: none !important;
    mix-blend-mode: screen !important;
    filter: drop-shadow(0 0 24px rgba(124, 58, 237, 0.18));
  }

  /* Outermost decorative ring (created via pseudo) */
  .h9-mobile-anim::before {
    content: '';
    position: absolute;
    inset: -8%;
    border-radius: 50%;
    border: 1px dashed rgba(255, 217, 107, 0.18);
    animation: v4SpinSlow 38s linear infinite;
    pointer-events: none;
  }

  /* Soft halo glow behind everything */
  .h9-mobile-anim::after {
    content: '';
    position: absolute;
    inset: 12%;
    border-radius: 50%;
    background: radial-gradient(circle at center,
      rgba(255, 184, 0, 0.18) 0%,
      rgba(124, 58, 237, 0.08) 40%,
      transparent 70%);
    filter: blur(8px);
    animation: v4HaloPulse 5s ease-in-out infinite alternate;
    pointer-events: none;
  }

  /* Outer orbit (Shani — teal/violet) */
  .ma-ring-1 {
    width: 100% !important;
    height: 100% !important;
    border: 1px solid rgba(255, 217, 107, 0.10) !important;
    border-top-color: rgba(125, 211, 192, 0.7) !important;
    border-right-color: rgba(125, 211, 192, 0.25) !important;
    box-shadow:
      inset 0 0 18px rgba(125, 211, 192, 0.05),
      0 0 24px rgba(125, 211, 192, 0.06) !important;
    animation: v4Spin 22s linear infinite !important;
  }
  /* Shani planet on outer orbit */
  .ma-ring-1::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #b8f5e8, #4cdbc4 50%, #0f7d6f 100%);
    box-shadow:
      0 0 14px rgba(125, 211, 192, 0.85),
      0 0 28px rgba(125, 211, 192, 0.4),
      inset -2px -2px 4px rgba(0, 0, 0, 0.4);
  }
  /* Small companion star on outer ring */
  .ma-ring-1::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff8d8, #f2cc78 60%, #c89a3a 100%);
    box-shadow: 0 0 10px rgba(242, 204, 120, 0.85), 0 0 18px rgba(242, 204, 120, 0.3);
    transform: translateY(-50%);
  }

  /* Mid orbit (Mangal — violet) */
  .ma-ring-2 {
    width: 70% !important;
    height: 70% !important;
    border: 1px solid rgba(255, 217, 107, 0.10) !important;
    border-right-color: rgba(167, 139, 250, 0.7) !important;
    border-bottom-color: rgba(167, 139, 250, 0.25) !important;
    box-shadow:
      inset 0 0 14px rgba(167, 139, 250, 0.05),
      0 0 18px rgba(167, 139, 250, 0.05) !important;
    animation: v4SpinRev 14s linear infinite !important;
  }
  /* Mangal planet on mid orbit */
  .ma-ring-2::before {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 18%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #f3c4ff, #a78bfa 50%, #5b21b6 100%);
    box-shadow:
      0 0 12px rgba(167, 139, 250, 0.85),
      0 0 24px rgba(167, 139, 250, 0.35),
      inset -2px -2px 3px rgba(0, 0, 0, 0.45);
  }
  /* Tiny twin moon on mid orbit */
  .ma-ring-2::after {
    content: '';
    position: absolute;
    top: 8%;
    left: -4px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffe8c2, #d6a85a);
    box-shadow: 0 0 7px rgba(214, 168, 90, 0.7);
  }

  /* Inner orbit (Chandra — gold) */
  .ma-ring-3 {
    width: 44% !important;
    height: 44% !important;
    border: 1px solid rgba(255, 217, 107, 0.10) !important;
    border-bottom-color: rgba(255, 184, 0, 0.85) !important;
    border-left-color: rgba(255, 184, 0, 0.32) !important;
    box-shadow:
      inset 0 0 10px rgba(255, 184, 0, 0.06),
      0 0 14px rgba(255, 184, 0, 0.05) !important;
    animation: v4Spin 9s linear infinite !important;
  }

  /* Chandra (existing element, supersized + glowing) */
  .ma-moon {
    width: 11px !important;
    height: 11px !important;
    top: -6px !important;
    background: radial-gradient(circle at 30% 30%, #fff5d2, #ffd166 55%, #b97500 100%) !important;
    box-shadow:
      0 0 14px #ffb800,
      0 0 30px rgba(255, 184, 0, 0.45),
      inset -2px -2px 3px rgba(0, 0, 0, 0.5) !important;
  }

  /* Sun core */
  .ma-center-star {
    font-size: 30px !important;
    color: #ffe39b !important;
    text-shadow:
      0 0 12px rgba(255, 217, 107, 0.95),
      0 0 26px rgba(242, 204, 120, 0.6),
      0 0 48px rgba(255, 145, 0, 0.35) !important;
    animation: v4StarBeat 2.4s ease-in-out infinite alternate !important;
    z-index: 2;
  }
}

/* Mobile (≤640) — slightly smaller, tucked top-right but visible */
@media (max-width: 640px) {
  .h9-mobile-anim {
    width: 280px !important;
    height: 280px !important;
    top: 32% !important;
    left: auto !important;
    right: -40px !important;
    transform: translateY(-50%) !important;
    opacity: 0.42 !important;
  }
}

/* Mid mobile (480–767) */
@media (min-width: 480px) and (max-width: 767px) {
  .h9-mobile-anim {
    width: 360px !important;
    height: 360px !important;
    top: 36% !important;
    right: -60px !important;
    opacity: 0.45 !important;
  }
}

/* ───── Keyframes ───── */
@keyframes v4Spin {
  to { transform: rotate(360deg); }
}
@keyframes v4SpinRev {
  to { transform: rotate(-360deg); }
}
@keyframes v4SpinSlow {
  to { transform: rotate(360deg); }
}
@keyframes v4HaloPulse {
  0%   { opacity: 0.65; transform: scale(0.96); }
  100% { opacity: 1;    transform: scale(1.04); }
}
@keyframes v4StarBeat {
  0%   { transform: scale(0.9);  opacity: 0.85; }
  100% { transform: scale(1.08); opacity: 1; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .h9-mobile-anim,
  .h9-mobile-anim *,
  .h9-mobile-anim::before,
  .h9-mobile-anim::after {
    animation: none !important;
  }
}

/* ════════════════════════════════════════════════════════════════════
   4) GLOBAL OVERFLOW SAFETY (mobile + tablet)
   No section ever causes horizontal scroll inside its bounds.
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  body > section,
  body > div,
  body > footer {
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  section,
  .wrap,
  .container,
  .inner {
    overflow-x: clip !important;
    box-sizing: border-box !important;
  }

  /* Common offenders — keep their inner scroll where intentional */
  .chip-row,
  .lt-features-grid,
  .planets-row {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  img, video, canvas, svg {
    max-width: 100% !important;
    height: auto;
  }

  /* No content can extend past viewport via negative margin */
  * {
    max-width: 100vw;
  }
}

/* ════════════════════════════════════════════════════════════════════
   5) TABLET (768–1024) section spacing polish
   ════════════════════════════════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1024px) {
  #birth-input,
  #intent,
  #demo,
  #testimonials,
  #pricing,
  #cta-final,
  #faq {
    padding-left: 32px !important;
    padding-right: 32px !important;
  }

  .planets-row {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 24px !important;
  }
}

/* ════════════════════════════════════════════════════════════════════
   6) BACK-TO-TOP — kill globally (chat oracle FAB only)
   ════════════════════════════════════════════════════════════════════ */
.back-to-top,
button.back-to-top,
#back-to-top {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

/* ════════════════════════════════════════════════════════════════════
   7) ORACLE CHAT — fix double-border (kill global input focus ring)
       Selector specificity must beat input[type="text"]:focus (0,2,1)
   ════════════════════════════════════════════════════════════════════ */
input.oracle-input,
input[type="text"].oracle-input,
.oracle-input-row > input.oracle-input {
  -webkit-appearance: none !important;
  appearance: none !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
}
input.oracle-input:focus,
input.oracle-input:focus-visible,
input.oracle-input:active,
input[type="text"].oracle-input:focus,
input[type="text"].oracle-input:focus-visible,
.oracle-input-row > input.oracle-input:focus {
  border: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  background: transparent !important;
}
.oracle-input-row { position: relative; }

/* Mobile chat polish */
@media (max-width: 640px) {
  .oracle-input-wrap {
    padding: 12px 14px 14px !important;
    padding-bottom: calc(14px + env(safe-area-inset-bottom)) !important;
  }
  .oracle-input-row {
    padding: 4px 6px 4px 14px !important;
    border-radius: 14px !important;
  }
  .oracle-input {
    font-size: 16px !important; /* prevent iOS auto-zoom on focus */
    padding: 10px 0 !important;
  }
  .oracle-send-btn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
  }
  .oracle-fab {
    bottom: 18px !important;
    right: 18px !important;
  }
}

/* ════════════════════════════════════════════════════════════════════
   8) COOKIE BANNER — compact on mobile, no viewport eating
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  #cookie-consent-banner,
  .cookie-banner,
  .cc-banner {
    padding: 14px 16px !important;
    padding-bottom: calc(14px + env(safe-area-inset-bottom)) !important;
    font-size: 12px !important;
    line-height: 1.45 !important;
    max-height: 50vh !important;
    overflow-y: auto !important;
  }
  #cookie-consent-banner h3,
  #cookie-consent-banner h4 {
    font-size: 14px !important;
    margin-bottom: 6px !important;
  }
  #cookie-consent-banner button,
  .cookie-banner button {
    min-height: 40px !important;
    font-size: 13px !important;
  }
}

/* ════════════════════════════════════════════════════════════════════
   9) GLOBAL TYPOGRAPHY POLISH (mobile + tablet)
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  h1 { line-height: 1.05 !important; letter-spacing: -0.02em !important; }
  h2 { line-height: 1.15 !important; letter-spacing: -0.015em !important; }
  h3 { line-height: 1.25 !important; }
  p, li { line-height: 1.55 !important; }

  /* Anti-aliased rendering on retina */
  body {
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
  }

  /* Prevent iOS auto-zoom on focusable inputs */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  input[type="number"],
  input[type="search"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* ════════════════════════════════════════════════════════════════════
  10) TAP TARGETS — minimum 44px hit area (Apple HIG / WCAG)
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  a.btn, a.button, button:not(.oracle-chip):not(.h9-asterism):not(.lt-time-sep) {
    min-height: 40px;
  }
  /* Inline links exempted */
  a:not(.btn):not(.button) { min-height: 0; }
}

/* ════════════════════════════════════════════════════════════════════
  11) PRICING SECTION — compact on mobile (was 3700px tall)
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  #pricing {
    padding: 40px 0 32px !important;
  }
  #pricing > .wrap,
  #pricing > .container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .pricing-grid,
  .plan-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .plan-card,
  .pricing-card {
    padding: 22px 18px !important;
  }
  .plan-card h3,
  .pricing-card h3 {
    font-size: 20px !important;
  }
  .plan-card .plan-price,
  .pricing-card .price {
    font-size: 36px !important;
  }
}

/* ════════════════════════════════════════════════════════════════════
  12) TESTIMONIALS / FAQ / CTA-FINAL spacing on mobile
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  #testimonials, #cta-final, #faq, #demo, #intent, #birth-input {
    padding-top: 40px !important;
    padding-bottom: 40px !important;
  }
  #testimonials h2, #cta-final h2, #faq h2, #demo h2 {
    font-size: clamp(24px, 7vw, 36px) !important;
    margin-bottom: 16px !important;
  }
  .faq2-q, .faq-question {
    padding: 14px 16px !important;
    font-size: 15px !important;
  }
  .faq2-a, .faq-answer {
    font-size: 14px !important;
    padding: 0 16px 14px !important;
  }
}

/* ════════════════════════════════════════════════════════════════════
  13) FOOTER — column stack and readable spacing
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .ak-unified-footer .footer-grid,
  .ak-unified-footer .footer-cols {
    grid-template-columns: 1fr 1fr !important;
    gap: 22px !important;
  }
  .ak-unified-footer h4,
  .ak-unified-footer .col-title {
    font-size: 12px !important;
    margin-bottom: 8px !important;
  }
  .ak-unified-footer a {
    font-size: 13px !important;
    line-height: 1.7 !important;
  }
}

/* ════════════════════════════════════════════════════════════════════
  14) SECTION DIVIDERS — tighter on mobile
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .section-divider {
    height: 40px !important;
  }
}

/* ════════════════════════════════════════════════════════════════════
  15) IMAGES — block layout shift, lazy-decode
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  img {
    image-rendering: -webkit-optimize-contrast;
    content-visibility: auto;
  }
}

