/* =========================================================
   GeoX Spatial Solution: Responsive Rules
   Every size snaps to the type scale and spacing tokens.
   ========================================================= */

/* ---------- Laptop ---------- */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .project-meta-panel { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 2.375rem; line-height: 1.1; }
}

/* ---------- Nav collapses to the floating glass menu ---------- */
@media (max-width: 960px) {
  .site-header { justify-content: stretch; }
  .nav-shell { width: 100%; justify-content: space-between; padding: 0.3125rem 0.375rem 0.3125rem 0.875rem; }
  .main-nav, .nav-shell > .nav-cta { display: none; }
  .nav-toggle { display: block; }
}

/* ---------- Tablet ---------- */
@media (max-width: 992px) {
  .section-pad, .tagline, .final-cta { padding: var(--s-700) 0; }

  .hero { min-height: 76vh; min-height: 76svh; padding: calc(var(--nav-offset) + var(--s-400)) 0 var(--s-700); }
  .hero-overlay { background: linear-gradient(0deg, rgba(4, 32, 40, 0.6) 0%, rgba(4, 32, 40, 0.45) 18%, rgba(4, 32, 40, 0) 35%), linear-gradient(90deg, rgba(4, 32, 40, 0.9) 0%, rgba(4, 32, 40, 0.8) 60%, rgba(4, 32, 40, 0.45) 85%, rgba(4, 32, 40, 0.3) 100%); }
  .discover-grid { grid-template-columns: 1fr; gap: var(--s-500); }   /* copy first, map second */
  .map-print { justify-self: center; max-width: 28rem; }

  .tools-inner { flex-direction: column; align-items: flex-start; gap: var(--s-200); }

  .problem-grid, .faq-layout, .split { grid-template-columns: 1fr; gap: var(--s-500); }
  .faq-layout .section-head { position: static; }
  
  .bento .span-4, .bento .span-2 { grid-column: span 3; }
  .bento .span-6 { grid-column: 1 / -1; }
  .steps { grid-template-columns: 1fr; }

  .tagline-text { font-size: 1.75rem; line-height: 1.2; }
  .final-cta h2 { font-size: 1.75rem; line-height: 1.2; }

  .status-card { flex-direction: column; align-items: flex-start; }

  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }

  .article-layout { grid-template-columns: 1fr; gap: var(--s-400); }
  .toc { position: static; padding-bottom: var(--s-300); border-bottom: 1px solid var(--border-soft); }

  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .outputs-grid { grid-template-columns: repeat(2, 1fr); }

  body.has-mobile-enroll-bar { padding-bottom: 5.5rem; }
  .mobile-enroll-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 420;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.875rem;
    padding: 0.65rem var(--gutter);
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    backdrop-filter: blur(18px) saturate(180%);
    border-top: 1px solid var(--border-strong);
    box-shadow: 0 -8px 24px rgba(15, 30, 44, 0.1);
  }
  .mobile-enroll-info strong {
    display: block;
    font-size: 1.0625rem;
    line-height: 1.15;
    color: var(--text-primary);
  }
  .mobile-enroll-info del {
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 0.3rem;
  }
  .mobile-enroll-info span {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--amber);
  }
  body.has-mobile-enroll-bar .whatsapp-float { bottom: 5.125rem; }
  body.has-mobile-enroll-bar .back-to-top { bottom: 8.375rem; }
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  :root { --gutter: var(--s-200); --nav-offset: 4.5rem; }
  .site-header { top: var(--s-100); padding: 0 var(--s-100); }
  .mobile-menu { top: 4rem; left: var(--s-100); right: var(--s-100); padding: var(--s-200); }

  .section-pad, .tagline, .final-cta { padding: var(--s-600) 0; }
  .section-head { margin-bottom: var(--s-300); }
  .section-head p, .hero .lede, .page-hero .lede, .problem-grid > div > p, .final-cta p { font-size: 0.9375rem; line-height: 1.55; }

  h1, .page-hero h1 { font-size: 1.75rem; line-height: 1.15; }
  h2 { font-size: 1.4375rem; line-height: 1.22; }
  .hero h1 { font-size: 1.875rem; line-height: 1.12; letter-spacing: -0.025em; }
  .hero { min-height: 34rem; padding: calc(var(--nav-offset) + var(--s-400)) 0 var(--s-600); justify-content: flex-start; }   /* room below the buttons for the delta to show */
  .hero-content { margin-bottom: var(--s-400); }
  .hero-bg img { object-position: 50% 100%; }   /* keep the delta (lower part of the phone crop) in view */
  /* phones get an even overlay: the text covers most of the portrait crop */
  /* phones: dark behind the text at the top, the delta shows below the buttons */
  .hero-overlay { background: linear-gradient(0deg, rgba(4, 32, 40, 0.8) 0%, rgba(4, 32, 40, 0.7) 16%, rgba(4, 32, 40, 0) 32%), linear-gradient(180deg, rgba(4, 32, 40, 0.82) 0%, rgba(4, 32, 40, 0.72) 60%, rgba(4, 32, 40, 0.3) 80%, rgba(4, 32, 40, 0.1) 100%); }
  .discover { padding: var(--s-500) 0 var(--s-600); }
  .discover-copy > p { font-size: 0.9375rem; line-height: 1.55; }
  .map-print { padding: var(--s-200) 0; }
  .hero .lede { margin-bottom: var(--s-300); }
  .hero-actions { gap: var(--s-100); }
  .hero-actions .btn { width: 100%; }
  .hero-actions .btn-hero-ghost { width: auto; flex: 1 1 0; }   /* About Us and Contact share one row under the main button */
  .hero-wa { width: 100%; margin-top: var(--s-100); }
  .tools-list { gap: var(--s-75); }
  .tools-inner > p { font-size: 1rem; }
  .tools-list li { padding: 0.4375rem 0.875rem 0.4375rem 0.5625rem; font-size: 0.8125rem; }
  .tools-list .tool-logo { height: 1.375rem; }
  .tools-list .ph { font-size: 1.25rem; }
  .code-panel { font-size: 0.75rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }   /* no sideways scrolling on phones */

  .tagline-text, .final-cta h2 { font-size: 1.5rem; line-height: 1.22; }
  .final-cta .cta-panel { padding: var(--s-600) var(--s-300); }
  .final-cta .cta-actions .btn { width: 100%; }

  .grid-2, .grid-3, .grid-4, .prize-grid, .content-types-grid, .upcoming-grid, .outputs-grid, .req-grid, .verify-meta-grid, .verify-steps { grid-template-columns: 1fr; }
  .instructor-header { flex-direction: column; align-items: flex-start; }
  .cert-preview { padding: 1.35rem 1.25rem; }
  .cert-preview-name { font-size: 1.35rem; }
  .upcoming-card.span-full { grid-column: auto; }
  .bento { grid-template-columns: 1fr; }
  .bento .span-4, .bento .span-2, .bento .span-6 { grid-column: auto; }
  .card { padding: var(--s-300); }

  .compare { grid-template-columns: 1fr; }
  .compare-col + .compare-col { border-left: 0; border-top: 1px solid var(--border-soft); }

  .topic-grid { grid-template-columns: 1fr; }
  .topic:nth-child(odd) { border-right: 0; }
  .topic:nth-last-child(2) { border-bottom: 1px solid var(--border-soft); }
  .topic { padding: var(--s-200); }

  .faq-item summary { font-size: 1rem; line-height: 1.5; padding: var(--s-200) 0; }
  .faq-answer { padding-right: 0; }

  /* phones: Learn, GEOX and Connect side by side, tops aligned, instead of Connect dropping below */
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-400) var(--s-200); }
  .footer-col a { overflow-wrap: anywhere; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }

  .subsection-title { flex-direction: column; align-items: flex-start; }
  .project-meta-panel { grid-template-columns: 1fr 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .filter-bar { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: var(--s-75); margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1); padding-left: var(--gutter); padding-right: var(--gutter); }
  .filter-btn { flex-shrink: 0; }
  .data-meta { grid-template-columns: 1fr; }
  #geox-data-map { height: 18.75rem; }

  .whatsapp-float { right: var(--s-200); bottom: var(--s-200); padding: 0.5625rem 0.875rem; font-size: 0.75rem; }
  .back-to-top { right: var(--s-200); bottom: calc(var(--s-200) + 3rem); }
  body.has-mobile-enroll-bar .whatsapp-float { bottom: 5rem; }
  body.has-mobile-enroll-bar .back-to-top { bottom: 8.125rem; }
}

/* ---------- Small phones ---------- */
@media (max-width: 420px) {
  .hero h1 { font-size: 1.625rem; line-height: 1.18; }
}
@media (max-width: 400px) {
  .project-meta-panel { grid-template-columns: 1fr; }
  .media-card .meta-row { flex-direction: column; align-items: flex-start; }
}

/* ---------- Touch: tap targets and no sticky hover ---------- */
@media (hover: none), (pointer: coarse) {
  .btn, .filter-btn, .main-nav a { min-height: 2.75rem; }
  /* small text links get a 2.75rem touch target (UI/UX Pro Max: touch target size) */
  .footer-col a, .breadcrumb a, .text-link, .footer-bottom a { display: inline-flex; align-items: center; min-height: 2.75rem; }
  .footer-col ul { gap: 0; }
  .social-row a { width: 2.75rem; height: 2.75rem; }
  a.card:hover, .media-card:hover { transform: none; border-color: var(--border-soft); }
  .media-card:hover .media img { transform: none; }
  .map-touch-hint { display: flex; }
  .map-frame.is-active .map-touch-hint { display: none; }
}

/* ---------- Hero credit: in the flow on narrow or short screens ----------
   Absolutely positioned, the credit collided with the CTA when the window was
   short (for example 150% to 200% browser zoom). */
@media (max-width: 992px), (max-height: 720px) {
  .hero-credit-row {
    position: static;
    justify-content: flex-end;                             /* still the bottom right corner, but in the flow so it never meets the buttons */
    margin-top: auto;
    padding: 0 var(--gutter);
  }
  .hero-credit { max-width: 20rem; }
}
