.mobile-menu-toggle {
  display: none;
}

@media screen and (max-width: 760px),
       screen and (max-width: 960px) and (max-height: 480px) and (pointer: coarse) {
  body {
    font-size: 16px;
    overflow-wrap: anywhere;
  }

  :is(img, video, iframe, embed, object) {
    max-width: 100%;
  }

  :is(a[href], button) {
    box-sizing: border-box;
    min-width: 44px;
    min-height: 44px;
  }

  :where(header, footer, .cvbar, .contact, .chips, .not-found, #rv3) a:not(.glass) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
  }

  :is(figcaption, .supporting-copy, footer a, .project h2) {
    font-size: 16px !important;
  }

  .portfolio :is(header, section, footer) {
    padding-inline: 16px !important;
  }

  .project section {
    padding-bottom: 48px !important;
  }

  .project header + section {
    padding-top: 32px !important;
  }

  .project header .glass {
    border-radius: 28px !important;
    gap: 4px !important;
    padding: 4px 12px !important;
  }

  .project header a {
    padding: 8px 4px !important;
  }

  .project footer > span {
    flex-wrap: wrap;
  }

  :is(.project-panel, .project section > a.glass, #ai-card, #contact > .glass) {
    padding: 24px 20px !important;
  }

  :is(.kgrid, .krow, .physgrid, .aigrid) > * {
    min-width: 0;
  }

  .project .lmrow {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    padding: 16px !important;
  }

  .ep-marquee {
    margin-inline: -16px !important;
  }

  .ep-track > .glass {
    box-sizing: border-box;
    width: min(280px, calc(100vw - 40px)) !important;
  }

  .site-header {
    padding-block: 8px !important;
  }

  .site-header:not([data-visible]) {
    transform: none;
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
  }

  .site-header > .glass {
    position: relative;
    flex-wrap: nowrap !important;
    padding: 4px 6px 4px 16px !important;
  }

  .site-header .site-name {
    justify-content: flex-start;
    text-align: left;
  }

  .mobile-menu-toggle:not([hidden]) {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: none;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: #1C1B22;
    color: #fff;
    font: inherit;
    font-size: 16px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-menu-toggle:active {
    background: #4A4853;
  }

  .site-header nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(100%, 260px);
    box-sizing: border-box;
    max-height: calc(100vh - 80px);
    max-height: calc(100dvh - 80px);
    overflow-y: auto;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 24px;
    background: #FAF7F6;
    box-shadow: 0 16px 40px rgba(60, 40, 80, .14);
  }

  .site-header .mobile-menu-toggle[aria-expanded="false"] + nav {
    display: none !important;
  }

  .site-header nav a {
    width: 100%;
    justify-content: flex-start;
  }

  .site-header nav a:last-child {
    justify-content: center;
  }

  .site-header :focus-visible {
    outline: 2px solid #853C65;
    outline-offset: 2px;
  }

  #top {
    min-height: min(620px, 100vh) !important;
    min-height: min(620px, 100svh) !important;
    padding-block: 104px 56px !important;
  }

  #top h1 {
    font-size: clamp(36px, 7.5vw, 56px) !important;
  }

  #top nav {
    display: none !important;
  }

  #rv3 a {
    padding-inline: 4px;
  }

  #rv5 {
    width: 100% !important;
    overflow: visible !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }

  .qmarquee {
    animation: none;
    display: grid !important;
    gap: 16px;
    width: auto !important;
    padding: 0 !important;
  }

  .qmarquee > div {
    width: auto !important;
    padding: 0 !important;
  }

  .qmarquee > [aria-hidden="true"] {
    display: none;
  }

  .qmarquee figure {
    padding: 20px !important;
  }

  #work {
    padding-block: 40px 64px !important;
    scroll-margin-top: 72px;
  }

  #ai-card {
    scroll-margin-top: 72px !important;
  }

  .work-card-copy {
    padding-inline: 4px !important;
  }

  .work-card-copy > span {
    text-align: left !important;
  }

  .mercado-thumbnail {
    left: 48% !important;
    max-width: 50%;
    object-fit: contain;
  }

  .resume :is(.role, .contact, .chips a, h2, .job h4, .job p, .wins li, aside li, .edu h4, .edu p, .cvbar a) {
    font-size: 16px;
  }

  .resume .cvbar {
    gap: 8px;
    flex-wrap: wrap;
    margin: 12px 0;
    padding-inline: 16px;
  }

  .resume .contact {
    align-items: center;
  }

  .resume main {
    grid-template-columns: minmax(0, 1fr);
  }

  .not-found {
    padding-inline: 16px;
  }
}
