/* ============================================================
   AJUSTES DE PERFORMANCE — SOMENTE CELULAR (até 640px)
   Carregado por último em todas as páginas para vencer os
   estilos inline. Nada aqui altera o desktop.
   ============================================================ */

@media (max-width: 640px) {

  /* ---- Header: mesmo padrão do index nas 3 páginas ---- */
  header.nav .nav-inner{
    padding: 12px 16px !important;
    min-height: 76px !important;
    justify-content: center !important;
    gap: 10px;
  }
  header.nav .brand{justify-content: center !important; margin: 0 auto !important;}
  header.nav .brand-logo-anim{height: 56px !important; width: auto !important;}
  header.nav .brand-name-text{display: none !important;}
  header.nav .ruler{display: none !important;}

  /* Sem backdrop-filter no header (blur é caro no celular) */
  header.nav{
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background: rgba(20,17,11,0.94) !important;
  }

  /* ---- Grain overlay: composição pesada e quase invisível no celular ---- */
  .grain{display: none !important;}

  /* ---- Fundo animado do briefing (WebGL) desligado ---- */
  #grainientBg{display: none !important;}
  body:has(#grainientBg){
    background:
      radial-gradient(80% 55% at 15% 0%, rgba(228,168,37,0.16), transparent 60%),
      radial-gradient(70% 50% at 90% 30%, rgba(154,46,27,0.20), transparent 65%),
      var(--black);
  }

  /* ============================================================
     DEPOIMENTOS — loop automático na mesma velocidade do desktop;
     aqui só garantimos que o texto não seja cortado pela máscara.
     ============================================================ */
  .depo-viewport{
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 3%, #000 97%, transparent 100%) !important;
    mask-image: linear-gradient(90deg, transparent 0, #000 3%, #000 97%, transparent 100%) !important;
  }
  /* Garante que os depoimentos apareçam mesmo se o reveal atrasar no celular. */
  .depo-viewport.reveal, .depo-hint.reveal{opacity: 1 !important; transform: none !important;}
  .depo-hint{display: inline-flex !important;}

  /* ============================================================
     PALAVRA GIGANTE DE FUNDO — mesmo movimento do desktop.
     No index e no orçamento ela desce para não ficar sob o header.
     ============================================================ */
  #hero > .hero-bg-word.top,
  #orc-topo > .hero-bg-word.top{top: 88px !important;}

  /* ============================================================
     BRIEFING — banner parallax sem as faixas marrons em cima/embaixo
     e um pouco mais alto no celular.
     ============================================================ */
  #brief-fotoxopi{padding: 0 !important;}
  #brief-fotoxopi .parallax-band{
    height: clamp(250px, 78vw, 360px) !important;
    min-height: 0 !important;
  }
  #brief-fotoxopi .parallax-band .p-img{
    top: -18% !important;
    height: 136% !important;
  }

  /* ============================================================
     ORÇAMENTO — paleta de logos: 2 marcas por estilo, bem maiores
     e com o mesmo flutuar do desktop.
     ============================================================ */
  #orc-logos .logo-show-stage{
    margin: 8px 8px 10px !important;
    padding: 14px 4px !important;
    min-height: 0 !important;
  }
  #orc-logos .logo-show-stage ul{
    flex-wrap: nowrap !important;
    justify-content: center !important;
    gap: 10px !important;
  }
  #orc-logos .logo-show-stage li{
    flex: 0 1 50% !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  #orc-logos .logo-show-stage li:nth-child(3){display: none !important;}
  #orc-logos .logo-show-stage img{
    height: 48px !important;
    width: auto !important;
    max-width: 100% !important;
    max-height: 48px !important;
    object-fit: contain;
    animation: logoFloat 3.4s ease-in-out infinite !important;
  }
  #orc-logos .logo-show-stage li:nth-child(2) img{animation-delay: .45s !important;}
  #orc-logos .logo-show-stage li .wm{font-size: 26px !important;}

  /* ============================================================
     ORÇAMENTO — 3 colunas × 5 cores (15 no total). As 5 mais
     parecidas com outras da lista ficam ocultas só no celular.
     ============================================================ */
  #orc-cores .cx-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  #orc-cores .cx-card__info{padding: 8px 8px 10px !important;}
  #orc-cores .cx-card__name{font-size: 12px !important;}
  #orc-cores .cx-card__code{
    font-size: 9.5px !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
  #orc-cores .cx-grid .cx-card[data-i="11"],
  #orc-cores .cx-grid .cx-card[data-i="12"],
  #orc-cores .cx-grid .cx-card[data-i="17"],
  #orc-cores .cx-grid .cx-card[data-i="18"],
  #orc-cores .cx-grid .cx-card[data-i="19"]{display: none !important;}

  /* ============================================================
     ORÇAMENTO — os 4 sistemas de cor em 2 colunas × 2 linhas.
     ============================================================ */
  #orc-cores .cx-sys{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    margin-bottom: 40px !important;
  }
  #orc-cores .cx-sys-card{
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 14px 12px !important;
    border-radius: 16px !important;
  }
  #orc-cores .cx-sys-ico{width: 46px !important; height: 46px !important;}
  #orc-cores .cx-sys-txt h4{font-size: 19px !important;}
  #orc-cores .cx-sys-txt p{font-size: 12px !important; margin-bottom: 8px !important;}

  /* Divisórias decorativas do orçamento: fora do celular. */
  body > main > div.orc-divider{display: none !important;}

  /* ============================================================
     MENU LAYERS — mais estreito quando aberto e um "chamado"
     de 5 em 5 segundos quando recolhido.
     ============================================================ */
  #layersPanel.lp{--pw: min(240px, calc(100vw - 96px)) !important;}
  /* O transform do painel é !important no plin.css, então o "chamado"
     de 5 em 5 segundos é feito pelo right, que a animação consegue mover. */
  @keyframes lpPeekMobile{
    0%, 62%, 100%{right: 0px;}
    74%{right: 18px;}
    86%{right: 0px;}
    93%{right: 8px;}
  }
  #layersPanel.lp:not(.is-open){
    animation: lpPeekMobile 5s ease-in-out infinite !important;
  }

  /* ============================================================
     SOFT-SKILLS — 3 colunas × 5 apps, só logo + nome. O toque
     abre uma telinha com a descrição de cada aplicativo.
     ============================================================ */
  #soft-skills .soft-skills-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  #soft-skills .soft-skill-item{
    min-height: 108px !important;
    padding: 12px 6px !important;
    flex-direction: column !important;
    text-align: center !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    cursor: pointer;
  }
  #soft-skills .soft-skill-img{width: 40px !important; height: 40px !important; flex: 0 0 40px !important;}
  #soft-skills .soft-skill-img img{max-width: 36px !important; max-height: 36px !important;}
  #soft-skills .soft-skill-info{gap: 0 !important;}
  #soft-skills .soft-skill-wm{font-size: 10.5px !important; line-height: 1.2 !important; min-height: 0 !important;}
  #soft-skills .soft-skill-desc{display: none !important;}
  #soft-skills .soft-skills-grid .soft-skill-item:nth-child(16){display: none !important;}

  .ss-sheet-bd{
    position: fixed; inset: 0; z-index: 900;
    display: none; align-items: center; justify-content: center;
    padding: 20px;
    background: rgba(10,8,4,.66);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  }
  .ss-sheet-bd.is-open{display: flex;}
  .ss-sheet{
    position: relative;
    width: 100%; max-width: 420px;
    margin: 0; padding: 22px 20px;
    background: var(--cream,#F3E9CE); color: var(--ink,#171310);
    border: 3px solid var(--ink,#171310);
    border-radius: 22px;
    box-shadow: 0 18px 54px rgba(0,0,0,.55);
    animation: ssSheetIn .3s cubic-bezier(.22,.8,.3,1);
  }
  @keyframes ssSheetIn{from{opacity:0; transform: translateY(14px) scale(.96);} to{opacity:1; transform: none;}}
  .ss-sheet-x{
    position: absolute; top: 12px; right: 12px;
    width: 34px; height: 34px; display: grid; place-items: center;
    border: 2px solid var(--ink,#171310); border-radius: 50%;
    background: var(--gold,#E4A825); color: var(--ink,#171310);
    font-size: 20px; font-weight: 800; line-height: 1; cursor: pointer;
    box-shadow: 2px 2px 0 var(--ink,#171310);
  }
  .ss-sheet-head{display: flex; align-items: center; gap: 12px; padding-right: 40px;}
  .ss-sheet-ico{
    width: 48px; height: 48px; flex: none; display: grid; place-items: center;
    border: 2px solid var(--ink,#171310); border-radius: 12px;
    background: #fff; box-shadow: 3px 3px 0 var(--ink,#171310);
  }
  .ss-sheet-ico img{max-width: 34px; max-height: 34px; width: auto; height: auto; display: block;}
  .ss-sheet-title{
    margin: 0; font-family: 'Anton', sans-serif; font-weight: 400;
    font-size: 24px; line-height: 1; text-transform: uppercase; color: var(--ink,#171310);
  }
  .ss-sheet-desc{margin: 14px 0 0; font-size: 14.5px; line-height: 1.6; color: rgba(23,19,16,.82);}

  /* ============================================================
     ANIMAÇÕES INFINITAS — só gastam bateria
     ============================================================ */
  .soft-skills::after{animation: none !important;}
  /* No celular não existe hover: o toque não pode congelar as faixas de clientes. */
  .marquee-row:hover .marquee-track{animation-play-state: running !important;}
  .hero::before{animation: none !important;}
  .cta{animation: none !important;}
  .bullet-icon{animation: none !important;}
  .logo-show-cta{animation: none !important;}
  .stat-big:hover .icon-stat-layouts svg,
  .stat-big:hover .icon-stat-block svg,
  .stat-big:hover .icon-stat-coffee svg,
  .stat-big:hover .icon-stat-zoom svg{animation: none !important;}

  /* ícones SVG com animação interna (stats e bullets) */
  #numeros svg *,
  .bullets svg *,
  .bullet svg *{animation: none !important;}

  #ctrlZBtn,
  #modoClienteBtn,
  .phone-play,
  .cta-actions .btn-primary,
  .cta-arc,
  .pensa-step .pensa-dot svg{animation: none !important;}

  /* Hover emulado pelo toque não deve mexer no layout */
  .phone-card:hover,
  .phone-card:focus-visible{transform: none !important; animation: none !important;}
  .depo-card:hover{transform: none !important; box-shadow: 6px 6px 0 var(--ink) !important;}
}

/* Respeita quem prefere menos movimento */
@media (max-width: 640px) and (prefers-reduced-motion: reduce){
  #layersPanel.lp:not(.is-open){animation: none !important;}
}
