:root {
  --bg: #fbfbf9;
  --ink: #1b1b1a;
  --muted: #9b9a95;
  --line: #e7e5e0;
  --side: 310px;
  --hand: "Architects Daughter", "Bradley Hand", cursive;
  --sans: "Inter", system-ui, -apple-system, "Helvetica Neue", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 13px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; letter-spacing: inherit; text-transform: inherit; }
p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hand { font-family: var(--hand); text-transform: uppercase; letter-spacing: .3em; }
.muted { color: var(--muted); }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

/* top bar: name on the left, sections across the right */
.side {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 30px 40px 32px; max-width: 1800px; margin: 0 auto;
}
.mark { display: block; width: 480px; max-width: 100%; flex: none; }
.mark img { width: 100%; height: auto; }
.menu-btn { display: none; }
.nav { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 8px 32px; font-size: 12.5px; }
.nav ul { list-style: none; margin: 0; padding: 0; display: contents; }   /* every link sits in one tidy row */
.nav li { margin: 0; }
.nav a { color: var(--muted); transition: color .2s; white-space: nowrap; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }

.main { padding: 0 40px 96px; max-width: 1800px; margin: 0 auto; min-height: 70vh; }

/* home: selected work */
.row { display: flex; gap: 40px; margin-bottom: 72px; align-items: flex-start; }
.sel { flex: var(--ar) 1 0; min-width: 0; margin: 0; }
.row.one { justify-content: center; }
.row.one .sel { flex: none; width: min(100%, calc((100vh - 120px) * var(--ar))); }   /* as big as fits on one screen */
.sel img { width: 100%; transition: opacity .3s; }
.sel .tile:hover img { opacity: .9; }
.sel figcaption { margin-top: 9px; font-size: 12px; color: var(--muted); }
.sel .tile { cursor: zoom-in; }

/* theme pages: justified collage */
.collage { display: flex; flex-wrap: wrap; gap: 14px; }
.collage::after { content: ""; flex-grow: 999; }        /* keeps the last row from stretching */
.collage .tile { flex: var(--ar) 1 calc(var(--ar) * 300px); min-width: 0; }
.collage img { width: 100%; height: 100%; object-fit: cover; transition: opacity .25s; }
.tile { cursor: zoom-in; display: block; }
.tile:hover img { opacity: .88; }

/* full-screen viewer */
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--bg); color: var(--ink); }
.lightbox::backdrop { background: var(--bg); }
.lightbox:focus { outline: none; }
.lightbox[open] { display: grid; place-items: center; animation: fade .25s ease; }
html:has(.lightbox[open]) { overflow: hidden; }
.lightbox img { max-width: calc(100vw - 96px); max-height: calc(100dvh - 120px); width: auto; height: auto; object-fit: contain; cursor: e-resize; }
.lb-cap { position: absolute; left: 32px; bottom: 26px; font-size: 12px; color: var(--muted); }
.lb-nav { position: absolute; right: 32px; bottom: 24px; font-size: 11.5px; letter-spacing: .22em; color: var(--muted); }
.lb-close { position: absolute; top: 24px; right: 32px; font-size: 11.5px; letter-spacing: .22em; color: var(--muted); }
.lightbox button:hover { color: var(--ink); }

/* about */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 72px; align-items: start; }
.about-text { max-width: 30em; padding-top: 4px; }
.about-text p { font-size: 15px; line-height: 1.7; margin-bottom: 1.1em; }
.about dl { display: grid; grid-template-columns: 110px 1fr; gap: 10px 12px; margin: 40px 0 0; font-size: 13px; }
.about dt { font-size: 11px; letter-spacing: .22em; color: var(--muted); padding-top: 2px; }
.about dd { margin: 0; }
.about dd a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.about dd a:hover { text-decoration-color: currentColor; }
.portrait { margin: 0; }
.portrait img { max-height: calc(100vh - 170px); width: auto; }

/* back to top */
.to-top { text-align: center; margin: 64px 0 0; font-size: 11.5px; letter-spacing: .24em; }
.to-top a { color: var(--muted); transition: color .2s; }
.to-top a:hover { color: var(--ink); }

@keyframes fade { from { opacity: 0; } }

/* phones and small tablets: sidebar becomes a top bar with a menu */
@media (max-width: 899px) {
  .side { position: sticky; top: 0; z-index: 10; padding: 16px; background: var(--bg); flex-direction: row; justify-content: space-between; }
  .mark { width: 240px; margin-left: 0; }
  .menu-btn { display: block; font-size: 12px; letter-spacing: .25em; }
  .nav { display: none; margin: 0; }
  .side.open .nav { display: block; position: fixed; inset: 56px 0 0 0; background: var(--bg); padding: 28px 16px; overflow: auto; font-size: 15px; }
  .side.open .nav ul { display: block; margin-bottom: 26px; }
  .nav li { margin-bottom: 14px; }
  .main { padding: 8px 16px 72px; }
  .row { flex-direction: column; gap: 48px; margin-bottom: 48px; }
  .sel, .row.one .sel { flex: none; width: 100%; }
  .collage { gap: 8px; }
  .collage .tile { flex-basis: calc(var(--ar) * 150px); }
  .lightbox img { max-width: 100vw; max-height: calc(100dvh - 140px); }
  .lb-cap { left: 16px; bottom: 56px; }
  .lb-nav { left: 16px; right: auto; bottom: 22px; }
  .lb-close { right: 16px; top: 16px; }
  .about { grid-template-columns: 1fr; gap: 32px; }
  .portrait { order: -1; }
  .portrait img { max-height: 70vh; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }
