/* =========================================================
   RESPONSIVE RULES
   Breakpoints: 1440 / 1366 / 1024 / 768 / 425 / 375 / 320
   ========================================================= */

@media (max-width: 1366px) {
  :root { --container-width: 1140px; }
}

@media (max-width: 1024px) {
  :root { --container-width: 96%; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .split, .split.reverse { grid-template-columns: 1fr; }
  .split.reverse .split-media { order: 0; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  :root { --header-height: 72px; }
  .brand img { width: 54px; height: 54px; }
  .brand-text { font-size: 1.55rem; }
  .brand-text span { font-size: 0.72rem; }
  .brand-subtitle { font-weight: 600 !important; font-size: 0.9rem !important; letter-spacing: 0.01em !important; }

  .main-nav .nav-list { display: none; }
  .nav-toggle { display: flex; }

  .main-nav {
    position: fixed;
    inset: 0;
    top: var(--header-height);
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-4);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 999;
  }
  .main-nav.is-open { transform: translateX(0); }
  .main-nav .nav-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
  }
  .nav-item { width: 100%; border-bottom: 1px solid var(--color-border); }
  .nav-link {
    width: 100%;
    justify-content: space-between;
    padding: 16px 4px;
    border-radius: 0;
  }
  .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    display: none;
    width: 100%;
    padding: 0 0 10px 14px;
    min-width: 0;
    transition: none;
  }
  .nav-item.is-open .dropdown { display: block; }
  .nav-item:hover .dropdown { opacity: 1; visibility: visible; } /* disable hover-open on touch */
  .nav-cta { margin-top: var(--space-4); text-align: center; }
}

@media (max-width: 768px) {
  :root { --space-7: 2.5rem; --space-8: 3.5rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-6 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .cta-band { flex-direction: column; text-align: center; }
  .contact-card { flex-direction: column; }
}

@media (max-width: 425px) {
  .grid-2, .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.4rem; }
  .pill-row { gap: 8px; }
  .btn { width: 100%; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .toc { flex-direction: column; }
  .toc a { text-align: center; }
  .back-to-top { right: var(--space-3); bottom: var(--space-3); }
}

@media (max-width: 375px) {
  :root { --header-height: 64px; }
  .container { padding: 0 var(--space-3); }
  .brand-text { font-size: 1.4rem; }
  .brand img { width: 46px; height: 46px; }
  .brand-subtitle { font-weight: 500 !important; font-size: 0.8rem !important; letter-spacing: 0 !important; }
}

@media (max-width: 320px) {
  .hero h1 { font-size: 1.25rem; }
  .stat-number { font-size: 1.9rem; }
}

/* ---------- Topbar (mobile: keep phone + email on one line) ---------- */
@media (max-width: 600px) {
  .topbar-inner { padding-top: 8px; padding-bottom: 8px; }
  .topbar-contacts {
    flex-wrap: nowrap;
    gap: 10px;
    width: 100%;
  }
  .topbar-contacts a {
    font-size: 0.72rem;
    gap: 5px;
    min-width: 0;
  }
  .topbar-contacts a:first-child { flex-shrink: 0; }
  .topbar-contacts a:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar-icon { width: 13px; height: 13px; }
  .topbar-social { display: none; }
}

@media (max-width: 400px) {
  .topbar-contacts a { font-size: 0.66rem; }
  .topbar-icon { width: 12px; height: 12px; }
}

@media (max-width: 340px) {
  .topbar-contacts { gap: 6px; }
  .topbar-contacts a { font-size: 0.6rem; }
}
