/* ===================================================
   Responsivo
   =================================================== */

/* Tablet */
@media (max-width: 1024px) {
  .project-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-right: 0;
    min-height: unset;
  }

  .project-card__content {
    padding: 40px 40px 0;
  }

  .project-card__image {
    width: 100%;
    min-height: 0;
    height: auto;
  }

  .project-card__image img,
  .project-card--bit .project-card__image img {
    position: static;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    height: auto;
    border-radius: 0;
    transform: none;
  }

  .principles__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .reflections__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --section-py: 64px;
  }

  section[id] {
    scroll-margin-top: 112px;
  }

  /* Navbar mobile */
  .header {
    top: 12px;
    padding-inline: 12px;
  }

  .nav {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    column-gap: 12px;
    width: 100%;
    max-width: none;
    min-height: 72px;
    padding: 12px 16px;
    /* Remove backdrop-filter no mobile: backdrop-filter cria containing block
       para position:fixed, o que faz o overlay do menu ser posicionado relativo
       ao .nav (~70px) em vez do viewport , causando o menu sumir ou ficar errado */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(255, 255, 255, 0.95);
    justify-content: space-between;
  }

  .nav__logo-wrap {
    padding-left: 0;
    width: auto;
    min-width: 0;
    grid-column: 1;
  }

  .nav__center {
    /* display:none oculta filhos position:fixed , usar height:0+overflow:hidden
       que clipa elementos em fluxo normal mas não elementos fixed (eles ignoram
       overflow do ancestor pois seu containing block é o viewport) */
    height: 0;
    width: 0;
    flex: 0 0 auto;
    overflow: hidden;
    pointer-events: none;
    grid-column: 2;
    min-width: 0;
  }

  .nav__right {
    display: none;
  }

  .nav__toggle {
    display: inline-flex !important;
    margin-left: 0;
    margin-right: 0;
    padding-right: 0;
    padding: 0;
    flex-shrink: 0;
    position: fixed;
    top: 28px;
    right: 28px;
    z-index: 250;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px solid rgba(1, 7, 29, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
    justify-self: end;
    align-self: center;
    grid-column: 3;
    appearance: none;
    -webkit-appearance: none;
  }

  .nav__toggle span {
    width: 18px;
  }

  /* Menu mobile overlay */
  .nav__menu {
    position: fixed;
    inset: 0;
    height: 100dvh;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(12px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    transform: translateX(100%);
    transition: transform var(--transition-slow);
    z-index: 200;
    pointer-events: none;
  }

  .nav__menu.open {
    transform: translateX(0);
    pointer-events: auto;
  }

  .header.menu-open .nav__center {
    pointer-events: auto;
  }

  .nav__item {
    width: 100%;
    height: auto;
    justify-content: center;
  }

  .nav__divider {
    display: none;
  }

  .nav__link {
    font-size: 1.5rem;
    padding: 16px 32px;
    text-align: center;
    width: 100%;
  }

  /* Hero mobile */
  .hero {
    padding-top: 0;
    min-height: auto;
  }

  .hero__container {
    grid-template-columns: 1fr;
    text-align: center;
    min-height: unset;
    padding-top: 122px;
    padding-bottom: 34px;
    align-items: end;
  }

  .hero__content {
    order: 2;
    align-items: center;
    padding-bottom: 0;
  }

  .hero__image {
    order: 1;
    justify-content: center;
    align-items: center;
    width: 78px;
    height: 78px;
  }

  .hero__image img {
    width: 100%;
    height: 100%;
    max-width: none;
  }

  .hero__title {
    text-align: center;
    max-width: 14ch;
    margin-inline: auto;
    font-size: clamp(1.85rem, 8vw, 2.45rem);
    line-height: 1.12;
  }

  .hero__subtitle {
    text-align: center;
    max-width: 19.5em;
    margin-inline: auto;
  }

  .hero__actions {
    justify-content: center;
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  .hero__cta,
  .hero__actions .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  .impact-stats {
    padding-block: 38px;
    min-height: auto;
  }

  .impact-stats__grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .impact-stat {
    min-height: 116px;
    padding-block: 22px;
  }

  .featured-projects__grid {
    grid-template-columns: 1fr;
  }

  .featured-project-card__media {
    aspect-ratio: 16 / 9;
    height: auto;
  }

  .featured-project-card__body {
    padding: 24px 20px;
  }

  .featured-project-card__tag {
    margin-bottom: 16px;
    white-space: normal;
  }

  .featured-project-card__title {
    max-width: 100%;
    font-size: clamp(1.2rem, 5vw, 1.45rem);
  }

  .featured-project-card__desc {
    max-width: 100%;
    margin-bottom: 28px;
  }

  .home-testimonials__grid {
    grid-template-columns: 1fr;
  }

  .home-testimonial-card {
    padding: 24px 20px;
  }

  .home-about__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .home-about__media {
    max-width: 420px;
    justify-self: center;
  }

  .home-about__content .section-title {
    margin-bottom: 24px;
  }

  .home-about__content {
    justify-self: center;
  }

  .home-about__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .home-about__btn {
    width: 100%;
  }

  /* Principios e reflections */
  .principles__grid {
    grid-template-columns: 1fr;
  }

  .reflections__grid {
    grid-template-columns: 1fr;
  }

  .article-page {
    padding-block: 72px 64px;
  }

  .article__back {
    margin-bottom: 24px;
  }

  .article__header {
    margin-bottom: 28px;
  }

  .article__title {
    letter-spacing: -0.04em;
  }

  .article__cover {
    margin-bottom: 36px;
    border-radius: 18px;
  }

  .article__body {
    font-size: 1.03rem;
    line-height: 1.75;
  }

  .article__body blockquote {
    padding: 20px;
    font-size: 1.05rem;
  }

  .article__footer {
    margin-top: 48px;
  }

  .projects .page-intro {
    gap: 16px;
    margin-bottom: 40px;
  }

  .projects .section-title.section-title--home {
    max-width: 10ch;
    line-height: 1.1;
  }

  .projects .section-subtitle {
    max-width: 100%;
    font-size: 1rem;
    line-height: 1.55;
  }

  .project-card {
    gap: 0;
    border-radius: 20px;
    overflow: hidden;
  }

  .project-card__content {
    justify-content: flex-start;
    min-height: auto;
    padding: 24px 20px 18px;
  }

  .project-card__tag {
    margin-bottom: 12px;
    line-height: 1.35;
  }

  .project-card__title {
    line-height: 1.15;
    margin-bottom: 12px;
  }

  .project-card__desc,
  .project-card__result {
    max-width: 100%;
  }

  .project-card__result {
    margin-top: 10px;
    margin-bottom: 24px;
  }

  .project-card__desc + .project-card__btn-wrap {
    margin-top: 24px;
  }

  .project-card__btn-wrap {
    margin-bottom: 0;
  }

  .project-card__image {
    align-self: stretch;
  }

  .project-card__image img,
  .project-card--bit .project-card__image img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 0;
  }

  /* Section header */
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  /* CTA */
  .cta-section {
    padding-bottom: 78px;
  }

  .cta-card {
    padding-block: 58px;
  }

  .cta-card__contacts {
    flex-direction: column;
    gap: 16px;
  }

  /* Footer */
  .footer__container {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .hero__title {
    font-size: 1.75rem;
    max-width: 14ch;
  }

  .hero__break--desktop {
    display: none;
  }

  .hero__break--mobile {
    display: inline;
  }

  .impact-stat__value {
    font-size: 2rem;
  }

  .nav__toggle {
    width: 38px;
    height: 38px;
  }
}

