/* ========== End mobile drawer / hamburger rebuild ========== */

/* ========== Professional mobile polish pass ========== */

/* Faster, more responsive hamburger/drawer behavior */
.nav-toggle,
.floating-menu,
.menu-close {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle,
.floating-menu {
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.nav-toggle span,
.floating-menu span {
  transition:
    transform 180ms ease,
    opacity 140ms ease;
}

.mobile-menu {
  transition: opacity 180ms ease;
  will-change: opacity;
}

.mobile-menu-panel {
  transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

/* Desktop floating menu should feel instant and crisp */
@media (min-width: 1021px) {
  .floating-menu {
    top: 1.1rem;
    right: 1.4rem;
  }

  .floating-menu.is-visible {
    transform: translateY(0) scale(1);
  }

  .floating-menu:active,
  .nav-toggle:active {
    transform: scale(0.96);
  }
}

/* Mobile and tablet header */
@media (max-width: 900px) {
  .site-header,
  .site-header.solid {
    background: linear-gradient(
      180deg,
      rgba(8, 11, 16, 0.78),
      rgba(8, 11, 16, 0.34)
    );
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(59, 130, 246, 0.12);
  }

  .nav-row {
    padding: 0.9rem 0;
    gap: 0.8rem;
  }

  .brand {
    gap: 0.65rem;
    min-width: 0;
  }

  .site-header .brand-mark,
  .brand-mark {
    width: 58px;
    height: 58px;
  }

  .brand-divider {
    height: 34px;
  }

  .brand-text .name {
    font-size: 0.76rem;
  }

  .brand-text .sub {
    font-size: 0.58rem;
    letter-spacing: 0.11em;
  }

  .site-nav {
    display: none;
  }

  .nav-toggle {
    display: grid;
    flex-shrink: 0;
  }

  .nav-cta {
    display: none;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 2rem, var(--max));
  }

  .site-header .brand-mark,
  .brand-mark {
    width: 52px;
    height: 52px;
  }

  .brand-divider,
  .brand-text {
    display: none;
  }

  .nav-row {
    padding: 0.85rem 0;
  }
}

/* Mobile drawer with socials */
.mobile-menu-panel {
  display: flex;
  flex-direction: column;
}

.mobile-menu-contact {
  margin-top: auto;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

.mobile-menu-phone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin-bottom: 1.2rem;
  color: var(--white);
  border: 1px solid rgba(59, 130, 246, 0.34);
  background: rgba(59, 130, 246, 0.07);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mobile-menu-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
}

.mobile-menu-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  padding: 0;
}

.mobile-menu-socials .social-icon-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

/* Home hero mobile polish */
@media (max-width: 700px) {
  .hero {
    min-height: auto;
  }

  .hero-content {
    padding: 7.4rem 0 4rem;
    min-height: auto;
  }

  .hero-kicker {
    font-size: 0.62rem;
    line-height: 1.45;
    letter-spacing: 0.18em;
    max-width: 32ch;
  }

  .hero h1 {
    font-size: clamp(3.2rem, 15vw, 5.2rem);
    line-height: 0.91;
    max-width: 8ch;
    letter-spacing: -0.045em;
  }

  .hero h1 .blue {
    display: block;
  }

  .hero-copy {
    max-width: 28ch;
    font-size: 1.03rem;
    line-height: 1.65;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }

  .hero-actions .btn {
    width: 100%;
    max-width: 300px;
  }
}

/* Trust bar mobile polish */
@media (max-width: 760px) {
  .trust-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .trust-item {
    min-height: 0;
    padding: 1.35rem 1.1rem;
    align-items: flex-start;
    gap: 0.9rem;
  }

  .trust-item h3 {
    font-size: 0.72rem;
    line-height: 1.25;
    letter-spacing: 0.16em;
  }

  .trust-item p {
    font-size: 0.82rem;
    line-height: 1.55;
  }

  .trust-icon,
  .trust-logo,
  .ca-gov-logo,
  .california-logo {
    max-width: 40px;
  }
}

@media (max-width: 520px) {
  .trust-grid {
    grid-template-columns: 1fr;
  }

  .trust-item {
    display: grid;
    grid-template-columns: 48px 1fr;
    padding: 1.25rem 1.1rem;
    border-right: none;
  }

  .trust-item:not(:last-child) {
    border-bottom: 1px solid var(--line);
  }

  .trust-item h3 {
    margin-bottom: 0.3rem;
  }
}

/* Inner page mobile hero */
@media (max-width: 760px) {
  .page-hero {
    padding: 7rem 0 3.2rem;
  }

  .page-hero h1 {
    font-size: clamp(2.6rem, 13vw, 4rem);
    max-width: 10ch;
  }

  .page-hero .lede {
    font-size: 0.98rem;
    line-height: 1.65;
  }

  .section {
    padding: 4.2rem 0;
  }

  .section-heading h2,
  .section-copy h2 {
    font-size: clamp(2rem, 10vw, 3.2rem);
    line-height: 1;
  }

  .split-grid,
  .split-grid.reverse {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .split-grid.reverse > :first-child {
    order: 0;
  }

  .image-card {
    min-height: 280px;
  }
}

/* Cards and grids mobile */
@media (max-width: 900px) {
  .project-grid,
  .project-grid.three,
  .service-grid,
  .capability-list,
  .stats-row,
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-grid,
  .cta-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .project-grid,
  .project-grid.three,
  .service-grid,
  .capability-list,
  .stats-row,
  .steps {
    grid-template-columns: 1fr;
  }

  .service-card,
  .cap,
  .info-card,
  .quote-form {
    padding: 1.35rem;
  }

  .filter-row {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0 0 0.45rem;
    scrollbar-width: thin;
  }

  .chip {
    flex: 0 0 auto;
  }
}

/* Contact form and map mobile */
@media (max-width: 760px) {
  .quote-form .row {
    grid-template-columns: 1fr;
  }

  .service-area-section {
    padding: 4.5rem 0;
  }

  .service-area-title h2 {
    font-size: clamp(2.6rem, 12vw, 4rem);
  }

  .service-map-wrapper {
    border-radius: 20px;
    padding: 8px;
  }

  .service-map-wrapper iframe {
    height: 440px;
    border-radius: 14px;
  }

  .service-area-note {
    padding: 1.35rem;
  }
}

/* Footer mobile polish */
@media (max-width: 760px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-brand .brand {
    align-items: flex-start;
  }

  .footer-brand .brand-mark {
    width: 112px;
    height: auto;
  }

  .footer-brand .brand-divider,
  .footer-brand .brand-text {
    display: none;
  }

  .footer-brand p {
    max-width: 36ch;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-bottom .links {
    flex-wrap: wrap;
  }
}

/* Project modal mobile polish */
@media (max-width: 900px) {
  .featured-project-card,
  .project-modal-panel {
    grid-template-columns: 1fr;
  }

  .project-modal {
    padding: 0.85rem;
  }

  .project-modal-panel {
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
  }

  .featured-project-image,
  .project-modal-media,
  .project-main-media,
  .project-main-media img,
  .project-main-media video,
  .project-modal-placeholder {
    min-height: 360px;
  }
}

@media (max-width: 560px) {
  .featured-project-copy {
    padding: 1.6rem 1.2rem;
  }

  .featured-project-copy h2 {
    font-size: clamp(2rem, 11vw, 3rem);
  }

  .project-modal-details {
    padding: 1.4rem;
  }

  .project-modal-close {
    top: 0.75rem;
    right: 0.75rem;
  }

  .project-modal-thumbs {
    grid-template-columns: repeat(3, 1fr);
  }

  .project-media-arrow {
    width: 36px;
    height: 46px;
    font-size: 2rem;
  }
}
