:root { --row-h: 150px; --side-w: 18rem; }
@media (min-width: 768px) { :root { --row-h: 240px; } }
@media (min-width: 1280px) { :root { --row-h: 280px; } }

.brand { font-weight: 600; letter-spacing: -.01em; text-decoration: none; }
.brand-lg { display: block; font-size: 1.25rem; }
.tagline { margin-top: .25rem; font-size: .875rem; color: var(--muted); }

/* layout */
.shell { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; padding: 2.5rem 1.25rem; }
.wrap { max-width: 72rem; }
.wrap.narrow { max-width: 48rem; }
.page-title { font-size: 2.25rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.block { margin-top: 1.5rem; } .block-lg { margin-top: 2.5rem; }
.lead { font-size: 1.125rem; }
.crumbs { margin-bottom: 1rem; font-size: .875rem; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: .5rem; }
.crumbs a:hover { color: var(--fg); }

/* sidebar */
.sidebar { display: none; }
.sidebar nav { display: flex; flex-direction: column; min-height: 100%; }
.nav-list { margin-top: 2rem; }
.nav-list .nav-list { margin: 0 0 0 .9rem; }
.nav-list a { display: block; padding: .3rem 0; font-size: .95rem; color: var(--muted); text-decoration: none; transition: color .15s; }
.nav-list a:hover, .nav-list a[aria-current] { color: var(--fg); }
.nav-list a[aria-current] { font-weight: 500; }
.nav-list summary { display: flex; align-items: center; list-style: none; cursor: pointer; }
.nav-list summary::-webkit-details-marker { display: none; }
.nav-list summary a { flex: 1; }
.chev { width: 2rem; height: 2rem; display: grid; place-items: center; color: var(--muted); }
.chev::before { content: ""; width: 6px; height: 6px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .15s; }
details[open] > summary .chev::before { transform: rotate(135deg); }
.legal { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-top: auto; padding-top: 2rem; font-size: .875rem; }
.legal a { color: var(--muted); text-decoration: none; } .legal a:hover { color: var(--fg); }

/* mobile top bar + drawer */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; padding: .6rem 1.25rem; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-actions { display: flex; align-items: center; gap: .5rem; }
.menu-btn { background: none; border: 0; padding: .25rem .5rem; font-size: .875rem; }
body.nav-open { overflow: hidden; }
body.nav-open .sidebar { display: block; position: fixed; inset: 49px 0 0 0; z-index: 20; overflow-y: auto; padding: 1.25rem; background: var(--bg); }

/* desktop */
.toolbar { display: none; }
@media (min-width: 1024px) {
  .topbar { display: none; }
  .main { padding: 3.5rem 3rem; }
  .sidebar { display: block; position: sticky; top: 0; align-self: flex-start; width: var(--side-w); flex-shrink: 0; height: 100vh; overflow-y: auto; padding: 2rem; border-right: 1px solid var(--line); }
  html[data-sidebar="closed"] .sidebar { display: none; }
  .toolbar { position: fixed; top: 1rem; right: 1rem; z-index: 40; display: flex; gap: .5rem; }
  body.nav-open { overflow: auto; }
}

.icon-btn { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; color: var(--muted); background: color-mix(in srgb, var(--bg) 80%, transparent); border: 1px solid var(--line); border-radius: 4px; backdrop-filter: blur(6px); transition: color .15s; }
.icon-btn:hover { color: var(--fg); }
[data-theme="dark"] .i-moon, [data-theme="light"] .i-sun { display: none; }

/* gallery tiles */
.tiles { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { position: relative; display: flex; align-items: flex-end; aspect-ratio: 3 / 2; overflow: hidden; padding: 1.25rem; font-size: 1.125rem; font-weight: 500; text-decoration: none; background: var(--line); border: 1px solid var(--line); transition: border-color .15s; }
.tile:hover { border-color: var(--muted); }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background-size: cover; transition: transform .5s; }
.tile:hover img { transform: scale(1.03); }
.tile span { position: relative; }
.tile.has-cover { color: #fff; border: 0; }
.tile.has-cover::after { content: ""; position: absolute; inset: 40% 0 0; background: linear-gradient(to top, rgba(0,0,0,.7), transparent); }
.tile.has-cover span { z-index: 1; }

/* justified photo rows (pure CSS, no layout shift) */
.justified { display: flex; flex-wrap: wrap; gap: 8px; }
.justified::after { content: ""; flex-grow: 1000000; }
.justified li { position: relative; }
.justified button { position: absolute; inset: 0; display: block; width: 100%; padding: 0; overflow: hidden; background: var(--line); border: 0; }
.justified img { width: 100%; height: 100%; object-fit: cover; background-size: cover; }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; color: #fff; background: rgba(0,0,0,.95); outline: none; }
body.lb-open { overflow: hidden; }
.lb-bar { display: flex; align-items: center; justify-content: space-between; padding: .75rem; }
.lb-count { padding: 0 .5rem; font-size: .875rem; color: rgba(255,255,255,.7); }
.lb-btn { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; color: #fff; background: rgba(255,255,255,.1); border: 0; border-radius: 50%; }
.lb-btn:hover { background: rgba(255,255,255,.2); }
.lb-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 0 .75rem; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; background-size: cover; cursor: zoom-in; transition: transform .2s; }
.lb-stage img.zoomed { cursor: zoom-out; transform: scale(2.2); }
.lb-prev, .lb-next { position: absolute; top: 50%; z-index: 2; margin-top: -1.375rem; display: none; }
.lb-prev { left: .75rem; } .lb-next { right: .75rem; }
@media (min-width: 640px) { .lb-prev, .lb-next { display: grid; } .lb-stage { padding: 0 4rem; } }
.lb-cap { min-height: 4rem; padding: 1rem 1.25rem; text-align: center; font-size: .875rem; }
.lb-cap b { display: block; font-weight: 500; }
.lb-cap p { max-width: 70ch; margin: .25rem auto 0; color: rgba(255,255,255,.7); }
.lb-cap small { display: block; margin-top: .25rem; font-size: .75rem; color: rgba(255,255,255,.45); }
