﻿/* ============================================================
   GOODLADY FINANCE - MOBILE RESPONSIVE ENGINE (v4.0)
   Golden Source for Tablet & Mobile Layout Shifts
   ============================================================ */

/* --- BREAKPOINT: TABLET & SMALL LAPTOPS (1024px) --- */
@media (max-width: 1024px) {
  :root {
    --header-height: 70px;
    --section-padding-mobile: 60px 20px;
    --mobile-font-h1: clamp(2rem, 8vw, 2.8rem);
    --mobile-font-h2: clamp(1.6rem, 6vw, 2.22rem);
    --mobile-font-p: 1rem;
  }

  html,
  body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
  }

  .container {
    padding: 0 24px;
  }

  .announcement-bar {
    line-height: 1.4;
    padding: 8px 15px;
  }

  /* --- Navigation & Header --- */
  header {
    height: var(--header-height);
    background: rgba(14, 60, 60, 0.98) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(197, 160, 89, 0.2);
  }

  header .container {
    gap: 12px;
  }

  header .btn-primary {
    -webkit-tap-highlight-color: transparent;

    display: none !important;
    /* Hide desktop CTA in header */
  }

  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(197, 160, 89, 0.1);
    border: 1px solid rgba(197, 160, 89, 0.3);
    color: var(--brand-gold);
    cursor: pointer;
    z-index: 2001;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-menu-btn:active {
    -webkit-tap-highlight-color: transparent;
    transform: scale(0.93);
  }

  .mobile-menu-btn.is-open {
    background: rgba(197, 160, 89, 0.18);
    border-color: rgba(197, 160, 89, 0.6);
  }

  /* â”€â”€ Hamburger bars â”€â”€ */
  .hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 20px;
    height: 16px;
  }

  .bar {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: var(--brand-gold, #c5a059);
    transition:
      transform 0.3s cubic-bezier(0.23, 1, 0.32, 1),
      opacity 0.2s ease,
      width 0.3s ease;
    transform-origin: center;
  }

  /* Animate to X when open */
  .mobile-menu-btn.is-open .bar-1 {
    transform: translateY(7px) rotate(45deg);
  }

  .mobile-menu-btn.is-open .bar-2 {
    opacity: 0;
    width: 0;
  }

  .mobile-menu-btn.is-open .bar-3 {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
     PREMIUM MOBILE NAV DRAWER  (v3.0)
     Full-height Â· Header zone Â· Section dividers Â· Icon rows
  â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
  nav {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    /* Viewport-safe width â€” won't overflow on narrow phones */
    width: min(340px, 85vw);
    height: 100dvh;
    background: linear-gradient(
      175deg,
      rgba(5, 18, 18, 0.99) 0%,
      rgba(10, 40, 40, 0.98) 50%,
      rgba(4, 14, 14, 1) 100%
    ) !important;
    backdrop-filter: blur(40px) saturate(1.6) !important;
    -webkit-backdrop-filter: blur(40px) saturate(1.6) !important;
    z-index: 2000 !important;
    display: flex !important;
    flex-direction: column;
    padding: 0;
    /* GPU-accelerated slide â€” avoids layout thrash on iOS */
    transform: translateX(100%) !important;
    transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow:
      -24px 0 80px rgba(0, 0, 0, 0.7),
      -1px 0 0 rgba(197, 160, 89, 0.2) !important;
    overflow: hidden !important;
    /* Prevent page scroll bleed when drawer reaches its scroll limits */
    overscroll-behavior: contain;
  }

  /* Gold shimmer at top */
  nav::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #c5a059 40%, #e8d08a 60%, transparent 100%);
    opacity: 0.8;
    z-index: 1;
  }

  /* Ambient glow orb */
  nav::after {
    content: "";
    position: absolute;
    top: -60px;
    right: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(197, 160, 89, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
  }

  header.nav-active nav {
    transform: translateX(0) !important;
  }

  /* â”€â”€ Injected drawer header (gl-nav-header) â€” JS adds this â”€â”€ */
  .gl-nav-header {
    flex-shrink: 0;
    padding: 14px 16px 12px;
    border-bottom: 1px solid rgba(197, 160, 89, 0.1);
    position: relative;
    z-index: 1;
  }

  .gl-nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }

  .gl-nav-brand-text {
    display: flex;
    flex-direction: column;
  }

  .gl-nav-brand-name {
    font-size: 1rem;
    font-weight: 700;
    color: #e2e8f0;
    letter-spacing: -0.01em;
    line-height: 1.2;
  }

  .gl-nav-brand-name span {
    color: #c5a059;
  }

  .gl-nav-tagline {
    font-size: 0.7rem;
    color: rgba(197, 160, 89, 0.65);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 2px;
  }

  .gl-nav-status {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.04em;
  }

  .gl-nav-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
    flex-shrink: 0;
    animation: gl-pulse 2.5s ease-in-out infinite;
  }

  @keyframes gl-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
  }

  /* â”€â”€ Scrollable nav list â”€â”€ */
  nav ul {
    flex-direction: column;
    gap: 1px;
    padding: 10px 12px 6px;
    margin: 0;
    overflow-y: auto !important;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: relative;
    z-index: 1;
  }

  nav ul::-webkit-scrollbar { display: none; }

  /* Section label (injected by JS above certain items) */
  .gl-nav-section-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(197, 160, 89, 0.5);
    padding: 14px 12px 6px;
    font-weight: 600;
  }

  .gl-nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 8px 12px;
  }

  nav ul li {
    width: 100%;
    border-bottom: none !important;
  }

  /* â”€â”€ Nav links â€” icon + label rows â”€â”€ */
  nav a {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(210, 220, 235, 0.85) !important;
    border-radius: 10px;
    margin-bottom: 1px;
    transition:
      background 0.2s ease,
      color 0.2s ease,
      transform 0.2s ease !important;
    background: transparent !important;
    border: 1px solid transparent;
    position: relative;
    letter-spacing: 0.005em;
    text-decoration: none;
  }

  /* Icon badge on each top-level link */
  .gl-nav-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(197, 160, 89, 0.7);
    font-size: 0.72rem;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease;
  }

  nav a:hover .gl-nav-icon,
  nav a:focus-visible .gl-nav-icon {
    background: rgba(197, 160, 89, 0.14);
    border-color: rgba(197, 160, 89, 0.3);
    color: #c5a059;
  }

  nav a:hover,
  nav a:focus-visible {
    background: rgba(197, 160, 89, 0.07) !important;
    border-color: rgba(197, 160, 89, 0.15) !important;
    color: #e2dfd6 !important;
    transform: translateX(4px) !important;
  }

  nav a:active {
    background: rgba(197, 160, 89, 0.13) !important;
    color: #c5a059 !important;
    transform: translateX(4px) scale(0.98) !important;
  }

  nav a.active {
    background: rgba(197, 160, 89, 0.11) !important;
    border-color: rgba(197, 160, 89, 0.25) !important;
    color: #c5a059 !important;
    font-weight: 600;
  }

  nav a.active .gl-nav-icon {
    background: rgba(197, 160, 89, 0.18);
    border-color: rgba(197, 160, 89, 0.4);
    color: #c5a059;
  }

  /* Active left-bar */
  nav a.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, #e8d08a, #c5a059);
  }

  /* â”€â”€ Chevron â”€â”€ */
  nav ul li > a > i.fa-chevron-down {
    margin-left: auto;
    font-size: 0.65rem;
    opacity: 0.4;
    transition: transform 0.25s ease, opacity 0.2s ease !important;
  }

  nav ul li.active > a > i.fa-chevron-down {
    transform: rotate(180deg) !important;
    opacity: 0.75;
  }

  /* â”€â”€ Dropdown accordion â”€â”€ */
  nav .dropdown-menu {
    position: static !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    max-height: 0;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.18) !important;
    border-radius: 10px;
    border: none;
    box-shadow: none !important;
    display: block !important;
    backdrop-filter: none !important;
    padding: 0;
    margin: 3px 0 4px 12px;
    width: auto;
    min-width: unset;
    grid-template-columns: 1fr;
    transition: max-height 0.38s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  nav ul li.active .dropdown-menu {
    max-height: 700px;
    padding: 6px;
  }

  nav .dropdown-menu li a {
    font-size: 0.85rem;
    padding: 9px 12px;
    border-radius: 9px;
    background: transparent !important;
    border: none;
    color: rgba(200, 210, 220, 0.7) !important;
    display: flex !important;
    align-items: center;
    gap: 10px;
    transform: none !important;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease !important;
  }

  nav .dropdown-menu li a:hover {
    background: rgba(197, 160, 89, 0.09) !important;
    color: #c5a059 !important;
    transform: translateX(3px) !important;
  }

  nav .dropdown-menu .dropdown-icon {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    flex: 0 0 24px;
    font-size: 0.7rem;
  }

  nav .dropdown-menu .dropdown-title {
    font-size: 0.85rem;
    font-weight: 500;
    display: block !important;
  }

  nav .dropdown-menu .dropdown-desc {
    font-size: 0.7rem;
    opacity: 0.55 !important;
    display: block !important;
    margin-top: 1px;
  }

  /* â”€â”€ Pinned CTA panel â”€â”€ */
  .gl-nav-footer {
    flex-shrink: 0;
    padding: 10px 12px 20px;
    border-top: 1px solid rgba(197, 160, 89, 0.1);
    position: relative;
    z-index: 1;
  }

  .gl-nav-cta-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 11px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #d5b56f 0%, #c39c4a 100%) !important;
    color: #0a1a1a !important;
    border: none;
    box-shadow:
      0 4px 14px rgba(197, 160, 89, 0.25),
      inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    transition: all 0.22s ease !important;
    text-decoration: none;
    cursor: pointer;
  }

  .gl-nav-cta-btn:hover { filter: brightness(1.06); }

  .gl-nav-cta-btn:active {
    transform: scale(0.97) !important;
    box-shadow: 0 3px 10px rgba(197, 160, 89, 0.2) !important;
  }

  /* Hide the old JS-cloned mobile CTA list item â€” replaced by .gl-nav-footer */
  .mobile-cta-item {
    display: none !important;
  }


  /* â”€â”€ Nav overlay (dark backdrop) â€” styled in .nav-overlay below â”€â”€ */

  /* --- Layout Reflows --- */
  .hero-with-image-overlay {
    padding: 100px 0 60px;
    text-align: center;
    min-height: auto;
  }

  .hero-stats {
    justify-content: center;
    gap: 20px;
  }

  .two-column-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: auto;
  }

  .tile-tall {
    grid-row: span 1;
    min-height: 250px;
  }

  .hero-bento-layout {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .hero-bento-visual {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 20px;
  }

  .hero h1 {
    font-size: var(--mobile-font-h1);
    margin-bottom: 20px;
  }

  .hero-text {
    font-size: 1.1rem;
    margin: 0 auto 30px;
    max-width: 100%;
  }

  .hero-cta-group {
    justify-content: center;
    gap: 15px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
    padding-bottom: 40px;
  }

  .footer-nav-column ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }

  .footer-links-list a {
    font-size: 1.1rem;
    padding: 10px;
    width: 100%;
    display: block;
    color: var(--brand-gold) !important;
    /* Make links stand out */
  }

  .footer-brand-section p {
    margin: 0 auto 25px;
    font-size: 1rem;
  }

  /* Prevent massive bottom space */
  footer {
    margin-bottom: 0;
    padding-bottom: 120px;
    /* Space for action bar */
  }

  .back-to-top {
    display: none !important;
  }

  .social-links-minimal {
    justify-content: center;
  }

  .footer-contact-info li {
    justify-content: center;
  }

  /* Hide floating Signal widget on mobile - redundant with action bar */
  .signal-widget {
    display: none !important;
  }

  /* Move a11y + lang toggles above the mobile action bar (72px height) */
  #gl-a11y-widget,
  #gl-lang-widget {
    bottom: 82px !important;
  }

  /* --- Grid & Structure --- */
  .stat-grid,
  .benefits-grid,
  .services-grid,
  .tech-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  /* --- Interactive Component Arrangement --- */
  .partner-grid {
    display: flex;
    flex-direction: column-reverse;
    /* Put visual/connector above text on tablet */
    gap: 40px;
  }

  .connector-flow {
    max-width: 600px;
    margin: 0 auto;
  }
}

/* --- BREAKPOINT: MOBILE (768px) --- */
@media (max-width: 768px) {
  /* â”€â”€ Global overflow containment â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
     Prevents any element from causing horizontal scrolling.
     Applies to all child elements without touching html/body overflow-x
     (already set at 1024px).
  â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
  *,
  *::before,
  *::after {
    max-width: 100%;
    box-sizing: border-box;
  }

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

  /* Grid and flex children must not exceed their track */
  [class*="grid"] > *,
  [class*="-grid"] > *,
  [class*="-layout"] > * {
    min-width: 0;
    max-width: 100%;
  }

  /* Two-column grids that weren't overridden collapse to 1 column */
  [class*="-layout"]:not([class*="two-column"]) {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: var(--mobile-font-h1);
    line-height: 1.1;
    letter-spacing: -0.03em;
  }

  h2 {
    font-size: var(--mobile-font-h2);
    line-height: 1.2;
  }

  p.lead {
    font-size: 1.15rem;
    line-height: 1.5;
  }

  section {
    padding: var(--section-padding-mobile);
  }

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

  .hero-actions .btn {
    -webkit-tap-highlight-color: transparent;
    width: 100%;
    justify-content: center;
  }

  /* Booking / Form Specifics */
  .booking-system-container iframe {
    height: 600px;
  }

  /* Improved Sticky Action Bar */
  .hero-stats {
    flex-direction: column;
    gap: 15px;
    margin: 30px auto 0;
    width: fit-content;
  }

  .stat-item {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(197, 160, 89, 0.2);
    border-radius: 12px;
    min-width: 200px;
  }

  .mobile-action-bar {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 72px;
    background: rgba(10, 31, 31, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(197, 160, 89, 0.2);
    z-index: 10000;
    align-items: center;
    justify-content: space-around;
    padding: 0 10px env(safe-area-inset-bottom, 10px) 10px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
    animation: slideUpAction 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    pointer-events: auto;
  }

  @keyframes slideUpAction {
    from {
      transform: translateY(100%);
      opacity: 0;
    }

    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    text-decoration: none;
    font-size: 0.7rem;
    gap: 4px;
    opacity: 0.8;
    /* WCAG 2.5.5 â€” minimum 44Ã—44px tap target */
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .action-item i {
    font-size: 1.4rem;
    color: var(--brand-gold);
    transition: transform 0.3s ease;
  }

  .action-item.active {
    opacity: 1;
    color: var(--brand-gold);
    font-weight: 700;
  }

  /* Gold primary action button in action bar â€” adopted from rebuild */
  .action-item.action-item-primary {
    color: var(--brand-gold);
    opacity: 1;
  }

  .action-item:active i {
    transform: translateY(-4px) scale(1.1);
  }

  /* --- Fast, Fair, Accessible Mobile Optimization --- */
  .grid-val-prop {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 0 5px;
  }

  .grid-val-prop .val-item {
    padding: 10px 5px;
  }

  .grid-val-prop .count {
    font-size: 1.2rem;
    margin-bottom: 5px;
  }

  .grid-val-prop h3 {
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    min-height: 2.4em;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .grid-val-prop p {
    font-size: 0.65rem;
    line-height: 1.2;
    opacity: 0.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* --- Generic horizontal scroller utility for grids --- */
  .tech-grid,
  .benefits-grid,
  .premium-grid,
  .protocol-grid,
  .architecture-grid,
  .roadmap-grid,
  .journey-grid,
  .stats-header-row,
  .services-grid,
  .services-grid-bento,
  .lab-blog-grid {
    display: flex !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory;
    gap: 16px;
    padding: 20px;
    margin: 0 -20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tech-grid::-webkit-scrollbar,
  .benefits-grid::-webkit-scrollbar,
  .premium-grid::-webkit-scrollbar,
  .protocol-grid::-webkit-scrollbar,
  .architecture-grid::-webkit-scrollbar,
  .roadmap-grid::-webkit-scrollbar,
  .journey-grid::-webkit-scrollbar,
  .stats-header-row::-webkit-scrollbar,
  .services-grid-bento::-webkit-scrollbar,
  .lab-blog-grid::-webkit-scrollbar {
    display: none;
  }

  /* --- Card sizing within scrollers --- */
  .tech-card,
  .benefit-card,
  .premium-card,
  .protocol-card,
  .arch-card,
  .roadmap-card,
  .journey-step,
  .stat-item-box,
  .protocol-node,
  .service-card,
  .lab-article-card {
    flex: 0 0 280px;
    min-width: 280px;
    scroll-snap-align: center;
    margin: 0;
  }

  .action-item:active i {
    transform: translateY(-4px) scale(1.1);
  }

  /* Specific handling for small stats boxes */
  .stats-header-row .stat-item-box {
    flex: 0 0 160px;
    min-width: 160px;
    padding: 15px;
  }

  /* Specific handling for journey steps */
  .journey-grid .journey-step {
    text-align: left;
  }

  /* Specific handling for services cards */
  .services-grid-bento .service-card {
    aspect-ratio: 1 / 1;
    height: 300px;
    padding: 20px;
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(197, 160, 89, 0.2);
  }

  .services-grid-bento .service-image-wrapper {
    height: 90px;
    width: 90px;
    margin: 0 auto 10px;
    border-radius: 12px;
    overflow: hidden;
  }

  .services-grid-bento .service-content h3 {
    font-size: 1.1rem;
  }

  .services-grid-bento .service-content p {
    font-size: 0.75rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Specific handling for blog cards */
  .lab-article-card {
    height: 300px;
    display: flex !important;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.4) !important;
    border-radius: 12px;
    overflow: hidden !important;
  }

  .lab-article-card .blog-image {
    height: 120px;
    overflow: hidden;
  }

  .lab-article-card .blog-image img {
    height: 100%;
    width: 100%;
    object-fit: cover;
  }

  .article-inner-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
  }

  .lab-article-card h3 {
    font-size: 0.95rem;
    color: var(--brand-gold) !important;
  }

  /* --- Related Articles Scroller --- */
  .post-content .content-section div:has(> .related-article-card) {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    gap: 16px;
    padding: 20px;
    margin: 0 -20px;
    scrollbar-width: none;
  }

  .related-article-card {
    flex: 0 0 260px;
    scroll-snap-align: center;
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(197, 160, 89, 0.1);
    padding: 20px;
    border-radius: 12px;
  }

  /* === Tappable Card Touch Improvements â€” adopted from rebuild ===
     Removes iOS tap flash on all tappable card elements.
     Adds active press feedback (subtle scale) for premium feel. */
  .service-card,
  .tile,
  .benefit-card,
  .tech-card,
  .glass-card,
  .partner-card,
  .feature-card {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .service-card:active,
  .tile:active,
  .benefit-card:active,
  .feature-card:active {
    transform: scale(0.98) !important;
    transition: transform 0.1s ease !important;
  }

  /* --- Topic Pills Scroller --- */
  .topic-pills {
    display: flex !important;
    overflow-x: auto !important;
    gap: 10px;
    padding: 5px 20px;
    margin: 0 -20px 30px;
    scrollbar-width: none;
  }

  .topic-pill {
    white-space: nowrap;
    flex: 0 0 auto;
  }

  /* --- Services Filter Pill Scroller --- */
  .filter-pill-group {
    justify-content: flex-start;
    overflow-x: auto !important;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 10px 20px;
    margin: 0 -20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .filter-pill-group::-webkit-scrollbar {
    display: none;
  }

  .filter-pill {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* Fix funding timeline comparison overflowing on mobile */
  .funding-timeline p {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 2px;
    white-space: normal;
    overflow: visible !important;
  }
}

/* --- BREAKPOINT: SMALL MOBILE (480px) --- */
@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }

  .container {
    padding: 0 16px;
  }

  /* Logo fills the header height â€” works on all pages */
  .logo {
    height: calc(var(--header-height, 70px) - 20px); /* 10px padding each side */
    max-width: clamp(120px, 55vw, 200px);
  }

  .logo img {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain !important;
  }
}

/* --- Navigation Overlay Fix --- */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 10, 10, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 1999;
  opacity: 0;
  display: none;
  transition: opacity 0.4s ease;
}

body.no-scroll {
  overflow: hidden !important;
}

/* === Reduced Motion Overrides (adopted from mobile rebuild) ===
   Respect user preference â€” disable all CSS animations & transitions.
   JS-driven animations are controlled separately via prefers-reduced-motion media. */
@media (prefers-reduced-motion: reduce) {
  .mobile-menu-btn,
  .bar,
  nav,
  .mobile-action-bar,
  .nav-overlay {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   COOKIE BANNER â€” MOBILE OVERRIDES (Acceptrics)
   Fixes crowded layout, hidden buttons, and action-bar overlap
   on viewports â‰¤ 768px.
   IDs sourced from live DOM audit 2026-03-17.
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

@media (max-width: 768px) {
  /* Lift banner above the action bar (z-index 10000) */
  #acceptricsCookieBanner {
    z-index: 10001;
    /* Clear the 72px action bar at the bottom */
    bottom: 72px !important;
    /* Constrain height â€” no more than 50% viewport */
    max-height: 52vh;
    overflow-y: auto !important;
    /* Tighter padding */
    padding: 14px 16px;
    /* Subtle backdrop blur to match site style */
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-top: 1px solid rgba(197, 160, 89, 0.25) !important;
    border-radius: 16px 16px 0 0;
  }

  /* Compact the text block */
  #acceptricsBannerText,
  #acceptricsCookieBanner p,
  #acceptricsCookieBanner span {
    font-size: 0.8rem;
    line-height: 1.45;
    margin-bottom: 10px;
  }

  /* Stack buttons vertically so none are cut off */
  #acceptricsCookieBanner .acceptrics-buttons,
  #acceptricsCookieBanner [class*="button"],
  #acceptricsCookieBanner [class*="btn"],
  #acceptricsCookieBanner .acceptrics-footer {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
  }

  /* Make each button full width and tappable (44px min-height) */
  #acceptricsCookieBanner button,
  #acceptricsCookieBanner a[role="button"] {
    width: 100%;
    min-height: 44px;
    font-size: 0.85rem;
    padding: 10px 16px;
    border-radius: 10px;
    text-align: center;
    box-sizing: border-box !important;
  }

  /* Prioritise "Accept all" visually */
  #acceptricsCookieBanner button:last-child,
  #acceptricsCookieBanner [id*="accept"],
  #acceptricsCookieBanner [class*="accept"] {
    order: -1;
  }
}

@media (max-width: 480px) {
  #acceptricsCookieBanner {
    /* Extra-small phones: even tighter */
    padding: 12px 14px;
    max-height: 55vh;
    bottom: 72px !important;
  }

  #acceptricsBannerText,
  #acceptricsCookieBanner p,
  #acceptricsCookieBanner span {
    font-size: 0.75rem;
    line-height: 1.4;
  }
}
/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   WIDGET CLUSTER â€” stacked below hamburger (mobile <= 768px)
   Accessibility Â· Language Â· Cookie circle â€” right-aligned column
   just below the 44px hamburger button.
   Stack: 120px -> 164px -> 208px (36px btn + 8px gap each step).
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
@media (max-width: 768px) {
  /* -- Accessibility widget ------------------------------------ */
  #gl-a11y-widget {
    position: fixed;
    top: 120px !important;
    right: 12px !important;
    bottom: auto !important;
    left: auto !important;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    z-index: 9000 !important;
  }

  #gl-a11y-toggle {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4) !important;
  }

  /* Panel opens LEFT so it stays on-screen */
  #gl-a11y-panel {
    right: 0 !important;
    left: auto !important;
    top: calc(100% + 6px) !important;
    bottom: auto !important;
  }

  /* -- Language widget ----------------------------------------- */
  #gl-lang-widget {
    position: fixed !important;
    top: 164px !important;
    right: 12px !important;
    bottom: auto !important;
    left: auto !important;
    flex-direction: column;
    align-items: flex-end;
    z-index: 8999 !important;
  }

  #gl-lang-toggle {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4) !important;
  }

  /* Panel opens LEFT */
  #gl-lang-panel {
    right: 0 !important;
    left: auto !important;
    top: calc(100% + 6px) !important;
    bottom: auto !important;
  }

  /* -- Cookie circle pill -------------------------------------- */
  #gl-cookie-pill {
    left: auto !important;
    right: 12px !important;
    transform: none !important;
    top: 208px !important;
    bottom: auto !important;
  }

  #gl-cookie-pill:focus-visible {
    outline: 2px solid #c5a059;
    outline-offset: 2px;
  }
}

/* ==========================================================================
   MOBILE HERO ENRICHMENT â€” adapted from mobile rebuild (Phase 2)
   Agent Card + 3-stat row replace the desktop bento grid on mobile.
   ========================================================================== */

/* Desktop: hide mobile enrichment block */
.mobile-hero-enrichment {
  display: none;
}

/* Desktop: show bento grid normally */
.hero-bento-visual {
  display: grid; /* keeps desktop layout intact */
}

@media (max-width: 768px) {
  /* Show the mobile enrichment block */
  .mobile-hero-enrichment {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    padding: 0 4px;
    margin-top: 8px;
  }

  /* Hide the complex desktop bento grid on mobile */
  .hero-bento-visual {
    display: none !important;
  }

  /* Hide the top announcement banner on mobile (user request: only keep bottom one) */
  #agent-goodlady-cta {
    display: none !important;
  }

  /* â”€â”€ Agent Card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
  .mobile-agent-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: linear-gradient(
      135deg,
      rgba(16, 185, 129, 0.10),
      rgba(14, 165, 233, 0.10)
    );
    border: 1px solid rgba(14, 165, 233, 0.22);
    border-radius: 16px;
    padding: 20px;
    text-align: left;
  }

  .mobile-agent-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #10b981, #0ea5e9);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    flex-shrink: 0;
  }

  .mobile-agent-content h3 {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff !important;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
  }

  .mobile-agent-content p {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.55) !important;
    font-style: italic;
    margin-bottom: 12px;
    max-width: unset;
  }

  .mobile-agent-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: linear-gradient(135deg, #10b981, #0ea5e9);
    color: #fff;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: opacity 0.2s;
  }

  .mobile-agent-btn:active {
    opacity: 0.85;
    transform: scale(0.98);
  }

  /* â”€â”€ 3-Stat Row â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
  .mobile-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .mobile-stat-card {
    background: rgba(14, 60, 60, 0.5);
    border: 1px solid rgba(197, 160, 89, 0.18);
    border-radius: 12px;
    padding: 14px 8px;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-stat-icon {
    color: var(--brand-gold);
    font-size: 1.15rem;
    margin-bottom: 6px;
  }

  .mobile-stat-label {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.2;
  }

  .mobile-stat-value {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--brand-gold);
    letter-spacing: -0.01em;
  }

  /* â”€â”€ Ensure hero section centred on mobile â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
  .bridging-hero .container,
  .bridging-container {
    text-align: center;
  }

  .hero-cta-group {
    justify-content: center;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
  }

  .hero-cta-group .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Very small screens: stack stat cards 1 column */
@media (max-width: 360px) {
  .mobile-stats-row {
    grid-template-columns: 1fr;
  }
}


