/* Phone reveal + responsive overrides */

.but.phone.phone-reveal {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 10.25rem;
  min-width: 0;
  width: auto;
  white-space: nowrap;
  overflow: hidden;
  text-decoration: none;
  line-height: 1.2;
  box-sizing: border-box;
}
.but.phone.phone-reveal:not(.is-revealed) { cursor: pointer; }
.but.phone .phone-reveal__value {
  display: inline;
  white-space: nowrap;
  font-size: inherit;
  line-height: inherit;
  position: relative;
  z-index: 0;
}
.but.phone.phone-reveal:not(.is-revealed) .phone-reveal__fade {
  display: inline;
  vertical-align: baseline;
  user-select: none;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,.28) 0%, rgba(0,0,0,.1) 18%, transparent 48%);
  mask-image: linear-gradient(90deg, rgba(0,0,0,.28) 0%, rgba(0,0,0,.1) 18%, transparent 48%);
}
.but.phone.phone-reveal:not(.is-revealed)::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 52%;
  background: linear-gradient(90deg, rgba(71,71,71,0) 0%, rgba(71,71,71,.75) 22%, #474747 48%, #474747 100%);
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
}
.but.phone.phone-reveal.is-revealed { color: #fff; max-width: none; }
.but.phone.phone-reveal.is-revealed:hover { color: #fec944; }

html {
  scroll-behavior: smooth;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

/* Below-fold sections: skip layout work until near viewport */
.b1,
.b5,
.b6,
#stages,
#principles,
.a-footer {
  content-visibility: auto;
  contain-intrinsic-size: 1px 720px;
}

#simply-burger {
  position: relative;
  flex: none;
  z-index: 30;
}

/* —— Tablet / mobile nav —— */
@media (max-width: 991.98px) {
  .simply-burger--css {
    display: block !important;
  }

  .a-navigation {
    flex-wrap: nowrap;
    gap: 0.5rem;
  }

  .a-nav {
    display: block !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 28;
    flex: none;
    width: 100%;
    max-width: none;
    padding: 5.5rem 1.25rem 2rem;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-0.5rem);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
    overflow-y: auto;
  }

  .a-nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .a-nav .menu--css,
  .a-nav #menu-1 {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    justify-content: flex-start;
  }

  .a-nav .menu--css li {
    margin: 0;
    border-bottom: 1px solid rgba(59, 75, 91, 0.1);
  }

  .a-nav .menu--css a {
    display: block;
    padding: 0.95rem 0.25rem;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
  }

  .a-nav .menu--css a::after {
    display: none;
  }

  body.nav-open {
    overflow: hidden;
  }

  /* Phone pill: keep compact next to burger */
  .but.phone.phone-reveal {
    margin-left: auto;
    max-width: 9.5rem;
    min-width: 0;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
    font-size: 0.8125rem;
  }

  .logo {
    flex: none;
    max-width: 7.5rem;
  }
}

@media (max-width: 767.98px) {
  .a-top {
    padding-top: 0.75rem;
    padding-bottom: 0.5rem;
  }

  .a-top.formmenu,
  #fixmenu.formmenu {
    padding-top: 0.5rem;
    padding-bottom: 0.35rem;
  }

  .but.phone.phone-reveal {
    max-width: 8.75rem;
    font-size: 0.75rem;
  }

  .a--header__left .title,
  .a-header .title {
    font-size: clamp(1.75rem, 7vw, 2.25rem);
    line-height: 1.15;
  }

  .a-sub-box {
    max-width: 100%;
  }

  .a-sub-box p {
    font-size: 0.95rem;
  }

  .a-header .but.btn-size,
  .a--header__left .but.btn-size {
    width: 100%;
    max-width: 100%;
  }

  .lists-a-get {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }

  .a-get {
    margin-top: 1.5rem;
  }

  /* Prevent absolute wide images from causing horizontal scroll */
  .a-main,
  .page-container,
  .a-header,
  section {
    overflow-x: clip;
  }

  .system__img,
  .leads__img,
  .a--header__img {
    max-width: 100%;
  }

  .a-problem-grid,
  .a-services,
  .leads-grid {
    grid-template-columns: 1fr !important;
  }

  .a-tags {
    justify-content: center;
    gap: 0.5rem;
  }

  .a-tag {
    font-size: 0.8rem;
  }

  .stereo {
    display: none;
  }

  .a-free h2 {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }

  .a-cont {
    font-size: 0.8125rem;
    padding-bottom: 1.25rem;
  }
}

@media (max-width: 575.98px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .but.phone.phone-reveal {
    max-width: 7.75rem;
    font-size: 0.7rem;
    margin-left: 0.35rem;
  }

  #simply-burger {
    margin-left: 0.5rem;
    width: 1.875rem;
  }
}

/* Desktop: keep nav readable, avoid cramped links */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .a-nav {
    flex: 1 1 auto;
    min-width: 0;
  }

  .menu--css {
    gap: 0.75rem;
  }

  .menu--css a {
    font-size: 0.8125rem;
    white-space: nowrap;
  }

  .but.phone.phone-reveal {
    margin-left: 0.75rem;
  }
}

@media (min-width: 1200px) {
  .menu--css {
    gap: 1rem;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .a-nav {
    transition: none;
  }
}
