@font-face {
  font-family: 'Unbounded';
  font-weight: 500;
  font-display: swap;
  src: url(fonts/unbounded-cyrillic-500-normal.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded';
  font-weight: 500;
  font-display: swap;
  src: url(fonts/unbounded-latin-500-normal.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;
}
@font-face {
  font-family: 'Onest';
  font-weight: 400;
  font-display: swap;
  src: url(fonts/onest-cyrillic-400-normal.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest';
  font-weight: 400;
  font-display: swap;
  src: url(fonts/onest-latin-400-normal.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 {
  --bg: #f6f5f1;
  --ink: #1b1d21;
  --dark: #121212;
  --paper: #f3f2ee;
  --muted: #9d9c97;
  --accent: #2c66c9;
  --tile: #e6e4de;
  --gutter: clamp(20px, 5vw, 64px);
}

html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Onest', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.lb-open { overflow: hidden; }

.zigzag { display: block; width: 100%; height: 14px; }

/* Шапка */
.hero { background: var(--dark); color: var(--paper); position: relative; overflow: hidden; }
.hero__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) var(--gutter) 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  align-items: end;
  gap: 24px;
}
.hero__text {
  padding: clamp(48px, 8vw, 120px) 0 clamp(40px, 7vw, 104px);
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.hero h1 {
  margin: 0;
  font-family: 'Unbounded', sans-serif;
  font-weight: 500;
  font-size: clamp(40px, 6vw, 80px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.dates {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: clamp(18px, 1.8vw, 22px);
  font-variant-numeric: tabular-nums;
  color: #c9c8c3;
}
.dates__dash { width: 32px; height: 2px; background: var(--accent); }
.hero__photo { display: flex; justify-content: center; align-self: end; }
.hero__photo img {
  display: block;
  width: 100%;
  max-width: 520px;
  height: min(84vh, 820px);
  object-fit: cover;
  object-position: 50% 12%;
  /* Фото растворяется в тёмном фоне к краям */
  -webkit-mask-image:
    linear-gradient(to bottom, transparent, #000 14%, #000 76%, transparent),
    linear-gradient(to right, transparent, #000 22%, #000 78%, transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, transparent, #000 14%, #000 76%, transparent),
    linear-gradient(to right, transparent, #000 22%, #000 78%, transparent);
  mask-composite: intersect;
}
.hero .zigzag { position: absolute; left: 0; bottom: 0; }

/* Предисловие */
.preface {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(64px, 10vw, 140px) var(--gutter);
  display: flex;
  flex-direction: column;
  gap: 24px;
  font-size: clamp(20px, 2.1vw, 27px);
  line-height: 1.5;
  text-wrap: pretty;
}
.preface p { margin: 0; max-width: 820px; }

/* Галерея: масонри по колонкам */
.gallery {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(80px, 10vw, 140px);
  columns: 3 260px;
  column-gap: 16px;
}
/* Раскладка из app.js: колонки-флексы, плитки по порядку в самую короткую */
.gallery--rows { columns: auto; display: flex; align-items: flex-start; gap: 16px; }
.gallery__column { flex: 1; min-width: 0; }
.tile {
  display: block;
  break-inside: avoid;
  margin-bottom: 16px;
  cursor: zoom-in;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  background: var(--tile);
}
.tile img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform .5s ease;
}
.tile:hover img { transform: scale(1.02); }
.tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}
.play::after {
  content: '';
  position: absolute;
  left: 22px;
  top: 18px;
  border-left: 16px solid #fff;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
}

/* Подвал */
.footer { background: var(--dark); color: var(--muted); }
.footer__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px var(--gutter) 48px;
  font-size: 15px;
  color: var(--paper);
}

/* Просмотр */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(14, 14, 14, .96);
  padding: 64px 72px;
  display: flex;
}
.lightbox[hidden] { display: none; }
.lb-stage {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-stage img,
.lb-stage video {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 2px;
  background: #000;
}
.lb-counter {
  position: absolute;
  top: 20px;
  left: 24px;
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.lb-close,
.lb-nav {
  position: absolute;
  color: var(--paper);
  font-family: inherit;
  cursor: pointer;
}
.lb-close {
  top: 12px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
}
.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid #3a3a3a;
  background: #1c1c1c;
  font-size: 20px;
}
.lb-nav:hover { background: var(--accent); border-color: var(--accent); }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }

@media (max-width: 640px) {
  .lightbox { padding: 56px 0 80px; }
  .lb-nav { top: auto; bottom: 16px; transform: none; }
  .lb-prev { left: calc(50% - 60px); }
  .lb-next { right: calc(50% - 60px); }
}
