/* Miha Matei v3 ... recreation of the live mihamatei.com (PhotoFolio).
   Spec extracted from the live layout.json + rendered mirror:
   bg #E5E2D9, logo Montserrat 600 60px ls 10px #232323 at (130, 50),
   menu Lato 400 14.2px ls 1.8px uppercase #919191 (active #111) top right,
   two-column masonry grid (20px gaps), fade slideshow on click,
   about page text Helvetica-light 16px #515151.
   The footer is kept from v2 (Jost), per Marc. */

/* Montserrat 600 (wordmark) */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/montserrat-600.woff2") format('woff2');
}
/* Lato 300 (copyright line) and 400 (menu) */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("../fonts/lato-300.woff2") format('woff2');
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/lato-400.woff2") format('woff2');
}
/* Jost ... used by the v2 footer, kept as-is */
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("../fonts/jost-cyrillic.woff2") format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("../fonts/jost-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("../fonts/jost-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --putty: #E5E2D9;
  --ink: #111111;
  --logo-ink: #232323;
  --menu-gray: #919191;
  --text-gray: #515151;
  --grid-gap: 20px;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--putty);
}

body {
  font-family: 'Lato', sans-serif;
  color: var(--ink);
  min-height: 100vh;
}

a { -webkit-tap-highlight-color: transparent; }

/* Header ... logo at (130, 50), menu right at ~(100, 104) */

.site-header {
  display: flex;
  align-items: flex-start;
  padding: 50px 100px 0 130px;
  box-sizing: border-box;
}

.wordmark {
  text-decoration: none;
  color: var(--logo-ink);
  font-family: 'Montserrat', sans-serif;
  font-size: 60px;
  font-weight: 600;
  letter-spacing: 10px;
  line-height: 1;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: baseline;
  gap: 22px;
  margin-left: auto;
  padding-top: 58px;
}

.nav-item {
  font-size: 14.2px;
  font-weight: 400;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--menu-gray);
  white-space: nowrap;
}

.nav-item:hover,
.nav-item.is-active { color: var(--ink); }

.nav-about { margin-left: 68px; }

/* Masonry gallery ... 20px gaps, fluid side margins (200px at 1600) */

.site-main {
  padding: 0 clamp(24px, 12.5vw, 200px);
}

/* About owns its own insets (matching the header's wordmark/nav exactly)
   instead of site-main's fluid clamp, so the portrait's left edge lines
   up with the wordmark and the text's right edge lines up with the nav. */
.site-main--about {
  padding: 0;
}

.masonry {
  display: flex;
  gap: var(--grid-gap);
  align-items: flex-start;
  margin-top: 96px;
}

.masonry-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--grid-gap);
}

.masonry-item {
  margin: 0;
}

.masonry-item img {
  width: 100%;
  height: auto;
  display: block;
}

.masonry-item a {
  display: block;
  cursor: pointer;
}

/* Rows layout (per-gallery option) ... mellon-studio.com style: photos
   flow left to right at their own Display size and wrap; neighbors keep
   their natural ratios so row bottoms are intentionally ragged. Widths
   subtract their share of the gap so half+half and large+small rows sum
   to exactly one line. */

.rows {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--grid-gap);
  margin-top: 96px;
}

.row-item {
  margin: 0;
}

.row-item img {
  width: 100%;
  height: auto;
  display: block;
}

.row-item--full  { width: 100%; }
.row-item--large { width: calc(66.666% - var(--grid-gap) / 3); }
.row-item--half  { width: calc(50% - var(--grid-gap) / 2); }
.row-item--small { width: calc(33.333% - var(--grid-gap) * 2 / 3); }

/* Vimeo rows (Motion), after the grid */

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: var(--grid-gap) 0 0;
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Lightbox ... the PhotoFolio image view: opaque putty, image fit,
   click to advance, fade 0.5s, copyright line bottom center */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--putty);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] { display: none; }

.lightbox img {
  max-width: calc(100vw - 30px);
  max-height: calc(100vh - 90px);
  margin-top: -20px;
  opacity: 0;
  transition: opacity 0.5s ease;
  user-select: none;
}

.lightbox img.is-visible { opacity: 1; }

.lightbox .lb-copyright {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: 'Lato', sans-serif;
  font-weight: 300;
  font-size: 14px;
  color: #000000;
  pointer-events: none;
}

.lightbox .lb-close {
  position: absolute;
  top: 18px;
  right: 26px;
  border: 0;
  background: none;
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
  color: var(--menu-gray);
  cursor: pointer;
  padding: 6px;
}

.lightbox .lb-close:hover { color: var(--ink); }

/* About ... portrait left, Helvetica-light text right */

.about-live {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  margin: 56px 0 0;
  padding: 0 100px 0 130px;
}

.about-portrait {
  margin: 0;
  flex: 0 0 auto;
  width: min(600px, 42vw);
}

.about-portrait img {
  width: 100%;
  height: auto;
  display: block;
}

.about-text {
  flex: 1 1 0;
  min-width: 0;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.42;
  color: var(--text-gray);
}

.about-text > p {
  /* Keep paragraphs at a readable measure even though the column now
     stretches to the nav's right edge; contact lines and clients below
     are meant to use the full width. */
  max-width: 620px;
}

.about-text p { margin: 0 0 1.42em; }

.about-text a { color: var(--text-gray); }

.about-contactlines p { margin: 0; }

.about-clients {
  margin-top: 96px;
  padding-left: 48px;
}

.about-clients strong { font-weight: 700; }

/* Client logos ... a Mellon Studio-style grid at the bottom of About:
   grayscale by default, full color on hover, links optional per logo. */

.client-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 32px 48px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid rgba(17, 17, 17, 0.1);
}

.client-logo {
  display: inline-flex;
  align-items: center;
  height: 42px;
}

.client-logo img {
  display: block;
  width: auto;
  height: auto;
  max-height: 42px;
  max-width: 150px;
  filter: grayscale(1);
  opacity: 0.5;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

a.client-logo:hover img,
a.client-logo:focus-visible img {
  filter: grayscale(0);
  opacity: 1;
}

/* Footer ... kept from v2 */

.site-footer {
  font-family: 'Jost', sans-serif;
  color: #1a1a1a;
  padding: 120px 0 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.footer-wordmark {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: #9a9a9a;
}

.footer-links a {
  color: #9a9a9a;
  text-decoration: none;
}

.footer-links a:hover { color: #1a1a1a; }

.footer-locations {
  font-size: 10px;
  letter-spacing: 0.3em;
  color: #9a9a9a;
}

.footer-copyright {
  font-size: 10px;
  letter-spacing: 0.3em;
  color: #c4c4c4;
}

/* Small screens */

@media (max-width: 1100px) {
  .site-header { padding: 36px 48px 0 48px; }
  .wordmark { font-size: 40px; letter-spacing: 7px; }
  .site-nav { padding-top: 38px; }
  .site-main { padding: 0 48px; }
  /* min-width: 0 on .about-text lets it shrink instead of wrap, so force
     a real stack here rather than relying on wrap+shrink. */
  .about-live { padding: 0 48px; flex-direction: column; align-items: stretch; }
  .about-portrait { width: 100%; }
}

@media (max-width: 700px) {
  .site-header {
    flex-direction: column;
    gap: 18px;
    padding: 28px 24px 0;
  }
  .wordmark { font-size: 30px; letter-spacing: 5px; }
  .site-nav { margin-left: 0; padding-top: 0; flex-wrap: wrap; }
  .nav-about { margin-left: 24px; }
  .site-main { padding: 0 24px; }
  .masonry { margin-top: 40px; }
  .rows { margin-top: 40px; }
  .row-item--full,
  .row-item--large,
  .row-item--half,
  .row-item--small { width: 100%; }
  .about-clients { margin-top: 48px; padding-left: 0; }
  .about-live { padding: 0 24px; }
  .site-footer { padding: 80px 0 48px; }
}
