/* ===== ОСНОВА ===== */

body {
  margin: 0;
  min-height: 100vh;
  text-align: center;

  font-family: "M PLUS Rounded 1c", sans-serif;
  font-weight: 700;

  background:
    radial-gradient(circle, rgba(255,255,255,0.35) 23%, transparent 24%),
    radial-gradient(circle, rgba(255,255,255,0.35) 23%, transparent 24%),
    linear-gradient(to bottom, #3d2965, #6537c4, #dc6bfb);

  background-size:
    32px 32px,
    32px 32px,
    100% 100%;

  background-position:
    0 0,
    16px 16px,
    0 0;

  background-repeat: repeat;
  background-blend-mode: overlay;

  animation: dotsFloat 18s linear infinite;
}

/* ===== АНИМАЦИЯ КРУЖОЧКОВ ===== */
@keyframes dotsFloat {
  0% {
    background-position:
      0 0,
      16px 16px,
      0 0;
  }
  100% {
    background-position:
      200px 0,
      216px 16px,
      0 0;
  }
}

/* ===== ТЕКСТ ===== */
h1, p {
  color: #ffffff;
  text-shadow:
    -1px -1px 0 #000,
     1px -1px 0 #000,
    -1px  1px 0 #000,
     1px  1px 0 #000;
}

/* ===== HEADER-КОШЕЧКО ===== */
.top-panel {
  max-width: 860px;
  margin: 20px auto 0 auto;
  padding: 18px 20px 14px;

  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(6px);

  border-radius: 18px;

  box-shadow:
    0 0 0 3px rgba(255,255,255,0.8),
    0 12px 30px rgba(0,0,0,0.35);
}

/* ===== ЛОГО ===== */
.top-logo {
  display: block;
  margin: 0 auto 8px auto;
  max-width: 220px;
  image-rendering: pixelated;
}

/* ===== НАВИГАЦИЯ ===== */
.nav {
  display: flex;
  justify-content: center;
  gap: 26px;
}

/* ссылки */
.nav a {
  color: #f7f1fe;
  text-decoration: none;
  font-weight: 700;

  background: none;
  border: none;
  padding: 0;
  margin: 0;

  transition: color 0.25s ease, text-shadow 0.25s ease;
}

/* подсветка ТЕКСТА */
.nav a:hover {
  color: #ffffff;
  text-shadow:
    0 0 4px rgba(247, 241, 254, 0.9),
    0 0 10px rgba(192, 158, 248, 0.7);
}

/* ===== ГАЛЕРЕЯ ===== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  padding: 30px;
  max-width: 900px;
  margin: 0 auto;
}

.gallery img {
  width: 100%;
  border-radius: 12px;

  box-shadow:
    0 0 0 3px rgba(255,255,255,0.8),
    0 6px 18px rgba(0,0,0,0.35);

  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery img:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow:
    0 0 0 3px #ffd9ff,
    0 10px 26px rgba(0,0,0,0.45);
}

/* ===== ПРОЕКТЫ ===== */
.projects {
  display: grid;
  gap: 24px;
  max-width: 720px;
  margin: 30px auto;
  padding: 0 20px;
}

.project-card {
  background: rgba(255,255,255,0.15);
  border-radius: 16px;
  padding: 20px;

  box-shadow:
    0 0 0 3px rgba(255,255,255,0.8),
    0 10px 30px rgba(0,0,0,0.35);

  backdrop-filter: blur(6px);
}

.project-card h2 {
  margin-top: 0;
}

.project-card a {
  display: inline-block;
  margin-top: 10px;

  color: #fff;
  text-decoration: none;

  padding: 6px 14px;
  border-radius: 999px;

  background: linear-gradient(to right, #ff8bf7, #b388ff);
}

/* ===== ABOUT ===== */
.about-box {
  max-width: 640px;
  margin: 30px auto;
  padding: 22px;

  background: rgba(255,255,255,0.15);
  border-radius: 18px;

  box-shadow:
    0 0 0 3px rgba(255,255,255,0.8),
    0 12px 30px rgba(0,0,0,0.35);

  backdrop-filter: blur(6px);
}

.about-box p {
  margin: 12px 0;
}

/* ===== OVERLAY ДЛЯ АРТА ===== */
.art-overlay {
  position: fixed;
  inset: 0;

  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);

  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;

  z-index: 999;
}

.art-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* АРТ В ЦЕНТРЕ — ОРИГ РАЗМЕР */
.art-overlay img {
  width: auto;
  height: auto;

  max-width: 90vw;
  max-height: 90vh;

  border-radius: 14px;

  box-shadow:
    0 0 0 3px rgba(255,255,255,0.9),
    0 18px 40px rgba(0,0,0,0.6);

  animation: flyIn 0.35s cubic-bezier(.2,.8,.2,1);
}

/* ПОДЛЁТ */
@keyframes flyIn {
  from {
    transform: translateY(40px) scale(0.92);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.art-view {
  position: relative;
  display: inline-block;
}

/* РУКА СВЕРХУ АРТА */
.art-hand {
  position: absolute;
  top: 1px;
  left: 50%;
  transition:
  opacity 0.25s ease,
  transform 0.25s ease;

  transform: translateX(-50%);
  transform-origin: center bottom;

  width: 96px;
  height: 96px;

  background: url("hand.gif") no-repeat center / contain;
  image-rendering: pixelated;

  opacity: 0;
  pointer-events: none;
}

.art-hand.active {
  opacity: 1;
  animation: patPat 0.6s ease-in-out infinite;
}

@keyframes patPat {
  0%   { transform: translateX(-50%) rotate(0deg) scale(1); }
  50%  { transform: translateX(-50%) rotate(-8deg) scale(0.96); }
  100% { transform: translateX(-50%) rotate(0deg) scale(1); }
}

/* ===== ПОЯВЛЕНИЕ HEADER ===== */
.top-panel {
  animation: windowIn 0.6s cubic-bezier(.22,1,.36,1) both;
}

@keyframes windowIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* ===== ПОЯВЛЕНИЕ СТРАНИЦЫ ===== */
.page {
  animation: pageIn 0.7s cubic-bezier(.22,1,.36,1) both;
  animation-delay: 0.15s;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.type-text span {
  opacity: 0;
  animation: fadeChar 0.3s ease forwards;
}

@keyframes fadeChar {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== ABOUT ===== */
.about-box {
  max-width: 640px;
  margin: 30px auto;
  padding: 22px;

  background: rgba(255,255,255,0.15);
  border-radius: 18px;

  box-shadow:
    0 0 0 3px rgba(255,255,255,0.8),
    0 12px 30px rgba(0,0,0,0.35);

  backdrop-filter: blur(6px);
}

/* контейнер строк */
.about-inner {
  display: flex;
  flex-direction: column;
}

/* ===== ОБЁРТКА СТРОКИ ===== */
.line-wrap {
  max-height: 0;
  overflow: hidden;

  transition: max-height 0.6s cubic-bezier(.22,1,.36,1);
}

/* отступ между строками */
.line-wrap + .line-wrap {
  margin-top: 12px;
}

/* ===== ТЕКСТ ===== */
.type-text {
  margin: 0;
  line-height: 1.7;
  letter-spacing: 0.02em;
  text-align: center;
}

/* буковки */
.type-text span {
  opacity: 0;
  display: inline-block;
  animation: charIn 0.25s ease forwards;
}

@keyframes charIn {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.type-text {
  white-space: pre-wrap;
}

/* ===== ЗВЁЗДОЧКИ ИЗ ССЫЛОК ===== */
.star-sprite {
  position: fixed;
  width: 24px;
  height: 24px;

  background: url("sparkle.gif?v=1") no-repeat center / contain;
  image-rendering: pixelated;

  pointer-events: none;
  z-index: 99999;

  animation: starPop 0.7s ease-out forwards;
}

@keyframes starPop {
  from {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  to {
    transform: translate(var(--x), var(--y)) scale(0.4);
    opacity: 0;
  }
}

/* ===== ПЛАВНЫЙ УХОД СТРАНИЦЫ ===== */
body.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* ===== ЛОГО ===== */

.logo-wrap {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.top-logo {
  display: block;
  position: relative;
  z-index: 1;

  transition:
    opacity 0.35s ease,
    transform 0.3s ease;
}

/* белая копия */
.logo-white {
  position: absolute;
  inset: 0;
  z-index: 2;

  pointer-events: none;
  opacity: 0;

  filter:
    brightness(2)
    drop-shadow(0 0 6px #fff)
    drop-shadow(0 0 14px #ffd6ff)
    drop-shadow(0 0 26px #caa0ff);

  transition: opacity 0.35s ease;
}

/* фаза вспышки */
.logo-wrap.flash .logo-white {
  opacity: 1;
}

/* исчезновение логотипа */
.logo-wrap.logo-hide .top-logo {
  opacity: 0;
  transform: scale(0.96);
}

/* ===== ПИКСЕЛИ ЛОГО ===== */

.logo-pixel {
  position: fixed;
  width: 6px;
  height: 6px;

  pointer-events: none;
  z-index: 9999;

  background: radial-gradient(
    circle,
    #ffffff 0%,
    #ffd6ff 45%,
    #caa0ff 75%,
    transparent 100%
  );

  animation: pixelOut 0.45s ease-out forwards;
}

/* вылет */
@keyframes pixelOut {
  from {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  to {
    transform: translate(var(--x), var(--y)) scale(0.6);
    opacity: 0;
  }
}

/* ===== ОБЁРТКА ПРОЕКТА ===== */

.project-shell {
  max-width: 960px;
  margin: 0 auto 60px;

  position: relative;
  overflow: hidden;

  border-radius: 28px;
  border: 3px solid rgba(255,255,255,0.95);

  box-shadow:
    0 18px 36px rgba(30, 0, 70, 0.45);

  background: rgba(120, 70, 170, 0.25);
}


/* ===== ВНУТРЕННИЙ БЛЮР-СЛОЙ ===== */

.project-shell::before {
  content: "";
  position: absolute;
  inset: 0;

  background: rgba(120, 70, 170, 0.45);
  backdrop-filter: blur(14px);

  z-index: 0;
}


/* чтобы контент был поверх блюра */
.project-shell > * {
  position: relative;
  z-index: 1;
}


/* ===== БАННЕР ===== */

.project-banner {
  height: 260px;

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  display: flex;
  align-items: center;
  justify-content: center;
}


/* заголовок-пнг — БЕЗ фильтров */
.project-title-img {
  max-width: 80%;
  height: auto;

  image-rendering: pixelated;
  filter: none;
}


/* ===== ТЕЛО ===== */

.project-body {
  padding: 18px 20px 24px;
  text-align: center;
  color: #fff;
}


/* описание */
.project-desc {
  max-width: 820px;
  margin: 0 auto 14px;

  font-size: 15px;
  line-height: 1.5;

  text-shadow: 0 2px 4px rgba(0,0,0,0.45);
}


/* ===== ТЭГИ ===== */

.project-tags {
  display: flex;
  justify-content: center;
  gap: 10px;

  margin-bottom: 16px;
}

.project-tags span {
  border: none;

  background: rgba(60, 30, 90, 0.55);
  color: #fff;

  padding: 5px 14px;
  font-size: 13px;

  border-radius: 999px;
}

/* ===== КНОПКА (упрощённая) ===== */

.project-btn {
  border: none;
  text-decoration: none;

  background: rgba(255, 170, 255, 0.7);
  color: #fff;

  padding: 8px 26px;
  font-size: 14px;
  font-weight: 700;

  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.25);

  transition:
    background 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.project-btn:hover {
  background: rgba(255, 190, 255, 0.85);
  transform: translateY(1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* ===== нижняя панель ===== */

.bottom-panel {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  padding: 12px 16px;

  background: rgba(170, 120, 210, 0.4);
  backdrop-filter: blur(6px);

  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 18px;

  animation: panelIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  z-index: 9999;
}

/* ===== кнопки ===== */

.bottom-panel .btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(255,255,255,0.25);
  border-radius: 10px;

  opacity: 0;
  animation: iconIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* задержки */
.bottom-panel .btn:nth-child(1) { animation-delay: 0.3s; }
.bottom-panel .btn:nth-child(2) { animation-delay: 0.4s; }
.bottom-panel .btn:nth-child(3) { animation-delay: 0.5s; }
.bottom-panel .btn:nth-child(4) { animation-delay: 0.6s; }

/* ===== иконки ===== */

.bottom-panel .btn img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;

  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== hover / active ===== */

.bottom-panel .btn:hover img {
  transform: translateY(-6px) scale(1.03);
}

.bottom-panel .btn:active img {
  transform: translateY(-2px) scale(0.97);
}

/* ===== анимации ===== */

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translate(-50%, 20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes iconIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== маленькие экраны ===== */

@media (max-height: 700px) {
  .bottom-panel {
    bottom: 10px;
    scale: 0.9;
  }
}

body.ui-exit {
  animation: uiFadeOut 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes uiFadeOut {
  from {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
  }
  to {
    opacity: 0;
    filter: blur(6px);
    transform: scale(0.98);
  }
}

.section-title {
  font-size: 32px;
  text-align: center;
  color: #fff;
}

/* каждая буква */
.section-title span {
  display: inline-block; /* ОБЯЗАТЕЛЬНО */

  animation: float 3s ease-in-out infinite;

  text-shadow:
    -2px -2px 0 #3b1c5a,
     2px -2px 0 #3b1c5a,
    -2px  2px 0 #3b1c5a,
     2px  2px 0 #3b1c5a;
}

/* анимация */
@keyframes float {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}
