/* ═══════════════════════════════════════════════════════
   100CLAN — Mobile Experience Overrides
   Loaded on all pages to fix touch targets, spacing,
   and ensure native-app-like mobile UX.
   ═══════════════════════════════════════════════════════ */

/* ─── Smooth scrolling ─── */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* ─── Prevent horizontal overflow globally ─── */
body {
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ─── Mobile-only overrides (≤ 768px) ─── */
@media (max-width: 768px) {

  /* ── Hamburger: enlarge touch target to 44px minimum ── */
  .hamburger {
    min-width: 44px;
    min-height: 44px;
    padding: 10px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .hamburger span {
    width: 26px !important;
    height: 2.5px !important;
    border-radius: 2px !important;
  }

  /* ── Mobile menu overlay — full redesign ── */
  .mobile-menu {
    z-index: 10000 !important;
    background: rgba(17,17,17,0.99) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    padding: 0 !important;
    gap: 0 !important;
    justify-content: flex-start !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-menu a {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 0 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    touch-action: manipulation;
  }
  /* Push menu links down and space them tighter */
  .mobile-menu a:first-of-type {
    margin-top: 100px;
  }

  /* ── Mobile close button — big, obvious, easy to tap ── */
  .mobile-close {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    width: 48px !important;
    height: 48px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 24px !important;
    color: #fff !important;
    background: rgba(255,255,255,0.1) !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    border-radius: 50% !important;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    z-index: 10001 !important;
  }
  .mobile-close:hover,
  .mobile-close:active {
    background: rgba(255,255,255,0.2) !important;
    color: #F5B800 !important;
  }

  /* ── All buttons and links: minimum touch targets ── */
  .btn-primary,
  .btn-outline,
  .btn-secondary,
  button:not(.mobile-close):not(.hamburger) {
    min-height: 44px;
    touch-action: manipulation;
  }

  /* ── Navigation: sticky with safe area for notch ── */
  .nav {
    padding-top: env(safe-area-inset-top, 0px);
  }

  /* ── Cards and interactive elements: proper spacing ── */
  .card,
  [class*="card"] {
    touch-action: manipulation;
  }

  /* ── Form inputs: prevent zoom on iOS (16px min) ── */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="tel"],
  input[type="url"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
    min-height: 44px;
  }

  /* ── Tables: horizontal scroll wrapper ── */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ── Images: prevent overflow ── */
  img, video, iframe {
    max-width: 100%;
    height: auto;
  }

  /* ── Admin sidebar toggle: enlarge touch target ── */
  .mob-toggle {
    min-width: 44px;
    min-height: 44px;
    font-size: 24px !important;
    padding: 8px !important;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  /* ── Admin sidebar links: adequate touch targets ── */
  .sidebar a {
    min-height: 44px;
    display: flex;
    align-items: center;
    touch-action: manipulation;
  }

  /* ── Hero section fixes ── */
  .hero-grid-lines {
    opacity: 0.3 !important;
    background-size: 40px 40px !important;
  }

  /* Hide hero creators strip on mobile */
  .hero-creators-mobile {
    display: none !important;
  }

  /* Fix hero buttons — wave pseudo-elements covering text */
  .btn-hero-primary {
    overflow: visible !important;
  }
  .btn-hero-primary::before,
  .btn-hero-primary::after {
    display: none !important;
  }
  .btn-hero-primary .bhp-text,
  .btn-hero-primary svg {
    position: relative;
    z-index: 2;
  }
  .btn-hero-outline {
    background: transparent !important;
    color: #1A1A1A !important;
    border: 2px solid rgba(0,0,0,0.25) !important;
  }

  /* Fix nav-cta buttons being cut off */
  .nav-cta .btn-outline,
  .nav-cta .btn-primary {
    font-size: 11px !important;
    padding: 8px 12px !important;
    white-space: nowrap !important;
  }

  .hero-trust {
    align-items: flex-start !important;
  }

  /* ── Hero visual: hide in hero (JS moves it after features) ── */
  .hero-visual {
    display: none !important;
  }
  /* When relocated after features, show it */
  .hero-visual.mobile-relocated {
    display: block !important;
    width: 100% !important;
    padding: 40px 20px !important;
    background: #111 !important;
  }
  .mobile-relocated .hero-network-card {
    transform: scale(0.65) !important;
    transform-origin: center center !important;
    margin: -80px auto !important;
    overflow: visible !important;
  }
  /* Remove yellow gradient overlays */
  .mobile-relocated .hero-network-card::before,
  .mobile-relocated .hero-network-card::after {
    display: none !important;
  }
  /* Push creator nodes further outside the earth */
  .mobile-relocated .n1 { top: -4% !important;  left: 8% !important; }
  .mobile-relocated .n2 { top: -4% !important;  right: 4% !important; }
  .mobile-relocated .n3 { top: 36% !important;  left: -8% !important; }
  .mobile-relocated .n4 { top: 36% !important;  right: -8% !important; }
  .mobile-relocated .n5 { bottom: 4% !important; left: 0% !important; }
  .mobile-relocated .n6 { bottom: 4% !important; right: 0% !important; }
  /* Smaller avatars on mobile */
  .mobile-relocated .net-avatar {
    width: 40px !important;
    height: 40px !important;
    font-size: 12px !important;
  }
  .mobile-relocated .net-name {
    font-size: 8px !important;
  }
  .mobile-relocated .net-tag {
    font-size: 7px !important;
  }
  .hero-content {
    gap: 16px !important;
  }

  /* ── Hide "How It Works" section on mobile ── */
  .how {
    display: none !important;
  }

  /* ── Stats: 4 across in one row, compact ── */
  .stats-bar {
    padding: 24px 0 !important;
  }
  .stats-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 0 !important;
  }
  .stat-block {
    padding: 12px 4px !important;
    border-right: 1px solid rgba(255,255,255,0.06) !important;
    border-top: none !important;
  }
  .stat-block:last-child {
    border-right: none !important;
  }
  .stat-number {
    font-size: 18px !important;
    margin-bottom: 2px !important;
  }
  .stat-label {
    font-size: 8px !important;
    letter-spacing: 0.08em !important;
  }

  /* ── Features: 2-column compact grid (3 top, 3 bottom) ── */
  .features-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .feature-card {
    min-height: 140px !important;
    border-radius: 12px !important;
  }
  .feature-card .fc-content {
    padding: 14px !important;
  }
  .feature-card .feature-title,
  .feature-card h3 {
    font-size: 13px !important;
    margin-bottom: 4px !important;
  }
  .feature-card .feature-desc,
  .feature-card p {
    font-size: 11px !important;
    line-height: 1.4 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }
  .feature-card .feature-link {
    font-size: 11px !important;
    margin-top: 6px !important;
  }
  /* Hide landmark background images on mobile for cleaner look */
  .feature-card::before {
    opacity: 0.08 !important;
  }
  .features {
    padding: 48px 0 !important;
  }
  .features-header {
    margin-bottom: 32px !important;
  }

  /* ── Sponsors/brands: fix wave transitions on mobile ── */
  .sponsors-tape {
    padding: 48px 0 40px !important;
  }
  .sponsors-wave-top,
  .sponsors-wave-bot {
    height: 40px !important;
  }
  .sponsors-label {
    margin-bottom: 20px !important;
    font-size: 9px !important;
  }
  .sponsor-item {
    padding: 0 24px !important;
    height: 36px !important;
  }
  .sponsor-item svg {
    height: 18px !important;
  }
  .sponsors-track.sp-reverse {
    margin-top: 12px !important;
  }

  /* ── Footer: compact 3-column layout on mobile ── */
  .footer-top {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 16px !important;
    margin-bottom: 32px !important;
  }
  /* Hide brand column on mobile (logo + tagline + socials) */
  .footer-brand {
    display: none !important;
  }
  .footer-col-title {
    font-size: 11px !important;
    letter-spacing: 0.12em !important;
    margin-bottom: 12px !important;
  }
  .footer-links {
    gap: 6px !important;
  }
  .footer-links a {
    font-size: 12px !important;
    min-height: 32px !important;
    display: flex;
    align-items: center;
  }
  .footer-links li a {
    min-height: 32px !important;
    padding: 2px 0 !important;
  }
  .footer-legal a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 4px 0;
  }
}

/* ─── Extra small screens (≤ 480px) ─── */
@media (max-width: 480px) {
  .mobile-menu a {
    font-size: 17px !important;
    min-height: 48px !important;
  }
  .mobile-menu a:first-of-type {
    margin-top: 80px !important;
  }

  /* Hero: hide grid lines entirely on small phones */
  .hero-grid-lines {
    display: none !important;
  }
  .hero {
    padding-top: 90px !important;
    padding-bottom: 48px !important;
  }
  .hero-headline {
    font-size: clamp(26px, 7.5vw, 40px) !important;
    line-height: 1.1 !important;
  }
  .hero-sub {
    font-size: 14px !important;
    line-height: 1.6 !important;
  }
  .hero-creators-mobile {
    display: none !important;
  }
}

/* ─── Safe area support for devices with notch ─── */
@supports (padding: env(safe-area-inset-bottom)) {
  .mobile-menu {
    padding-bottom: calc(40px + env(safe-area-inset-bottom)) !important;
  }
  .footer {
    padding-bottom: env(safe-area-inset-bottom);
  }
}
