/* ==========================================================================
   Responsive hardening: phones, tablets, laptops and wide desktop screens
   ========================================================================== */
html { width: 100%; max-width: 100%; overflow-x: clip; }
body { width: 100%; max-width: 100%; overflow-x: clip; }
.container {
  width: min(calc(100% - 48px), var(--container-max, 1600px));
  max-width: var(--container-max, 1600px);
  margin-inline: auto;
}
img, video, iframe, canvas, svg { max-width: 100%; }
video, iframe { display: block; }
input, select, textarea, button { max-width: 100%; }
pre, code { white-space: pre-wrap; overflow-wrap: anywhere; }
p, li, a, h1, h2, h3, h4 { overflow-wrap: break-word; }
.grid, [class*="-grid"] { min-width: 0; }
[class*="-grid"] > * { min-width: 0; }
.nav-container { min-width: 0; }
.nav-menu { min-width: 0; }
.hero-content, .hero-visual, .hero-image-wrap { min-width: 0; }
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--cyan-primary);
  outline-offset: 3px;
}
@media (min-width: 1601px) {
  .container { width: min(calc(100% - 96px), 1600px); }
}
@media (max-width: 1100px) {
  .container { width: calc(100% - 48px); }
  .hero-split-grid, .einvoice-banner-grid, .calc-container,
  .story-grid, .contact-main-grid, .service-detail-grid,
  .service-detail-grid.reverse {
    grid-template-columns: minmax(0, 1fr);
  }
  .service-detail-grid.reverse .service-detail-info,
  .service-detail-grid.reverse .service-detail-card-box { order: initial; }
  .values-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pricing-grid, .engagement-models-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-visual, .hero-image-wrap, .hero-visual-card { width: 100%; min-width: 0; }
  .pricing-card.featured { transform: none; }
}
@media (max-width: 768px) {
  :root { --header-height: 68px; --topbar-height: 34px; }
  html { font-size: 15px; }
  .container { width: calc(100% - 36px); }
  .top-bar-inner { min-height: var(--topbar-height); gap: 8px; }
  .top-bar-left { flex-wrap: wrap; justify-content: center; gap: 6px 12px; }
  .top-bar-right { display: none !important; }
  .main-header { width: 100%; }
  .nav-container { min-height: var(--header-height); gap: 12px; }
  .brand-logo img { max-width: 150px; height: auto !important; max-height: 46px; }
  .nav-menu {
    position: fixed;
    top: calc(var(--header-height) + var(--topbar-height));
    left: 0;
    right: 0;
    width: 100%;
    max-height: calc(100dvh - var(--header-height) - var(--topbar-height));
    overflow-y: auto;
    padding: 20px 24px 26px;
    gap: 8px;
    align-items: stretch;
    background: rgba(4, 8, 20, .98);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 18px 35px rgba(0,0,0,.35);
    transform: translateY(-150%);
    visibility: hidden;
    pointer-events: none;
    z-index: 999;
  }
  .nav-menu.open {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }
  .nav-menu .nav-link { display: block; width: 100%; padding: 12px 8px; }
  .mobile-nav-toggle { display: flex; flex: 0 0 auto; }
  .nav-actions .btn { display: none; }
  .hero-section { padding-top: 42px; padding-bottom: 48px; }
  .hero-split-grid { gap: 26px; }
  .hero-title, .hero-heading, .hero-headline, .hero-content h1 {
    font-size: clamp(2.15rem, 8vw, 3.4rem);
    line-height: 1.12;
  }
  .page-hero-banner { padding: 48px 0 36px; }
  .page-hero-title { font-size: clamp(1.9rem, 7vw, 2.7rem); }
  .page-hero-desc { font-size: .98rem; padding-inline: 4px; }
  .section-padding, .service-detail-section { padding-block: 42px; }
  .support-services-grid, .services-grid, .footer-grid,
  .case-grid, .practice-grid, .quick-connect-strip,
  .contact-main-grid, .story-grid, .service-detail-grid,
  .service-detail-grid.reverse, .einvoice-banner-grid, .calc-container {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .values-grid, .pricing-grid, .engagement-models-grid,
  .hero-stats-strip, .einvoice-points, .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero-stats-strip { gap: 10px; }
  .stat-item { padding: 12px 8px; border-right: 0; }
  .form-card, .contact-details-box, .deliverables-box, .modal-content-box {
    padding: 22px;
  }
  .modal-overlay { padding: 12px; }
  .modal-content-box { max-height: 92dvh; }
  .modal-hero-img { height: 190px; }
  .article-title { font-size: 1.5rem; }
  .blog-controls-bar { align-items: stretch; }
  .search-input-box { width: 100%; min-width: 0; }
  .blog-grid, .services-grid { grid-template-columns: minmax(0, 1fr); }
  .service-nav-bar { top: var(--header-height); }
  .service-nav-track { overflow-x: auto; padding-bottom: 4px; }
  .footer-compliance-strip, .footer-bottom { align-items: flex-start; }
  .newsletter-form { flex-wrap: wrap; }
  .newsletter-input { min-width: 0; }
}
@media (max-width: 480px) {
  .container { width: calc(100% - 28px); }
  .top-bar-left { font-size: .72rem; }
  .brand-logo img { max-width: 126px; max-height: 42px; }
  .hero-title, .hero-heading, .hero-headline, .hero-content h1 { font-size: clamp(1.95rem, 9vw, 2.5rem); }
  .hero-badge-arabic { max-width: 100%; flex-wrap: wrap; }
  .values-grid, .pricing-grid, .engagement-models-grid,
  .hero-stats-strip, .einvoice-points, .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .btn, .btn-primary, .btn-secondary { max-width: 100%; white-space: normal; }
  .hero-actions, .cta-actions, .hero-cta-group { flex-direction: column; align-items: stretch; }
  .hero-actions .btn, .cta-actions .btn, .hero-cta-group .btn { width: 100%; justify-content: center; }
  .form-card, .contact-details-box, .deliverables-box { padding: 18px; }
  .page-hero-banner { padding: 38px 0 30px; }
  .section-header { margin-bottom: 26px; }
  .toast-container { left: 12px; right: 12px; bottom: 12px; }
  .toast { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 768px) {
  .hero-headline { font-size: clamp(2.1rem, 8vw, 3.25rem); line-height: 1.12; }
  .hero-cta-group { display: flex; flex-wrap: wrap; gap: 12px; }
  .hero-visual-card { max-width: 100%; }
}

@media (max-width: 480px) {
  .hero-headline { font-size: clamp(1.9rem, 8.8vw, 2.45rem); }
}
