/* Bruce Walter portfolio. The photographs carry the colour; the interface stays quiet. */
@import url('https://fonts.googleapis.com/css2?family=Newsreader:opsz,wght@6..72,400;6..72,500&display=swap');

:root {
  --paper: #f5f5f3;
  --ink: #1b1b1a;
  --muted: #6e6e68;
  --line: #dcdcd6;
  --panel: #101010;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --gap: 14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: baseline;
  gap: 28px;
  padding: 18px 30px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-right: auto;
}

.nav-links { display: flex; align-items: baseline; gap: 22px; flex-wrap: wrap; }

.site-nav a, .nav-top {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 4px 0;
  cursor: pointer;
  font-family: var(--sans);
  transition: color 0.18s ease;
}

.site-nav a:hover, .nav-top:hover, .site-nav a.active { color: var(--ink); }
.site-nav a.active { border-bottom: 1px solid var(--ink); }

.nav-group { position: relative; }

.nav-sub {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 190px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.nav-group:hover .nav-sub,
.nav-group:focus-within .nav-sub {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-sub a { white-space: nowrap; }

.menu-toggle { display: none; }

/* ---------- main ---------- */
main { padding: 46px 30px 70px; max-width: 1500px; margin: 0 auto; }

.gallery-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 4px 0 34px;
}

/* masonry grid keeps mixed portrait / landscape tidy */
.grid { columns: 4 260px; column-gap: var(--gap); }

.tile {
  display: block;
  margin: 0 0 var(--gap);
  break-inside: avoid;
  background: #e7e7e2;
  overflow: hidden;
  cursor: zoom-in;
}

.tile img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.5s ease, transform 0.6s ease;
}

.tile:hover img { transform: scale(1.02); }

/* ---------- text pages ---------- */
.prose { max-width: 640px; font-size: 16px; }
.prose p { margin: 0 0 1em; }
.prose h2 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 1.4em 0 0.4em; }
.page-img { max-width: 360px; width: 100%; height: auto; float: right; margin: 0 0 20px 28px; }
main h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 5vw, 48px); margin: 4px 0 26px; }
.note { color: var(--muted); font-size: 13px; }

/* ---------- footer ---------- */
.site-footer {
  padding: 40px 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
}

/* ---------- lightbox ---------- */
.lb {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--panel);
}
.lb.open { display: flex; }
.lb img {
  max-width: 94vw;
  max-height: 90vh;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lb-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  color: #fff;
  font-size: 40px;
  line-height: 1;
  padding: 20px;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.15s ease;
  font-family: var(--serif);
}
.lb-btn:hover { opacity: 1; }
.lb-prev { left: 6px; }
.lb-next { right: 6px; }
.lb-close { top: 14px; right: 18px; transform: none; font-size: 30px; }
.lb-count {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  opacity: 0.6;
  font-size: 12px;
  letter-spacing: 0.12em;
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .site-nav { flex-wrap: wrap; gap: 14px; padding: 14px 18px; }
  .menu-toggle {
    display: block;
    margin-left: auto;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 11.5px;
  }
  .nav-links {
    flex-basis: 100%;
    flex-direction: column;
    gap: 14px;
    display: none;
    padding-top: 10px;
  }
  body.nav-open .nav-links { display: flex; }
  .nav-sub {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    border: 0;
    padding: 8px 0 0 14px;
    min-width: 0;
  }
  main { padding: 30px 18px 50px; }
  .grid { columns: 2 150px; }
  .page-img { float: none; margin: 0 0 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .tile:hover img { transform: none; }
}

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.lb :focus-visible { outline-color: #fff; }
