
@media (pointer: coarse) {
  /* Disable heavy animations on touch devices */
  :is(.hero-title, .s-title, .contact-headline) .tl span {
    animation-duration: 0.5s;
  }


  * {
    -webkit-tap-highlight-color: transparent;
  }

  button, a, [role="button"] {
    -webkit-touch-callout: none;
  }
}


@media (min-width: 901px) {
  #hero {
    margin-top: -10rem;
    margin-bottom: 4rem;
  }
}

/* Optimize animations for mobile and lower-end devices */
@media (max-width: 900px) {
  @media (prefers-reduced-motion: no-preference) {
    * { animation-duration: 0.8s !important; }
  }
}

@media (max-width: 900px) {
  :root {
    --pad-x: 24px;
  }

  nav { padding: 18px var(--pad-x); }
  nav.scrolled { top: 12px; left: 16px; right: 16px; padding: 12px 20px; }

  #hero {
    padding: 0 var(--pad-x) 0;
    justify-content: center;
  }

  .hero-eyebrow {
    margin-bottom: 12px;
  }

  .hero-title {
    margin-bottom: 32px;
    text-align: left;
  }

  .hero-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-right {
    align-items: flex-start;
  }

  .skills-logoloop-wrap {
    padding: 4px 0;
    margin-top: -130px;
  }

  .nav-links { display: none; }

  #work,
  #about,
  #contact {
    padding: 80px var(--pad-x);
  }

  .s-header { margin-bottom: 40px; }

  .pcard-inner {
    grid-template-columns: 1fr;
  }

  .pcard-vis {
    height: 260px;
    order: -1;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
    margin-top: 48px;
  }

  .contact-footer {
    flex-direction: column;
    gap: 24px;
    align-items: flex-start;
  }

  #showcase {
    padding-left: var(--pad-x);
  }

  .showcase-header {
    padding: 40px var(--pad-x) 0;
  }

  .showcase-inner {
    padding: 32px var(--pad-x) 40px 0;
  }

  .sc-card {
    flex: 0 0 250px;
    height: 320px;
  }

  /* Mobile-friendly touch targets */
  button, a[role="button"], .p-arrow {
    min-height: 44px;
    min-width: 44px;
  }

  @media (prefers-reduced-motion: reduce) {
    * {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }

  img {
    max-width: 100%;
    height: auto;
  }

  .hero-title {
    line-height: 1.05;
  }

  .pcard-img, .pcard-img-overlay {
    will-change: auto;
    backface-visibility: hidden;
  }
}

@media (max-width: 480px) {
  .hero-title { font-size: 11vw; }
  .s-title    { font-size: 14vw; }
  .pname      { font-size: 7vw; }
  .pcard-info { padding: 28px 24px; }
  .contact-headline { font-size: 14vw; }
  .cf-right { flex-wrap: wrap; gap: 14px; }
}
