    @media(prefers-reduced-motion:reduce) {
      html {
        scroll-behavior: auto;
      }

      .ct-glow {
        animation: none !important;
      }

      #immersive-canvas {
        display: none !important;
      }

      .hero-eyebrow::before {
        animation: none !important;
      }

      .scroll-cue .line::after {
        animation: none !important;
      }

      .ct-wrap.ct-play {
        animation: none !important;
      }

      *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
      }

      .reveal,
      .reveal.active,
      .sl-l,
      .sl-r,
      .stg {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
      }

      .sec.sec-visible::after {
        transform: scaleX(1) !important;
      }
    }

    @media(max-width:800px) {
      nav {
        padding: 16px 20px;
      }

      nav.scrolled {
        padding: 12px 20px;
      }

      .nav-links {
        display: none;
      }

      .ham {
        display: flex;
      }

      .hero {
        padding: 90px 20px 90px;
      }

      .hero-eyebrow {
        gap: 8px;
        --eb-line-h: 1.55em;
        font-size: .56rem;
        letter-spacing: .12em;
      }

      .scroll-cue {
        left: 20px;
      }

      .sec {
        padding: 72px 20px;
      }

      .inn {
        max-width: 100%;
      }

      .ab-grid {
        grid-template-columns: 1fr;
        gap: 44px;
      }

      .stats {
        grid-template-columns: 1fr;
        gap: 16px;
      }

      .sk-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
      }

      .exp-hd {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 12px;
      }

      .exp-per {
        align-self: flex-start;
      }

      .ct-links {
        gap: 8px;
      }

      .cl {
        padding: 10px 16px;
        font-size: .74rem;
      }

      footer {
        padding: 24px 20px;
        flex-direction: column;
        gap: 14px;
        text-align: center;
        align-items: center;
        justify-content: center;
      }

      .footer-brand,
      .footer-meta {
        justify-content: center;
      }

      #btt {
        width: 28px;
        height: 28px;
        font-size: .7rem;
      }

      .p-info {
        padding: 32px 24px;
      }

      .p-title-large {
        font-size: clamp(1.6rem, 7.5vw, 2.2rem);
      }

      .p-desc-large {
        max-width: 100%;
      }
    }


/* A consistent reading rhythm between mobile sections and anchor targets. */
@media (max-width: 640px) {
  body.portfolio-home main section.sec { padding-block: 44px 48px !important; }
  body.portfolio-home main section.sec:is(#about, #education, #certificates, #contact) { padding-block: 44px 48px !important; }
  body.portfolio-home footer { gap: 10px; padding-block: 20px; }
  #btt { width: 44px; height: 44px; font-size: 1rem; }
}

@media (max-width: 800px) {
  body.portfolio-home main section.sec[id] { scroll-margin-top: 24px !important; }
}
