/* VALUE — mobile experience layer
   Loaded after the existing design files so every rule here is isolated to
   phone-sized viewports. Desktop layout and behavior remain untouched. */

@media (max-width: 767px) {
  :root {
    --mobile-gutter: 20px;
    --mobile-section: 72px;
    --mobile-rail-width: min(84vw, 340px);
  }

  html {
    scroll-padding-top: 76px;
    -webkit-text-size-adjust: 100%;
  }

  body {
    min-width: 320px;
    background: var(--ink);
    font-size: 16px;
  }

  .container {
    width: 100%;
    padding-inline: var(--mobile-gutter);
  }

  .section {
    padding-block: var(--mobile-section);
  }

  .eyebrow {
    margin-bottom: 12px;
    font-size: 0.64rem;
    line-height: 1.4;
    letter-spacing: 0.17em;
  }

  .section-title {
    max-width: 14ch;
    margin-bottom: 16px;
    font-size: clamp(2.35rem, 10.8vw, 3.05rem);
    line-height: 0.98;
    letter-spacing: -0.052em;
    word-spacing: 0.035em;
  }

  .section-subtitle {
    max-width: 38ch;
    font-size: 0.96rem;
    line-height: 1.7;
  }

  .section-actions {
    margin-top: 24px;
  }

  .btn {
    min-height: 52px;
    padding: 14px 20px;
    border-radius: 7px;
    font-size: 0.8rem;
    touch-action: manipulation;
  }

  .btn-sm {
    min-height: 44px;
    padding: 11px 17px;
  }

  /* Compact, unambiguous mobile navigation. */
  .navbar {
    padding: 10px 0;
    background: linear-gradient(180deg, rgba(4, 12, 23, 0.9), rgba(4, 12, 23, 0));
  }

  .navbar.scrolled {
    padding: 8px 0;
    background: rgba(5, 15, 27, 0.93);
    box-shadow: 0 12px 36px rgba(1, 8, 16, 0.22);
  }

  .navbar .container {
    padding-inline: 16px;
  }

  .navbar .nav-logo {
    width: 72px;
    min-width: 72px;
    height: 50px;
  }

  .navbar .nav-logo .brand-logo {
    width: 188px;
    height: 188px;
  }

  .navbar .nav-cta {
    display: none !important;
  }

  .mobile-toggle {
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 14px;
    background: rgba(255,255,255,0.055);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
    transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
  }

  .mobile-toggle:active {
    transform: scale(0.96);
  }

  .mobile-toggle svg {
    width: 20px;
    height: 20px;
  }

  .mobile-menu {
    z-index: 100;
    align-items: stretch;
    justify-content: flex-end;
    gap: 0;
    padding: 116px 22px max(30px, env(safe-area-inset-bottom));
    background:
      radial-gradient(circle at 88% 10%, rgba(32,169,155,0.15), transparent 30%),
      rgba(4, 12, 23, 0.985);
    opacity: 0;
    transform: translateY(-12px) scale(0.985);
    transform-origin: top center;
    transition: opacity 240ms ease, transform 320ms var(--ease);
    counter-reset: mobile-nav;
  }

  .mobile-menu.open {
    opacity: 1;
    transform: none;
  }

  .mobile-menu > a:not(.btn) {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 58px;
    border-top: 1px solid var(--line);
    color: rgba(245,250,249,0.72);
    font-family: var(--font-display);
    font-size: clamp(1.55rem, 7vw, 2rem);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.045em;
    counter-increment: mobile-nav;
  }

  .mobile-menu > a:not(.btn)::before {
    content: "0" counter(mobile-nav);
    width: 36px;
    color: var(--brand-accent);
    font-family: var(--font);
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.08em;
  }

  .mobile-menu > a:not(.btn).active {
    color: #fff;
  }

  .mobile-menu > a:not(.btn).active::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-left: auto;
    background: var(--brand-accent);
    border-radius: 50%;
    box-shadow: 0 0 18px rgba(32,169,155,0.55);
  }

  .mobile-menu > .btn {
    width: 100%;
    margin-top: 20px !important;
    justify-content: space-between;
  }

  .mobile-menu .mob-close {
    top: max(18px, env(safe-area-inset-top));
    right: 16px;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(255,255,255,0.055);
  }

  /* Home hero: photographic, readable and contained within the first screen. */
  .hero-premium {
    min-height: max(760px, 100svh);
    background: #050f1c;
  }

  .hero-premium .hero-layout {
    min-height: max(760px, 100svh);
    align-content: end;
    gap: 0;
    padding-top: 112px;
    padding-bottom: max(32px, env(safe-area-inset-bottom));
  }

  .hero-premium .hero-bg img {
    object-position: 50% center;
    filter: brightness(0.6) contrast(1.05) saturate(0.72);
  }

  .hero-premium .hero-bg::after {
    background:
      linear-gradient(180deg, rgba(4,12,23,0.48) 0%, rgba(4,12,23,0.38) 28%, rgba(4,12,23,0.79) 58%, rgba(4,12,23,0.99) 87%),
      linear-gradient(90deg, rgba(4,12,23,0.48), rgba(4,12,23,0.08) 78%);
  }

  .hero-premium .hero-content {
    max-width: 100%;
  }

  .hero-premium h1 {
    max-width: 100%;
    margin-bottom: 20px;
    font-size: clamp(2.85rem, 11.8vw, 3.3rem);
    line-height: 0.94;
    letter-spacing: -0.055em;
    word-spacing: 0.035em;
  }

  .hero-premium .hero-desc {
    max-width: 36ch;
    margin-bottom: 24px;
    font-size: 0.93rem;
    line-height: 1.65;
    color: rgba(246,242,234,0.78);
  }

  .hero-premium .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    align-items: start;
  }

  .hero-premium .hero-actions .btn-blue {
    width: 100%;
    justify-content: space-between;
  }

  .hero-premium .hero-actions .btn-outline {
    width: max-content;
    min-height: 38px;
    padding: 9px 0;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,0.24);
    border-radius: 0;
    background: transparent;
  }

  .hero-ledger {
    display: none;
  }

  .hero-premium--portrait .hero-bg picture {
    width: 100%;
    height: 100%;
  }

  .hero-premium--portrait .hero-bg img {
    width: 100%;
    max-width: 100%;
    height: 100%;
    margin-left: 0;
    object-fit: cover;
    object-position: 52% center;
    filter: brightness(0.62) contrast(1.04) saturate(0.88);
  }

  .value-framework {
    padding-block: var(--mobile-section);
  }

  .value-framework-head {
    gap: 36px;
    padding-bottom: 38px;
  }

  .value-framework-head .section-title {
    max-width: 12ch;
  }

  .value-framework-metrics {
    grid-template-columns: 1fr;
  }

  .value-framework-metric {
    min-height: 0;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: end;
    gap: 20px;
    padding: 24px 0;
  }

  .value-framework-metric + .value-framework-metric {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .value-framework-metric strong {
    font-size: clamp(2.8rem, 15vw, 3.65rem);
  }

  .value-framework-metric span {
    padding-bottom: 2px;
    font-size: 0.76rem;
  }

  .value-framework-item {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 14px;
    padding: 34px 0;
  }

  .value-framework-item > div {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .value-framework-item h3 {
    font-size: 1.12rem;
  }

  .value-framework-item p {
    max-width: 36ch;
    font-size: 0.94rem;
    line-height: 1.72;
  }

  .value-framework-item .value-framework-lead {
    max-width: 28ch;
    font-size: clamp(1.35rem, 7vw, 1.7rem);
    line-height: 1.28;
  }

  .about-photo.about-photo--portrait img {
    object-position: 50% 20%;
  }

  /* Internal page intros are intentionally shorter on a phone. */
  .page-hero {
    padding: 132px 0 68px;
  }

  .page-hero .section-title {
    max-width: 12ch !important;
    font-size: clamp(2.65rem, 11.6vw, 3.2rem);
  }

  .page-hero .section-title br {
    display: none;
  }

  .page-hero .section-subtitle {
    max-width: 37ch;
  }

  .page-hero::after {
    background:
      radial-gradient(circle at 90% 10%, rgba(32,169,155,0.14), transparent 34%);
  }

  /* Section rhythm and editorial headings. */
  .services-intro,
  .client-proof-head,
  .testimonial-head {
    gap: 20px;
    margin-bottom: 34px;
  }

  .services-intro .section-subtitle,
  .client-proof-head .section-subtitle,
  .testimonial-head .section-subtitle {
    max-width: 36ch;
  }

  /* Native horizontal rails keep rich collections compact and touch-friendly. */
  .service-grid,
  .testimonial-grid,
  .pocket-grid,
  .diff-grid,
  .values-grid,
  .client-case-grid {
    display: flex !important;
    align-items: stretch;
    gap: 12px !important;
    margin-inline: calc(var(--mobile-gutter) * -1);
    padding: 0 var(--mobile-gutter) 16px;
    overflow-x: auto;
    overflow-y: hidden;
    border: 0 !important;
    background: transparent !important;
    scroll-padding-inline: var(--mobile-gutter);
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .service-grid::-webkit-scrollbar,
  .testimonial-grid::-webkit-scrollbar,
  .pocket-grid::-webkit-scrollbar,
  .diff-grid::-webkit-scrollbar,
  .values-grid::-webkit-scrollbar,
  .client-case-grid::-webkit-scrollbar,
  .client-logo-grid::-webkit-scrollbar,
  .logo-wall::-webkit-scrollbar,
  .client-name-cloud::-webkit-scrollbar,
  .channels::-webkit-scrollbar {
    display: none;
  }

  .service-grid .service-card,
  .service-grid .service-card:not(.service-card-large) {
    flex: 0 0 var(--mobile-rail-width);
    min-height: auto !important;
    padding: 28px 24px 30px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, var(--ink-3), var(--ink-2));
    scroll-snap-align: start;
  }

  .service-card::before {
    margin-bottom: 24px;
  }

  .service-card h3 {
    max-width: 14ch;
    font-size: 1.55rem;
  }

  .service-card p {
    font-size: 0.88rem;
    line-height: 1.65;
  }

  .service-points {
    margin-top: 20px;
  }

  .service-points li {
    padding-block: 11px;
    font-size: 0.82rem;
  }

  .service-points li::before {
    top: 18px;
  }

  .testimonial-head::after {
    content: "Deslize para ver os relatos  →";
    display: block;
    color: var(--blue-light);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
  }

  .testimonial-card {
    flex: 0 0 min(86vw, 360px);
    scroll-snap-align: start;
  }

  #allTestimonials {
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: min(86vw, 360px);
    grid-template-rows: repeat(2, auto);
    align-items: start;
  }

  #allTestimonials .testimonial-card {
    width: 100%;
  }

  .testimonial-media,
  .testimonial-grid--featured .testimonial-card:first-child .testimonial-media {
    aspect-ratio: 16 / 9;
    margin-bottom: 14px;
    border-radius: 5px;
    box-shadow: 0 18px 42px rgba(1,8,16,0.22);
  }

  .testimonial-headline {
    font-size: 1.05rem;
  }

  .testimonial-play {
    right: 14px;
    bottom: 14px;
    width: 50px;
    height: 50px;
  }

  .testimonial-duration {
    left: 14px;
    bottom: 17px;
  }

  /* Client marks become a dense two-row gallery instead of a tall matrix. */
  .client-logo-grid,
  .logo-wall {
    display: grid !important;
    grid-template-columns: none !important;
    grid-template-rows: repeat(2, 98px);
    grid-auto-flow: column;
    grid-auto-columns: 150px;
    gap: 8px;
    margin-inline: calc(var(--mobile-gutter) * -1);
    margin-bottom: 0;
    padding: 0 var(--mobile-gutter) 14px;
    overflow-x: auto;
    overflow-y: hidden;
    border: 0;
    background: transparent;
    scroll-padding-inline: var(--mobile-gutter);
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
  }

  .client-logo-cell,
  .logo-card {
    min-height: 98px;
    padding: 15px;
    border: 1px solid rgba(6,17,31,0.1);
    border-radius: 0;
    background: #f8fbfa;
    box-shadow: none;
    scroll-snap-align: start;
  }

  .logo-card {
    border-color: var(--line);
    background: var(--ink-2);
  }

  .client-logo-cell img,
  .logo-card img {
    max-width: 112px;
    max-height: 48px;
  }

  .client-name-cloud {
    display: flex !important;
    gap: 8px !important;
    margin-inline: calc(var(--mobile-gutter) * -1) !important;
    padding: 0 var(--mobile-gutter) 12px;
    overflow-x: auto;
    border: 0 !important;
    background: transparent !important;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .client-name-cloud .name-pill {
    flex: 0 0 auto;
    padding: 13px 16px;
    border: 1px solid rgba(6,17,31,0.1);
    background: #f8fbfa;
    scroll-snap-align: start;
  }

  .client-stat-grid {
    gap: 8px;
  }

  .client-stat {
    min-height: 118px;
    padding: 22px 14px;
    border-radius: 4px;
  }

  /* Existing internal-page collections use the same editorial rail language. */
  .pocket-card,
  .diff-item,
  .val-card,
  .client-case {
    flex: 0 0 var(--mobile-rail-width);
    min-height: 0 !important;
    scroll-snap-align: start;
  }

  .pocket-card,
  .client-case {
    padding: 28px 24px !important;
  }

  .diff-item {
    display: grid !important;
    grid-template-columns: 34px 1fr;
    gap: 14px !important;
    padding: 28px 24px !important;
  }

  .diff-icon {
    padding-top: 3px;
  }

  .val-card {
    padding: 30px 24px !important;
  }

  .val-card h3 {
    margin-bottom: 24px !important;
  }

  .segments-grid {
    gap: 1px !important;
  }

  .seg-item {
    min-height: 126px;
    padding: 24px 18px !important;
  }

  .seg-icon {
    margin-bottom: 20px !important;
  }

  .story-grid,
  .founder-grid,
  .contact-layout,
  .main-service {
    gap: 38px;
  }

  .about-photo {
    width: calc(100% + (var(--mobile-gutter) * 2));
    margin-inline: calc(var(--mobile-gutter) * -1);
  }

  .founder-stat {
    grid-template-columns: 92px 1fr;
    gap: 18px;
    margin-top: 30px;
    padding-block: 22px;
  }

  .founder-stat strong {
    font-size: 2.7rem;
  }

  .founder-stat span {
    font-size: 0.79rem;
  }

  .note-box {
    padding: 20px 0 !important;
  }

  .pillar {
    gap: 16px !important;
    padding: 20px 0 !important;
  }

  .pillar-num {
    min-width: 30px;
    font-size: 1.05rem !important;
  }

  /* Blog controls remain visible and easy to hit. */
  .content-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 28px;
    padding: 4px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.025);
  }

  .content-tab {
    min-height: 44px;
    padding: 9px 10px;
    border: 0;
    font-size: 0.68rem;
    line-height: 1.25;
  }

  .content-tab.active {
    background: rgba(32,169,155,0.13);
  }

  .content-empty {
    gap: 18px;
    padding: 30px 0;
  }

  /* Contact: form first, proof second, with no oversized dead zones. */
  .page-hero + .section {
    padding-block: 56px;
  }

  .page-hero + .section:has(.channels) {
    padding: 48px 0 24px;
  }

  main > .section:has(.contact-split) {
    padding-top: 28px;
  }

  /* WhatsApp/e-mail/Instagram: only 3 items, no reason to make them a
     horizontal-scroll carousel — stack them like a normal list instead. */
  .channels {
    display: flex !important;
    flex-direction: column;
    gap: 10px !important;
    margin-inline: 0;
    padding: 0;
    overflow-x: visible;
    border: 0 !important;
    background: transparent !important;
  }

  .channel {
    flex: 1 1 auto;
    width: 100%;
    min-height: 92px;
    padding: 20px !important;
    border: 1px solid var(--line) !important;
    background: var(--ink-2) !important;
    scroll-snap-align: start;
  }

  .channel .ch-icon {
    width: 42px;
    height: 42px;
  }

  .channel p {
    max-width: 29ch;
    overflow-wrap: anywhere;
  }

  .contact-split {
    display: flex !important;
    flex-direction: column;
    gap: 36px !important;
  }

  .contact-split .form-card {
    order: -1;
  }

  .form-card {
    padding: 26px 20px 24px !important;
    border: 1px solid var(--line-strong) !important;
    background: linear-gradient(180deg, var(--ink-3), var(--ink-2)) !important;
  }

  .form-card h3 {
    font-size: 1.55rem !important;
  }

  .form-card > p {
    margin-bottom: 22px;
    line-height: 1.6;
  }

  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .form-field input,
  .form-field select,
  .form-field textarea {
    width: 100%;
    min-width: 0;
    min-height: 54px;
    padding-inline: 14px;
    font-size: 0.9rem;
  }

  .form-field label {
    font-size: 0.74rem;
    line-height: 1.4;
  }

  .form-field input::placeholder,
  .form-field textarea::placeholder {
    color: rgba(245,250,249,0.34);
  }

  .contact-info {
    counter-reset: mobile-contact;
  }

  .info-block {
    position: relative;
    padding: 22px 0 22px 44px;
    counter-increment: mobile-contact;
  }

  .info-block::before {
    content: "0" counter(mobile-contact);
    position: absolute;
    top: 25px;
    left: 0;
    color: var(--brand-accent);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.08em;
  }

  .info-block h3 {
    font-size: 1rem !important;
  }

  .info-block p {
    font-size: 0.83rem;
  }

  /* CTA and footer close the page without another long vertical stack. */
  .cta-panel {
    gap: 28px;
    padding: 42px 0;
  }

  .cta-panel .section-title {
    max-width: 13ch;
  }

  .cta-actions {
    gap: 20px;
  }

  .cta-actions .btn {
    width: 100%;
    justify-content: space-between;
  }

  .footer {
    padding-top: 52px;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
    gap: 34px 22px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer .nav-logo {
    width: 108px;
    height: 82px;
  }

  .footer .nav-logo .brand-logo {
    width: 310px;
    height: 310px;
  }

  .footer-brand p {
    max-width: 36ch;
    font-size: 0.82rem;
    line-height: 1.65;
  }

  .footer-col h4 {
    margin-bottom: 14px;
    font-size: 0.62rem;
  }

  .footer-col a {
    width: fit-content;
    min-height: 30px;
    font-size: 0.8rem;
    overflow-wrap: anywhere;
  }

  .footer-bottom {
    gap: 18px;
    margin-top: 38px;
    padding: 22px 0 max(26px, env(safe-area-inset-bottom));
  }

  .footer-bottom p {
    max-width: 30ch;
    font-size: 0.68rem;
    line-height: 1.55;
  }

  .wa-fab {
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    width: 54px;
    height: 54px;
    border: 4px solid rgba(5,15,27,0.92);
    box-shadow: 0 12px 32px rgba(3, 72, 65, 0.34);
  }

  .video-modal {
    align-items: center;
    padding: max(62px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
  }

  .video-modal-dialog {
    width: min(100%, 720px);
  }

  .video-modal-close {
    top: -48px;
    width: 42px;
    height: 42px;
  }

  .not-found {
    min-height: 100svh;
    align-items: end;
    padding: 124px 0 max(54px, env(safe-area-inset-bottom));
  }

  .not-found h1 {
    font-size: clamp(3.15rem, 15vw, 4.4rem);
  }

  .not-found__actions {
    display: grid;
    gap: 8px;
  }

  .not-found__actions .btn {
    width: 100%;
    justify-content: space-between;
  }

  #meshCanvas,
  .cursor-glow,
  .float-shapes {
    display: none !important;
  }
}

@media (max-width: 379px) {
  :root {
    --mobile-gutter: 18px;
    --mobile-rail-width: calc(100vw - 48px);
  }

  .section-title {
    font-size: clamp(2.2rem, 10.5vw, 2.55rem);
  }

  .hero-premium h1 {
    font-size: clamp(2.65rem, 12vw, 3rem);
  }

  .hero-premium .hero-desc {
    font-size: 0.88rem;
  }

  .page-hero .section-title {
    font-size: clamp(2.4rem, 11.5vw, 2.8rem);
  }

  .footer-grid {
    gap: 32px 16px;
  }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .mobile-menu {
    transform: none;
  }
}
