/* ==========================================================================
   iTecweb — Responsive overrides
   Large desktop ≥1440 · Desktop 1024–1439 · Tablet 768–1023 · Mobile 375–767 · Small <375
   ========================================================================== */

/* ---------- Large desktop (≥1440) ---------- */
@media (min-width: 1440px) {
  :root { --fs-h1: 52px; }
}

/* ---------- Desktop (1024–1439) ---------- */
@media (max-width: 1439px) {
  :root { --gutter: 32px; --fs-h1: 44px; }
  .nav-link { padding: 0 11px; font-size: 14px; }
  .nav-link::after { left: 11px; right: 11px; }
  .services .container { grid-template-columns: 1fr; gap: 30px; }
  .services-intro { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px 40px; }
  .services-intro .section-desc { max-width: 560px; margin-bottom: 0; }
  .services-intro > .eyebrow, .services-intro > .h2 { grid-column: 1; }
  .services-intro .btn { grid-column: 2; grid-row: 1 / span 3; align-self: end; }
  .projects .container { grid-template-columns: 1fr; gap: 26px; }
  .projects-intro { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 6px 40px; }
  .projects-intro .section-desc { max-width: 560px; margin-bottom: 0; }
  .projects-intro .btn { grid-column: 2; grid-row: 1 / span 3; }
  .why-strip { grid-template-columns: repeat(5, 1fr); row-gap: 22px; }
  .why-strip .why-title { grid-column: 1 / -1; text-align: center; }
  .why-strip .why-title .eyebrow { justify-content: center; }
  .why-item:nth-child(2)::before { display: none; }
  .testimonial .container { grid-template-columns: 1.7fr 1px 1fr; gap: 40px; }
  .quote-block { grid-column: 1; }
  .v-sep { grid-column: 2; }
  .testimonial .trust { grid-column: 3; }
  .footer-grid { grid-template-columns: 1.7fr 1fr 1.2fr 1.4fr 1.5fr; gap: 24px; }
}

@media (max-width: 1180px) {
  .topbar-right { gap: 22px; }
  .header-cta { padding: 0 18px; }
  .logo { width: 160px; }
  .hero .container { grid-template-columns: 1fr 1fr; }
  .cms-control .container { gap: 40px; }
  .stat { gap: 12px; }
  .stat .icon { width: 34px; height: 34px; }
}

/* ---------- Tablet & mobile nav (≤1023) ---------- */
@media (max-width: 1023px) {
  :root { --gutter: 28px; --sec-y: 60px; --header-h: 72px; --fs-h1: 44px; --fs-h2: 28px; }
  .topbar-left { display: none; }
  .topbar .container { justify-content: center; }
  .site-header .container { gap: 16px; }
  /* backdrop-filter would make the header the containing block of the fixed menu */
  .site-header { backdrop-filter: none; background: #fff; }
  .nav-toggle { display: grid; }
  .header-cta { display: none; }
  .main-nav {
    position: fixed; top: var(--nav-top, 72px); left: 0; right: 0; bottom: 0; z-index: 99;
    display: block; background: #fff; overflow-y: auto; padding: 16px var(--gutter) 40px;
    opacity: 0; transform: translateY(-10px); transition: opacity .25s ease, transform .25s ease, visibility .25s; visibility: hidden;
    border-top: 1px solid var(--border);
  }
  .nav-open .main-nav { opacity: 1; transform: none; visibility: visible; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-item { border-bottom: 1px solid var(--border); }
  .nav-link { width: 100%; justify-content: space-between; height: 56px; padding: 0 4px; font-size: 16px; }
  .nav-link::after { display: none; }
  .nav-item.is-active > .nav-link { color: var(--orange); }
  .dropdown {
    position: static; min-width: 0; box-shadow: none; border: 0; padding: 0 0 10px 6px;
    opacity: 1; visibility: visible; transform: none; display: none; background: transparent;
  }
  .nav-item:hover > .dropdown { display: none; }
  .nav-item.is-open > .dropdown { display: block; }
  .mobile-cta { display: flex; width: 100%; margin-top: 24px; }
  body.nav-open { overflow: hidden; }

  .hero .container { grid-template-columns: 1fr; min-height: 0; padding-top: 40px; gap: 10px; }
  .hero-copy { text-align: center; padding-bottom: 0; }
  .hero .lead { margin-inline: auto; }
  .hero-actions, .checks-inline { justify-content: center; }
  .hero-visual { min-height: 0; aspect-ratio: 16 / 11; max-width: 720px; width: 100%; margin: 0 auto; }
  .hero-visual .laptop { top: 6%; }

  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 26px; }
  .stat:nth-child(3)::before { display: none; }
  .stat { justify-content: flex-start; padding-left: 30px; }

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

  .cms-control .container { grid-template-columns: 1fr; gap: 20px; }
  .cms-visual { max-width: 640px; width: 100%; margin: 0 auto; }

  .why-strip { grid-template-columns: repeat(3, 1fr); }
  .why-item:nth-child(5)::before { display: none; }

  .steps { grid-template-columns: 1fr; gap: 0; max-width: 560px; margin-inline: auto; }
  .step { display: grid; grid-template-columns: 110px 1fr; text-align: left; align-items: start; gap: 16px; padding-bottom: 26px; }
  .step-top { justify-content: flex-start; margin: 0; height: auto; }
  .step p { margin: 0; max-width: none; }
  .step h3 { margin-top: 14px; }
  .step:not(:last-child)::after {
    top: 34px; left: 15px; width: 0; height: calc(100% - 20px); border-top: 0; border-left: 2px dotted #c9cfd9;
  }

  .cards-3 { grid-template-columns: repeat(3, 1fr); gap: 14px; }

  .testimonial .container { grid-template-columns: 1fr; gap: 26px; }
  .quote-block, .v-sep, .testimonial .trust { grid-column: 1; grid-row: auto; }
  .v-sep { width: 100%; height: 1px; }
  .trust { justify-content: center; }

  .cta-banner { flex-direction: column; align-items: flex-start; padding: 34px; }

  .footer-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
  .newsletter { grid-column: span 3; max-width: 420px; }

  .split, .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .split.reverse > :first-child { order: 0; }
  .feature-grid, .cms-steps, .manage-grid, .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
  .service-detail { grid-template-columns: 72px 1fr; }
  .service-detail > :last-child { grid-column: 2; }
  .page-hero h1 { font-size: 40px; }
  .page-hero .mountains { width: 70%; }
}

/* ---------- Mobile (≤767) ---------- */
@media (max-width: 767px) {
  :root { --gutter: 20px; --sec-y: 48px; --header-h: 66px; --fs-h1: 34px; --fs-h2: 25px; }
  .topbar { display: none; }
  .logo { width: 140px; }
  .hero .container { padding-top: 30px; }
  .hero h1 { margin-top: 18px; }
  .hero .lead { font-size: 15.5px; }
  .hero-actions { flex-direction: column; gap: 12px; }
  .hero-actions .btn { width: 100%; }
  .checks-inline { flex-direction: column; align-items: center; gap: 8px; }
  .hero-visual { aspect-ratio: 1 / .72; margin-top: 10px; }
  .hero-visual .laptop { left: 0; width: 100%; top: 16%; }
  .hero-visual .mountains { width: 110%; right: -20%; top: -4%; }
  .hero-visual .orange-swoosh { width: 34%; top: 14%; }
  .hero-visual .pencils, .hero-visual .plant { display: none; }
  .hero-visual .flag-pole { width: 20px; top: 2%; }
  .float-chip.code { width: 46px; height: 40px; top: 4%; }
  .float-chip.code .icon { width: 22px; height: 22px; }
  .float-chip.layers { width: 48px; height: 48px; bottom: 10%; }
  .float-chip.layers .icon { width: 24px; height: 24px; }

  .stats { grid-template-columns: 1fr 1fr; padding: 22px 12px; }
  .stat { flex-direction: column; text-align: center; padding: 0 6px; gap: 8px; justify-content: flex-start; }
  .stat strong { font-size: 22px; }
  .stat span { font-size: 12.5px; }

  .services-intro, .projects-intro { display: block; }
  .services-intro .section-desc, .projects-intro .section-desc { margin-bottom: 20px; }
  .cards-4 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .service-card { padding: 22px 16px; }
  .service-card .icon { width: 36px; height: 36px; margin-bottom: 16px; }
  .service-card h3 { font-size: 16px; }
  .service-card p { font-size: 13.5px; }

  .cms-visual { padding: 26px 0; }
  .cms-window { margin-left: 2%; width: 92%; transform: none; }
  .cms-body { min-height: 0; }
  .cms-side { padding: 14px 10px; }
  .cms-side .brand { font-size: 12px; margin-bottom: 10px; }
  .cms-side li { font-size: 10px; gap: 6px; padding: 3px 0; }
  .cms-main { padding: 14px 10px; }
  .cms-action { padding: 10px 4px 8px; font-size: 9px; }
  .cms-action .ico { width: 26px; height: 26px; margin-bottom: 6px; }
  .cms-action .ico .icon { width: 15px; height: 15px; }
  .cms-badge { right: 0; padding: 8px 10px; }
  .cms-badge span { font-size: 11px; }
  .cms-cursor { width: 18px; bottom: 50px; }
  .cms-copy .h2 { font-size: 25px; }

  .why-strip { grid-template-columns: 1fr 1fr; padding: 24px 16px; }
  .why-item::before { display: none; }
  .why-item:last-child { grid-column: 1 / -1; }
  .why-strip .h2 { font-size: 22px; }

  .step { grid-template-columns: 96px 1fr; }
  .step-ico { width: 48px; height: 48px; }
  .step-ico .icon { width: 28px; height: 28px; }

  .cards-3 { grid-template-columns: 1fr; gap: 16px; }

  .testimonial .bg-mtn { width: 70%; opacity: .5; }
  .testimonial .bg-mtn.right { display: none; }
  .quote-block { grid-template-columns: 36px 1fr; }
  .quote-mark { font-size: 48px; }
  .trust p { font-size: 15.5px; }

  .cta-banner { padding: 28px 22px; border-radius: 18px; }
  .cta-banner h2 { font-size: 23px; }
  .cta-actions { width: 100%; flex-direction: column; gap: 12px; }
  .cta-actions .btn { width: 100%; min-width: 0; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px 20px; }
  .footer-brand, .newsletter, .footer-col.contact { grid-column: 1 / -1; }
  .newsletter { max-width: none; }
  .footer-bottom .container { flex-direction: column; text-align: center; }

  .feature-grid, .cms-steps, .manage-grid, .portfolio-grid, .form-grid { grid-template-columns: 1fr; }
  .service-detail { grid-template-columns: 1fr; gap: 16px; padding: 30px 0; }
  .service-detail > :last-child { grid-column: auto; }
  .page-hero { padding-block: 44px 50px; }
  .page-hero h1 { font-size: 32px; }
  .panel, .form-card, .contact-card { padding: 26px 20px; }
  .to-top { right: 14px; bottom: 14px; }
}

/* ---------- Small mobile (<375) ---------- */
@media (max-width: 374px) {
  :root { --gutter: 16px; --fs-h1: 30px; }
  .cards-4 { grid-template-columns: 1fr; }
  .why-strip { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .stat + .stat::before { display: none; }
  .btn { padding: 0 18px; }
  .legal-links a { padding: 0 8px; }
}

/* ---------- Fidelity-pass adjustments for smaller screens ---------- */
@media (max-width: 1023px) {
  .hero-visual .laptop { transform: perspective(1600px) rotateY(12deg) rotateX(4deg); top: 14%; left: -2%; width: 104%; }
  .hero-visual .mountains { top: -2%; right: -14%; width: 104%; }
  .hero-visual .orange-swoosh { top: 18%; }
  .hero-visual .flag-pole { right: 1%; top: 4%; }
  .cms-window { transform: perspective(1400px) rotateY(8deg) rotateX(4deg); }
  .testimonial { padding-bottom: 60px; }
  .testimonial .bg-mtn { width: 46%; }
}
@media (max-width: 767px) {
  .hero-visual .laptop { transform: none; top: 16%; }
  .cms-window { transform: none; box-shadow: 0 20px 40px rgba(16,27,50,.15), 0 0 0 6px rgba(255,255,255,.85); }
  .testimonial .bg-mtn { width: 80%; opacity: .5; }
  .cta { margin-top: -40px; }
}
