/* Projects only. Natural image proportions, progressively enhanced masonry. */
.projects-page { max-width: 82rem; padding-top: 8rem; padding-bottom: 4rem; }
.projects-breadcrumb { margin-bottom: 1.7rem; color: var(--color-muted); font-size: .8rem; }
.projects-breadcrumb ol { display: flex; gap: .65rem; }
.projects-breadcrumb li + li::before { content: "/"; margin-right: .65rem; color: #a09a90; }
.projects-breadcrumb a:hover { text-decoration: underline; text-underline-offset: .2em; }
.projects-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; padding-bottom: 1.8rem; margin-bottom: 1.8rem; border-bottom: 1px solid var(--color-border); }
.projects-intro h1 { font-size: clamp(2.2rem, 3.4vw, 3rem); line-height: 1.1; }
.projects-intro__count { margin: .65rem 0 0; color: var(--color-muted); font-size: .78rem; }
.projects-intro__copy { max-width: 30rem; font-size: .92rem; line-height: 1.65; }
.projects-intro__copy p { margin-bottom: .7rem; }
.projects-intro__copy .text-link { font-size: .8rem; }
.projects-fragment { display: block; height: 0; scroll-margin-top: 8rem; }
.projects-grid { --project-columns: 3; --project-gap: 1.35rem; display: grid; grid-template-columns: repeat(var(--project-columns), minmax(0, 1fr)); gap: var(--project-gap); align-items: start; }
.projects-grid > li { min-width: 0; }
.projects-grid.is-masonry { grid-auto-rows: 1px; row-gap: 0; }
.projects-grid.is-masonry > li { padding-bottom: var(--project-gap); }
.project-card { -webkit-tap-highlight-color: transparent; position: relative; display: block; overflow: hidden; aspect-ratio: var(--photo-ratio); background: var(--color-stone); }
.project-card > img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms cubic-bezier(.2,.65,.3,1); }
.project-card__overlay { display: flex; position: absolute; inset: 0; justify-content: space-between; align-items: flex-end; padding: 1.3rem; background: linear-gradient(180deg, rgba(14,17,15,.06), rgba(14,17,15,.42)); color: #fff; font-size: .8rem; letter-spacing: .025em; opacity: 0; transition: opacity 350ms ease; pointer-events: none; }
.project-card__overlay > :last-child { font-size: 1.25rem; line-height: 1; }
.project-card:focus-visible { outline: 2px solid var(--color-text); outline-offset: 4px; }
.project-card:focus-visible > img { transform: scale(1.055) rotate(1deg); }
.project-card:focus-visible .project-card__overlay { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
    .project-card:hover > img { transform: scale(1.055) rotate(1deg); }
    .project-card:hover .project-card__overlay { opacity: 1; }
}
@media (hover: none), (pointer: coarse) {
    .project-card__overlay { opacity: 1; padding: .85rem 1rem; background: linear-gradient(180deg, transparent 65%, rgba(14,17,15,.55)); font-size: .72rem; }
}
/* Native dialog provides a modal top layer and makes the page behind it inert. */
body.project-lightbox-open { overflow: hidden; }
.project-lightbox { position: fixed; inset: 0; width: 100%; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: 1.3rem 2rem; border: 0; background: #121512; color: #f7f4ed; overflow: hidden; }
.project-lightbox:not([open]), .project-lightbox [hidden] { display: none !important; }
.project-lightbox[open] { display: flex; flex-direction: column; }
.project-lightbox::backdrop { background: rgba(10,12,10,.95); }
.project-lightbox__header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-shrink: 0; }
.project-lightbox__header h2 { font: 400 1.5rem/1.2 var(--font-display); letter-spacing: -.02em; }
.project-lightbox__button { -webkit-tap-highlight-color: transparent; display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; padding: .7rem; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; background: transparent; color: #fff; cursor: pointer; flex-shrink: 0; }
.project-lightbox__button:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.project-lightbox__button:focus-visible, .project-lightbox a:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.project-lightbox__button svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.4; }
.project-lightbox__stage { position: relative; display: flex; justify-content: center; align-items: center; flex: 1; min-height: 0; margin: 1rem 0; touch-action: pan-y pinch-zoom; }
.project-lightbox__stage > img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; }
.project-lightbox__loading, .project-lightbox__error { position: absolute; max-width: 25rem; padding: 1rem; margin: 0; text-align: center; font-size: .85rem; background: #121512; }
.project-lightbox__error a { text-decoration: underline; text-underline-offset: .2em; }
.project-lightbox__footer { width: min(100%, 42rem); margin-inline: auto; flex-shrink: 0; }
.project-lightbox__controls { display: grid; grid-template-columns: 2.75rem 1fr 2.75rem; align-items: center; gap: 1rem; }
.project-lightbox__controls p { margin: 0; text-align: center; font-size: .8rem; font-variant-numeric: tabular-nums; letter-spacing: .05em; }
.project-lightbox__caption { min-height: 2.6em; margin: .8rem 0 0; font-size: .78rem; line-height: 1.5; text-align: center; color: #c7ccc5; }
@media (max-width: 64rem) {
    .projects-grid { --project-columns: 2; }
    .projects-intro__copy { max-width: 25rem; }
}
@media (max-width: 48rem) {
    .projects-page { padding-top: 6.15rem; padding-bottom: 2.5rem; }
    .projects-breadcrumb { margin-bottom: 1.25rem; font-size: .75rem; }
    .projects-intro { align-items: flex-start; flex-direction: column; gap: 1rem; padding-bottom: 1.25rem; margin-bottom: 1.25rem; }
    .projects-intro h1 { font-size: 2.25rem; }
    .projects-intro__copy { max-width: 32rem; font-size: .88rem; }
    .projects-intro__count { margin-top: .45rem; }
    .projects-grid { --project-gap: 1rem; }
    .project-lightbox { padding: max(.75rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(.75rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); }
    .project-lightbox__header h2 { font-size: 1.3rem; }
    .project-lightbox__caption { font-size: .75rem; }
}
@media (max-width: 32rem) {
    .projects-grid { --project-columns: 1; }
}
@media (max-height: 30rem) and (orientation: landscape) {
    .project-lightbox { padding-block: .5rem; }
    .project-lightbox__stage { margin-block: .5rem; }
    .project-lightbox__caption { min-height: 0; margin-top: .3rem; font-size: .7rem; }
}
@media (prefers-reduced-motion: reduce) {
    .project-card > img, .project-card__overlay { transition: none; }
    .project-card:hover > img, .project-card:focus-visible > img { transform: none; }
}
