.gallery [hidden] { display: none !important; }
.gallery .project-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 2rem 1.4rem; }
.gallery .project-visual { aspect-ratio: 4/3; background: #161b24; }
.gallery .project-visual > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.project-open { display: block; width: 100%; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: left; cursor: zoom-in; }
.gallery .project-info h3 { white-space: normal; padding-right: 0; font-size: clamp(1.4rem,2.3vw,2.5rem); }
.gallery .project-info > span { font-size: .8125rem; line-height: 1.6; }
.project-open:hover img { transform: scale(1.035); }
.project-open:focus-visible { outline-offset: 7px; border-radius: 8px; }
.project-zoom { position: absolute; z-index: 2; right: 1rem; bottom: 1rem; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #090c12b3; border: 1px solid #ffffff55; color: #fff; font-size: 1.3rem; transition: background .2s,color .2s; }
.project-open:hover .project-zoom { background: var(--accent); color: #090c12; }
.project-filters { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 2rem; }
.project-filters button { padding: .7rem 1rem; border: 1px solid var(--line); border-radius: 24px; background: #111620; color: var(--muted); font-size: .9375rem; cursor: pointer; transition: background .2s,color .2s,border-color .2s; }
.project-filters button:hover { border-color: #d9ff7277; color: var(--ink); }
.project-filters button[aria-pressed="true"] { background: var(--accent); color: #090c12; border-color: var(--accent); font-weight: 700; }
.gallery .project-card:not([hidden]) { animation: gallery-in .35s ease both; }
.project-detail { margin-top: .2rem; }
body.dialog-open { overflow: hidden; }
.project-dialog { width: min(1120px,calc(100% - 32px)); max-width: none; max-height: calc(100svh - 32px); padding: 0; border: 1px solid #39404d; border-radius: 12px; color: var(--ink); background: #0e131b; overflow: auto; box-shadow: 0 25px 90px #0008; }
.project-dialog::backdrop { background: #03060be6; backdrop-filter: blur(10px); }
.dialog-shell { padding: clamp(1rem,2.5vw,2rem); }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.dialog-heading h2 { font-size: clamp(1.4rem,2.3vw,2.4rem); line-height: 1.15; letter-spacing: -.04em; margin: .5rem 0 0; font-weight: 600; }
.dialog-close, .dialog-prev, .dialog-next { display: grid; place-items: center; flex-shrink: 0; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: #151d29; color: var(--ink); cursor: pointer; font-size: 1.2rem; }
.dialog-close { font-size: 1.7rem; }
.dialog-close:hover, .dialog-prev:hover, .dialog-next:hover { background: var(--accent); color: #090c12; }
.dialog-figure { margin: 0; min-height: 120px; background: #07090e; border-radius: 6px; overflow: hidden; display: grid; place-items: center; }
.dialog-figure img { display: block; width: 100%; max-height: 61svh; object-fit: contain; }
.dialog-figure p { padding: 2rem; color: var(--muted); }
.dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.dialog-description { font-size: 1.125rem; color: var(--muted); line-height: 1.75; margin: 0; max-width: 680px; }
.dialog-navigation { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }
.dialog-index { min-width: 3rem; text-align: center; color: var(--muted); font-family: var(--mono); font-size: .64rem; }
@keyframes gallery-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
body[data-motion="paused"] .gallery .project-card { animation: none; }
@media (max-width: 780px) {
  .gallery .project-grid { grid-template-columns: 1fr; gap: 1.7rem; }
  .project-filters { gap: .5rem; }.project-filters button { font-size: .875rem; padding: .65rem .85rem; }
  .gallery .project-info h3 { font-size: 1.65rem; }
  .dialog-footer { display: block; }.dialog-navigation { justify-content: center; margin-top: 1rem; }
  .dialog-figure img { max-height: 55svh; }.dialog-heading h2 { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) { .gallery .project-card { animation: none !important; }.gallery * { transition: none !important; } }

