/* Layout and motion follow levonbiss.com: name left, nav right, 3-column
   masonry, grey intro band per set, grey footer, 1.5s fade-in on load,
   images fading in as they arrive, and a pale lightbox over the page. */
:root {
  --bg: #fff;
  --ink: #111;
  --mute: #6f6f6f;
  --band: #f4f4f3;
  --accent: #2f6b4f; /* fern green from the forest photos */
  --line: rgba(0, 0, 0, .1);
  --side: 30px;
  --gap: 20px;   /* spacing between photos; /admin sets it (and --gap-m for phones) */
  --gap-m: 6px;
  --tile: #f1f0ee;
  --viewer: rgba(255, 255, 255, .86);
  --ctrl: #333;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.6 "Poppins", system-ui, sans-serif;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; }

/* page-load fade, staggered across the header like the reference */
.fade { opacity: 1; transition: opacity 1.5s ease; }
body.loading .fade, body.loading #main, body.loading .foot { opacity: 0; }
#main, .foot { transition: opacity 1.5s ease; }
.nav .fade:nth-child(2) { transition-delay: .03s; }
.nav .fade:nth-child(3) { transition-delay: .06s; }
.nav .fade:nth-child(4) { transition-delay: .09s; }
#main.swap { opacity: 0; transition: none; }

/* header */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px var(--side) 30px;
  background: var(--bg);
}
.name { font-size: 19px; font-weight: 400; }
.nav { display: flex; align-items: center; gap: 22px; font-size: 14.5px; }
.nav > a, .work-btn { padding: 2px 0; border-bottom: 1px solid transparent; }
.nav > a:hover, .work-btn:hover, .nav [aria-current="page"] { border-bottom-color: currentColor; }
.social { display: flex; align-items: center; gap: 14px; margin-left: 6px; }
.social a { display: flex; padding: 2px 0; }
.social a:hover { color: var(--accent); }
.work { position: relative; }
.work-menu {
  position: absolute; top: 100%; left: -18px; z-index: 30;
  list-style: none; margin: 8px 0 0; padding: 12px 18px;
  min-width: 170px; background: var(--bg); border: 1px solid var(--line);
  display: none;
}
.work:hover .work-menu, .work:focus-within .work-menu, .work-menu.open { display: block; }
.work-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.work-menu a { display: block; padding: 5px 0; white-space: nowrap; }
.work-menu a:hover, .work-menu a[aria-current="page"] { color: var(--accent); }
/* burger: two thin lines that turn into an X (timing measured on levonbiss.com) */
.burger { display: none; width: 44px; height: 44px; margin-right: -5px; position: relative; z-index: 27; }
.burger span { position: absolute; left: 5px; width: 34px; top: 21.5px; height: 1px; background: var(--ink);
  transition: transform .25s cubic-bezier(.2, .6, .3, 1), width .25s cubic-bezier(.2, .6, .3, 1); }
.burger span:first-child { transform: translateY(-5.5px); }
.burger span:last-child { transform: translateY(5.5px); }
.menu-open .burger span { width: 29px; left: 8px; }
.menu-open .burger span:first-child { transform: rotate(-135deg); }
.menu-open .burger span:last-child { transform: rotate(135deg); }

/* phone menu: fades in over the page; Work slides across to its own panel; icons rise in at the bottom */
.mobile-menu { position: fixed; inset: 0; z-index: 25; background: var(--bg); display: none;
  opacity: 0; visibility: hidden; transition: visibility .6s cubic-bezier(.4, 0, .2, 1), opacity .4s cubic-bezier(.4, 0, .2, 1); }
.menu-open .mobile-menu { opacity: 1; visibility: visible; }
.mm-panels { position: absolute; inset: 84px 0 90px; overflow: hidden; }
.mm-panel { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0 20px; overflow-y: auto; transition: transform .6s cubic-bezier(.4, 0, .2, 1); }
.mm-sub { transform: translateX(100%); }
.mm-sub-open .mm-root { transform: translateX(-100%); }
.mm-sub-open .mm-sub { transform: none; }
.mm-panel a, .mm-panel button { display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 33px; line-height: 1; padding: 11.5px 0; font-weight: 400; }
#mm-sets { display: flex; flex-direction: column; align-items: center; }
.mm-panel a[aria-current="page"] { color: var(--accent); }
.mm-panel svg { width: 12px; height: 24px; margin-left: 12px; }
.mm-back { color: var(--mute); }
.mm-back svg { margin: 0 10px 0 0 !important; }
.mm-social { position: absolute; left: 0; right: 0; bottom: 40px; display: flex; justify-content: center; gap: 18px;
  transform: translateY(55px); transition: transform .6s cubic-bezier(.4, 0, .2, 1); }
.menu-open .mm-social { transform: none; }
.mm-social a { display: flex; padding: 4px; }

main { min-height: 70vh; }
.view[hidden] { display: none !important; }

/* masonry: columns filled by JS, shortest column first */
.masonry { display: flex; gap: var(--gap); align-items: flex-start; padding: 0 var(--side) 90px; }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.tile { display: block; background: var(--tile); overflow: hidden; }
.tile img { width: 100%; height: auto; opacity: 0; transition: opacity 1s ease; }
.tile img.in { opacity: 1; }
.tile:hover img.in { opacity: .88; transition-duration: .3s; }
.tile:has(.tile-cap) { background: none; }
.tile-cap { padding: 12px 0 4px; font-size: 14px; line-height: 1.45; }
.cap-title, .cap-line { display: block; }
.cap-line { color: var(--mute); font-size: 13px; }
/* title under the photo in the viewer; fades in with the photo */
.caption { position: absolute; left: 80px; right: 80px; bottom: 8px; text-align: center; font-size: 14px; line-height: 1.4;
  opacity: 0; transition: opacity .7s ease; pointer-events: none; }
.caption.in { opacity: 1; }

/* set intro band */
.intro { background: var(--band); padding: 26px var(--side) 30px; margin-bottom: 30px; }
.note { color: var(--accent); font-size: 15px; max-width: 900px; margin: 0; }
.meta { color: var(--mute); font-size: 13px; margin: 8px 0 0; }

/* about */
.page { display: grid; grid-template-columns: minmax(0, 620px) minmax(0, 440px); justify-content: space-between; gap: 60px; padding: 10px var(--side) 100px; max-width: 1340px; margin: 0 auto; }
.page h1 { color: var(--accent); font-weight: 600; font-size: 44px; line-height: 1.15; margin: 0 0 30px; }
.page-text p { margin: 0 0 1.1em; font-size: 15.5px; }
.page-text a, .foot a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.page-img { margin-top: 84px; background: var(--tile); }
.page-img img { width: 100%; height: auto; opacity: 0; transition: opacity 1s ease; }
.page-img img.in { opacity: 1; }

.foot { background: var(--band); padding: 46px var(--side); text-align: center; font-size: 13.5px; }
.foot p { margin: 0; }

/* lightbox: pale overlay over the page, photo fades in, crossfades on step */
.viewer { position: fixed; inset: 0; z-index: 40; background: var(--viewer); opacity: 0; transition: opacity .45s ease; }
.viewer.open { opacity: 1; }
.viewer[hidden] { display: none; }
.stage { position: absolute; inset: 40px 80px 52px; }
.stage { pointer-events: none; }
.stage img { position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: 100%; width: auto; height: auto; opacity: 0; transition: opacity .7s ease; pointer-events: auto; cursor: pointer; }
.stage img.in { opacity: 1; }
.nav-arrow, .close { position: absolute; color: var(--ctrl); padding: 14px; }
.nav-arrow { top: 50%; transform: translateY(-50%); }
.nav-arrow svg { width: 12px; height: 24px; display: block; }
.nav-arrow.prev { left: 20px; }
.nav-arrow.next { right: 20px; }
.close { top: 10px; right: 14px; }
.close svg { width: 18px; height: 18px; display: block; }
.nav-arrow:hover, .close:hover { color: var(--ink); }

@media (max-width: 900px) {
  :root { --side: 16px; }
  .masonry, .col { gap: var(--gap-m); }
  .top { padding: 22px var(--side); position: sticky; top: 0; z-index: 26; }
  .name { font-size: 17px; }
  .nav { display: none; }
  .burger { display: block; }
  .mobile-menu { display: block; }
  .top { margin: 0; }
  .intro { padding: 20px var(--side) 22px; margin-bottom: 16px; }
  .page { grid-template-columns: 1fr; gap: 28px; padding-bottom: 70px; }
  .page h1 { font-size: 34px; margin-bottom: 20px; }
  .page-img { margin-top: 0; }
  .foot { padding: 34px var(--side); }
  .stage { inset: 56px 12px 70px; }
  .caption { left: 16px; right: 16px; bottom: 18px; }
  html:not([data-bg="dark"]) .viewer { background: rgba(255, 255, 255, .96); }
  html[data-bg="offwhite"] .viewer { background: rgba(250, 248, 244, .97); }
  .nav-arrow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .fade, #main, .foot, .tile img, .page-img img, .viewer, .stage img, .burger span, .mobile-menu, .mm-panel, .mm-social, .caption { transition: none !important; }
}
