@media(min-width:901px) and (max-height:760px) {
  .hero-main {
    bottom: 6vh;
  }

  .hero-bottom {
    margin-top: 25px;
  }

  .accordion {
    margin-top: 20px;
  }


  .service-inner p {
    padding-bottom: 18px;
  }

  .tags {
    padding-bottom: 18px;
  }

  .services-bottom {
    padding-top: 16px;
  }

  .gallery-item {
    flex-basis: clamp(180px,min(10.94vw,32svh),280px);
    width: clamp(180px,min(10.94vw,32svh),280px);
  }
}

@media(pointer:fine) and (prefers-reduced-motion:no-preference) {
  body.custom-cursor:not(.dialog-open),body.custom-cursor:not(.dialog-open) a,body.custom-cursor:not(.dialog-open) button {
    cursor: none;
  }
}

@media(min-width:901px) and (max-width:1100px) {
  .service-inner {
    gap: 4vw;
  }

  .service-inner p {
    padding-left: 40px;
  }

  .service-head {
    grid-template-columns: 25px minmax(0,1fr) 24px;
  }
}

@media(max-width:900px) {
  :root {
    --gutter: clamp(18px,4vw,32px);
    --title-mobile: clamp(20px,calc((100vw - 2 * var(--gutter)) / 12.8),28px);
    --title-section: var(--title-mobile);
  }

  .viewport {
    position: relative;
    overflow: visible;
  }

  .track {
    display: block;
    height: auto;
    transform: none;
  }

  .panel {
    height: auto;
    min-height: 100svh;
    width: 100%;
    overflow: visible;
  }

  .hero {
    display: flex;
    flex-direction: column;
    padding: clamp(110px,22svh,220px) var(--gutter) var(--panel-bottom);
    overflow: hidden;
  }

  .header {
    position: absolute;
  }

  .hero-main {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
  }

  .hero h1 {
    font-size: var(--title-mobile);
  }

  .hero-bottom {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-top: 28px;
  }

  .hero-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .hero-summary p {
    width: 100%;
    max-width: none;
  }

  .hero-summary p br,
  .experience br {
    display: none;
  }

  .experience {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid color-mix(in srgb,var(--accent) 12%,transparent);
  }

  .scroll-link {
    margin-top: auto;
    padding-top: 40px;
    justify-content: space-between;
  }

  .hero-third-content {
    font-size: 1em;
  }

  .opening-path {
    stroke-width: 1.5;
  }

  .hero-oval img {
    width: 1.2em;
  }

  .intro-complete .hero-oval {
    width: 1.2em;
    margin-right: .13em;
  }

  .services {
    padding: var(--panel-top) var(--gutter) var(--panel-bottom);
    min-height: 0;
  }

  .services-top h2 {
    white-space: normal;
  }

  .accordion {
    margin-top: 30px;
  }

  .gallery-count {
    display: none;
  }

  .service-head {
    grid-template-columns: 22px minmax(0,1fr) 18px;
    gap: 12px;
  }

  .service-name {
    font-size: 1.375rem;
  }

  .active .service-name {
    transform: translateX(5px);
  }

  .service-inner {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .service-inner p {
    padding: 4px 0 22px 34px;
    max-width: none;
  }

  .tags {
    padding: 0 0 25px 34px;
    gap: 6px;
  }

  .tags span {
    padding: 6px 9px;
  }

  .services-bottom {
    margin-top: 48px;
    align-items: stretch;
    flex-direction: column;
    gap: 24px;
  }

  .services-bottom p {
    max-width: 38ch;
  }

  .gallery {
    padding: var(--panel-top) var(--gutter) var(--panel-bottom);
    min-height: 0;
    overflow: hidden;
  }

  .gallery-heading {
    gap: 18px;
    align-items: start;
  }

  .gallery-heading p {
    line-height: 1.5;
  }

  .gallery-window {
    flex: none;
    overflow: auto;
    padding-bottom: 35px;
  }

  .gallery-track {
    gap: 20px;
    transform: none;
  }

  .gallery-item {
    width: clamp(200px,42vw,280px);
    flex-basis: clamp(200px,42vw,280px);
  }

  .progress,.cursor {
    display: none;
  }

  .gallery-dialog .close-dialog {
    top: 20px;
  }

}

/* Short desktop viewports keep all expanded service content reachable. */
@media(min-width:901px) and (max-height:650px) {
  .services {
    overflow-y: auto;
  }
  .services-top,
  .accordion,
  .services-bottom {
    flex-shrink: 0;
  }
}

@media(max-width:760px) {
  .opening-mark {
    gap: 12px;
    width: calc(100vw - 24px);
  }

  .opening-left {
    width: 36vw;
  }

  .opening-right {
    width: 42vw;
  }

  .opening-dot {
    width: 3vw;
    height: 3vw;
  }
}

@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    animation-duration: .01ms;
    animation-delay: 0s;
    transition-duration: .01ms;
  }

  .cursor,.progress,.opening-intro {
    display: none;
  }

  .reveal>span,
  .gallery-track {
    transform: none;
  }

  .hero-bottom {
    opacity: 1;
  }

  .viewport {
    position: relative;
    overflow: visible;
  }

  .track {
    display: block;
    height: auto;
  }

  .panel {
    height: auto;
    min-height: 100svh;
  }

  .intro-complete .header,.scroll-wheel {
    animation: none;
  }

  .hero-oval,.intro-complete .hero-oval {
    transform: none;
    transition: none;
  }

  .hero-oval img,.intro-complete .hero-oval img {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .gallery-window {
    flex: none;
    overflow: auto;
    padding-bottom: 50px;
  }
}
