.mobile-nav {
  display: none;
}

@media (max-width: 768px), (max-height: 500px) and (max-width: 950px) {
  body {
    padding-bottom: calc(4.2rem + env(safe-area-inset-bottom, 0px));
  }

  body.dialog-open {
    padding-bottom: 0;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    min-height: calc(3.8rem + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
  }

  .topbar__nav {
    display: none;
  }

  .topbar__meta {
    display: block;
    justify-self: end;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
  }

  .mobile-nav {
    position: fixed;
    z-index: 80;
    right: 0.75rem;
    bottom: max(0.6rem, env(safe-area-inset-bottom, 0px));
    left: 0.75rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.25rem;
    min-height: 3.5rem;
    padding: 0.28rem;
    border: 1px solid var(--line-strong);
    background: rgba(251, 247, 239, 0.94);
    box-shadow: 0 12px 32px rgba(18, 16, 13, 0.16);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }

  body.dialog-open .mobile-nav {
    display: none;
  }

  .mobile-nav a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.42rem;
    min-width: 0;
    min-height: 2.95rem;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    touch-action: manipulation;
  }

  .mobile-nav a::after {
    position: absolute;
    right: 0.4rem;
    bottom: 0.16rem;
    left: 0.4rem;
    height: 1px;
    background: transparent;
    content: "";
  }

  .mobile-nav a[aria-current="location"] {
    color: var(--ink);
  }

  .mobile-nav a[aria-current="location"]::after {
    background: var(--orange);
  }

  .mobile-nav svg {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
  }

  .hero__contact {
    max-width: none;
    margin-top: 1rem;
    padding-top: 0;
    border-top: 0;
  }

  .hero__contact-label {
    margin-bottom: 0.45rem;
    font-size: 0.72rem;
  }

  .hero__contact-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .hero__contact-row > * {
    min-height: 3.2rem;
    padding: 0.5rem 0.62rem;
    border: 1px solid var(--line);
    background: rgba(251, 247, 239, 0.52);
  }

  .hero__contact-row a {
    font-size: 0.75rem;
    letter-spacing: -0.01em;
    transition:
      color 160ms var(--ease),
      background-color 160ms var(--ease);
    touch-action: manipulation;
  }

  .hero__contact-row a:active {
    color: var(--orange-ink);
    background: var(--paper-deep);
  }

  .catalogue-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    border: 0;
  }

  .catalogue__item,
  .catalogue__item:first-child {
    grid-template-columns: 3.35rem minmax(0, 1fr) auto;
    gap: 0.9rem;
    align-items: center;
    align-content: center;
    min-height: 5.6rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line-strong);
  }

  .catalogue__number {
    font-size: 2.55rem;
  }

  .catalogue__copy {
    align-content: center;
  }

  .catalogue__copy strong {
    font-size: 1.2rem;
  }

  .catalogue__arrow {
    position: static;
    width: 1.1rem;
  }

  .project-row__strip {
    grid-auto-columns: minmax(17.5rem, 80vw);
    gap: 0.9rem;
    padding: 0 var(--gutter) 0.55rem 0;
    overscroll-behavior-inline: contain;
    scroll-padding-inline: 0 var(--gutter);
    scrollbar-width: none;
  }

  .project-row__strip::-webkit-scrollbar {
    display: none;
  }

  .project-row__item {
    border-color: var(--line-strong);
    box-shadow: 0 8px 22px rgba(18, 16, 13, 0.08);
    touch-action: manipulation;
  }

  .project-row__caption {
    min-height: 5.25rem;
    padding: 0.8rem 0.86rem 0.9rem;
  }

  .project-row__caption-title {
    font-size: 0.98rem;
  }

  .project-dialog {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    border: 0;
  }

  .project-dialog__shell {
    border: 0;
  }

  .project-dialog__header {
    padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
  }

  .project-dialog__viewer {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
  }

  .project-dialog__media {
    height: auto;
    min-height: 0;
  }

  .project-dialog__media:not(.is-long) .project-dialog__stage {
    align-items: center;
    justify-content: center;
    padding: 0.55rem;
  }

  .project-dialog__media:not(.is-long):not(.is-tall) img {
    max-height: 100%;
  }

  .project-dialog__media:not(.is-long):not(.is-tall)
    .project-dialog__stage {
    touch-action: none;
  }

  .project-dialog__media.is-long .project-dialog__stage,
  .project-dialog__media.is-tall .project-dialog__stage {
    touch-action: auto;
  }

  .project-dialog__viewer-aside {
    max-height: 14.5rem;
    gap: 0.45rem;
    padding: 0.8rem 1rem
      calc(0.75rem + env(safe-area-inset-bottom, 0px));
    overflow: auto;
    border-top: 1px solid var(--line-strong);
    border-left: 0;
  }

  .project-dialog__viewer-aside h3 {
    font-size: 1.15rem;
  }

  .project-dialog__group {
    font-size: 0.76rem;
  }

  .project-dialog__description {
    max-height: 4.5em;
    overflow: auto;
    font-size: 0.82rem;
    line-height: 1.5;
  }

  .project-dialog__nav {
    gap: 0.55rem;
    margin-top: 0.1rem;
    padding-top: 0.65rem;
  }

  .project-dialog__nav .dialog-nav-button {
    min-height: 2.9rem;
    touch-action: manipulation;
  }

  .project-dialog__hint {
    font-size: 0.75rem;
    text-align: center;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .mobile-nav {
    background: var(--paper-light);
    backdrop-filter: none;
  }
}
