/* Shared mobile navigation, preserving the published typeface. */
@media (max-width: 620px) {
  .mobile-navigation-links {
    position: absolute;
    grid-area: auto;
    top: 50%;
    right: var(--gutter);
    left: var(--gutter);
    gap: clamp(10px, 3vw, 20px);
    padding-top: 0;
    transform: translateY(-50%);
  }

  .mobile-navigation-links a {
    font-family: "Avenir Next", "Gill Sans", "Helvetica Neue", sans-serif;
    font-size: clamp(42px, 13vw, 72px);
    font-weight: 400;
    line-height: 0.98;
    letter-spacing: 0;
  }

  .site-header .brand {
    font-family: "Avenir Next", "Gill Sans", "Helvetica Neue", sans-serif;
    font-weight: 400;
    text-transform: lowercase;
    letter-spacing: 0.025em;
  }

  .mobile-navigation-play {
    appearance: none;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-self: start;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    color: inherit;
    font-family: "Avenir Next", "Gill Sans", "Helvetica Neue", sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0.15em;
    text-transform: lowercase;
  }

  .mobile-navigation-play span {
    display: inline-block;
    transform-origin: 50% 80%;
  }

  .mobile-navigation-play:focus-visible {
    outline: none;
    text-decoration: underline;
    text-underline-offset: 5px;
  }

  .nav-toggle path { stroke-width: 1.1; }
  .nav-toggle:focus-visible path { stroke-width: 1.6; }

}

.pop-close svg { display: none; }

/* Touch handling for the mobile artwork viewers. */
@media (max-width: 980px) {
  .image-pop,
  .aira-dialog { touch-action: pan-y pinch-zoom; }
}

@media (max-width: 980px) {
  .illustration-page .image-pop { background: var(--paper); backdrop-filter: none; }
  .image-pop .pop-nav { display: none; }
  .image-pop .pop-close,
  .image-pop .pop-close:hover {
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #73716c;
    transform: none;
  }
  .pop-close-desktop { display: none; }
  .pop-close svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.25; }
  .image-pop .pop-stage { padding-bottom: 44px; }
  .image-pop .pop-media-frame { overflow: hidden; touch-action: none; }
  .image-pop .pop-image, .image-pop .pop-video { max-width: 100%; max-height: min(70svh, 620px); object-fit: contain; }
  .image-pop .pop-image { box-shadow: none; user-select: none; -webkit-user-drag: none; }
  .image-pop .pop-media-frame.is-zoomed .pop-image { cursor: grab; }
  .image-pop .pop-media-frame.is-zoomed:active .pop-image { cursor: grabbing; }
}

/* The mobile header mark stays still; desktop keeps its letter hover. */
@media (max-width: 980px) {
  .site-header .brand:hover span,
  .site-header .brand:active span { animation: none; transform: none; }
  .site-header .brand { transition: transform 180ms ease-out, color 160ms ease; }
  .site-header .brand:active { transform: none; }
}
@media (max-width: 980px) and (prefers-reduced-motion: reduce) {
  .site-header .brand { transition: none; }
  .site-header .brand:active { transform: none; }
}
