/* ============================================================
   Layouts — Page-specific grid responsive helpers
   ============================================================ */

/* Solutions grid (home + tecnologia capabilities) */
.solutions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Cases grid */
.cases-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* Testimonials */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Articles */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Team */
.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* Metrics row */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* Architecture */
.arch-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* Logo grid (footer + hero strip) */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 20px 24px;
  align-items: center;
}

/* Clients wall */
.clients-wall {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-left: 1px solid rgba(255,255,255,0.12);
}

/* Footer top */
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
}

/* Generic 2-col helper that flips on tablet */
.grid-2-flex {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* Page fade */
.page-fade {
  animation: pageFade 380ms cubic-bezier(.16,1,.3,1) both;
}
@keyframes pageFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Input focus */
input:focus, textarea:focus, select:focus {
  border-color: var(--orange) !important;
  background: #fff !important;
}

/* Hide on small screens helper */
.hide-sm { display: inline; }
@media (max-width: 760px) {
  .hide-sm { display: none; }

  /* Hero warm gradient — move to bottom-right + lower opacity on mobile */
  .hero-warm-field {
    background:
      radial-gradient(ellipse 90% 60% at 85% 100%, rgba(230, 90, 28, 0.62) 0%, rgba(230, 90, 28, 0.32) 20%, rgba(230, 90, 28, 0.10) 42%, transparent 65%),
      radial-gradient(ellipse 60% 40% at 80% 95%, rgba(255, 157, 0, 0.28) 0%, transparent 55%) !important;
  }
}

/* Logo strip — refined real-brand wordmark feel */
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: opacity 200ms ease, color 200ms ease;
}

/* ============================================================
   Tablet (max 1024px)
   ============================================================ */
@media (max-width: 1100px) {
  .solutions-grid,
  .articles-grid,
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .arch-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .clients-wall {
    grid-template-columns: repeat(4, 1fr);
  }
  .logo-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
  }
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
}

/* ============================================================
   Mobile (max 760px)
   ============================================================ */
@media (max-width: 760px) {
  /* Nav */
  .nav-desktop { display: none !important; }
  .nav-mobile-toggle { display: inline-flex !important; }
  .nav-cta { display: none !important; }

  /* All grids → 1 col */
  .solutions-grid,
  .articles-grid,
  .testimonials-grid,
  .team-grid,
  .arch-grid,
  .cases-grid,
  .grid-2-flex,
  .contact-grid,
  .form-grid,
  .values-grid,
  .dashboard-grid {
    grid-template-columns: 1fr !important;
  }

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

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

  .logo-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px;
  }

  .footer-top {
    grid-template-columns: 1fr !important;
    gap: 40px;
  }

  /* Layout adjustments */
  .timeline-step {
    grid-template-columns: 80px 1fr !important;
  }
  .timeline-step > div:nth-child(3) {
    grid-column: 2 / 3;
    text-align: left !important;
  }

  .solution-row {
    grid-template-columns: 56px 1fr !important;
    gap: 16px !important;
  }
  .solution-row > div:nth-child(3),
  .solution-row > div:nth-child(4) {
    grid-column: 1 / -1;
  }
  .solution-row > div:nth-child(4) {
    display: none !important;
  }

  .history-row {
    grid-template-columns: 100px 1fr !important;
    gap: 16px !important;
  }
  .history-row span {
    font-size: 32px !important;
  }

  .sector-row {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    padding: 16px 0 !important;
  }
  .sector-row > span:last-child {
    text-align: left !important;
  }

  /* Footer bottom: stack */
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start !important;
  }

  /* Section spacing */
  .section, .section-lg {
    padding: 64px 0 !important;
  }
}

@media (max-width: 480px) {
  .container { padding: 0 18px; }
  .section, .section-lg { padding: 56px 0 !important; }
  .metrics-grid {
    grid-template-columns: 1fr !important;
  }
  .clients-wall {
    grid-template-columns: 1fr !important;
  }
  .logo-grid {
    grid-template-columns: 1fr !important;
  }

  /* Hero titles — tighter at very narrow widths */
  .hero-title-mobile-tight {
    font-size: 44px !important;
    line-height: 1.0 !important;
    letter-spacing: -0.035em !important;
  }
}

/* ============================================================
   Phone-specific (max 760px) overrides for components
   ============================================================ */
@media (max-width: 760px) {
  /* Body type scale tightens */
  html, body { font-size: 16px; }

  /* Eyebrow without dash on tiny */
  .eyebrow {
    font-size: 10px;
    letter-spacing: 0.16em;
  }

  /* Buttons — full-width feel */
  .btn {
    min-height: 46px;
    padding: 0 22px;
    font-size: 14px;
  }

  /* Logo strip — wrap with nice gap */
  .logo-strip {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 22px 16px !important;
    justify-items: center !important;
    text-align: center;
  }
  .logo-strip > div {
    justify-content: center !important;
  }

  /* Phone mockup — scale down */
  .phone-mockup {
    transform: scale(0.78);
    transform-origin: center top;
    margin-bottom: -120px;
  }

  /* Dashboard preview — make it horizontally scrollable */
  .dashboard-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
    margin-left: -18px;
    margin-right: -18px;
    padding-left: 18px;
    padding-right: 18px;
  }
  .dashboard-wrap > .dashboard-inner {
    min-width: 720px;
  }

  /* Manifesto pillars — single column with tighter gaps */
  .manifesto-pillars {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  /* Values grid — single column */
  .values-grid {
    grid-template-columns: 1fr !important;
  }
  .value-item {
    border-right: none !important;
    padding: 28px 0 !important;
  }

  /* Featured article — stack image+text */
  .featured-article {
    grid-template-columns: 1fr !important;
    min-height: auto !important;
  }
  .featured-article > div:first-child {
    min-height: 240px !important;
  }
  .featured-article > div:last-child {
    padding: 32px 28px 32px !important;
  }

  /* Newsletter card */
  .newsletter-card {
    padding: 48px 28px !important;
  }

  /* Cases & solutions row hover removed; no transform */
  .solution-row > div:nth-child(2) h2 {
    font-size: 26px !important;
    line-height: 1.05 !important;
  }
  .history-row span {
    font-size: 28px !important;
  }

  /* Big titles at mobile — universal cap */
  h1 {
    font-size: clamp(40px, 11vw, 64px) !important;
    line-height: 1.0 !important;
    letter-spacing: -0.04em !important;
  }

  /* Big H2 caps */
  .heat-field h2,
  .dark-field h2 {
    font-size: clamp(34px, 9vw, 52px) !important;
    line-height: 1.02 !important;
  }

  /* Section paddings — reduce hero pad-top */
  section[style*="paddingTop: 120"],
  section[style*="paddingTop: 88"] {
    padding-top: 48px !important;
  }

  /* Dark final CTA & hot CTAs — center properly */
  .heat-field .container,
  .dark-field .container {
    text-align: left !important;
  }

  /* Card insets */
  .card {
    padding: 24px !important;
  }

  /* Form: full width */
  .contact-grid > form {
    padding: 28px !important;
  }

  /* Footer adjustments */
  .footer-bottom {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 24px !important;
  }
  .footer-bottom > div {
    gap: 12px !important;
  }
}

@media (max-width: 480px) {
  .container { padding: 0 20px; }
  .metrics-grid {
    grid-template-columns: 1fr !important;
  }
  .clients-wall {
    grid-template-columns: 1fr !important;
  }
}
