/* ============================================================
   RESPONSIVE · global breakpoints + mobile polish
   ============================================================ */

/* --- Base mobile --- */
@media (max-width: 1100px) {
  .wrap { padding-left: 24px; padding-right: 24px; }
}

@media (max-width: 880px) {
  .wrap { padding-left: 20px; padding-right: 20px; }

  /* Nav */
  .nav-row { gap: 12px; }
  .brand-logo { width: 38px; height: 38px; }
  .lang-switch { gap: 4px; }

  /* Display sizes scale down */
  .display.xl { font-size: clamp(36px, 9vw, 64px) !important; }
  .display.lg { font-size: clamp(32px, 8vw, 56px) !important; }
  .display { font-size: clamp(28px, 7vw, 48px); }

  /* Section padding */
  section { padding-top: 80px !important; padding-bottom: 80px !important; }
  .cta-section { padding: 80px 0 100px !important; }

  /* Kicker */
  .kicker { font-size: 12px; }

  /* CTA pro */
  .cta-head { margin-bottom: 48px; }
  .cta-card-pro { padding: 28px 24px 24px; gap: 20px; }
  .cta-card-pro-actions { flex-direction: column; }
  .cta-card-pro-actions .btn { width: 100%; justify-content: center; }
  .cta-pillar { padding: 24px 20px; min-height: 140px; }
  .cta-pillar-num { font-size: clamp(32px, 8vw, 44px); }

  /* ClautMet block */
  .clautmet-cta { flex-direction: column; align-items: stretch; }
  .clautmet-cta .btn { width: 100%; justify-content: center; }

  /* Footer */
  .footer-mega { font-size: clamp(40px, 14vw, 80px) !important; }
  .footer-bottom { flex-direction: column; gap: 8px; align-items: flex-start; }
}

@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }

  /* Nav */
  .nav-row { padding: 12px 0; }
  .brand-logo { width: 34px; height: 34px; }
  .nav .btn-sm { padding: 8px 12px; font-size: 12px; }

  /* Hero — already sm responsive but harden */
  .hero-grid { padding-bottom: 40px !important; }
  .hero-meta { font-size: 11px; }

  /* Stats */
  .stat { padding: 24px 20px; }
  .stat-num { font-size: clamp(40px, 12vw, 56px) !important; }

  /* Sectors grid: 2 cols stays, but adjust padding */
  .sectores-grid { grid-template-columns: 1fr !important; }
  .sector-card { padding: 20px; }

  /* Comités */
  .comite { padding: 24px 20px; }

  /* Eventos */
  .evento { grid-template-columns: 1fr !important; gap: 12px !important; padding: 20px !important; }
  .evento-date { display: flex; gap: 8px; align-items: baseline; }
  .evento-arrow { display: none; }

  /* Mapa */
  .states-stack { font-size: 14px; }

  /* Blog */
  .post { padding: 20px; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr !important; gap: 32px; }
  .footer-mega { font-size: clamp(32px, 14vw, 56px) !important; letter-spacing: -0.04em; }

  /* CTA pro */
  .cta-card-features { gap: 10px; padding: 18px 0; }
  .cta-card-pro-title { font-size: clamp(22px, 6vw, 30px); }
  .cta-pillars { grid-template-columns: 1fr 1fr; }

  /* ClautMet */
  .clautmet { padding: 28px 20px !important; }
  .clautmet h3 { font-size: clamp(24px, 7vw, 32px); }

  /* Sequence canvas */
  .seq-canvas { aspect-ratio: 4/5; }
}

@media (max-width: 420px) {
  /* Final tightening */
  .nav-row { gap: 8px; }
  .lang-switch { display: none; } /* hide on tiny screens to keep CTA visible */
  .brand-logo { width: 32px; height: 32px; }
  .cta-pillars { grid-template-columns: 1fr; }
  .stats-grid > * + * { border-top: 1px solid var(--line-1); }
}

/* Prevent horizontal overflow */
html, body { overflow-x: hidden; max-width: 100vw; }

/* Images and SVGs never overflow */
img, svg, video, canvas { max-width: 100%; height: auto; }
.brand-logo, .brand-logo-footer { height: auto; } /* preserve aspect via width */

/* ============================================================
   MOBILE POLISH — prevent text overflow + lock viewport
   ============================================================ */
@media (max-width: 880px) {
  /* Hero protections */
  .hero { min-height: auto; padding-top: 120px; padding-bottom: 60px; }
  .hero-grid { padding-bottom: 40px; }
  .hero-title { word-break: break-word; overflow-wrap: anywhere; max-width: 100%; }
  .hero-meta { font-size: 10px; gap: 6px 16px; margin-bottom: 20px; }
  .hero-side .lead { font-size: 15px; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; justify-content: center; }

  /* Nav mobile — esconder menú principal, dejar solo logo + actions */
  .nav-links { display: none !important; }
  .nav-actions { gap: 8px; }
  .nav-actions .btn { padding: 8px 14px !important; font-size: 12px !important; }
  .nav-actions .lang-btn { display: none; }

  /* Footer */
  .footer-lead { flex-direction: column; gap: 24px; align-items: flex-start; }
  .footer-lead__regions { font-size: 11px; }
  .footer-bottom { flex-wrap: wrap; gap: 12px; }
}

@media (max-width: 480px) {
  .hero { padding-top: 100px; }
  .hero-title { letter-spacing: -0.03em; }
  .hero-bottom-bar { display: none; } /* esconder en pantallas muy chicas */
  .scroll-hint { display: none !important; }

  /* Botones más compactos */
  .btn-lg { padding: 14px 22px !important; font-size: 13px !important; }
  .btn { padding: 10px 16px; font-size: 12px; }

  /* Tweaks button — más pequeño en móvil */
  #tweaks-btn { width: 36px !important; height: 36px !important; bottom: 16px !important; right: 16px !important; }
}

/* ============================================================
   FOOTER · LUMIA AI Solutions credit
   ============================================================ */
.footer-dev {
  color: var(--fg-3);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.footer-dev a {
  color: var(--claut-red);
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.footer-dev a:hover { opacity: 0.75; }

/* ============================================================
   LIQUID GLASS NAV — translucent Apple-style glass
   ============================================================ */
.nav {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.06) 100%) !important;
  backdrop-filter: blur(56px) saturate(220%) brightness(1.15) !important;
  -webkit-backdrop-filter: blur(56px) saturate(220%) brightness(1.15) !important;
  border-bottom: 1px solid rgba(255,255,255,0.14) !important;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.32) inset,
    0 -1px 0 rgba(0,0,0,0.04) inset,
    0 24px 60px -32px rgba(0,0,0,0.22);
  position: fixed !important;
  isolation: isolate;
}
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(140% 100% at 0% 0%, rgba(255,255,255,0.35), transparent 55%),
    radial-gradient(80% 100% at 100% 0%, rgba(199,37,43,0.05), transparent 60%);
}
.nav::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
}
.nav.scrolled {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.12) 100%) !important;
  backdrop-filter: blur(64px) saturate(220%) brightness(1.10) !important;
  -webkit-backdrop-filter: blur(64px) saturate(220%) brightness(1.10) !important;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.4) inset,
    0 16px 50px -20px rgba(0,0,0,0.18);
}

/* Nav text colors flipped to dark for light glass */
.nav .nav-links a,
.nav .lang-btn {
  color: rgba(7,8,10,0.72) !important;
}
.nav .nav-links a:hover,
.nav .lang-btn:hover,
.nav .lang-btn.active {
  color: #07080A !important;
}
.nav .lang-btn { border-color: rgba(0,0,0,0.10) !important; }
.nav .lang-btn:hover, .nav .lang-btn.active { border-color: rgba(0,0,0,0.25) !important; }
.nav .btn-ghost { color: #07080A !important; border-color: rgba(0,0,0,0.14) !important; }
.nav .btn-ghost:hover { background: rgba(0,0,0,0.05) !important; }

.brand-logo {
  width: 56px !important;
  height: 56px !important;
  filter: none;
}

@media (max-width: 880px) {
  .brand-logo { width: 48px !important; height: 48px !important; }
}
@media (max-width: 640px) {
  .brand-logo { width: 42px !important; height: 42px !important; }
}

/* ============================================================
   FOOTER inverted — keep dark theme, NOT light
   The footer should stay dark; only sections 05 ClautMet & 10 CTA invert.
   ============================================================ */
.footer.invert-on-scroll.is-inverted {
  background: var(--bg-0) !important;
  color: var(--fg-1) !important;
}
.footer.invert-on-scroll.is-inverted * {
  color: inherit;
}
.footer.invert-on-scroll.is-inverted .footer-mega {
  -webkit-text-stroke: 1px rgba(255,255,255,0.08) !important;
  color: transparent !important;
}
.footer.invert-on-scroll.is-inverted .footer-links a,
.footer.invert-on-scroll.is-inverted h5,
.footer.invert-on-scroll.is-inverted .muted,
.footer.invert-on-scroll.is-inverted .footer-bottom {
  color: var(--fg-2) !important;
}
.footer.invert-on-scroll.is-inverted h5 { color: var(--fg-1) !important; }
.footer.invert-on-scroll.is-inverted .footer-links a:hover { color: var(--claut-red) !important; }
