/* Phone / tablet layout — desktop stays as-is above 980px */

.nav-toggle {
  display: none;
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.5rem;
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  z-index: 60;
}

.nav-toggle span {
  display: block;
  width: 1.35rem;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-drawer-foot {
  display: none;
}

.nav-backdrop {
  display: none;
}

.phone-bar {
  display: none;
}

@media (max-width: 980px) {
  html {
    -webkit-text-size-adjust: 100%;
  }

  .shell {
    width: min(1180px, calc(100% - 1.5rem));
  }

  .site-header {
    background: color-mix(in srgb, var(--bg) 94%, transparent);
  }

  .header-inner {
    grid-template-columns: 1fr auto;
    min-height: 3.75rem;
    padding-block: 0.35rem;
    padding-top: calc(0.35rem + env(safe-area-inset-top));
    gap: 0.5rem;
  }

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

  .brand-mark {
    width: 2.55rem;
    height: 2.55rem;
  }

  .brand-text strong {
    font-size: 0.98rem;
    letter-spacing: -0.03em;
    line-height: 1.15;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .header-actions {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(10, 10, 10, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }

  .nav-backdrop.is-on {
    opacity: 1;
    pointer-events: auto;
  }

  .nav {
    display: flex !important;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 55;
    width: min(22rem, 88vw);
    height: 100dvh;
    height: 100svh;
    margin: 0;
    padding: calc(4.6rem + env(safe-area-inset-top)) 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
    background: var(--bg-elevated);
    border-left: 1px solid var(--line);
    box-shadow: -18px 0 40px rgba(0, 0, 0, 0.12);
    transform: translateX(110%);
    transition: transform 0.28s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav.is-open {
    transform: translateX(0);
  }

  .nav a {
    display: flex;
    align-items: center;
    min-height: 3rem;
    padding: 0.35rem 0.15rem;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--line);
  }

  .nav a.is-active::after {
    display: none;
  }

  .nav a.is-active {
    color: var(--ink);
    box-shadow: inset 3px 0 0 var(--accent);
    padding-left: 0.65rem;
  }

  .nav-drawer-foot {
    display: grid;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1.25rem;
  }

  .nav-drawer-foot .btn {
    width: 100%;
    min-height: 3rem;
  }

  .nav-drawer-phone {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
    border-bottom: 0 !important;
  }

  body.nav-lock {
    overflow: hidden;
  }

  .hero {
    padding: 1.15rem 0 1.75rem;
  }

  .hero-grid {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
  }

  .hero-copy {
    display: contents;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .hero h1 {
    order: 1;
    font-size: 1.45rem;
    line-height: 1.22;
    letter-spacing: -0.035em;
  }

  .hero-lead {
    order: 2;
    margin-top: 0.15rem;
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: none;
  }

  .hero-media {
    order: 3;
    margin: 0;
    width: 100%;
    min-height: 14.5rem;
    height: auto;
    border-radius: 1rem;
    aspect-ratio: 4 / 3;
  }

  .hero-media img,
  .hero-media .hero-slide {
    min-height: 100%;
    height: 100%;
    width: 100%;
    aspect-ratio: auto;
    object-position: 50% 42%;
    transform: none;
    animation: none;
    filter: saturate(0.96) contrast(1.02) brightness(1.01);
  }

  .hero-media .hero-slide.is-on {
    animation: none;
  }

  .hero-media::before {
    width: 100%;
    height: 42%;
    inset: auto 0 0 0;
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.55), transparent);
  }

  .hero-location {
    top: 0.75rem;
    right: 0.75rem;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
  }

  .hero-badge {
    right: 0.7rem;
    bottom: 0.7rem;
    max-width: calc(100% - 1.4rem);
    padding: 0.65rem 0.75rem;
  }

  .hero-actions {
    order: 4;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
    margin-top: 0.15rem;
  }

  .hero-actions .btn {
    width: 100%;
    min-height: 3.05rem;
    font-size: 0.95rem;
  }

  .hero-pager {
    order: 5;
    justify-content: center;
    margin-top: 0.35rem;
    gap: 1rem;
  }

  .features {
    margin-top: 0;
  }

  .features-panel {
    grid-template-columns: 1fr;
    gap: 0.55rem;
    padding: 0.35rem 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    border-radius: 0;
  }

  .feature {
    grid-template-columns: 2.6rem 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.85rem;
    row-gap: 0.2rem;
    padding: 1rem 0.95rem;
    border-radius: 0.9rem;
    background: var(--bg-elevated);
    border: 1px solid var(--line);
  }

  .feature-icon {
    grid-row: 1 / span 2;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0.35rem;
    border-radius: 0.55rem;
    border: 1.5px solid var(--accent);
  }

  .section {
    padding: 2.35rem 0;
  }

  .section-title {
    font-size: 1.45rem;
  }

  .about-stats {
    grid-template-columns: 1fr 1fr;
  }

  .about-stats .stat:last-child {
    grid-column: 1 / -1;
  }

  .project-card figure {
    aspect-ratio: 16 / 11;
  }

  .project-card h3 {
    font-size: 1.08rem;
  }

  .lead {
    padding: 2.1rem 0;
  }

  .lead-inner {
    gap: 1.1rem;
  }

  .lead h2 {
    font-size: 1.4rem;
  }

  .lead-form {
    padding: 1rem 0.95rem 1.1rem;
  }

  .lead-form input[type="text"],
  .lead-form input[type="tel"],
  .lead-form .btn {
    min-height: 3.05rem;
    width: 100%;
  }

  .footer-brand .brand-mark {
    width: 3.1rem;
    height: 3.1rem;
  }

  .footer-col h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 3rem;
    margin: 0;
    padding: 0.35rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
  }

  .footer-col h3::after {
    content: "+";
    font-size: 1.2rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
  }

  .footer-col.is-open h3::after {
    content: "–";
  }

  .footer-col ul,
  .footer-col .footer-contacts {
    display: none;
    padding-bottom: 0.65rem;
  }

  .footer-col.is-open ul,
  .footer-col.is-open .footer-contacts {
    display: grid;
  }

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

  .page-hero {
    min-height: 16.5rem;
  }

  .page-hero h1 {
    max-width: none;
    font-size: 1.7rem;
  }

  .page-hero p {
    font-size: 0.95rem;
  }

  .contact-map {
    min-height: 240px;
  }

  .btn {
    min-height: 2.95rem;
  }

  .phone-bar {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 0.55rem;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    padding: 0.65rem 0.9rem calc(0.65rem + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(14px);
  }

  .phone-bar-call,
  .phone-bar-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.95rem;
    border-radius: 0.55rem;
    font-weight: 800;
    text-decoration: none;
  }

  .phone-bar-call {
    color: var(--ink);
    border: 1px solid var(--line);
    background: var(--bg-elevated);
  }

  .phone-bar-cta {
    width: 100%;
  }

  body {
    padding-bottom: calc(4.6rem + env(safe-area-inset-bottom));
  }

  .nav-drawer-foot .site-switches {
    display: flex !important;
    position: static !important;
    flex-direction: row !important;
    bottom: auto !important;
    right: auto !important;
    z-index: 1 !important;
  }

  .nav-drawer-foot .site-switches .switch-group {
    flex-direction: row !important;
  }

  body > .site-switches {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .about-stats {
    grid-template-columns: 1fr;
  }

  .about-stats .stat:last-child {
    grid-column: auto;
  }
}

@media (max-width: 380px) {
  .brand-text strong {
    font-size: 0.88rem;
  }
}
