/* ---------- Base ---------- */
:root {
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e6e6e6;
  --bg: #ffffff;
  --label-bg: rgba(255, 255, 255, 0.72);
  --max: 1100px;
  --font: "Roboto Mono", ui-monospace, Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

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

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Nav ---------- */
.nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

.nav__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 96px;
}

.nav__logo {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.nav__links {
  display: flex;
  gap: 36px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__links a {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.nav__links a:hover,
.nav__links a[aria-current="page"] {
  border-color: currentColor;
}

.nav--light {
  color: #fff;
}


.nav--static {
  position: static;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  /* 60% экрана — блок с разделами выглядывает снизу */
  height: 60vh;
  min-height: 380px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #fff;
  background: #2a2522;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
}

.hero__text {
  position: relative;
  z-index: 1;
  padding: 0 24px;
}

.hero__title {
  margin: 0;
  font-size: clamp(22px, 4vw, 52px);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.1;
}

.hero__subtitle {
  margin: 14px 0 0;
  font-size: clamp(12px, 1.3vw, 16px);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  opacity: 0.85;
}


/* ---------- Category tiles ---------- */
.categories {
  padding: 72px 0 80px;
}

.categories__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 90px 90px;
  max-width: 1000px;
  margin: 0 auto;
}

/* staggered right column, like a magazine spread */
.categories__grid .tile:nth-child(even) {
  margin-top: 70px;
}

.tile {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: #f1f0ee;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
}

.tile:hover img {
  transform: scale(1.03);
}

.label {
  position: absolute;
  font-size: 13px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 12px 22px;
  background: var(--label-bg);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}

/* ---------- Gallery sections ---------- */
.section {
  padding: 100px 0 40px;
  scroll-margin-top: 0;
}

.section__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 18px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--line);
}

.section__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.section__count {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* justified-галерея: в каждом ряду кадры одной высоты, ширина по пропорциям (--r = w/h) */
.gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.gallery figure {
  position: relative;
  flex: var(--r) 1 calc(var(--r) * 280px);
  /* не даём одинокому кадру в последнем ряду раздуться */
  max-width: calc(var(--r) * 440px);
  margin: 0;
  overflow: hidden;
  cursor: zoom-in;
  background: #f1f0ee;
}

.gallery img {
  width: 100%;
  height: auto;
  transition: transform 0.6s ease, opacity 0.3s;
}

.gallery figure:hover img {
  transform: scale(1.03);
  opacity: 0.92;
}


/* ---------- About ---------- */
.about {
  padding: 60px 0 120px;
}

.about__title {
  margin: 0 0 80px;
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #3d3d3d;
}

.about__grid {
  display: grid;
  grid-template-columns: 430px 1fr;
  gap: 72px;
  align-items: start;
  max-width: 1000px;
  margin: 0 auto;
}

.about__photo {
  aspect-ratio: 893 / 1280;
  object-fit: cover;
  width: 100%;
  background: #f1f0ee;
}

.about__text {
  /* верх текста по верхнему краю фото */
  margin-top: -0.3em;
  font-size: 15px;
  line-height: 1.6;
  color: #3d3d3d;
  max-width: 520px;
}

.about__text p {
  margin: 0 0 20px;
}

.about__text strong {
  font-weight: 400;
  color: var(--ink);
}

.about__contact {
  display: inline-block;
  margin-top: 8px;
  padding: 14px 28px;
  border: 1px solid var(--ink);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: background 0.2s, color 0.2s;
}

.about__contact:hover {
  background: var(--ink);
  color: #fff;
}

.about__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.about__actions .about__contact {
  margin-top: 0;
}

.about__contact--ghost {
  border-color: var(--line);
}

/* ---------- Footer ---------- */
.footer {
  padding: 120px 0 60px;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  color: #444;
}

.footer__copy {
  font-size: 15px;
  text-transform: uppercase;
}

.footer__links {
  display: flex;
  gap: 80px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 16px;
}

.footer__links a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.97);
}

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

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

.lightbox button {
  position: absolute;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  padding: 16px;
}

.lightbox__close {
  top: 20px;
  right: 24px;
}

.lightbox__prev {
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__next {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .gallery figure {
    flex-basis: calc(var(--r) * 220px);
  }

  .categories__grid,
  .about__grid {
    gap: 48px;
  }

  .about__grid {
    grid-template-columns: 1fr;
    max-width: 520px;
  }

  .about__text {
    margin-top: 0;
  }

  .footer__links {
    gap: 40px;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 12px;
  }

  .hero__text {
    padding: 0 12px;
  }


  .nav__links {
    gap: 20px;
  }

  .nav__logo {
    display: none;
  }

  .nav__inner {
    justify-content: flex-end;
    height: 72px;
  }

  .categories {
    padding: 72px 0 40px;
  }

  .categories__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .categories__grid .tile:nth-child(even) {
    margin-top: 0;
  }

  .gallery figure {
    flex-basis: 100%;
    max-width: none;
  }

  .section {
    padding-top: 72px;
  }

  .about__title {
    margin-bottom: 40px;
  }

  .footer__inner {
    flex-direction: column-reverse;
    align-items: flex-start;
  }

  .footer__links {
    gap: 28px;
    font-size: 16px;
  }

  .lightbox__prev,
  .lightbox__next {
    top: auto;
    bottom: 8px;
    transform: none;
  }
}

/* ---------- Loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: transform 0.7s cubic-bezier(0.76, 0, 0.24, 1);
}

.loader.is-done {
  transform: translateY(-100%);
}

.loader__inner {
  width: min(420px, 80vw);
}

.loader__name {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.loader__name span {
  display: inline-block;
  transform: translateY(110%);
  animation: loader-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.loader__line {
  display: block;
  height: 1px;
  margin: 18px 0 12px;
  background: var(--line);
}

.loader__line i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--ink);
}

.loader__meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

@keyframes loader-rise {
  to {
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader {
    display: none;
  }
}
