/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0a0a;
  --text: #f5f5f5;
  --yellow: #FFCC00;
  --pink: #E84B8A;
  --radius: 0;
  --gap: 20px;
  --side-pad: 70px;
  --max-w: 1440px;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Onest', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 18px;
  line-height: 1.5;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

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

/* ===== NAVIGATION ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--yellow);
  height: 45px;
}

.nav__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--side-pad);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__links-left {
  display: flex;
  gap: 20px;
}

.nav__link {
  font-family: 'Onest', sans-serif;
  font-size: 16px;
  font-weight: 300;
  color: #000;
  transition: opacity 0.2s;
}

.nav__link:hover {
  opacity: 0.7;
}

/* ===== HERO ===== */
.hero {
  width: 100%;
  padding: 190px 0 160px;
  position: relative;
  overflow: hidden;
}

#metaballs {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  image-rendering: pixelated;
}

.hero__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--side-pad);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}

.hero__title {
  font-family: 'Dela Gothic One', cursive;
  font-size: clamp(32px, 5vw, 66px);
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--text);
  max-width: 975px;
  margin-bottom: 50px;
}

/* ===== BUTTON ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Dela Gothic One', cursive;
  font-size: 22px;
  width: 284px;
  height: 72px;
  border: none;
  border-radius: 0;
  background: var(--yellow);
  color: #000;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.btn:hover {
  transform: scale(1.03);
}

.hero .btn {
  align-self: flex-start;
}

/* ===== SECTIONS ===== */
.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--side-pad);
  margin-bottom: 20px;
}

.section__title {
  font-family: 'Dela Gothic One', cursive;
  font-size: clamp(28px, 4.5vw, 65px);
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 40px;
}

/* ===== ILLUSTRATION BLOCK SPACING ===== */
.oh-god-cards,
.grid-2x4,
.small-and-banner,
.mixed-grid {
  margin-bottom: 60px;
}

/* ===== TITLED SECTION SPACING ===== */
.volunteer,
.plasticine,
.posters,
.about {
  margin-top: 80px;
}

/* ===== OH GOD CARDS ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.card__media {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  display: block;
}

/* ===== GRID 2x4 with zoom ===== */
.grid-2x4 {
  position: relative;
}

.grid-zoom-spacer {
  height: 0;
}

.grid-zoom-sticky {
  position: sticky;
  top: 45px; /* below nav */
  overflow: visible;
}

.grid-2x4__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  position: relative;
}

.grid-2x4__grid img {
  width: 100%;
  aspect-ratio: 310 / 413;
  object-fit: cover;
  will-change: transform, opacity;
}

.grid-2x4__grid img[data-grid="0"] {
  transform-origin: center top;
  z-index: 10;
  position: relative;
}

/* ===== SMALL + BANNER ===== */
.small-and-banner__layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  grid-template-rows: 1fr;
  gap: var(--gap);
  align-items: stretch;
}

.small-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}

.small-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.wide-banner {
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.wide-banner img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== MIXED GRID ===== */
.mixed-grid__layout {
  display: grid;
  grid-template-columns: 319fr 626fr 316fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
}

.mixed-grid__tl { grid-area: 1 / 1; }
.mixed-grid__bl { grid-area: 2 / 1; }
.mixed-grid__center { grid-area: 1 / 2 / 3 / 3; }
.mixed-grid__tr { grid-area: 1 / 3; }
.mixed-grid__br { grid-area: 2 / 3; }

.mixed-grid__layout img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

/* ===== MOBILE / DESKTOP SEPARATION ===== */
.mobile-only { display: none !important; }

@media (max-width: 768px) {
  .mobile-only { display: revert !important; }
  .desktop-only { display: none !important; }
}

/* ===== VOLUNTEER WORK ===== */

/* --- Scene layout --- */
.volunteer__scene {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
  margin-bottom: 50px;
  min-height: 550px;
}

.volunteer__text {
  font-family: 'Dela Gothic One', cursive;
  font-size: clamp(20px, 3.5vw, 42px);
  line-height: 1.15;
  text-transform: uppercase;
  max-width: 680px;
  margin-bottom: 60px;
}

/* --- Sticker sheet stack (left) --- */
.vol-stack {
  position: relative;
  width: 500px;
  height: 500px;
}

.vol-stack__sheet {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  object-fit: contain;
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* --- Cat box + stickers (right) --- */
.vol-cat {
  position: relative;
  width: 100%;
  height: 700px;
}

.vol-cat__box {
  position: absolute;
  z-index: 20;
  width: 600px;
  left: 50%;
  top: calc(50% - 100px);
  transform: translate(-50%, -50%);
}

.vol-sticker {
  position: absolute;
  z-index: 10;
  left: 50%;
  top: calc(50% - 100px);
  pointer-events: none;
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* Sticker sizes */
.vol-sticker[data-sticker="0"] { width: 144px; }  /* red cat */
.vol-sticker[data-sticker="1"] { width: 168px; }  /* green cat */
.vol-sticker[data-sticker="2"] { width: 36px;  }  /* paw */
.vol-sticker[data-sticker="3"] { width: 114px; }  /* blue face */
.vol-sticker[data-sticker="4"] { width: 36px;  }  /* paw */
.vol-sticker[data-sticker="5"] { width: 155px; }  /* pink cat 1 */
.vol-sticker[data-sticker="6"] { width: 150px; }  /* pink cat 2 */
.vol-sticker[data-sticker="7"] { width: 145px; }  /* pink cat 3 */
.vol-sticker[data-sticker="8"] { width: 130px; }  /* blue bow */
.vol-sticker[data-sticker="9"] { width: 180px; }  /* orange cat */
.vol-sticker[data-sticker="10"] { width: 36px; }  /* paw */
.vol-sticker[data-sticker="11"] { width: 36px; }  /* paw */
.vol-sticker[data-sticker="12"] { width: 36px; }  /* paw */

/* --- Postcards scene --- */
/* ===== OVERFLOW GUARD (full viewport width clip) ===== */
.overflow-guard {
  position: relative;
  left: calc(-50vw + 50%);
  width: 100vw;
  overflow-x: clip;
}

.postcards__scene {
  display: flex;
  justify-content: center;
  gap: 60px;
  margin-top: 20px;
  overflow: visible;
}

.pc-stack {
  position: relative;
  overflow: visible;
}

.pc-stack--left {
  width: 380px;
  height: 290px;
}
.pc-stack--right {
  width: 250px;
  height: 370px;
}

.pc-stack__card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.25));
  will-change: transform;
  backface-visibility: hidden;
}

/* ===== PLASTICINE STICKERS ===== */
.plasticine__layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 40px;
  align-items: start;
}

.plasticine__phone img {
  width: 100%;
}

.plasticine__right {
  position: relative;
}

.plasticine__stickers-top {
  display: flex;
  align-items: flex-start;
  gap: 30px;
  margin-bottom: 20px;
}

.plast-item--cat { width: 240px; }
.plast-item--strawberry { width: 180px; margin-top: 20px; }
.plast-item--moon { width: 210px; }

.plasticine__photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  position: relative;
  z-index: 1;
  max-width: 550px;
  margin-left: 120px;
}

.plasticine__photos img {
  width: 100%;
  object-fit: cover;
}

.plasticine__stickers-bottom {
  display: flex;
  align-items: flex-start;
  gap: 25px;
  position: relative;
  z-index: 2;
  margin-top: -80px;
}

.plast-item--eye { width: 200px; }
.plast-item--hot { width: 190px; margin-top: 40px; }
.plast-item--mouth { width: 210px; margin-top: -20px; }

/* Small decorations */
.plast-deco {
  position: absolute;
  pointer-events: none;
}
.plast-deco--star1 { width: 18px; top: 180px; left: 420px; }
.plast-deco--star2 { width: 14px; top: 120px; right: 40px; }

/* ===== POSTERS ===== */
.posters__row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.posters__row-3 img {
  width: 100%;
  aspect-ratio: 421 / 596;
  object-fit: cover;
}

.posters__row-2 {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: var(--gap);
}

.posters__row-2 img {
  width: 100%;
  object-fit: cover;
}

/* ===== ABOUT ME ===== */
.about__layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.about__bio {
  font-size: 20px;
  line-height: 1.6;
  margin-bottom: 40px;
  max-width: 740px;
  color: rgba(245, 245, 245, 0.85);
}

.about__photo-col img {
  width: 100%;
  max-width: 530px;
  border-radius: var(--radius);
  margin-left: auto;
  display: block;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--pink);
  padding: 80px 0 100px;
  margin-top: 80px;
}

.footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--side-pad);
}

.footer__title {
  font-family: 'Dela Gothic One', cursive;
  font-size: clamp(28px, 4.5vw, 65px);
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--bg);
  max-width: 1020px;
  margin-bottom: 40px;
}

.footer__text {
  font-size: 20px;
  line-height: 1.5;
  color: var(--bg);
  max-width: 680px;
  opacity: 0.85;
  margin-bottom: 40px;
}

.footer__icons {
  display: flex;
  gap: 16px;
}

.footer__icon img {
  width: 44px;
  height: 44px;
  border-radius: 0;
  transition: opacity 0.2s;
}

.footer__icon:hover img {
  opacity: 0.7;
}

/* ===== LIGHTBOX ===== */
.grid-2x4__grid img {
  cursor: zoom-in;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox--open {
  opacity: 1;
  visibility: visible;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  transform: scale(0.92);
  transition: transform 0.3s ease;
}

.lightbox--open .lightbox__img {
  transform: scale(1);
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 48px;
  cursor: pointer;
  padding: 20px;
  opacity: 0.6;
  transition: opacity 0.2s;
  user-select: none;
}

.lightbox__nav:hover {
  opacity: 1;
}

.lightbox__nav--prev { left: 20px; }
.lightbox__nav--next { right: 20px; }

/* ===== CONTENT-VISIBILITY ===== */
.oh-god-cards, .small-and-banner, .mixed-grid,
.plasticine, .posters, .about {
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
}


/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  :root {
    --side-pad: 40px;
  }

  .grid-2x4__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .mixed-grid__layout {
    grid-template-columns: 1fr 1fr;
  }

  .mixed-grid__center {
    grid-row: span 2;
  }

  .mixed-grid__right {
    grid-column: 1;
  }

  .small-and-banner__layout {
    grid-template-columns: 1fr;
  }

  .small-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .small-grid img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }
}

@media (max-width: 768px) {
  :root {
    --side-pad: 24px;
    --gap: 12px;
  }

  .cards-grid {
    grid-template-columns: 1fr 1fr;
    max-width: 100%;
  }

  .cards-grid .card:first-child {
    grid-column: 1 / -1;
  }

  .grid-2x4__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .small-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .wide-banner {
    min-height: unset;
  }

  .wide-banner img {
    position: static;
    width: 100%;
    height: auto;
    object-fit: unset;
  }

  .mixed-grid__layout {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
  }

  .mixed-grid__tl     { grid-row: 1; grid-column: 1; aspect-ratio: 3 / 4; object-fit: cover; }
  .mixed-grid__tr     { grid-row: 1; grid-column: 2; aspect-ratio: 3 / 4; object-fit: cover; }
  .mixed-grid__center { grid-row: 2; grid-column: 1 / -1; }
  .mixed-grid__bl     { grid-row: 3; grid-column: 1; }
  .mixed-grid__br     { grid-row: 3; grid-column: 2; }

  .mixed-grid__right { display: none; }

  .mixed-grid__layout img {
    width: 100%;
    height: auto;
  }

  .mixed-grid__center {
    aspect-ratio: unset;
    object-fit: contain;
  }

  .plasticine__content {
    grid-template-columns: 1fr;
  }

  .plasticine__phone img {
    max-width: 100%;
  }

  .posters__row-3 {
    grid-template-columns: repeat(2, 1fr);
    max-width: 100%;
  }

  .posters__row-3 img:last-child {
    grid-column: 1 / -1;
    width: 100%;
    height: auto;
  }

  .posters__row-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .posters__row-2 img:first-child {
    aspect-ratio: 3 / 4;
    object-fit: cover;
  }

  .posters-mobile {
    display: flex !important;
    flex-direction: column;
    gap: var(--gap);
  }

  .posters-mobile__pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap);
  }

  .posters-mobile__pair img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
  }

  .posters-mobile__wide {
    width: 100%;
    height: auto;
  }

  .about__layout {
    grid-template-columns: 1fr;
  }

  .about__photo-col img {
    margin-left: 0;
    max-width: 100%;
  }

  .btn {
    font-size: 18px;
    padding: 14px 40px;
  }

  /* Отключаем scroll-анимации — показываем элементы статично */
  .grid-zoom-spacer { height: 0 !important; }
  .grid-zoom-sticky { position: static; }
  .grid-2x4__grid img {
    transform: none !important;
    opacity: 1 !important;
  }

  .vol-stack__sheet {
    transform: none !important;
  }

  .vol-sticker {
    display: none;
  }

  .vol-cat {
    display: none;
  }

  .vol-mobile {
    display: flex !important;
    flex-direction: column;
    gap: var(--gap);
    margin-bottom: 40px;
  }

  .vol-mobile img {
    width: 100%;
    height: auto;
  }

  .vol-mobile--postcards {
    display: block !important;
    width: 100%;
    height: auto;
    margin-top: var(--gap);
  }

  /* Postcards: показываем только верхнюю карточку каждого стека */
  .pc-stack__card {
    transform: none !important;
    opacity: 1 !important;
  }

  .pc-stack__card:not([data-i="0"]) {
    display: none;
  }

  .postcards__scene {
    gap: 16px;
    justify-content: flex-start;
    padding: 0 var(--side-pad);
  }


  .pc-stack--left,
  .pc-stack--right {
    flex: 1;
    width: auto;
    height: auto;
  }

  .pc-stack__card[data-i="0"] {
    position: static;
    width: 100%;
    height: auto;
  }
}
