:root {
  --bg: #FAFAFA;
  --fg: #111111;
  --muted: #666;
  --nav-h: clamp(46px, 5.75vh, 72px);
  --page-margin-x: clamp(6px, 1.2vw, 12px);
  --content-margin-x: 60px;
  --grid-gap: 28px;
  --salon-gap: 18px;
}

@font-face {
  font-family: 'PP Neue Machina Inktrap';
  src: url('fonts/PPNeueMachina-InktrapSemibold.woff2') format('woff2'),
       url('fonts/PPNeueMachina-InktrapSemibold.woff') format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Mori';
  src: url('fonts/PPMori-SemiBold.woff2') format('woff2'),
       url('fonts/PPMori-SemiBold.woff') format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Mori';
  src: url('fonts/PPMori-Regular.woff2') format('woff2'),
       url('fonts/PPMori-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.4 'PP Mori', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.viewer-open {
  overflow: hidden;
}

body.viewer-open .nav,
body.viewer-open .page {
  filter: blur(20px) brightness(1.15);
  transition: filter 0.35s ease;
}

.nav,
.page {
  transition: filter 0.35s ease;
}

/* NAV */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--content-margin-x);
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
  background: var(--bg);
  z-index: 1000;
}

.logo {
  font-family: 'PP Neue Machina Inktrap', system-ui, -apple-system, sans-serif;
  font-weight: 600;
  font-size: clamp(1.05rem, 0.8rem + 0.6vw, 1.7rem);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin: 2px 0 0;
}

.logo-link,
.logo-link:hover {
  color: inherit;
  text-decoration: none;
}

.nav a,
.footer a {
  color: inherit;
  text-decoration: none;
}

.nav a:hover,
.footer a:hover {
  text-decoration: none;
}

.nav .links {
  display: flex;
  gap: 24px;
  align-items: center;
  font-family: 'PP Mori', system-ui, -apple-system, sans-serif;
  font-weight: 600;
  font-size: clamp(0.875rem, 0.875rem + 0.2vw, 1.125rem);
  letter-spacing: 0.02em;
}

.footer a {
  display: flex;
  gap: 24px;
  align-items: center;
  font-family: 'PP Mori', system-ui, -apple-system, sans-serif;
  font-weight: 600;
  font-size: clamp(0.72rem, 0.72rem + 0.2vw, 0.96rem);
  letter-spacing: 0.02em;
}

/* FOOTER */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--page-margin-x);
  height: var(--nav-h);
  border-top: 1px solid rgba(0, 0, 0, 0.3);
  background: var(--bg);
  font-family: 'PP Mori', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: clamp(0.68rem, 0.6rem + 0.12vw, 0.8rem);
  letter-spacing: 0.01em;
}

.footer > div:first-child {
  color: var(--muted);
}

/* GALLERY — single column small, interlocking salon hang large */
.page {
  padding-top: calc(var(--nav-h) + 0.75rem);
  padding-inline: var(--page-margin-x);
  padding-bottom: 0.75rem;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.gallery {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--grid-gap);
  width: 100%;
  margin: 0;
  padding: 0;
}

.gallery--salon {
  display: block;
  gap: 0;
  width: calc(100% + 2 * var(--page-margin-x));
  margin-inline: calc(-1 * var(--page-margin-x));
}

.gallery__item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: inherit;
}

.gallery--salon .gallery__item {
  width: auto;
  height: auto;
  overflow: visible;
}

.gallery--salon .gallery__frame {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  overflow: hidden;
  line-height: 0;
}

.gallery--salon .gallery__frame img.is-thumb {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.gallery__item:focus-visible {
  outline: 2px solid #2a7cff;
  outline-offset: 2px;
}

.gallery__frame {
  display: block;
  position: relative;
  width: 100%;
  overflow: hidden;
  background: transparent;
  aspect-ratio: 1;
}

.gallery:not(.gallery--salon) .gallery__frame {
  overflow: visible;
}

.gallery__frame img {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  object-fit: cover;
}

.gallery__frame img.is-thumb {
  transform: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__frame img.is-thumb.is-ready {
  opacity: 1;
}

.gallery__frame img.is-cropped {
  width: calc(100% / var(--crop-w, 1));
  height: calc(100% / var(--crop-h, 1));
  object-fit: fill;
  opacity: 1;
  transform: translate(
    calc(-1 * var(--crop-x, 0) * 100%),
    calc(-1 * var(--crop-y, 0) * 100%)
  );
}

.gallery__frame img.is-mobile-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  transform: none;
  opacity: 1;
}

.gallery__item:hover img.is-ready,
.gallery__item:hover img.is-cropped,
.gallery__item:hover img.is-mobile-frame {
  opacity: 0.92;
}

.gallery__caption {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--content-bottom, 1) * 100% + 40px);
  margin: 0;
  padding: 0 0.25rem;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  color: var(--fg);
  z-index: 2;
  pointer-events: none;
}

.gallery__caption .title {
  font-weight: 600;
  font-style: italic;
}

.gallery__caption .meta {
  opacity: 0.8;
}

.gallery:not(.gallery--salon) {
  gap: calc(var(--grid-gap) + 20px);
}

.gallery:not(.gallery--salon) .gallery__item {
  /* Reserve caption space synchronously — avoids post-load padding jumps */
  padding-bottom: max(
    12px,
    calc(106px - (1 - var(--content-bottom, 1)) * 100% / var(--mobile-ar, 1))
  );
}

.gallery:not(.gallery--salon) .gallery__caption {
  display: block;
  top: calc(var(--content-bottom, 1) * 100% + 30px);
}

.gallery--salon .gallery__caption {
  display: none;
}

.about {
  position: relative;
  width: 100%;
  margin-top: clamp(72px, 12vh, 160px);
  padding: 60px var(--content-margin-x);
  border-top: none;
  font-family: 'PP Mori', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  color: var(--fg);
}

.about::before {
  content: '';
  position: absolute;
  top: 0;
  left: calc(-1 * var(--page-margin-x));
  right: calc(-1 * var(--page-margin-x));
  border-top: 1px solid rgba(0, 0, 0, 0.3);
}

.about__inner {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(2rem, 6vw, 5rem);
}

.about__bio,
.about__email {
  font-size: 16px;
}

.about__bio-block {
  width: 60%;
  max-width: 60%;
  flex: 0 1 60%;
}

.about__bio {
  margin: 0.25em 0 0;
  width: 100%;
  max-width: 100%;
}

.about__contact {
  flex: 0 0 auto;
  text-align: right;
  margin-left: auto;
}

.about__contact-label {
  margin: 0;
  font-weight: 400;
  font-size: 14px;
}

.about__email {
  display: inline-block;
  margin-top: 0.25em;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.about__email:hover {
  text-decoration: none;
  opacity: 0.7;
}

.about__copyright {
  margin: clamp(2.5rem, 6vh, 4rem) 0 0;
  font-size: 12px;
  font-weight: 400;
  color: var(--fg);
  opacity: 0.75;
}

/* VIEWER OVERLAY */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  background: rgba(250, 250, 250, 0.5);
  backdrop-filter: blur(8px) saturate(1.05);
  -webkit-backdrop-filter: blur(8px) saturate(1.05);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.viewer.active {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  opacity: 1;
}

.viewer__close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2002;
  width: var(--nav-h);
  height: var(--nav-h);
  border: none;
  background: transparent;
  color: var(--fg);
  font-size: 2rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.viewer__close:hover {
  opacity: 0.6;
}

.viewer__nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(40px, 6vw, 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  z-index: 2001;
}

.viewer__nav--prev {
  left: 0;
}

.viewer__nav--next {
  right: 0;
}

.viewer__nav button {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--fg);
}

.viewer__nav svg {
  width: 28px;
  height: 28px;
}

.viewer__content {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 0;
  overflow: hidden;
  padding: clamp(4px, 0.8vh, 10px) clamp(40px, 7vw, 80px) clamp(8px, 1.5vh, 16px);
  gap: 0.35rem;
}

.viewer__image-wrap {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  width: 100%;
  max-height: calc(100dvh - 5.5rem);
  padding: 0;
  border: none;
  background: transparent;
}

.viewer__crop {
  position: relative;
  overflow: hidden;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: var(--viewer-ar, 1);
  width: min(100%, calc((100dvh - 5.5rem) * var(--viewer-ar, 1)));
  height: auto;
  max-height: calc(100dvh - 5.5rem);
}

.viewer__image {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 5.5rem);
  width: auto;
  height: auto;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

.viewer__crop .viewer__image {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  max-height: none;
  width: calc(100% / var(--crop-w, 1));
  height: calc(100% / var(--crop-h, 1));
  object-fit: fill;
  transform: translate(
    calc(-1 * var(--crop-x, 0) * 100%),
    calc(-1 * var(--crop-y, 0) * 100%)
  );
}

.viewer__crop.is-full-frame .viewer__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  transform: none;
}

.viewer__meta {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.15em;
  padding: 0;
  margin-top: -0.15rem;
  font-size: clamp(0.85rem, 0.8rem + 0.2vw, 1rem);
  line-height: 1.4;
  text-align: center;
  background: transparent;
}

.viewer__meta .title {
  font-weight: 600;
  font-style: italic;
}

.viewer__meta .meta {
  opacity: 0.8;
}

/* FOCUS */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #2a7cff;
  outline-offset: 2px;
}

@media (min-width: 1600px) {
  :root {
    --content-margin-x: 10%;
  }
}

/* MOBILE */
@media (max-width: 899px) {
  :root {
    --content-margin-x: 32px;
  }

  .nav .links {
    font-size: 1rem;
  }

  .viewer__content {
    justify-content: center;
    height: 100%;
    max-height: 100dvh;
    width: 100%;
    padding: var(--nav-h) clamp(44px, 12vw, 56px) clamp(12px, 2vh, 20px);
    box-sizing: border-box;
  }

  .viewer__image-wrap {
    flex: 0 1 auto;
    width: 100%;
    max-height: calc(100dvh - var(--nav-h) - 5rem);
  }

  .viewer__meta {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .logo {
    font-size: 1.2rem;
    letter-spacing: 0.005em;
    white-space: nowrap;
  }

  .nav .links {
    gap: 10px;
    margin-left: 24px;
  }

  .about {
    width: 100%;
    font-size: 14px;
    margin-top: 56px;
    padding: 60px var(--content-margin-x);
  }

  .about__inner {
    width: 100%;
    flex-direction: column;
    gap: 1.5rem;
  }

  .about__bio-block {
    width: 100%;
    max-width: 100%;
    flex: none;
  }

  .about__bio {
    width: 100%;
    max-width: 100%;
  }

  .about__contact {
    text-align: left;
    margin-left: 0;
  }

  .about__bio,
  .about__email {
    font-size: 14px;
  }

  .about__contact-label {
    font-size: 12px;
  }

  .viewer.active {
    grid-template-columns: 1fr;
    place-items: center;
  }

  .viewer__content {
    gap: 0.3rem;
  }

  .viewer__image-wrap {
    max-height: calc(100dvh - var(--nav-h) - 5rem);
  }

  .viewer__crop {
    max-height: calc(100dvh - var(--nav-h) - 5rem);
    width: min(100%, calc((100dvh - var(--nav-h) - 5rem) * var(--viewer-ar, 1)));
  }

  .viewer__image {
    max-height: calc(100dvh - var(--nav-h) - 5rem);
  }
}
