/* CUNHA / NAESK — HERO mobile 2026-11-18 v4
   Atua APENAS na home em <=640px. Substitui a folha de correção antiga,
   não deve ser concatenada sobre múltiplas versões conflitantes.
   Fotografia mobile servida por <picture> no index.html. */
@media (max-width: 640px) {
  .home-page .hero {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    box-sizing: border-box;
    height: auto !important;
    min-height: max(810px, 100svh);
    padding: 0 0 30px !important;
    overflow: hidden;
    background: #061522;
  }

  /* picture não cria caixa de layout; a imagem continua posicionada
     em relação ao HERO exatamente como na implementação desktop. */
  .home-page .hero-picture { display: contents; }

  /* Segurança no cabeçalho antigo: não deixar texto de orçamento
     invadir a marca em telas estreitas. Mantém a topbar aprovada. */
  .home-page .site-header--home .nav-shell.wrap {
    grid-template-columns: minmax(0,1fr) auto auto;
    gap: 7px;
    padding-inline: 12px;
  }
  .home-page .site-header--home .brand { min-width: 0; max-width: 100%; }
  .home-page .site-header--home .brand-wordmark-image {
    width: min(28vw,108px);
    max-width: 100%;
  }
  .home-page .site-header--home .nav-contact {
    max-width: 102px;
    min-width: 40px;
    overflow: hidden;
    font-size: 11px;
    gap: 6px;
    padding-inline: 9px;
    white-space: nowrap;
  }
  .home-page .site-header--home .mobile-menu summary { gap: 6px; white-space: nowrap; }

  .home-page .hero-photo {
    position: absolute;
    z-index: -2;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 100%;
    object-fit: contain;
    object-position: center center;
    transform: none;
    opacity: 1;
    filter: none;
  }
  .home-page .hero-shade {
    position: absolute;
    z-index: -1;
    inset: 0;
    width: 100%;
    height: 100%;
    background:
      linear-gradient(180deg,rgba(3,12,22,.76) 0%,rgba(3,12,22,.44) 31%,rgba(3,12,22,.08) 53%,rgba(3,12,22,.20) 72%,#030c15 100%),
      linear-gradient(90deg,rgba(3,12,22,.38),transparent 90%);
    pointer-events: none;
  }
  .home-page .hero-inner.wrap {
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    display: block;
    width: calc(100% - 38px);
    max-width: none;
    min-width: 0;
    flex: 0 0 auto;
    margin: 0 auto;
    padding: calc(132px + env(safe-area-inset-top, 0px)) 0 0 !important;
    transform: none;
  }
  .home-page .hero-eyebrow {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin: 0 0 20px;
    font-size: clamp(8.2px,2.2vw,10px);
    line-height: 1.4;
    letter-spacing: .12em;
    font-weight: 600;
    white-space: normal;
    color: #eaf3f9;
  }
  .home-page .hero-title {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    font-size: clamp(34px,10vw,44px) !important;
    line-height: 1.035;
    letter-spacing: -.055em;
    font-weight: 650;
    text-wrap: initial;
    overflow-wrap: normal;
    color: #f9fcff;
  }
  .home-page .hero-title br { display: initial !important; }
  .home-page .hero-title span {
    color: #b9dbf2;
    background: linear-gradient(100deg,#eaf6ff,#b9d9f0 65%,#a7cdeb);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  .home-page .hero-lead {
    max-width: 35ch;
    margin: 18px 0 0;
    font-size: clamp(13.5px,3.55vw,15.5px);
    line-height: 1.5;
    color: #f4f8fb;
    letter-spacing: -.012em;
  }
  .home-page .hero-actions {
    display: grid;
    grid-template-columns: minmax(0,1fr);
    gap: 11px;
    width: min(100%,350px);
    max-width: 100%;
    margin: 27px auto 0;
  }
  .home-page .hero-actions .button {
    box-sizing: border-box;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 49px;
    min-width: 0;
    padding: 11px 40px 11px 20px;
    border-radius: 999px;
    font-size: clamp(12px,3.3vw,14px);
    line-height: 1.2;
    font-weight: 650;
    text-transform: none;
    letter-spacing: 0;
    text-align: center;
    white-space: normal;
  }
  .home-page .hero-actions .button-dark {
    background: #147aca;
    border: 1px solid #2689d2;
    color: white;
  }
  .home-page .hero-actions .button-outline {
    background: rgba(4,13,23,.34);
    border: 1px solid rgba(248,251,254,.88);
    color: #fff;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
  }
  .home-page .hero-actions .button .arrow-icon {
    position: absolute;
    top: 50%;
    right: 18px;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
  }
  .home-page .hero-index.wrap {
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    flex: 0 0 auto;
    width: calc(100% - 38px);
    max-width: none;
    min-width: 0;
    inset: auto;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    margin: clamp(160px,22svh,190px) auto 0;
    padding: 0;
    gap: 0;
    border: none;
    background: none;
  }
  .home-page .hero-index > div {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 72px;
    gap: 5px;
    margin: 0;
    padding: 10px 6px;
    text-align: center;
    border: 0;
    border-right: 1px solid rgba(239,247,253,.42);
    border-bottom: 1px solid rgba(239,247,253,.42);
    background: none;
    box-shadow: none;
  }
  .home-page .hero-index > div:nth-child(2n) { border-right: 0; }
  .home-page .hero-index > div:nth-last-child(-n+2) { border-bottom: 0; }
  .home-page .hero-index > div span {
    font-size: clamp(9.2px,2.5vw,11px);
    line-height: 1.22;
    font-weight: 650;
    letter-spacing: .015em;
    color: #f9fcff;
  }
  .home-page .hero-index > div strong {
    font-size: clamp(10.5px,2.8vw,12px);
    line-height: 1.32;
    font-weight: 450;
    letter-spacing: 0;
    color: rgba(240,248,254,.94);
  }
  .home-page .hero-disclosure { display: none; }

  /* Os cartões dos serviços estavam espremidos lado a lado e apresentavam
     texto minúsculo sobre a foto no iPhone. No mobile a imagem vem ACIMA
     do texto, em uma coluna, sem qualquer sobreposição. */
  .home-page .services-section .service-grid {
    display: grid;
    grid-template-columns: minmax(0,1fr) !important;
    gap: 18px;
  }
  .home-page .services-section .service-card {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    min-height: 0 !important;
    overflow: hidden;
    border-radius: 8px;
  }
  .home-page .services-section .service-card figure {
    display: block;
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    min-height: 0 !important;
    height: clamp(190px,53vw,238px) !important;
    aspect-ratio: auto;
    overflow: hidden;
  }
  .home-page .services-section .service-card figure img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .home-page .services-section .service-card-body {
    position: relative;
    display: block;
    align-self: stretch;
    flex: 1 0 auto;
    width: auto;
    min-width: 0;
    min-height: 0 !important;
    padding: 20px 20px 56px !important;
    background: #071724;
  }
  .home-page .services-section .service-card h3 {
    margin: 7px 0 9px;
    font-size: clamp(22px,5.7vw,26px) !important;
    line-height: 1.12;
    letter-spacing: -.03em;
    color: #f7fbff;
  }
  .home-page .services-section .service-card p {
    max-width: none;
    font-size: clamp(14px,3.65vw,16px) !important;
    line-height: 1.55;
    color: #bfccd5;
  }
  .home-page .services-section .service-card .card-link {
    right: 20px;
    bottom: 19px;
    font-size: 13px !important;
  }
}
@media (max-width: 360px) {
  .home-page .hero-inner.wrap,
  .home-page .hero-index.wrap { width: calc(100% - 32px); }
  .home-page .hero-inner.wrap { padding-top: calc(120px + env(safe-area-inset-top, 0px)) !important; }
  .home-page .hero-title { font-size: clamp(32px,9.6vw,35px) !important; }
  .home-page .hero-index.wrap { margin-top: clamp(132px,18svh,150px); }
  .home-page .hero-index > div span { font-size: 9px; }
}
