/* A single rhythm for the portrait, editorial headings and photo viewer. */
@media (prefers-reduced-motion: no-preference) {
  .hero-full .title-panel .micro { animation: portrait-copy .65s .06s both; }
  .hero-full h1 { animation: portrait-copy .75s .12s both; }
  .hero-full .bottom { animation: portrait-copy .75s .22s both; }
  @keyframes portrait-copy { from { opacity: .55; } to { opacity: 1; } }
  #menu[open] { animation: menu-open .25s cubic-bezier(.22,.7,.2,1); }
  @keyframes menu-open { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
  .gallery-dialog::backdrop { transition: background .34s ease; }
  .gallery-dialog { transition: background-color .34s ease, box-shadow .34s ease; }
  .gallery-dialog.photo-closing { background-color: transparent; box-shadow: none; }
  .gallery-dialog.photo-closing::backdrop { background: transparent; }
  .gallery-dialog.photo-closing > :not(.photo-flight) { opacity: 0; transition: opacity .12s ease; }
  .cta .arrow, .hero .cta span, .nav-links a { transition: transform .2s ease, opacity .2s ease; }
}
.gallery-dialog.photo-transition { overflow: visible; }
.photo-flight { filter: none !important; }
.gallery-gesture-hint { display: none; }
@media (max-width:767px), (max-width:1024px) and (pointer:coarse) {
  #gallery.gallery-dialog {
    position: fixed; inset: 0; width: 100%; max-width: none;
    height: 100vh; height: 100dvh; max-height: none; margin: 0;
    padding: max(8px, env(safe-area-inset-top)) 0 max(12px, env(safe-area-inset-bottom));
    box-sizing: border-box; border: 0; border-radius: 0; box-shadow: none;
    background: rgba(24,23,22,var(--gallery-shade,1)); overscroll-behavior: none;
  }
  #gallery[open] { display: grid; grid-template-rows: auto minmax(0,1fr) auto auto auto; }
  #gallery::backdrop { background: transparent; }
  #gallery .gallery-head { padding: 0 12px 8px 20px; font-size: 11px; letter-spacing: .09em; }
  #gallery .close { font-size: 24px; }
  #gallery-image { width: 100%; height: 100%; min-height: 0; object-fit: contain; touch-action: pinch-zoom; transform-origin: center; }
  #gallery-collection { display: none; }
  #gallery .gallery-controls { padding: 8px 14px 0; gap: 12px; }
  #gallery .gallery-controls button { border: 0; min-width: 44px; min-height: 44px; font-size: 20px; }
  #gallery-caption { font-size: 11px; line-height: 1.4; color: #d2cbc2; }
  #gallery .gallery-pick { margin: 0 auto; min-height: 40px; font-size: 12px; text-underline-offset: 4px; }
  #gallery .gallery-gesture-hint { display: block; margin: 0; padding: 4px 16px; text-align: center; font-size: 10px; line-height: 1.4; color: #a9a39a; }
  #gallery.gallery-swiping { transition: none; }
  #gallery.gallery-swiping > :not(#gallery-image):not(.photo-flight) { opacity: var(--gallery-controls-opacity,1); }
  #gallery.swipe-closing { background: transparent; transition: background-color .2s ease; }
  #gallery.swipe-closing > :not(#gallery-image):not(.photo-flight) { opacity: 0; }
  #gallery.photo-closing { background: transparent; }
  @media (orientation: landscape) and (max-height: 500px) {
    #gallery.gallery-dialog { padding-top: max(52px, env(safe-area-inset-top)); padding-bottom: max(48px, env(safe-area-inset-bottom)); }
    #gallery[open] { grid-template-rows: minmax(0,1fr); }
    #gallery .gallery-head { position: absolute; inset: 8px 0 auto; }
    #gallery .gallery-controls { position: absolute; inset: auto 0 0; padding-top: 0; }
    #gallery-caption, #gallery .gallery-gesture-hint { display: none; }
    #gallery[data-load-error] #gallery-caption { display: block; position: absolute; bottom: 48px; left: 12px; right: 12px; background: #181716; padding: 8px; }
    #gallery .gallery-pick { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); min-height: 44px; white-space: nowrap; }
  }
}
.carousel-track.is-dragging { scroll-snap-type: none; scroll-behavior: auto; cursor: grabbing; user-select: none; }
.carousel-track.is-dragging .photo-button { cursor: grabbing; }
.carousel-track img { -webkit-user-drag: none; user-select: none; }
@media (hover: hover) and (pointer: fine) {
  .carousel-track { cursor: grab; }
  .carousel-track .photo-button { cursor: inherit; }
  .hero .cta:hover span, .contact .cta:hover .arrow { transform: translate(2px, -2px); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-image { transform: none !important; }
}
