/* ============ Tokens ============ */
:root {
  --bg: #f3f1ec;
  --bg-2: #e9e6df;
  --card: #e4e1d9;
  --fg: #0e0e0e;
  --muted: #6f6c66;
  --line: rgba(14, 14, 14, 0.14);
  --accent: #c8102e;
  --header-h: 64px;
  --gutter: clamp(16px, 3vw, 40px);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --f-body: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b0b0b;
  --bg-2: #141414;
  --card: #181818;
  --fg: #f1efea;
  --muted: #8d8a84;
  --line: rgba(241, 239, 234, 0.14);
  --accent: #e0263f;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

body.no-scroll { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, video { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }

/* Логотип — белый PNG; в светлой теме инвертируется в чёрный (кроме шапки поверх видео) */
.logo { display: block; }
.logo img { height: 100%; width: auto; transition: filter 0.35s var(--ease); }
:root[data-theme="light"] .logo img { filter: invert(1); }
:root[data-theme="light"] .header.is-over-hero .logo img { filter: none; }
:root[data-theme="light"] .menu-open .header .logo img { filter: invert(1); }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono, .label { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.label { color: var(--muted); }

:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 3px; }

/* ============ Header ============ */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  color: var(--fg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease);
}

/* Прозрачная шапка поверх видео на главной */
.header.is-over-hero {
  color: #f1efea;
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.header__inner {
  height: 100%;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.header__nav { display: flex; gap: 28px; }
.header__nav a {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  position: relative;
  padding: 6px 0;
}
.header__nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.header__nav a:hover::after,
.header__nav a.is-active::after { transform: scaleX(1); }

.header__logo { height: 30px; justify-self: center; }

.header__tools { justify-self: end; display: flex; align-items: center; gap: 18px; }

.lang { display: flex; gap: 2px; }
.lang button {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 6px 7px;
  opacity: 0.45;
  transition: opacity 0.2s;
}
.lang button:hover { opacity: 0.8; }
.lang button.is-active { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }

.theme-toggle {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid currentColor;
  border-color: color-mix(in srgb, currentColor 35%, transparent);
  transition: border-color 0.2s, transform 0.5s var(--ease);
}
.theme-toggle:hover { border-color: currentColor; transform: rotate(25deg); }
:root[data-theme="dark"] .icon-moon,
:root[data-theme="light"] .icon-sun { display: none; }

.header__burger {
  display: none;
  width: 36px; height: 36px;
  position: relative;
}
.header__burger span {
  position: absolute; left: 7px; right: 7px;
  height: 1.5px; background: currentColor;
  transition: transform 0.35s var(--ease), top 0.35s var(--ease);
}
.header__burger span:nth-child(1) { top: 14px; }
.header__burger span:nth-child(2) { top: 21px; }
.menu-open .header__burger span:nth-child(1) { top: 17.5px; transform: rotate(45deg); }
.menu-open .header__burger span:nth-child(2) { top: 17.5px; transform: rotate(-45deg); }

/* Мобильное меню */
.menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--bg);
  padding: calc(var(--header-h) + 40px) var(--gutter) 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s;
}
.menu-open .menu { opacity: 1; visibility: visible; }
.menu-open .header { color: var(--fg); background: var(--bg); border-bottom-color: var(--line); }
.menu__nav { display: flex; flex-direction: column; gap: 6px; }
.menu__nav a {
  font-size: clamp(44px, 13vw, 72px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.05;
  transform: translateY(16px);
  opacity: 0;
  transition: transform 0.5s var(--ease), opacity 0.5s var(--ease);
}
.menu-open .menu__nav a { transform: none; opacity: 1; }
.menu-open .menu__nav a:nth-child(2) { transition-delay: 0.05s; }
.menu-open .menu__nav a:nth-child(3) { transition-delay: 0.1s; }
.menu__bottom { display: flex; justify-content: space-between; align-items: center; }

/* ============ Hero ============ */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  background: #000;
  color: #f1efea;
}
.hero__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0) 22%),
    linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 45%);
  pointer-events: none;
}
.hero__sound {
  position: absolute;
  z-index: 2;
  right: var(--gutter);
  bottom: clamp(24px, 5vh, 48px);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  border: 1px solid rgba(241,239,234,0.4);
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background-color 0.2s, border-color 0.2s;
}
.hero__sound:hover { border-color: #f1efea; background: rgba(241,239,234,0.1); }
.hero__sound .bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 11px; }
.hero__sound .bars i { width: 2px; height: 3px; background: currentColor; }
.hero__sound.is-on .bars i { animation: bar 0.9s ease-in-out infinite; }
.hero__sound.is-on .bars i:nth-child(2) { animation-delay: 0.2s; }
.hero__sound.is-on .bars i:nth-child(3) { animation-delay: 0.4s; }
@keyframes bar { 0%, 100% { height: 3px; } 50% { height: 11px; } }

/* ============ Sections ============ */
.page { padding-top: var(--header-h); min-height: 70vh; }
.page--home { padding-top: 0; }

.section { padding: clamp(56px, 9vw, 120px) var(--gutter) 0; }
.section:last-child { padding-bottom: clamp(56px, 9vw, 120px); }

.section__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding-bottom: 20px;
  margin-bottom: clamp(20px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
}
.section__title {
  font-size: clamp(44px, 8vw, 112px);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 0.9;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.section__title sup { font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.08em; font-weight: 400; color: var(--muted); margin-top: 0.6em; }
.section__intro { max-width: 380px; color: var(--muted); margin-top: 18px; }

.link-arrow {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
  padding-bottom: 6px;
}
.link-arrow span { transition: transform 0.3s var(--ease); }
.link-arrow:hover span { transform: translateX(4px); }

/* ============ Product grid ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(28px, 3vw, 44px) clamp(10px, 1.4vw, 20px);
}

.card { display: block; }
.card__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--card);
}
.card__media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity 0.6s var(--ease), transform 1.2s var(--ease);
}
.card__media img.alt { opacity: 0; }
@media (hover: hover) {
  .card:hover .card__media img.alt { opacity: 1; }
  .card:hover .card__media img { transform: scale(1.03); }
}
.card__badge {
  position: absolute;
  z-index: 2;
  top: 10px; left: 10px;
  padding: 5px 8px 4px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--bg);
  color: var(--fg);
}
.card__badge--live { background: var(--accent); color: #fff; }
.card__info { padding-top: 12px; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.card__name { font-size: 14px; font-weight: 500; line-height: 1.3; }
.card__status { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--muted); white-space: nowrap; }
.card__status--live { color: var(--fg); }
.card.is-sold .card__name { color: var(--muted); }

/* ============ Events ============ */
.events { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 3vw, 44px) clamp(10px, 1.4vw, 20px); }
.event { display: block; }
.event__media { aspect-ratio: 4 / 5; overflow: hidden; background: var(--card); position: relative; }
.event__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), filter 0.6s var(--ease); }
@media (hover: hover) {
  .event:hover .event__media img { transform: scale(1.04); }
}
.event__num { position: absolute; top: 10px; left: 10px; color: #fff; mix-blend-mode: difference; }
.event__info { padding-top: 14px; }
.event__name { font-size: clamp(17px, 1.6vw, 22px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; }
.event__meta { margin-top: 6px; color: var(--muted); }

/* ============ Moments (masonry) ============ */
.masonry { columns: 4 260px; column-gap: clamp(8px, 1vw, 14px); }
.masonry__item {
  break-inside: avoid;
  margin-bottom: clamp(8px, 1vw, 14px);
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--card);
  cursor: zoom-in;
}
.masonry__item img {
  width: 100%; height: auto;
  transition: transform 1s var(--ease), opacity 0.6s var(--ease);
}
@media (hover: hover) {
  .masonry__item:hover img { transform: scale(1.03); }
}

/* ============ Product page ============ */
.product {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
  gap: clamp(24px, 4vw, 64px);
  padding: 24px var(--gutter) 0;
}
.product__gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.product__gallery > :first-child { grid-column: span 2; }
.product__shot { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--card); cursor: zoom-in; }
.product__gallery > .product__shot:first-child { aspect-ratio: 1 / 1; }
.product__shot img, .product__shot video { width: 100%; height: 100%; object-fit: cover; }
.product__shot .play {
  position: absolute; left: 10px; bottom: 10px;
  padding: 5px 8px 4px;
  background: var(--bg); color: var(--fg);
}

.product__info { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; padding-bottom: 24px; }
.crumbs { display: flex; gap: 8px; color: var(--muted); margin-bottom: 28px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--fg); }
.product__name { font-size: clamp(30px, 3.4vw, 48px); font-weight: 500; letter-spacing: -0.04em; line-height: 1; }
.product__rows { margin: 32px 0; border-top: 1px solid var(--line); }
.product__row { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); }
.product__row span:last-child { font-family: var(--f-mono); font-size: 13px; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); margin-right: 8px; vertical-align: 1px; }
.status-dot--live { background: #2fbf5b; box-shadow: 0 0 0 0 rgba(47,191,91,0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(47,191,91,0); } 100% { box-shadow: 0 0 0 0 rgba(47,191,91,0); } }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  height: 54px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--fg);
  color: var(--bg);
  transition: opacity 0.2s, transform 0.2s;
}
.btn:hover { opacity: 0.86; }
.btn:active { transform: scale(0.99); }
.btn[disabled] { background: transparent; color: var(--muted); border: 1px solid var(--line); cursor: not-allowed; opacity: 1; }
.product__note { color: var(--muted); font-size: 14px; margin-top: 16px; }
.product__note a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }

.product-nav { display: flex; justify-content: space-between; gap: 16px; padding: 32px var(--gutter) 0; }
.product-nav .link-arrow { min-width: 0; max-width: calc(50% - 8px); }
.product-nav em { font-style: normal; overflow: hidden; text-overflow: ellipsis; }

/* ============ Event page ============ */
.event-page__head { padding: 40px var(--gutter) 0; }
.event-page__title { font-size: clamp(36px, 6vw, 88px); font-weight: 500; letter-spacing: -0.05em; line-height: 0.95; max-width: 14ch; margin-top: 8px; }
.event-page__meta { margin-top: 18px; color: var(--muted); }
.event-page__gallery { columns: var(--cols, 3) 260px; column-gap: 8px; padding: 40px var(--gutter) 0; max-width: calc(var(--cols, 3) * 520px + 2 * var(--gutter)); }
.event-page__gallery .product__shot { aspect-ratio: auto; display: block; width: 100%; break-inside: avoid; margin-bottom: 8px; }
.event-page__gallery .product__shot img { height: auto; }

/* ============ Not found ============ */
.not-found { min-height: 70vh; display: grid; place-content: center; text-align: center; gap: 20px; padding: 0 var(--gutter); }
.not-found__code { font-size: 120px; font-weight: 500; letter-spacing: -0.06em; line-height: 1; }

/* ============ Footer ============ */
.footer { padding: clamp(56px, 9vw, 120px) var(--gutter) 24px; border-top: 1px solid var(--line); margin-top: clamp(56px, 9vw, 120px); }
.page--home + .footer { margin-top: 0; }
.footer__top { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; flex-wrap: wrap; }
.footer__logo { height: clamp(72px, 14vw, 200px); }
.footer__cols { display: flex; gap: clamp(40px, 6vw, 96px); }
.footer__cols div { display: flex; flex-direction: column; gap: 8px; }
.footer__cols .label { margin-bottom: 6px; }
.footer__cols a { font-size: 15px; }
.footer__cols a:hover { color: var(--accent); }
.footer__bottom { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); }

/* ============ Lightbox ============ */
.lightbox {
  position: fixed; inset: 0;
  z-index: 100;
  background: rgba(8, 8, 8, 0.96);
  color: #f1efea;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s;
  touch-action: pan-y;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__stage { width: 100%; height: 100%; display: grid; place-items: center; padding: 64px clamp(16px, 7vw, 96px); }
.lightbox__stage img, .lightbox__stage video {
  max-width: 100%;
  max-height: calc(100vh - 128px);
  max-height: calc(100svh - 128px);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  animation: lb-in 0.35s var(--ease);
}
@keyframes lb-in { from { opacity: 0; transform: scale(0.985); } to { opacity: 1; transform: none; } }
.lightbox__close { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; display: grid; place-items: center; z-index: 2; }
.lightbox__arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 56px; height: 80px; display: grid; place-items: center; opacity: 0.7; z-index: 2; transition: opacity 0.2s; }
.lightbox__arrow:hover { opacity: 1; }
.lightbox__arrow--prev { left: 4px; }
.lightbox__arrow--next { right: 4px; }
.lightbox__counter { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); opacity: 0.7; }

/* ============ Reveal on scroll ============ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ============ Responsive ============ */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  :root { --header-h: 56px; }
  .header__nav, .header__tools .lang { display: none; }
  .header__burger { display: block; justify-self: start; }
  .header__logo { height: 26px; }

  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .events { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .masonry { columns: 2; }


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

  .product { grid-template-columns: 1fr; padding: 0; gap: 24px; }
  .product__gallery {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 0;
    scrollbar-width: none;
  }
  .product__gallery::-webkit-scrollbar { display: none; }
  .product__gallery > .product__shot,
  .product__gallery > .product__shot:first-child { flex: 0 0 100%; aspect-ratio: 4 / 5; scroll-snap-align: start; }
  .product__info { position: static; padding: 0 var(--gutter); }
  .product__dots { display: flex; }
  .crumbs { margin-bottom: 18px; }
}

@media (min-width: 861px) {
  .product__dots { display: none; }
}

.product__dots { justify-content: center; gap: 5px; padding: 0 var(--gutter); flex-wrap: wrap; margin-top: -12px; }
.product__dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--line); transition: background-color 0.2s, width 0.2s; }
.product__dots i.is-active { background: var(--fg); width: 14px; border-radius: 3px; }

@media (max-width: 520px) {
  .events { grid-template-columns: 1fr; }
  .card__info { flex-direction: column; gap: 2px; }
  .card__name { font-size: 13px; }
  .footer__bottom { flex-direction: column; gap: 4px; }
  .lightbox__arrow { display: none; }
  .lightbox__stage { padding: 56px 0; }
}
