/* ONLYDROP v91 — shared navigation + a true mobile-first category index.
   Do not revive the legacy mobile MENU bar or the hidden desktop .nav. */

/* Navigation lives outside all view panels so it remains visible on every route. */
html body .portfolio-navigation {
  position: fixed !important;
  top: clamp(16px, 2.4vh, 28px) !important;
  right: clamp(16px, 2.6vw, 44px) !important;
  bottom: auto !important;
  left: auto !important;
  z-index: 8500 !important;
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  width: max-content;
  max-width: calc(100vw - 32px);
  pointer-events: auto;
}
html body .portfolio-navigation a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 15px;
  flex: 0 0 auto;
  background: rgba(12,18,22,.95);
  color: #e8ece8;
  border: 1px solid rgba(194,215,213,.42);
  border-left: 3px solid rgba(210,255,74,.55);
  box-shadow: 3px 3px 0 rgba(0,0,0,.65);
  font: 700 10px/1.1 'IBM Plex Mono', monospace;
  letter-spacing: .12em;
  text-decoration: none;
  transform: skewX(-7deg);
  transition: color .2s, background .2s, border-color .2s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
html body .portfolio-navigation a:hover,
html body .portfolio-navigation a.active,
html body .portfolio-navigation a[aria-current="page"] {
  color: #101618;
  background: #d2ff4a;
  border-color: #d2ff4a;
}
html body .portfolio-navigation a:focus-visible {
  outline: 2px solid #f8f6ed;
  outline-offset: 4px;
}

/* Removing the header also removes its legacy 62px mobile viewport reservation. */
html body .views {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100dvh !important;
  min-height: 100svh;
  flex: none !important;
}

/* Tablets: preserve two columns but provide genuinely large preview windows. */
@media (min-width: 701px) and (max-width: 900px) {
  html body #views #home {
    height: 100% !important;
    max-height: none !important;
    overflow-y: auto !important;
  }
  html body #views #home .index-screen {
    height: auto !important;
    max-height: none !important;
    min-height: 100dvh !important;
    overflow: visible !important;
    justify-content: flex-start !important;
    padding-bottom: 50px !important;
  }
  html body #views #home .category-menu {
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    grid-template-rows: auto !important;
    overflow: visible !important;
    flex: 0 0 auto !important;
    align-items: start !important;
    gap: 22px 16px !important;
  }
  html body #views #home .category-card {
    height: auto !important;
    grid-column: auto !important;
    grid-row: auto !important;
    margin: 0 !important;
  }
  html body #views #home .category-card:last-child {
    grid-column: 1 / -1 !important;
  }
  html body #views #home .category-visual {
    flex: 0 0 auto !important;
    height: clamp(220px,29vw,300px) !important;
    min-height: 0 !important;
    max-height: none !important;
  }
}

/* Phones: a single editorial column; showcase the artwork, not tiny thumbnails. */
@media (max-width: 700px) {
  html body .portfolio-navigation {
    top: auto !important;
    right: auto !important;
    left: 50% !important;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    transform: translateX(-50%);
    width: min(420px, calc(100vw - 24px));
    max-width: none;
    justify-content: center;
    gap: 6px;
    padding: 0;
  }
  html body .portfolio-navigation a {
    flex: 1 1 0;
    min-width: 0;
    min-height: 46px;
    padding: 12px 7px;
    font-size: clamp(9px, 2.6vw, 11px);
    letter-spacing: .06em;
    transform: none;
    box-shadow: 2px 3px 0 rgba(0,0,0,.75);
  }

  /* The FX control moves to the top to leave the bottom navigation unobstructed. */
  html body #motionToggle {
    inset: calc(12px + env(safe-area-inset-top, 0px))
           max(12px, env(safe-area-inset-right, 0px))
           auto auto !important;
    min-height: 38px !important;
    padding: 7px 9px !important;
    font-size: 9px !important;
  }
  html body #motionToggle .motion-toggle-label {
    font-size: 9px !important;
  }

  html body #views #home.view-panel {
    height: 100% !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  html body #views #home .index-screen {
    height: auto !important;
    max-height: none !important;
    min-height: 100dvh !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    gap: 16px !important;
    padding: calc(16px + env(safe-area-inset-top, 0px)) 5vw
             calc(106px + env(safe-area-inset-bottom, 0px)) !important;
  }
  html body #views #home .index-intro {
    flex: 0 0 auto !important;
    margin: 0 !important;
    min-height: 0 !important;
  }
  html body #views #home .category-menu {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) !important;
    grid-template-rows: none !important;
    grid-auto-rows: auto !important;
    gap: clamp(18px, 4.7vw, 26px) !important;
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    align-items: stretch !important;
    transform: none !important;
  }
  html body #views #home .category-menu > a.category-card:nth-child(n) {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    width: 100% !important;
    min-height: 0 !important;
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    margin: 0 !important;
    rotate: 0deg !important;
    transform: none !important;
  }
  html body #views #home .category-menu > a.category-card .category-visual {
    flex: 0 0 auto !important;
    width: 100% !important;
    height: clamp(224px, 62vw, 345px) !important;
    min-height: 0 !important;
    max-height: none !important;
    border-width: 1px !important;
  }
  html body #views #home .category-menu > a.category-card .category-info {
    min-height: 0 !important;
    margin-top: 5px !important;
    padding: 9px 6px !important;
  }
  html body #views #home .category-info p {
    font-size: clamp(9px, 2.3vw, 11px) !important;
    letter-spacing: .075em !important;
  }
  html body #views #home .category-info .category-arrow {
    font-size: 21px;
  }
  html body #views #home .category-title {
    min-height: 0 !important;
  }
  html body #views #home .index-footer {
    padding-bottom: 9px;
  }
  /* Keep lower content reachable behind the always-visible navigation. */
  html body #views #work .work-section,
  html body #views #about .about-section,
  html body #views #contact .contact-section {
    padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)) !important;
  }
  html body #views #contact .contact-back {
    bottom: calc(95px + env(safe-area-inset-bottom, 0px)) !important;
  }
}
