/* ========== LK FINANCE — MOBILE RESPONSIVE LAYER ==========
   Comprehensive mobile fixes. Loaded LAST (after styles.css + polish.css).
   Three breakpoints: 1024px (tablet), 768px (mobile landscape), 480px (mobile portrait).
   Added: 2026-05-13
*/

/* ==================================================
   1. HAMBURGER MENU (mobile nav)
   ================================================== */
.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--hairline);
  cursor: pointer;
  padding: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background 0.2s ease;
  z-index: 100;
}
.nav-toggle:hover { background: #fff; }
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.2s ease;
}
.nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==================================================
   2. TABLET breakpoint (≤ 1024px)
   ================================================== */
@media (max-width: 1024px) {
  .container, .container-narrow {
    padding-left: 22px;
    padding-right: 22px;
  }
  .hero {
    padding: 72px 0 60px;
  }
}

/* ==================================================
   3. MOBILE breakpoint (≤ 880px) — hamburger appears
   ================================================== */
@media (max-width: 880px) {
  /* Show hamburger, hide desktop nav */
  .nav-toggle { display: flex; }

  .nav-inner {
    position: relative;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    left: 0;
    background: rgba(255, 255, 255, 0.97);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px;
    border: 1px solid var(--hairline);
    border-radius: 20px;
    box-shadow: 0 24px 64px -16px rgba(10, 22, 40, 0.2);
    z-index: 99;
    animation: nav-slide-in 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .nav.is-open .nav-links { display: flex; }

  .nav-links a:not(.nav-cta) {
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 17px;
    text-align: right;
    transition: background 0.2s ease;
  }
  .nav-links a:not(.nav-cta):hover {
    background: var(--bg-tint);
  }
  /* Disable hover underline on mobile */
  .nav-links a:not(.nav-cta)::after { display: none; }

  .nav-cta {
    margin-top: 8px;
    padding: 14px 20px;
    font-size: 16px;
    text-align: center;
    justify-content: center;
  }

  @keyframes nav-slide-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

/* ==================================================
   4. MOBILE breakpoint (≤ 720px) — main responsive
   ================================================== */
@media (max-width: 720px) {
  /* === Typography === */
  body { font-size: 16px; line-height: 1.6; }

  .h-display {
    font-size: clamp(30px, 8.5vw, 44px);
    line-height: 1.1;
    letter-spacing: -0.02em;
  }
  .h-1 {
    font-size: clamp(26px, 7.5vw, 38px);
    line-height: 1.15;
  }
  .h-2 {
    font-size: clamp(22px, 5.8vw, 30px);
    line-height: 1.2;
  }
  .h-3 { font-size: 20px; }
  .h-4 { font-size: 17px; }

  .lead {
    font-size: 16px;
    line-height: 1.65;
  }

  .eyebrow {
    font-size: 11px;
    padding: 6px 12px;
  }

  /* === Container padding === */
  .container, .container-narrow {
    padding-left: 18px;
    padding-right: 18px;
  }

  /* === Hero === */
  .hero {
    padding: 40px 0 32px;
  }
  .hero-grid {
    gap: 28px;
  }

  /* Brand card simpler/smaller on mobile */
  .hero-art {
    max-width: 320px;
    margin: 0 auto;
  }
  .brand-card {
    padding: 22px 18px;
    border-radius: 22px;
  }
  .brand-name { font-size: 22px; }
  .brand-role { font-size: 13px; }
  .brand-tagline { font-size: 13px; }

  /* === Buttons full-width on mobile === */
  .hero .flex.gap-3 {
    flex-direction: column;
    width: 100%;
  }
  .hero .btn-primary,
  .hero .btn-ghost {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 14px 20px;
    font-size: 16px;
  }

  /* === Stats bar — 2x2 on mobile === */
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .stat {
    padding: 18px 14px;
  }
  .stat-num span,
  .stat-num {
    font-size: clamp(24px, 6.5vw, 32px) !important;
  }
  .stat-lbl {
    font-size: 12.5px;
    line-height: 1.4;
  }

  /* === Pain grid — 1 col === */
  .pain-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .pain-card {
    padding: 22px 20px;
  }

  /* === Process steps — vertical stack === */
  .step,
  .steps .step {
    grid-template-columns: 1fr !important;
    text-align: center;
  }
  .step-num {
    margin: 0 auto 14px;
  }
  .step > div:last-child {
    text-align: right;
  }

  /* === Authority / Story card === */
  .card-glass {
    padding: 28px 22px !important;
    border-radius: 22px !important;
  }
  .quote {
    font-size: 19px !important;
    line-height: 1.4 !important;
  }
  blockquote {
    font-size: 18px !important;
    padding: 18px 20px !important;
  }

  /* === Blog grid — 1 col === */
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .blog-card {
    min-height: auto;
  }
  .blog-card .cover {
    min-height: 140px;
  }

  /* === Forms === */
  .form-card {
    padding: 28px 22px;
    border-radius: 22px;
  }
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }
  .form-field input,
  .form-field textarea,
  .form-field select {
    font-size: 16px; /* prevents iOS auto-zoom */
    padding: 12px 14px;
  }
  .form-submit {
    width: 100%;
    padding: 16px 24px !important;
    font-size: 16px !important;
  }

  /* === Anti-pitch list === */
  .anti-pitch {
    padding: 24px 22px;
  }
  .anti-pitch li {
    font-size: 15.5px;
  }

  /* === Prose === */
  .prose h2 {
    font-size: 24px;
    margin-top: 28px;
  }
  .prose p {
    font-size: 16px;
    line-height: 1.7;
  }

  /* === Callout === */
  .callout {
    padding: 20px 18px;
  }

  /* === Footer minimal === */
  .footer-minimal {
    padding: 48px 0 24px;
    margin-top: 56px;
  }
  .footer-brand-logo {
    width: 72px;
    height: 72px;
  }
  .footer-brand-statement {
    font-size: 18px;
    line-height: 1.4;
  }
  .footer-legal-band {
    font-size: 12px;
  }
  .footer-legal-band > div:nth-child(2) {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 8px;
  }

  /* === Nav logo on mobile === */
  .nav {
    padding: 14px 0;
  }
  .nav-inner {
    padding: 0 18px;
  }

  /* === WhatsApp + Bot — keep both visible but smaller, ensure no overlap === */
  .wa-fab {
    width: 54px;
    height: 54px;
    bottom: 16px;
    right: 16px;
  }
  .wa-fab svg {
    width: 26px;
    height: 26px;
  }

  #lk-bot {
    bottom: 16px;
    left: 16px;
  }
  .lk-bot-fab {
    width: 54px;
    height: 54px;
  }
  .lk-bot-fab img {
    width: 28px;
    height: 28px;
  }

  /* Chat panel takes most of viewport on mobile */
  .lk-bot-panel {
    position: fixed;
    bottom: 80px;
    left: 12px;
    right: 12px;
    width: auto;
    height: calc(100vh - 100px);
    max-height: 680px;
    border-radius: 22px;
  }

  /* === Background orbs smaller === */
  .orb.a { width: 280px !important; height: 280px !important; }
  .orb.b { width: 260px !important; height: 260px !important; }
  .orb.c { width: 220px !important; height: 220px !important; }

  /* === Hero halo === */
  .brand-halo {
    width: 280px !important;
    height: 280px !important;
  }
}

/* ==================================================
   5. SMALL MOBILE (≤ 480px) — fine-tuning
   ================================================== */
@media (max-width: 480px) {
  .container, .container-narrow {
    padding-left: 16px;
    padding-right: 16px;
  }

  .h-display {
    font-size: clamp(28px, 9vw, 38px);
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .stat {
    padding: 16px;
  }

  /* Process step numbers slightly smaller */
  .step-num {
    width: 56px;
    height: 56px;
    font-size: 22px;
  }

  /* Footer links wrap vertically */
  .footer-legal-band > div {
    text-align: center;
  }

  /* Brand card: ultra-compact */
  .hero-art {
    max-width: 260px;
  }
  .brand-card {
    padding: 18px 16px;
  }
  .portrait-wrap {
    width: 100px !important;
    height: 100px !important;
  }

  /* Card-glass tighter */
  .card-glass {
    padding: 22px 18px !important;
  }

  /* Assessment-specific (lk-finance-assessment.html) */
  .stats-row {
    flex-direction: column;
    gap: 12px;
  }
}

/* ==================================================
   6. TOUCH OPTIMIZATIONS (all touch devices)
   ================================================== */
@media (hover: none) and (pointer: coarse) {
  /* Touch targets minimum 44x44 */
  a, button {
    -webkit-tap-highlight-color: rgba(46, 164, 160, 0.15);
  }

  /* Remove hover effects that don't apply */
  .pain-card:hover {
    transform: none;
  }
  .blog-card:hover {
    transform: none;
  }

  /* Better scrolling */
  body {
    -webkit-overflow-scrolling: touch;
  }
}
