body:has(.gallery-page) { background: #080807; overflow: hidden; }
.gallery-page { --gallery-pad: clamp(.875rem, .434rem + 1.23vw, 2.429rem); position: fixed; inset: 0; width: 100%; height: 100%; background: #080807; color: #fcfcfc; overflow: hidden; }
.gallery-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.gallery-canvas { position: absolute; inset: 0; overflow: hidden; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; outline-offset: -5px; }
.gallery-canvas:focus-visible { outline: 1px solid #fcfcfc80; }
.gallery-canvas.is-pressed, .gallery-canvas.is-pressed .gallery-tile { cursor: grabbing; }
.gallery-scale { position: absolute; inset: 0; transform-origin: 50% 50%; transition: transform 1s cubic-bezier(.16,1,.35,1); will-change: transform; }
.gallery-canvas.is-pressed .gallery-scale { transform: scale(.9); transition-duration: 1.2s; }
.gallery-board { position: absolute; width: 300vw; height: 210vw; left: 50%; top: 50%; transform: translate(-50%,-50%); will-change: transform; }
.gallery-canvas.is-initialized .gallery-board { left: 0; top: 0; }
.gallery-tile { position: absolute; display: block; width: var(--tile-width); left: var(--tile-left); top: var(--tile-top); aspect-ratio: var(--tile-ratio); padding: 0; margin: 0; border: 0; color: inherit; cursor: grab; outline-offset: 7px; -webkit-user-drag: none; -webkit-touch-callout: none; touch-action: none; }
.gallery-tile:focus-visible { outline: 2px solid #fcfcfc; }
.gallery-tile img { display: block; width: 100%; max-width: none; height: auto; pointer-events: none; -webkit-user-drag: none; filter: var(--image-treatment, grayscale(0) invert(0)); }
.gallery-tile--drawing { --image-treatment: grayscale(1) invert(1); mix-blend-mode: screen; }
.gallery-tile__fallback { display: none; position: absolute; inset: 0; padding: 16px; background: #252523; border: 1px solid #fcfcfc66; font-size: 14px; line-height: 1.3; flex-direction: column; justify-content: center; gap: 12px; }
.gallery-tile__fallback small { font-size: 11px; }
.gallery-tile.has-image-error { mix-blend-mode: normal; }
.gallery-tile.has-image-error img { visibility: hidden; }
.gallery-tile.has-image-error .gallery-tile__fallback { display: flex; }
/* A usable image grid remains if JavaScript or a browser API is unavailable. */
.gallery-canvas:not(.is-initialized) { overflow: auto; touch-action: pan-y; }
.gallery-canvas:not(.is-initialized) .gallery-scale { position: relative; height: auto; will-change: auto; }
.gallery-canvas:not(.is-initialized) .gallery-board { position: relative; left: 0; top: 0; width: 100%; height: auto; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 24px; padding: 110px var(--gallery-pad) 90px; transform: none; will-change: auto; }
.gallery-canvas:not(.is-initialized) .gallery-tile { position: relative; left: auto; top: auto; width: 100%; touch-action: pan-y; }
.gallery-canvas.is-compact .gallery-scale { transform: none; transition: none; will-change: auto; }
.gallery-canvas.is-compact .gallery-tile--drawing { --image-treatment: none; mix-blend-mode: normal; }
.gallery-canvas.is-initialized.is-compact .gallery-tile img { animation: none; }
.gallery-canvas.is-initialized .gallery-tile img { animation: gallery-image-enter 1.2s cubic-bezier(.16,1,.35,1) both; animation-delay: var(--reveal-delay); }
@keyframes gallery-image-enter { from { filter: blur(5px) var(--image-treatment, grayscale(0) invert(0)); transform: scale(.9); } to { filter: blur(0) var(--image-treatment, grayscale(0) invert(0)); transform: scale(1); } }
.gallery-description { position: fixed; left: var(--gallery-pad); bottom: var(--gallery-pad); z-index: 3; max-width: 34ch; pointer-events: none; mix-blend-mode: difference; }
.gallery-description p { margin: 0; color: #fcfcfc; font-size: 14px; font-weight: 500; line-height: 1.2; letter-spacing: -.01em; text-wrap: pretty; }
.gallery-description .gallery-touch-hint { display: none; margin-top: 8px; }
.gallery-hint { position: fixed; bottom: var(--gallery-pad); right: var(--gallery-pad); z-index: 3; width: 250px; padding: 8px 8px 12px; background: #fcfcfc; color: #080807; border-radius: 4px; pointer-events: none; transition: opacity .6s cubic-bezier(.7,0,.22,1), filter .6s cubic-bezier(.7,0,.22,1), visibility .6s; }
.gallery-hint.is-dismissed { opacity: 0; filter: blur(40px); visibility: hidden; }
.gallery-hint p { margin: 9px 0 0; text-align: center; font-size: 10px; font-weight: 600; line-height: 1.2; text-transform: uppercase; }
.gallery-hint__demo { position: relative; height: 120px; background: #111110; border-radius: 2px; overflow: hidden; }
.gallery-hint__demo::before,.gallery-hint__demo::after { content: ''; position: absolute; background-position: center; background-size: cover; animation: gallery-hint-pan 4s cubic-bezier(.53,.23,.25,1) infinite alternate; }
.gallery-hint__demo::before { width: 148px; height: 94px; left: 24px; top: 22px; background-image: url('/assets/elm-page-16.jpg'); }
.gallery-hint__demo::after { width: 72px; height: 50px; left: 190px; top: 50px; background-image: url('/assets/dorest-exterior.png'); }
.gallery-hint__cross { position: absolute; z-index: 1; left: 50%; top: 50%; color: #fff; background: #080807; border: 1px solid #fcfcfc60; border-radius: 50%; width: 26px; height: 26px; text-align: center; font-size: 18px; line-height: 24px; }
@keyframes gallery-hint-pan { to { translate: -52px -14px; } }
.gallery-viewer { position: fixed; inset: 0; width: 100%; max-width: 100%; height: 100%; height: 100dvh; max-height: 100dvh; padding: max(var(--gallery-pad),env(safe-area-inset-top)) max(var(--gallery-pad),env(safe-area-inset-right)) max(var(--gallery-pad),env(safe-area-inset-bottom)) max(var(--gallery-pad),env(safe-area-inset-left)); margin: 0; border: 0; color: #fcfcfc; background: #080807; overflow: hidden; }
.gallery-viewer[open] { display: grid; grid-template-rows: auto minmax(0,1fr) auto; gap: 16px; }
.gallery-viewer::backdrop { background: #080807; }
.gallery-viewer__top,.gallery-viewer__bottom { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex: 0 0 auto; }
.gallery-viewer__top p,.gallery-viewer__bottom a { margin: 0; max-width: 70ch; color: inherit; font-size: 12px; line-height: 1.3; text-transform: uppercase; }
.gallery-viewer__bottom a { text-decoration: none; }
.gallery-viewer__bottom a:hover { text-decoration: underline; text-underline-offset: 4px; }
.gallery-viewer button { padding: 10px 0; min-width: 44px; min-height: 44px; background: transparent; color: inherit; border: 0; font: inherit; cursor: pointer; }
.gallery-viewer__close { display: flex; align-items: center; gap: 20px; text-transform: uppercase; font-size: 12px!important; white-space: nowrap; }
.gallery-viewer__close span { font-size: 24px; line-height: 1; }
.gallery-viewer__image { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; width: 100%; height: 100%; max-width: 1280px; margin: 0 auto; overflow: hidden; }
.gallery-viewer__image img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.gallery-viewer__status { position: absolute; max-width: 28ch; text-align: center; font-size: 14px; line-height: 1.5; }
.gallery-viewer__status[hidden] { display: none; }
.gallery-viewer.is-loading .gallery-viewer__image img,.gallery-viewer.has-image-error .gallery-viewer__image img { visibility: hidden; }
.gallery-viewer__navigation { display: flex; align-items: center; gap: 18px; }
.gallery-viewer__navigation button { font-size: 23px; }
.gallery-viewer__navigation span { min-width: 55px; text-align: center; font-size: 12px; white-space: nowrap; }
@media (max-width: 767px) { .gallery-hint { display: none; } .gallery-description { max-width: 32ch; bottom: max(var(--gallery-pad),env(safe-area-inset-bottom)); } .gallery-description p { font-size: 12px; } .gallery-description .gallery-touch-hint { display: block; } .gallery-canvas:not(.is-initialized) .gallery-board { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; } }
@media (max-width: 600px) { .gallery-viewer__top { gap: 10px; align-items: flex-start; } .gallery-viewer__top p { padding-top: 13px; max-width: 29ch; font-size: 11px; } .gallery-viewer__bottom { gap: 12px; align-items: end; } .gallery-viewer__bottom a { max-width: 22ch; font-size: 11px; overflow-wrap: anywhere; } .gallery-viewer__navigation { gap: 3px; flex-shrink: 0; } }
@media (prefers-reduced-motion: reduce) { .gallery-scale,.gallery-hint { transition: none; } .gallery-canvas.is-pressed .gallery-scale { transform: none; } .gallery-canvas.is-initialized .gallery-tile img,.gallery-hint__demo::before,.gallery-hint__demo::after { animation: none; } }
