:root {
  --bg: #ffffff;
  --band: #f4f4f4;
  --ink: #2f3542;
  --muted: #6b7280;
  --rule: #e5e7eb;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  --gutter: 16px;
  --max: 1200px;
  color-scheme: light;
}

* { box-sizing: border-box; }

/* Keep the scrollbar's space so the justified rows do not shift when it appears. */
html { scrollbar-gutter: stable; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 300;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

/* Masthead: the grey band with the name on the left and the nav on the right. */
.masthead { background: var(--band); }
.masthead-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px var(--gutter);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.brand { text-decoration: none; display: flex; flex-direction: column; }
.brand-name {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.15;
}
.brand-role { color: var(--muted); font-size: 1rem; }
.nav { display: flex; gap: 22px; font-size: 0.9rem; letter-spacing: 0.04em; }
.nav a { text-decoration: none; color: var(--muted); padding-bottom: 2px; }
.nav a:hover, .nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom: 1px solid currentColor;
}

main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px var(--gutter);
}

/* Portfolio: justified rows, laid out by site.js. */
.gallery { display: flex; flex-direction: column; gap: 28px; }
.gallery-row { display: flex; gap: 28px; }
.tile {
  display: block;
  padding: 0;
  border: 0;
  background: var(--band);
  box-shadow: var(--shadow);
  cursor: zoom-in;
  overflow: hidden;
  flex: none;
}
.tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.tile:hover img, .tile:focus-visible img { transform: scale(1.02); }
.tile:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.empty { color: var(--muted); text-align: center; padding: 80px 0; }

/* Lightbox */
.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(255, 255, 255, 0.97);
  color: var(--ink);
}
.lightbox[open] {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
}
.lightbox::backdrop { background: transparent; }
.lb-figure {
  margin: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
  min-width: 0;
}
.lb-img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  object-fit: contain;
  box-shadow: var(--shadow);
}
.lb-caption { margin-top: 16px; text-align: center; max-width: 60ch; font-size: 0.95rem; }
.lb-title { display: block; font-weight: 500; }
.lb-text { color: var(--muted); }
.lightbox button {
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: 2.6rem;
  line-height: 1;
  cursor: pointer;
  height: 100%;
}
.lightbox button:hover { color: var(--ink); }
.lb-close { position: absolute; top: 12px; right: 16px; height: auto !important; z-index: 1; }

/* About */
.about-intro {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 56px;
  align-items: center;
}
.portrait { width: 100%; max-width: 380px; box-shadow: var(--shadow); justify-self: end; }
.bio p { margin: 0 0 1em; max-width: 55ch; }
.about-intro:not(:has(.portrait:not([hidden]))) { grid-template-columns: 1fr; }
.sections {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 40px 56px;
}
.section h2 {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 8px;
  margin: 0 0 16px;
}
.entry { margin-bottom: 18px; }
.entry-title { font-weight: 500; }
.entry-sub, .entry-detail { color: var(--muted); font-size: 0.92rem; }

/* Footer */
.footer {
  border-top: 1px solid var(--rule);
  padding: 28px var(--gutter);
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}
.links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 28px; margin-bottom: 8px; }
.links a { text-decoration: none; letter-spacing: 0.04em; }
.links a:hover { color: var(--ink); text-decoration: underline; }
.copyright { margin: 0; }

@media (max-width: 700px) {
  main { padding-top: 28px; }
  .about-intro { grid-template-columns: 1fr; gap: 28px; }
  .portrait { justify-self: center; }
  .lightbox[open] { grid-template-columns: 36px 1fr 36px; }
}
