/* ============================================================
   3D TACT | Responsive Styles
   ============================================================ */

/* === LARGE DESKTOP (1280px+) === */
@media (min-width: 1280px) {
  :root {
    --px: 2rem;
  }
}

/* === TABLET (max 1024px) === */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
  .process-steps,
  .process-steps-7 {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem 0;
  }
  .process-connector,
  .process-connector-7 {
    display: none;
  }
  .split {
    gap: 2.5rem;
  }
  .about-split {
    gap: 3rem;
  }
  .contact-grid {
    gap: 2rem;
  }
  .values-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* === TABLET / MOBILE (max 900px) === */
@media (max-width: 900px) {
  .split,
  .about-split {
    grid-template-columns: 1fr;
  }
  .split-img,
  .about-img {
    aspect-ratio: 16/9;
  }
  .about-img img {
    aspect-ratio: unset;
    height: 380px;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .materials-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .industry-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  /* Show section text before the main image on mobile */
  .split .split-img {
    order: 1;
  }
  .split .split-content {
    order: 0;
  }
}

/* === MOBILE (max 768px) === */
@media (max-width: 768px) {
  :root {
    --px: 1.25rem;
    --nav-h: 64px;
  }

  .section {
    padding: 3.75rem 0;
  }

  /* Nav — compact animated dropdown */
  .nav-menu {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: rgba(10, 10, 11, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 0.5rem 0 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    z-index: 99;
    /* Hidden state */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition:
      opacity 0.22s ease,
      transform 0.22s ease,
      visibility 0s linear 0.22s;
  }
  .nav-menu.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition:
      opacity 0.22s ease,
      transform 0.22s ease;
  }
  .nav-menu li {
    width: 100%;
  }
  .nav-menu .nav-link {
    display: block;
    width: 100%;
    padding: 0.9375rem var(--px);
    font-size: 0.9375rem;
    color: var(--text-2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  .nav-menu .nav-link:hover {
    color: var(--text);
  }
  .nav-menu .nav-link.active {
    color: var(--yellow);
  }
  .nav-menu .nav-link.active::after {
    display: none;
  }
  .nav-cta {
    display: none;
  }
  .nav-toggle {
    display: flex;
  }
  .nav-cta-mobile {
    display: block !important;
    width: 100%;
    padding: 1rem var(--px) 0.25rem;
  }
  .nav-cta-mobile .btn {
    width: 100%;
    justify-content: center;
  }

  /* Mobile dropdown list styling */
  .nav-dropdown-menu {
    position: static !important;
    display: none;
    border-left: 2px solid var(--yellow);
    background: rgba(255, 255, 255, 0.03);
    padding: 0.5rem 0 0.5rem 1rem;
    margin: 0.5rem 0 0 0;
  }

  .nav-item-dropdown.open .nav-dropdown-menu {
    display: block;
  }

  .nav-dropdown-menu li {
    list-style: none;
  }

  .nav-dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--text-2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: color var(--t);
  }

  .nav-dropdown-menu a:hover {
    color: var(--yellow);
  }

  .nav-dropdown-menu li:last-child a {
    border-bottom: none;
  }

  /* Hero */
  .hero {
    min-height: 92vh;
  }
  .hero-content {
    padding: 3.5rem 0;
  }
  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Page hero */
  .page-hero {
    padding-top: calc(var(--nav-h) + 3rem);
    padding-bottom: 3rem;
  }

  /* Grids */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  .process-steps,
  .process-steps-7 {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .industry-grid {
    grid-template-columns: 1fr;
  }
  .values-grid {
    grid-template-columns: 1fr;
  }
  .materials-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }

  /* Section header */
  .section-header {
    margin-bottom: 2.5rem;
  }

  /* CTA */
  .cta-section {
    padding: 4rem 0;
  }

  /* ---- Mobile footer ---- */
  .footer {
    padding: 2rem 0 1.25rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 0;
    margin-bottom: 0;
  }

  /* Brand */
  .footer-brand {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .footer-brand p {
    max-width: 100%;
  }

  /* Accordion columns */
  .footer-accordion-col {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .footer-accordion-col h4 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 0;
    margin-bottom: 0;
    cursor: pointer;
    user-select: none;
  }
  .footer-chevron {
    display: block;
    flex-shrink: 0;
    transition: transform 0.22s ease;
    color: var(--text-muted);
  }
  .footer-accordion-col.open .footer-chevron {
    transform: rotate(180deg);
  }
  .footer-accordion-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .footer-accordion-col.open .footer-accordion-list {
    max-height: 220px;
    padding-bottom: 1rem;
  }

  /* Get in Touch column */
  .footer-col:not(.footer-accordion-col) {
    padding-top: 1.25rem;
  }
  .footer-col:not(.footer-accordion-col) h4 {
    margin-bottom: 0.875rem;
  }

  /* Contact items — icon grid */
  .footer-contact-items {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
  .footer-contact-item {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
  }
  .footer-contact-item.fc-full {
    grid-column: 1 / -1;
  }
  .fc-label {
    display: none;
  }
  .fc-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: var(--yellow-bg);
    border: 1px solid var(--yellow-border);
    border-radius: var(--radius);
    flex-shrink: 0;
    color: var(--yellow);
  }
  .footer-contact-item a,
  .footer-contact-item span:not(.fc-icon):not(.fc-label) {
    font-size: 0.8125rem;
  }

  /* WhatsApp pill */
  .footer-wa-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.5rem 1.125rem;
    background: #25d366;
    color: #fff;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: opacity 0.2s;
  }
  .footer-wa-btn:hover {
    opacity: 0.88;
  }

  /* Footer bottom */
  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 1.25rem;
    gap: 0.375rem;
  }
  .footer-legal {
    justify-content: center;
    gap: 0;
  }
  .footer-legal a + a::before {
    content: " · ";
    color: var(--text-faint);
    padding: 0 0.3rem;
  }

  /* Split */
  .split-img {
    aspect-ratio: 16/9;
  }

  /* About */
  .about-split {
    gap: 2.5rem;
  }
  .about-img img {
    height: 300px;
  }
}

/* === FIX: "How It Works" steps invisible on mobile ===
   .process-steps-7 uses display:contents on mobile so its children
   flatten into the parent grid. But an element with display:contents
   has no box, so IntersectionObserver never sees it intersect and
   the JS never adds .visible — steps stayed opacity:0 forever.
   Force them visible here instead of relying on the scroll observer. */
@media (max-width: 768px) {
  .process-steps-7.stagger-children > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* === FOUNDER CARD RESPONSIVE === */
@media (max-width: 768px) {
  .founder-card {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .credentials-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .credentials-grid {
    grid-template-columns: 1fr;
  }
}

/* === FLOATING WHATSAPP — MOBILE === */
@media (max-width: 768px) {
  .wa-float {
    width: 50px;
    height: 50px;
    bottom: 16px;
    right: 16px;
  }
}

/* === NAV WORDMARK RESPONSIVE === */
@media (max-width: 600px) {
  .nav-wordmark {
    font-size: 1.1rem;
  }
}

/* === SMALL MOBILE (max 480px) === */
@media (max-width: 480px) {
  :root {
    --px: 1rem;
  }

  .hero-eyebrow {
    display: none;
  }
  .btn-lg {
    padding: 0.9375rem 1.75rem;
  }

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

  .footer-legal {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* === HERO GALLERY RESPONSIVE === */
@media (max-width: 1024px) {
  .hero-gallery {
    height: 280px;
  }
}
@media (max-width: 768px) {
  /* Hero — mobile background image */
  .hero-bg {
    background-image: url("../assets/homepage_background_mobile.png") !important;
    background-position: center center;
  }

  /* Stats bar — 2×2 grid */
  .hero-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .hero-stat + .hero-stat::before {
    display: none;
  }
  .hero-stat {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
  }
  .hero-stat:nth-child(2n) {
    border-right: none;
  }
  .hero-stat:nth-child(3),
  .hero-stat:nth-child(4) {
    border-bottom: none;
  }
  .hero-stat-num {
    font-size: 1.5rem;
  }
  .hero-gallery {
    grid-template-columns: 1fr 1fr;
    height: 200px;
    gap: 0.625rem;
    margin-top: 2rem;
  }
  .hero-gallery-item:last-child {
    display: none;
  }
  .display-title {
    line-height: 0.9;
  }
}
@media (max-width: 480px) {
  .hero-gallery {
    grid-template-columns: 1fr;
    height: 220px;
  }
  .display-title {
    font-size: clamp(2.75rem, 14vw, 4rem) !important;
    line-height: 0.92;
  }
}
