/* ── шрифты ─────────────────────────────────────────────────────────── */

@font-face {
  font-family: "Martian Grotesk";
  src: url("/assets/fonts/MartianGrotesk-StdRg.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Martian Grotesk";
  src: url("/assets/fonts/MartianGrotesk-StdMd.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Martian Grotesk";
  src: url("/assets/fonts/MartianGrotesk-StdBd.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Martian Grotesk SemiExpanded";
  src: url("/assets/fonts/MartianGrotesk-sWdRg.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Martian Grotesk SemiExpanded";
  src: url("/assets/fonts/MartianGrotesk-sWdBl.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}

/* ── переменные ─────────────────────────────────────────────────────── */

:root {
  --bg: #1b1b1b;
  --text: #d0c9e9;
  --accent: #ffffff;
  --muted: #5d596e;

  --pad: 15px;
  --gutter: 30px;
  --cols: 2;
  --gal-top: 37px;

  --fs-nav: 13px;
  --fs-foot: 13px;
  --fs-h1: 26px;
  --lh-h1: 34px;
}

@media (min-width: 768px) {
  :root {
    --pad: 40px;
    --cols: 4;
    --gal-top: 54px;
    --fs-nav: 16px;
    --fs-foot: 14px;
  }
}

@media (min-width: 1280px) {
  :root {
    --pad: clamp(40px, 8.333vw, 160px);
    --gutter: clamp(30px, 2.344vw, 45px);
    --cols: 6;
    --gal-top: 86px;
    --fs-nav: 20px;
    --fs-h1: 32px;
    --lh-h1: 46px;
  }
}

/* ── база ───────────────────────────────────────────────────────────── */

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

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

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: "Martian Grotesk", system-ui, sans-serif;
  font-size: 14px;
  line-height: 22px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

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

button {
  font: inherit;
  color: inherit;
}

.shell {
  width: min(100% - var(--pad) * 2, 1600px);
  margin-inline: auto;
}

.main {
  flex: 1 0 auto;
}

body.is-locked {
  overflow: hidden;
}

.rule {
  height: 2px;
  background: var(--muted);
}

/* ── ссылки ─────────────────────────────────────────────────────────── */

.link {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease;
}

.link:hover,
.link:focus-visible {
  color: var(--accent);
}

.link.is-current {
  color: var(--accent);
}

.link--accent {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.link--accent:hover,
.link--accent:focus-visible {
  color: var(--accent);
  text-decoration: none;
}

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

/* ── шапка ──────────────────────────────────────────────────────────── */

.hdr {
  padding-top: 30px;
}

.hdr__bar {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "logo logo"
    "nav lang";
  row-gap: 26px;
  align-items: center;
}

.hdr__logo {
  grid-area: logo;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.39em;
  max-width: 100%;
  color: var(--text);
  text-decoration: none;
  font-family: "Martian Grotesk SemiExpanded", "Martian Grotesk", sans-serif;
  font-weight: 900;
  font-size: clamp(13px, calc(4.35vw - 1.5px), 33px);
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* до подгонки по ширине прячем слово, чтобы не было прыжка размера */
@media (max-width: 1439px) {
  .hdr__word {
    visibility: hidden;
  }

  html.is-fit .hdr__word {
    visibility: visible;
  }
}

.hdr__logo:hover,
.hdr__logo:focus-visible {
  color: var(--accent);
}

.hdr__star {
  width: 1.167em;
  height: 1.167em;
  flex: none;
}

.hdr__word {
  display: block;
}

.hdr__nav {
  grid-area: nav;
  font-size: var(--fs-nav);
  line-height: 1.2;
}

.hdr__lang {
  grid-area: lang;
  justify-self: end;
  display: flex;
  gap: 15px;
  font-size: var(--fs-nav);
  line-height: 1.2;
}

.hdr .rule {
  margin-top: 12px;
}

@media (min-width: 768px) {
  .hdr {
    padding-top: 34px;
  }

  .hdr__bar {
    row-gap: 28px;
  }

  .hdr__logo {
    font-size: clamp(24px, calc(3.75vw - 3px), 36px);
  }

  .hdr .rule {
    margin-top: 19px;
  }
}

@media (min-width: 1440px) {
  .hdr {
    padding-top: 32px;
  }

  .hdr__bar {
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas: "nav logo lang";
    column-gap: 24px;
    row-gap: 0;
  }

  .hdr__nav {
    justify-self: start;
  }

  .hdr__logo {
    justify-self: center;
    font-size: 36px;
  }

  .hdr__lang {
    gap: 23px;
  }

  .hdr .rule {
    margin-top: 31px;
  }
}

/* на мобиле звёзды в логотипе скрыты — так в макете */
@media (max-width: 767px) {
  .hdr__star {
    display: none;
  }
}

/* ── футер ──────────────────────────────────────────────────────────── */

.ftr {
  flex: none;
  padding-top: 20px;
}

.ftr__row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 22px 0 53px;
  font-size: var(--fs-foot);
  line-height: 22px;
  text-align: center;
}

@media (min-width: 768px) {
  .ftr__row {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    gap: 24px;
    padding: 23px 0 56px;
    text-align: left;
  }
}

/* ── галерея ────────────────────────────────────────────────────────── */

.gal {
  display: flex;
  align-items: flex-start;
  gap: var(--gutter);
  padding-top: var(--gal-top);
}

.gal__col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gutter);
}

/* до инициализации JS — обычные CSS-колонки */
.gal:not(.is-masonry) {
  display: block;
  columns: var(--cols);
  column-gap: var(--gutter);
}

.gal:not(.is-masonry) .stamp {
  break-inside: avoid;
  margin-bottom: var(--gutter);
}

.stamp {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}

.stamp img {
  width: 100%;
  height: auto;
  transition: opacity 0.18s ease;
}

.stamp:hover img,
.stamp:focus-visible img {
  opacity: 0.82;
}

.gal__sentinel {
  height: 1px;
}

.gal__empty {
  margin: 0;
  font-size: 14px;
  line-height: 22px;
}

.gal__end,
.gal__more {
  padding: 60px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--text);
}

.page--gallery .main {
  padding-bottom: 60px;
}

/* ── лайтбокс ───────────────────────────────────────────────────────── */

.lb {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  display: none;
}

.lb[open] {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.lb::backdrop {
  background: var(--bg);
}

.lb:focus,
.lb:focus-visible {
  outline: none;
}

.lb__stage {
  grid-column: 2;
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 40px 0;
  height: 100dvh;
  /* жест свайпа принадлежит лайтбоксу, а не прокрутке/зуму страницы */
  touch-action: none;
}

/* «вписать целиком, но не увеличивать больше 100%»:
   размеры картинки заданы атрибутами, ширина/высота не форсируются */
.lb__img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  -webkit-user-drag: none;
  user-select: none;
}

.lb__close {
  position: absolute;
  top: 39px;
  right: 39px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
}

.lb__close svg,
.lb__nav svg {
  width: 100%;
  height: 100%;
}

.lb__close:hover,
.lb__nav:hover {
  color: var(--accent);
}

.lb__nav {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
  display: none;
}

.lb__nav--prev {
  grid-column: 1;
  margin-left: 42px;
}

.lb__nav--next {
  grid-column: 3;
  margin-right: 42px;
}

@media (min-width: 900px) {
  .lb__nav {
    display: block;
  }
}

@media (max-width: 899px) {
  .lb__close {
    top: 15px;
    right: 14px;
    width: 24px;
    height: 24px;
  }

  .lb__stage {
    padding: 56px 15px;
  }
}

/* ── «О проекте» ────────────────────────────────────────────────────── */

.page--about .main {
  padding-bottom: 56px;
}

.about {
  padding-top: 108px;
}

.about__art {
  position: relative;
  width: 100%;
}

.art {
  position: absolute;
  left: var(--l);
  top: var(--t);
  width: var(--w);
  transform: rotate(var(--r, 0deg));
  transform-origin: center;
}

.art img {
  width: 100%;
  height: auto;
}

/* — композиция слева, десктоп — */
.about__art--left {
  aspect-ratio: 603.66 / 524.43;
}

.art--s1 {
  --l: 3.37%;
  --t: 0%;
  --w: 14.1%;
  --r: 14.06deg;
}

.art--s2 {
  --l: 0%;
  --t: 23.13%;
  --w: 14.39%;
  --r: 12.34deg;
}

.art--photo {
  --l: 27.01%;
  --t: 1.99%;
  --w: 47.17%;
  --r: 0deg;
}

.art--s3 {
  --l: 64.95%;
  --t: 83.41%;
  --w: 14.02%;
  --r: 0deg;
}

.art--s4 {
  --l: 79.36%;
  --t: 71.95%;
  --w: 14.5%;
  --r: 11.94deg;
}

.art--s5 {
  --l: 85.69%;
  --t: 23.45%;
  --w: 14.32%;
  --r: 0.44deg;
}

/* — композиция справа — */
.about__art--right {
  width: 87%;
  aspect-ratio: 278.1 / 159.9;
}

.art--r1 {
  --l: 0%;
  --t: 0%;
  --w: 31.66%;
  --r: 10.59deg;
}

.art--r2 {
  --l: 68.84%;
  --t: 3.65%;
  --w: 31.17%;
  --r: 15.74deg;
}

.art--r3 {
  --l: 19.07%;
  --t: 43.67%;
  --w: 31.25%;
  --r: 10.59deg;
}

.about__h1 {
  margin: 0;
  font-family: "Martian Grotesk SemiExpanded", "Martian Grotesk", sans-serif;
  font-weight: 400;
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
  color: var(--accent);
  max-width: 420px;
}

.about__accent {
  font-weight: 900;
}

.about__body {
  margin-top: 27px;
  /* max-width: 366px; */
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.about__p {
  margin: 0;
  font-size: 14px;
  line-height: 24px;
}

.tape {
  margin: 0;
  background: transparent url("/assets/img/about/tape.webp") center / cover no-repeat;
  color: var(--accent);
  font-family: "Martian Grotesk SemiExpanded", "Martian Grotesk", sans-serif;
  font-weight: 900;
  font-size: 18px;
  line-height: 40px;
  text-align: center;
  padding: 16px 8px;
}

.contacts {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: auto auto;
  justify-content: center;
  column-gap: 36px;
  row-gap: 14px;
  font-size: 14px;
  line-height: 22px;
}

.about__note {
  margin: 26px 0 0;
  max-width: 277px;
  font-size: 11px;
  line-height: 20px;
}

/* десктопная раскладка «О проекте» */
@media (min-width: 1280px) {
  .about {
    display: grid;
    grid-template-columns: 35% 40% 25%;
    justify-content: start;
    align-items: center;
    padding-top: 108px;
  }

  .about__art--left {
    width: 100%;
  }

  .about__aside {
    padding: 46px 48px 0 48px;
  }

  .tape {
    font-size: 24px;
    padding: 28px 8px;
    margin-top: 70px;
  }

  .contacts {
    margin-top: 29px;
    padding: 0 45px;
    grid-template-columns: 138px auto;
    justify-content: start;
    column-gap: 0;
  }

  .about__text {
    padding: 0 85px;
  }

  .about__note {
    margin-top: 28px;
    padding-left: 45px;
  }
}

/* планшет */
@media (min-width: 768px) and (max-width: 1279px) {
  .about {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 240px);
    column-gap: 62px;
    row-gap: 0;
    padding-top: 53px;
    padding-bottom: 20px;
  }

  .about__art--left {
    grid-column: 1 / -1;
    justify-self: center;
    width: min(336px, 70%);
    margin-bottom: 53px;
    aspect-ratio: 330 / 297.65;
  }

  .about__text {
    grid-column: 1;
  }

  .about__aside {
    grid-column: 2;
    padding-top: 4px;
  }

  .about__h1 {
    font-size: 28px;
    line-height: 38px;
  }

  .about__body {
    margin-top: 32px;
    /* max-width: 387px; */
  }

  .about__art--right {
    display: none;
  }

  .tape {
    margin-top: 0;
    padding: 16px 8px;
  }

  .contacts {
    margin-top: 62px;
    padding: 0 0 0 39px;
    grid-template-columns: 86px auto;
    justify-content: start;
    column-gap: 0;
  }

  .about__note {
    margin-top: 26px;
    padding: 0 0 0 39px;
  }
}

/* мобильный */
@media (max-width: 767px) {
  .about {
    padding-top: 56px;
  }

  .about__art--left {
    max-width: 330px;
    margin: 0 auto;
    aspect-ratio: 330 / 297.65;
  }

  .about__art--right {
    display: none;
  }

  .about__h1 {
    margin-top: 57px;
    max-width: none;
    text-align: center;
  }

  .about__body {
    margin-top: 32px;
    text-align: center;
    /* max-width: none; */
  }

  .about__aside {
    margin-top: 50px;
    text-align: center;
  }

  .tape {
    width: 240px;
    margin: 0 auto;
  }

  .contacts {
    margin-top: 23px;
    padding: 0;
    justify-content: center;
    column-gap: 36px;
  }

  .about__note {
    margin: 18px auto 0;
    text-align: center;
  }
}

/* мобильная композиция коллажа */
@media (max-width: 767px) {
  .art--s1 {
    --l: 3.37%;
    --t: 3.79%;
    --w: 14.08%;
  }

  .art--s2 {
    --l: 0%;
    --t: 26.05%;
    --w: 14.37%;
  }

  .art--photo {
    --l: 26.98%;
    --t: 5.71%;
    --w: 47.12%;
  }

  .art--s3 {
    --l: 64.87%;
    --t: 84.03%;
    --w: 14.01%;
  }

  .art--s4 {
    --l: 79.27%;
    --t: 73.03%;
    --w: 14.48%;
  }

  .art--s5 {
    --l: 85.58%;
    --t: 26.33%;
    --w: 14.31%;
  }
}

/* ── 404 ────────────────────────────────────────────────────────────── */

.empty {
  padding: 160px 0;
  text-align: center;
  font-size: 20px;
  line-height: 32px;
}

/* ── админка ────────────────────────────────────────────────────────── */

.admin {
  padding: 40px 0 80px;
  font-size: 14px;
}

.admin h1 {
  font-family: "Martian Grotesk SemiExpanded", sans-serif;
  font-weight: 900;
  font-size: 24px;
  line-height: 40px;
  margin: 0 0 24px;
  color: var(--accent);
}

.admin__bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.admin__tabs {
  display: flex;
  gap: 22px;
}

.admin__notices {
  margin: 0 0 20px;
  font-size: 13px;
}

.admin__notices .ok {
  color: #9fd6a8;
}

.admin__notices .bad {
  color: #e8a0a0;
}

.admin__box {
  border: 1px solid var(--muted);
  padding: 20px;
  margin-bottom: 28px;
}

.admin__box h2 {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 14px;
  color: var(--accent);
}

.admin input[type="text"],
.admin input[type="password"],
.admin input[type="url"],
.admin input[type="file"],
.admin textarea {
  width: 100%;
  background: #232323;
  border: 1px solid var(--muted);
  color: var(--text);
  font: inherit;
  padding: 8px 10px;
  border-radius: 2px;
}

.admin textarea {
  resize: vertical;
}

.admin button,
.admin .btn {
  font: inherit;
  background: #2c2c2c;
  border: 1px solid var(--muted);
  color: var(--accent);
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 2px;
}

.admin button:hover {
  background: #3a3a3a;
}

.admin .btn--danger {
  border-color: #7a4a4a;
  color: #e8a0a0;
}

.admin__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}

.admin__card {
  border: 1px solid #333;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin__card img {
  width: 100%;
  height: auto;
  background: #111;
}

.admin__card input[type="text"] {
  font-size: 12px;
}

.admin__card .row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.admin__field {
  margin-bottom: 18px;
}

.admin__field label {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
}

.admin__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .admin__cols {
    grid-template-columns: 1fr;
  }
}

.admin__hint {
  font-size: 12px;
  color: #9b95ad;
  margin: 4px 0 0;
}

.login {
  max-width: 340px;
  margin: 12vh auto 0;
}

.login h1 {
  text-align: center;
}

.login .admin__field {
  margin-bottom: 16px;
}

.login button {
  width: 100%;
}
