/* ==========================================================================
   Jacob Feingold Photography — Style System
   Elegant serif wordmark + minimal direct-link nav, dense editorial
   masonry grid (Quentin de Briey influence), adjustable grid density,
   click-to-expand lightbox.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Inter:wght@400;500;600&display=swap');

:root {
  --black: #111111;
  --white: #ffffff;
  --grey: #8a8a8a;
  --grey-light: #e5e5e5;
  --nav-height: 88px;
  --gutter: clamp(20px, 4vw, 56px);
  --transition: 320ms cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

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

/* ---------- Cover page ---------- */

.cover-page {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--white);
  cursor: pointer;
  opacity: 1;
  transition: opacity 650ms ease;
}

.cover-page.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.cover-frame {
  max-width: min(78vw, 1100px);
  max-height: 82vh;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.18);
  transition: transform 600ms cubic-bezier(.4,0,.2,1), box-shadow 600ms;
}

.cover-page:hover .cover-frame {
  transform: translateY(-4px);
  box-shadow: 0 50px 110px rgba(0, 0, 0, 0.24);
}

.cover-frame img {
  max-width: min(78vw, 1100px);
  max-height: 82vh;
  width: auto;
  height: auto;
}

.cover-enter {
  position: absolute;
  bottom: clamp(24px, 5vh, 48px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--grey);
  transition: color var(--transition), letter-spacing var(--transition);
}

.cover-page:hover .cover-enter {
  color: var(--black);
  letter-spacing: 0.3em;
}

@media (max-width: 700px) {
  .cover-frame,
  .cover-frame img {
    max-width: 90vw;
    max-height: 74vh;
  }
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 34px var(--gutter) 22px;
  color: var(--black);
}

.wordmark {
  font-family: 'Archivo Black', sans-serif;
  font-weight: 400;
  -webkit-text-stroke: 0.4px currentColor;
  text-transform: uppercase;
  font-size: clamp(21px, 2.8vw, 32px);
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  gap: clamp(18px, 2.5vw, 40px);
}

.main-nav a {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 4px;
}

.main-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition);
}

.main-nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ---------- Grid density toolbar ---------- */

.grid-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  padding: 0 var(--gutter) 20px;
}

.density-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--grey-light);
  background: var(--white);
  color: var(--black);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.density-btn:hover {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.density-btn:disabled {
  opacity: 0.3;
  cursor: default;
  background: var(--white);
  color: var(--black);
  border-color: var(--grey-light);
}

/* ---------- Masonry grid ---------- */

.masonry {
  column-count: 5;
  column-gap: 28px;
  padding: 0 var(--gutter) var(--gutter);
  transition: column-count var(--transition);
}

.grid-item {
  break-inside: avoid;
  margin-bottom: 28px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 650ms ease, transform 650ms ease;
}

.grid-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.grid-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 700ms cubic-bezier(.4,0,.2,1), filter var(--transition);
}

.grid-item:hover img {
  transform: scale(1.03);
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10,10,10,0.97);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox.is-open { display: flex; }

.lightbox img {
  max-width: 88vw;
  max-height: 84vh;
  width: auto;
  object-fit: contain;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: var(--white);
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
}

.lightbox-close { top: 32px; right: var(--gutter); }
.lightbox-prev { left: var(--gutter); top: 50%; transform: translateY(-50%); font-size: 28px; }
.lightbox-next { right: var(--gutter); top: 50%; transform: translateY(-50%); font-size: 28px; }

.lightbox-count {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  letter-spacing: 0.1em;
}

/* ---------- Contact page ---------- */

.contact-page {
  min-height: calc(100vh - var(--nav-height) - 90px);
  min-height: calc(100dvh - var(--nav-height) - 90px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px var(--gutter);
  gap: 28px;
}

.contact-bio {
  max-width: 46ch;
  font-size: clamp(18px, 2.4vw, 24px);
  line-height: 1.6;
  color: var(--black);
  margin: 0;
}

.contact-email {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(18px, 2.6vw, 26px);
  letter-spacing: -0.01em;
  border-bottom: 2px solid var(--black);
  padding-bottom: 4px;
  transition: opacity var(--transition);
}

.contact-email:hover {
  opacity: 0.6;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 32px var(--gutter);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey);
  border-top: 1px solid var(--grey-light);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .site-header { flex-direction: row; }
}

@media (max-width: 560px) {
  .main-nav { gap: 14px; }
  .main-nav a { font-size: 11px; }
  .wordmark { font-size: 20px; }
  .lightbox-prev, .lightbox-next { font-size: 20px; }
  .site-footer { flex-direction: column; gap: 8px; }
  .masonry { column-gap: 16px; }
  .grid-item { margin-bottom: 16px; }
}
