/* Layout: name and email up top, then the photographs in a masonry grid on a dark ground. */
:root {
  --ink: #0b0e14;
  --ink-rgb: 11 14 20;
  --line: #262c39;
  --fog: #8e96a8;
  --paper: #eee8dc;
  --accent: #f4a63d;
  --display: "Anybody", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --pad-l: max(clamp(16px, 3vw, 40px), env(safe-area-inset-left, 0px));
  --pad-r: max(clamp(16px, 3vw, 40px), env(safe-area-inset-right, 0px));
  --gap: clamp(8px, 1.2vw, 16px);
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--ink); -webkit-text-size-adjust: 100%; }
html.lb-open { overflow: hidden; }
body {
  margin: 0; background: var(--ink); color: var(--paper);
  font-family: var(--body); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-left: var(--pad-l); padding-right: var(--pad-r);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.top {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 32px;
  padding-top: calc(clamp(28px, 5vw, 64px) + env(safe-area-inset-top, 0px));
  padding-bottom: clamp(24px, 4vw, 48px);
}
.name {
  margin: 0;
  font-family: var(--display); font-weight: 700;
  font-variation-settings: "wdth" 100, "wght" 700;
  font-size: clamp(34px, 5.2vw, 72px); line-height: .95; letter-spacing: -.01em;
}
.sub { margin: 10px 0 0; color: var(--fog); }
.bio { margin: 18px 0 0; max-width: 56ch; color: var(--paper); font-size: clamp(15px, .3vw + 14px, 17px); line-height: 1.6; text-wrap: pretty; }
.mail { color: var(--fog); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; transition: color .3s, border-color .3s; overflow-wrap: anywhere; }
.mail:hover, .mail:focus-visible { color: var(--paper); border-color: var(--paper); }

.gallery { columns: 2; column-gap: var(--gap); }
@media (min-width: 1000px) { .gallery { columns: 3; } }
/* With the script: real columns, each photo placed in the shortest one */
.gallery.is-balanced { columns: auto; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.gcol { display: grid; gap: var(--gap); min-width: 0; }
.gcol .ph { margin: 0; }
.ph { margin: 0 0 var(--gap); break-inside: avoid; }
.ph button {
  display: block; width: 100%; overflow: hidden;
  aspect-ratio: var(--ar); background: var(--tone, #151a24);
}
.ph img { width: 100%; height: 100%; object-fit: cover; }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  margin-top: clamp(32px, 5vw, 64px);
  padding-block: 24px calc(24px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line); color: var(--fog); font-size: 14px;
}
.foot a { text-decoration: none; }
.foot a:hover { color: var(--paper); }

.lightbox {
  position: fixed; inset: 0; z-index: 90;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px;
  background: var(--ink);
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  padding-left: var(--pad-l); padding-right: var(--pad-r);
}
.lb-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; color: var(--fog); font-size: 14px; }
.lb-stage { display: grid; place-items: center; min-height: 0; }
.lb-img {
  max-width: 100%; max-height: calc(100svh - 130px); width: auto; height: auto; object-fit: contain;
}
.lb-btn { padding: 10px 4px; color: var(--paper); }
.lb-btn:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .mail { transition: none; }
}
