:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #8f8f8f;
  --line: #d8d8d8;

  --max: 1840px;
  --side: 56px;

  --gallery-gap: 20px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", Inter, Helvetica, Arial, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

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

button {
  font: inherit;
}

.wrap {
  width: min(calc(100% - (var(--side) * 2)), var(--max));
  margin-left: auto;
  margin-right: auto;
}

/* =========================
   Header
   ========================= */

.site-header {
  padding-top: 24px;
}

.header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.site-logo img {
  display: block;
  width: auto;
  height: 58px;
  max-width: min(380px, 72vw);
  object-fit: contain;
}

.menu-toggle {
  display: none;
}

.menu-panel {
  display: block;
}

.menu-panel-inner {
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
  text-align: center;
}

.site-nav a {
  display: inline-block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  font-weight: 400;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  transition: color 140ms ease, font-weight 140ms ease;
}

.site-nav a:hover {
  color: var(--text);
  font-weight: 700;
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 700;
}

/* =========================
   Main / Gallery
   ========================= */

main.wrap {
  padding-top: 43px;
}

/*
  Masonry layout через CSS columns.
*/
.gallery {
  width: 100%;
  column-count: 4;
  column-gap: var(--gallery-gap);
}

/* Анімація появи фото знизу вгору */
@keyframes tile-in {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tile {
  display: inline-block;
  width: 100%;
  margin: 0 0 var(--gallery-gap);
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  cursor: pointer;
  vertical-align: top;

  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.tile img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border: 0;
}

.tile:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 4px;
}

.tile:focus:not(:focus-visible) {
  outline: none;
}

.placeholder {
  display: block;
  width: 100%;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 24px 0;
}

/* =========================
   About / Contact base
   ========================= */

.meta {
  max-width: 720px;
  margin: 0 auto;
  padding-top: 20px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.7;
  text-align: center;
}

.meta p {
  margin: 0 0 18px;
}

.list {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.list li {
  margin: 10px 0;
}

.list a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.list a:hover {
  color: var(--text);
}

/* =========================
   About page
   ========================= */

.about-page {
  padding-top: 64px;
}

.about-layout {
  display: grid;
  grid-template-columns: 400px minmax(320px, 1fr);
  gap: 72px;
  align-items: start;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
}

.about-photo {
  max-width: 400px;
  width: 100%;
}

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

.about-content {
  max-width: 620px;
  margin: 0 auto;
  padding-top: 8px;
  text-align: left;
  color: var(--text);
}

.about-content h1,
.about-content h2 {
  margin: 0 0 22px;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: left;
}

.about-content h2 {
  margin-top: 34px;
  margin-bottom: 18px;
  font-size: 15px;
}

.about-content p {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.65;
  font-weight: 400;
  text-align: left;
}

/* =========================
   Lightbox
   ========================= */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
}

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

.lightbox-stage {
  position: absolute;
  inset: 52px 120px 118px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.lightbox-stage img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: auto;
}

.lightbox-controls {
  position: fixed;
  left: 50%;
  bottom: 44px;
  transform: translateX(-50%);
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  pointer-events: none;
}

.lightbox-counter {
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  font-weight: 400;
  letter-spacing: 0.06em;
  pointer-events: none;
}

.lb-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.lb-arrow {
  position: static;
  transform: none;
  z-index: auto;

  width: 48px;
  height: 48px;
  padding: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 0;
  background: transparent;
  color: var(--text);

  font-size: 28px;
  line-height: 1;
  font-weight: 300;
  letter-spacing: 0;

  opacity: 0.45;
  pointer-events: auto;
  transition: opacity 140ms ease;
}

.lb-arrow:hover {
  opacity: 1;
}

.lb-prev,
.lb-next {
  left: auto;
  right: auto;
}

.lb-close {
  position: fixed;
  right: 44px;
  bottom: 34px;
  z-index: 10004;

  min-width: 132px;
  height: 58px;
  padding: 0 24px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);

  font-size: 13px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;

  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.lb-close:hover {
  border-color: #bdbdbd;
  background: rgba(255, 255, 255, 0.96);
}

.lb-close .close-icon {
  display: none;
  font-size: 30px;
  line-height: 1;
  font-weight: 300;
  letter-spacing: 0;
}

.lb-close:hover .close-label {
  display: none;
}

.lb-close:hover .close-icon {
  display: inline-block;
}

/* =========================
   Focus states
   ========================= */

.menu-toggle:focus-visible,
.site-nav a:focus-visible,
.lb-btn:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 5px;
}

/* =========================
   Responsive
   ========================= */

@media (max-width: 1400px) {
  :root {
    --side: 44px;
    --gallery-gap: 18px;
  }

  .gallery {
    column-count: 4;
  }
}

@media (max-width: 1200px) {
  :root {
    --side: 38px;
    --gallery-gap: 16px;
  }

  .gallery {
    column-count: 4;
  }

  .site-nav {
    gap: 28px;
  }

  .site-nav a {
    font-size: 12px;
    letter-spacing: 0.28em;
  }
}

@media (max-width: 1000px) {
  .about-layout {
    grid-template-columns: 1fr;
    gap: 44px;
    max-width: 720px;
  }

  .about-photo {
    max-width: 400px;
    margin: 0 auto;
  }

  .about-content {
    max-width: 620px;
  }
}

@media (max-width: 900px) {
  :root {
    --side: 30px;
    --gallery-gap: 14px;
  }

  .gallery {
    column-count: 2;
  }

  .site-logo img {
    height: 52px;
  }

  .site-logo {
    margin-bottom: 32px;
  }

  .site-nav {
    gap: 22px;
  }

  .site-nav a {
    font-size: 11px;
    letter-spacing: 0.22em;
  }

  main.wrap {
    padding-top: 72px;
  }

  .lightbox-stage {
    inset: 44px 84px 112px;
  }
}

@media (max-width: 700px) {
  .gallery {
    column-count: 1;
  }
}

@media (max-width: 560px) {
  :root {
    --side: 22px;
    --gallery-gap: 24px;
  }

  .site-header {
    padding-top: 34px;
  }

  .header-inner {
    align-items: stretch;
  }

  .site-logo {
    margin-bottom: 22px;
  }

  .site-logo img {
    height: 44px;
    max-width: 260px;
    margin: 0 auto;
  }

  .menu-toggle {
    display: inline-flex;
    align-self: center;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--text);
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    cursor: pointer;
  }

  .menu-panel {
    margin-top: 16px;
  }

  .menu-panel.is-collapsed {
    display: none;
  }

  .site-nav {
    flex-direction: column;
    gap: 16px;
    padding: 10px 0 6px;
  }

  .site-nav a {
    font-size: 12px;
    letter-spacing: 0.22em;
  }

  main.wrap {
    padding-top: 48px;
  }

  .gallery {
    column-count: 1;
    column-gap: 0;
  }

  .tile {
    margin-bottom: var(--gallery-gap);
  }

  .about-page {
    padding-top: 44px;
  }

  .about-layout {
    gap: 34px;
  }

  .about-photo {
    max-width: 400px;
  }

  .about-content h1,
  .about-content h2 {
    font-size: 15px;
    text-align: left;
  }

  .about-content p {
    font-size: 14px;
    line-height: 1.65;
    text-align: left;
  }

  .lightbox-stage {
    inset: 26px 18px 112px;
  }

  .lb-arrow {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }

  .lightbox-controls {
    bottom: 38px;
  }

  .lightbox-counter {
    font-size: 14px;
  }

  .lb-close {
    right: 18px;
    bottom: 26px;
    min-width: 112px;
    height: 54px;
    padding: 0 18px;
    font-size: 12px;
    letter-spacing: 0.26em;
  }
}