/* Experiência dedicada a celulares e dispositivos sensíveis ao toque */
@media (max-width: 780px) {
  :root {
    --mobile-gutter: 18px;
    --mobile-nav-bottom: max(14px, env(safe-area-inset-bottom));
    --mobile-nav-height: 78px;
  }

  html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-bottom: 125px;
  }

  body {
    min-width: 320px;
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
    -webkit-tap-highlight-color: transparent;
  }

  .app-shell,
  .page-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transform: none;
    contain: none;
  }

  .sidebar,
  .page-sidebar {
    position: fixed;
    z-index: 100;
    left: 12px;
    right: 12px;
    bottom: var(--mobile-nav-bottom);
    top: auto;
    width: auto;
    height: var(--mobile-nav-height);
    min-height: var(--mobile-nav-height);
    padding: 8px;
    border: 1px solid rgba(17, 17, 20, 0.17);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 15px 45px rgba(17, 17, 20, 0.2);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    overflow: visible;
  }

  .sidebar > .brand,
  .sidebar > .profile-card,
  .sidebar > .availability,
  .sidebar > footer,
  .page-sidebar > .brand,
  .page-sidebar > .profile-card,
  .page-sidebar > .availability {
    display: none;
  }

  .main-nav {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 8px;
  }

  .nav-item,
  .nav-item.active {
    width: 100%;
    min-width: 0;
    min-height: 60px;
    padding: 8px 12px;
    border-radius: 18px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    touch-action: manipulation;
  }

  .nav-item svg {
    flex: 0 0 auto;
    width: 25px;
    height: 25px;
    stroke-width: 2.2;
  }

  .nav-item span {
    flex: 0 1 auto;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
  }

  .content,
  .page-content {
    width: 100%;
    padding: 30px var(--mobile-gutter) 42px;
  }

  .topbar {
    position: relative;
    margin-bottom: 34px;
    gap: 20px;
  }

  .eyebrow {
    margin-bottom: 9px;
    font-size: 11px;
    letter-spacing: 1.7px;
  }

  .topbar h2 {
    max-width: 280px;
    font-size: clamp(24px, 7vw, 31px);
    line-height: 1.18;
    letter-spacing: -0.8px;
  }

  .top-actions {
    flex: 0 0 auto;
  }

  .top-actions .search {
    width: 54px;
    height: 54px;
    padding: 0;
    border-radius: 17px;
    justify-content: center;
    z-index: 12;
    cursor: pointer;
    transition: width .3s ease, box-shadow .3s ease, background .3s ease;
  }

  .top-actions .search.search-open {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 0 18px;
    justify-content: flex-start;
    background: rgba(255, 255, 255, 0.97);
    border-color: rgba(17, 17, 20, 0.32);
    box-shadow: 0 14px 35px rgba(17, 17, 20, 0.18);
    backdrop-filter: blur(18px);
  }

  .top-actions .search.search-open input {
    display: block;
    flex: 1;
    width: auto;
    min-width: 0;
    margin-left: 9px;
    font-size: 16px;
  }

  .search svg {
    width: 24px;
    height: 24px;
  }

  .sidebar,
  .page-sidebar {
    transform: translateZ(0);
    will-change: transform;
  }

  .feed-head {
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
  }

  .feed-head h3 {
    padding-top: 7px;
    font-size: 22px;
    line-height: 1.2;
  }

  .filters {
    flex: 1 1 auto;
    max-width: 68vw;
    padding: 4px;
    border-radius: 13px;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .filters button {
    min-height: 42px;
    padding: 8px 13px;
    font-size: 13px;
    font-weight: 700;
    touch-action: manipulation;
    scroll-snap-align: start;
  }

  .feed-pagination {
    min-height: 130px;
    padding-bottom: 25px;
  }

  .feed-pagination p {
    font-size: 15px;
  }

  .post-content-block {
    margin: 20px 0;
    border-radius: 19px;
  }

  .block-toolbar {
    min-height: 58px;
    padding: 0 13px;
  }

  .block-toolbar b {
    font-size: 12px;
  }

  .copy-code {
    min-width: 48px;
    min-height: 44px;
    justify-content: center;
  }

  .copy-code span {
    display: none;
  }

  .code-block pre {
    padding: 20px 17px;
  }

  .code-block code {
    font-size: 13px;
    line-height: 1.75;
  }

  .linked-image-block > a {
    height: clamp(260px, 78vw, 360px);
  }

  .post-content-block figcaption {
    min-height: 60px;
    padding: 13px 15px;
    font-size: 13px;
    line-height: 1.4;
  }

  .video-block video {
    min-height: 210px;
  }

  .feed {
    gap: 24px;
  }

  .post {
    padding: 21px;
    border-radius: 27px;
    box-shadow: 0 14px 38px rgba(17, 17, 20, 0.08);
  }

  .post-author > img {
    width: 54px;
    height: 54px;
    margin-right: 13px;
    border-radius: 17px;
  }

  .post-author b {
    font-size: 16px;
  }

  .post-author b svg {
    width: 18px;
    height: 18px;
  }

  .post-author span {
    margin-top: 4px;
    font-size: 13px;
  }

  .post > p {
    margin: 20px 1px;
    font-size: 16px;
    line-height: 1.65;
  }

  .post > p .hashtag {
    min-height: 34px;
    margin-top: 6px;
    padding: 7px 11px;
    font-size: 14px;
  }

  .post-gallery,
  .project-image,
  .code-gallery .project-image,
  .code-gallery .code-preview {
    height: clamp(300px, 88vw, 430px);
    border-radius: 20px;
  }

  .gallery-slide {
    height: 100%;
  }

  .project-image > span {
    top: 14px;
    left: 14px;
    padding: 8px 11px;
    font-size: 10px;
  }

  .project-image > div {
    left: 18px;
    right: 18px;
    bottom: 62px;
  }

  .project-image small {
    font-size: 10px;
  }

  .project-image b {
    font-size: clamp(22px, 6vw, 28px);
  }

  .gallery-arrow {
    top: 50%;
    width: 48px;
    height: 48px;
    margin-top: -24px;
    border-width: 1px;
    opacity: 1;
    transform: none;
    touch-action: manipulation;
  }

  .gallery-arrow svg {
    width: 25px;
    height: 25px;
  }

  .gallery-prev { left: 12px; }
  .gallery-next { right: 12px; }

  .gallery-footer {
    bottom: 14px;
    min-width: 145px;
    min-height: 40px;
    padding: 9px 14px;
  }

  .gallery-dots button {
    width: 8px;
    height: 8px;
  }

  .gallery-dots button.active {
    width: 24px;
  }

  .gallery-count {
    font-size: 12px;
  }

  .code-preview {
    padding: 28px 24px;
  }

  .code-copy h4 {
    font-size: clamp(25px, 7vw, 34px);
    margin-bottom: 22px;
  }

  .code-copy span,
  .code-copy a {
    font-size: 12px;
  }

  .orb {
    width: 105px;
    height: 105px;
  }

  .page-intro {
    margin-bottom: 38px;
  }

  .page-intro h1 {
    margin-bottom: 20px;
    font-size: clamp(38px, 11vw, 54px);
    line-height: 1.06;
    letter-spacing: -2px;
  }

  .page-intro > p {
    font-size: 18px;
    line-height: 1.65;
  }

  .about-grid,
  .contact-grid {
    gap: 20px;
  }

  .info-card,
  .contact-option {
    padding: 27px;
    border-radius: 25px;
  }

  .info-card h2 {
    font-size: 25px;
  }

  .info-card p {
    font-size: 16px;
  }

  .contact-option {
    min-height: 245px;
  }

  .contact-option > i {
    width: 62px;
    height: 62px;
  }

  .contact-option strong {
    overflow-wrap: anywhere;
    font-size: 20px;
  }

  .contact-note {
    padding: 24px;
  }

  .contact-note p,
  .contact-note span {
    font-size: 15px;
  }
}

@media (max-width: 390px) {
  :root { --mobile-gutter: 14px; }

  .sidebar,
  .page-sidebar {
    left: 8px;
    right: 8px;
  }

  .nav-item {
    padding-inline: 8px;
    gap: 7px;
  }

  .nav-item span {
    font-size: 14px;
  }

  .post {
    padding: 17px;
  }

  .post-gallery,
  .project-image,
  .code-gallery .project-image,
  .code-gallery .code-preview {
    height: 310px;
  }

  .feed-head {
    display: block;
  }

  .feed-head h3 {
    margin-bottom: 12px;
  }

  .filters {
    width: fit-content;
  }

  .orb {
    width: 82px;
    height: 82px;
  }
}

@media (hover: none) and (pointer: coarse) {
  button,
  a,
  input {
    touch-action: manipulation;
  }

  .gallery-arrow {
    opacity: 1;
    transform: none;
  }
}
