/* Progressive enhancement: without WebGL, every project remains readable. */
.hero--gallery { padding: 0; min-height: 0 !important; overflow: visible; }
.hero--gallery::before { display: none; }
.project-gallery__sticky { position: relative; padding-block: 2.25rem 1.5rem; overflow: clip; }
.hero--gallery .hero__inner { max-width: var(--container); }
.hero--gallery .hero__eyebrow { margin-bottom: 1rem; }
.hero--gallery .hero__title { font-size: clamp(2.4rem, 4.4vw, 4.1rem); margin-bottom: 1rem; }
.project-gallery__intro { max-width: 45ch; }
.hero--gallery .hero__lede { font-size: .95rem; margin-bottom: .75rem; }
.project-gallery__projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 2rem; margin-top: 2rem; }
.project-gallery__project { min-width: 0; }
.project-gallery__photo { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: contain; margin-bottom: 1rem; }
.project-gallery__index, .project-gallery__tags, .project-gallery__link {
    font: 11px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.project-gallery__index { color: var(--ink-soft); }
.project-gallery__title { font-size: clamp(1.15rem, 2vw, 1.8rem); line-height: 1.1; letter-spacing: -.035em; margin: .3rem 0; }
.project-gallery__subtitle { font-size: .8rem; color: var(--ink-soft); margin: .4rem 0 0; }
.project-gallery__tags { display: flex; flex-wrap: wrap; gap: .35rem .75rem; list-style: none; padding: 0; margin: 0 0 1rem; }
.project-gallery__tags li { border-bottom: 2px solid var(--accent); padding-bottom: .2rem; }
.project-gallery__description { font-size: .95rem; line-height: 1.6; margin: 0 0 1rem; white-space: pre-line; overflow-wrap: anywhere; }
.project-gallery__link { display: inline-flex; align-items: center; min-height: 44px; border-bottom: 1px solid var(--ink); }
.project-gallery__viewport { display: none; }
.project-gallery__status { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.hero--gallery.is-enhanced { height: var(--gallery-scroll-height, 100svh); background: #080C0B; }
.is-enhanced .project-gallery__sticky {
    --ink: #F0F4F8;
    --ink-soft: #A4B0AA;
    --line: #F0F4F81A;
    --line-strong: #F0F4F833;
    position: sticky;
    top: var(--gallery-header-height, 66px);
    height: calc(100svh - var(--gallery-header-height, 66px));
    min-height: 580px;
    padding: 2rem 0 0;
    color: var(--ink);
    background: radial-gradient(ellipse 80% 42% at 50% 100%, #A9B9B024, transparent 90%), radial-gradient(ellipse 65% 65% at 50% 85%, #37E4AF14, transparent 85%), #080C0B;
}
.is-enhanced .hero__eyebrow { color: var(--ink-soft); background: transparent; border-color: var(--line-strong); }
.is-enhanced .project-gallery__intro .btn { color: var(--ink); border-color: var(--line-strong); }
.is-enhanced .project-gallery__intro .btn:hover { color: #161412; background: var(--accent); }
.is-enhanced .hero__inner { display: grid; grid-template-columns: 1.2fr 1fr; column-gap: 8%; align-items: start; z-index: 2; pointer-events: none; }
.is-enhanced .hero__inner a { pointer-events: auto; }
.is-enhanced .hero__eyebrow { grid-column: 1 / -1; justify-self: start; margin-bottom: .9rem; font-size: .65rem; }
.is-enhanced .project-gallery__intro { justify-self: end; max-width: 37ch; }
.is-enhanced .project-gallery__intro .btn { min-height: 36px; padding: .55rem 1rem; font-size: .75rem; }
.is-enhanced .project-gallery__viewport { display: block; position: absolute; inset: 0; touch-action: pan-y; }
.project-gallery__viewport canvas { display: block; width: 100%; height: 100%; outline: none; }
.project-gallery__viewport canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: -8px; }
.is-enhanced .project-gallery__projects { display: block; position: static; margin-top: 0; }
.is-enhanced .project-gallery__project { display: none; }
.is-enhanced .project-gallery__project.is-selected { display: block; }
.is-enhanced .project-gallery__photo { display: none; }
.is-enhanced .project-gallery__caption { position: absolute; bottom: 1.5rem; left: var(--gutter); max-width: 55%; z-index: 2; pointer-events: none; }
.is-enhanced .project-gallery__title { font-size: clamp(1rem, 1.7vw, 1.45rem); }
.is-enhanced .project-gallery__subtitle { font-size: .7rem; }
.is-enhanced .project-gallery__specs {
    display: none;
    position: absolute;
    top: 30%;
    right: max(var(--gutter), calc((100% - var(--container)) / 2));
    width: 32%;
    max-height: 58%;
    z-index: 3;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: .5rem;
    scrollbar-width: thin;
}
.is-enhanced.is-flipped .project-gallery__project.is-selected .project-gallery__specs { display: block; animation: gallery-details-in .4s .2s both; }
.project-gallery__link:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.hero--gallery.is-reduced-motion { height: auto; }
.is-reduced-motion .project-gallery__sticky { position: relative; top: 0; }
@keyframes gallery-details-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 1440px) {
    .is-enhanced .project-gallery__caption { left: max(var(--gutter), calc((100% - var(--container)) / 2)); }
}
@media (max-width: 720px) {
    .project-gallery__sticky { padding-top: 1.5rem; }
    .is-enhanced .project-gallery__sticky { padding-top: 1.25rem; min-height: 600px; }
    .is-enhanced .hero__inner { display: block; }
    .hero--gallery .hero__title { font-size: clamp(2.2rem, 8.6vw, 3.6rem); margin-bottom: .65rem; }
    .is-enhanced .project-gallery__intro { max-width: 40ch; }
    .is-enhanced .hero__lede { font-size: .8rem; line-height: 1.4; margin-bottom: .5rem; }
    .is-enhanced .project-gallery__intro .btn { display: none; }
    .is-enhanced .project-gallery__caption { bottom: 1.25rem; max-width: calc(100% - 2 * var(--gutter)); }
    .is-enhanced .project-gallery__title { font-size: 1rem; }
    .is-enhanced .project-gallery__specs { top: 34%; width: 46%; max-height: 51%; right: var(--gutter); }
    .is-enhanced .project-gallery__description { font-size: .8rem; line-height: 1.45; }
    .project-gallery__tags { font-size: 10px; gap: .25rem .5rem; margin-bottom: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
    .hero--gallery *, .hero--gallery *::after { animation: none !important; transition: none !important; }
}
