/* ------------------ ШРИФТЫ RALEWAY & MULI ------------------ */
@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;500;600;700&family=Muli:wght@300;400&display=swap');

/* ------------------ Базовая стилизация (Desktop) ------------------ */
body {
  margin: 0;
  font-family: 'Muli', sans-serif;
  font-weight: 300;
  color: #eee;
  background: #1a1a1a;
  overflow-x: hidden;
  line-height: 1.6;
}

canvas#bgCanvas {
  position: fixed;
  top: 0; left: 0;
  z-index: -1;
}

section {
  padding: 60px 20px;
  text-align: center;
}

h1, h2 {
  color: #b19cd9;
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  letter-spacing: 1.5px;
}

#about {
  padding: 300px 20px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.project-section {
  background: rgba(45, 45, 58, 0.7);
  width: 100%;
  padding: 60px 40px;
  box-sizing: border-box;
  border-top: 1px solid rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  border-radius: 30px;
}

.fade-in-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s ease, transform 1s ease;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-gallery {
  display: flex;
  overflow-x: auto;
  gap: 20px;
  padding: 20px 0;
  scroll-behavior: smooth;
}

.scroll-gallery img {
  height: 400px;
  border-radius: 10px;
  flex-shrink: 0;
  background: #222;
  cursor: pointer;
  transition: transform 0.2s;
}

.scroll-gallery img:hover {
  transform: scale(1.05);
}

/* Lightbox */
#lightbox {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
#lightbox.hidden {
  display: none;
}
#lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
}

.project-spacer {
  height: 80px;
  background: rgba(26, 26, 26, 0.8);
}

#footer {
  background: rgba(0, 0, 0, 0.45);
  padding: 10px 10px;
  text-align: center;
  color: #aaa;
  font-size: 14px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
  letter-spacing: 0.5px;
}

#footer a {
  color: #b19cd9;
  text-decoration: none;
  font-weight: 400;
}
#footer a:hover {
  text-decoration: underline;
}

/* About */
.about-container::before {
  content: "Gorelova PH";
  position: absolute;
  top: -80%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 6rem;
  font-weight: 700;
  font-family: 'Cinzel', serif;
  color: rgba(177, 156, 217, 0.05);
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
  z-index: 0;
  letter-spacing: 4px;
}

.about-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  margin: 40px auto;
  max-width: 500px;
}

.about-photo img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #b19cd9;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
}

.about-photo h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 600;
  margin-top: 25px;
  color: #b19cd9;
  letter-spacing: 2px;
}

.about-bubble {
  position: absolute;
  background: transparent;
  color: #eee;
  padding: 18px 28px;
  border-radius: 8px;
  max-width: 280px;
  font-size: 16px;
  font-weight: 400;
  font-family: 'Muli', sans-serif;
  line-height: 1.8;
  backdrop-filter: blur(3px);
  text-align: center;
  transition: all 0.4s ease;
  z-index: 1;
}

.about-bubble::before,
.about-bubble::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(177, 156, 217, 0.6);
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.about-bubble::before { top: 0; left: 0; border-right: none; border-bottom: none; }
.about-bubble::after { bottom: 0; right: 0; border-left: none; border-top: none; }

.about-bubble:hover::before,
.about-bubble:hover::after { width: 100%; height: 100%; border: 1px solid #b19cd9; }
.about-bubble:hover { transform: scale(1.05); box-shadow: 0 0 20px rgba(208, 139, 224, 0.4); }

/* Расположение на десктопе */
.top-left {
  top: -150px;
  left: -240px;
  transform: translate(0, 0);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.top-left:hover {
  transform: translate(0, 0) scale(1.05);
  box-shadow: 0 0 20px rgba(208, 139, 224, 0.4);
}

.top-right {
  top: -150px;
  right: -240px;
  transform: translate(0, 0);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.top-right:hover {
  transform: translate(0, 0) scale(1.05);
  box-shadow: 0 0 20px rgba(208, 139, 224, 0.4);
}

.bottom-center {
  bottom: -150px;
  left: 50%;
  transform: translateX(-50%);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.bottom-center:hover {
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 0 20px rgba(208, 139, 224, 0.4);
}

/* ------------------ Адаптация для мобильных ------------------ */
@media (max-width: 768px) {
  #about {
    padding: 100px 20px;
  }

  .about-container {
    flex-direction: column;
    align-items: center;
    max-width: 90%;
    margin: 20px auto;
  }

  .about-bubble {
    position: static;
    margin-top: 15px;
    max-width: 100%;
    font-size: 15px;
    text-align: center;
    backdrop-filter: blur(2px);
  }

  .about-bubble::before,
  .about-bubble::after {
    display: none;
  }

  .project-section {
    padding: 40px 20px;
    margin: 20px 0;
  }

  .scroll-gallery img {
    height: 200px;
  }

  #bgCanvas {
    height: 30vh;
  }
}

/* --- Универсальная мобильная адаптация --- */
@media (max-width: 768px) {
  body, html {
    overflow-x: hidden;
  }

  #about {
    padding: 100px 10px;
  }

  .about-container {
    max-width: 100%;
    margin: 0 auto;
    flex-direction: column;
    align-items: center;
    padding: 0 10px;
    box-sizing: border-box;
  }

  .about-bubble {
    position: static;
    margin: 10px auto;
    max-width: 100%;
    text-align: center;
    left: auto; right: auto;
    transform: none;
  }

  #bgCanvas {
    width: 100vw;
    height: 30vh;
  }

  .project-section {
    padding: 40px 10px;
    margin: 20px 0;
  }

  .scroll-gallery img {
    height: 180px;
  }
}

/* ========== ОБНОВЛЕННЫЕ СТИЛИ ДЛЯ КАТЕГОРИЙ ПРОЕКТОВ ========== */
/* === Категории на главной странице === */
#categories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin: 60px auto;
  max-width: 1400px;
  padding: 0 20px;
}

.category-card {
  position: relative;
  width: 100%;
  height: 440px;
  overflow: hidden;
  border-radius: 14px;
  cursor: pointer;
  /* Тонкая рамка вместо толстой фиолетовой */
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) brightness(0.9);
  opacity: 0.8;
  transition: all 0.5s ease;
}

.category-card .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(26, 26, 26, 0.85);
  color: #b19cd9;
  padding: 25px;
  text-align: center;
  font-family: 'Muli', sans-serif;
  font-size: 1.8em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;
  backdrop-filter: blur(5px);
  border-top: 1px solid rgba(177, 156, 217, 0.2);
  z-index: 2;
}

/* Эффект при наведении - плавное появление плашки */
.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  border-color: rgba(177, 156, 217, 0.3);
}

.category-card:hover img {
  filter: grayscale(0%) brightness(1);
  opacity: 1;
  transform: scale(1.05);
}

.category-card:hover .overlay {
  opacity: 1;
  transform: translateY(0);
}

/* Мобильная адаптация для категорий */
@media (max-width: 1024px) {
  #categories {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .category-card {
    height: 380px;
  }
}

@media (max-width: 768px) {
  #categories {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 0 15px;
  }

  .category-card {
    height: 300px;
  }

  .category-card .overlay {
    font-size: 1.6em;
    letter-spacing: 1.5px;
    padding: 20px;
  }
}

.section-title {
  text-align: center;
  color: #b19cd9;
  font-family: 'Muli', sans-serif;
  font-size: 3.5rem;
  font-weight: 600;
  margin: 80px 0 40px 0;
  letter-spacing: 4px;
  text-transform: uppercase;
  animation: fadeIn 1.2s ease;
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #b19cd9, transparent);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* SVG и анимации */
svg {
  width: 256px;
  height: 256px;
}

* {
  box-sizing: border-box;
}

svg.photo-svg {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 08%;
  top: 18%;
  transform: perspective(700px) rotateX(58deg);
  -webkit-transform: perspective(700px) rotateX(58deg);
}

.full-icon {
  position: absolute;
  width: 256px;
  height: 256px;
  left: 10%;
  top: 68%;
  transform: none;
}

.full-icon .button-press {
  transform-origin: 0% 8%;
  animation: 3.7s btn-press infinite;
}

@keyframes btn-press {
  0%, 2.702702702702703% { transform: scaleY(1); }
  5.405405405405405%, 10.81081081081081% { transform: scaleY(0.75); }
  10.91081081081081%, 100% { transform: scaleY(1); }
}

.full-icon .light-blink {
  opacity: 0;
  animation: 3.7s dot-blink infinite ease-out;
}

@keyframes dot-blink {
  0%, 3.378378378378378% { opacity: 0; }
  6.756756756756757% { opacity: 1; }
  10.13513513513513% { opacity: 0; }
  13.51351351351351% { opacity: 1; }
  16.89189189189189%, 100% { opacity: 0; }
}

.full-icon .photo {
  transform: scaleY(0);
  transform-origin: 100% 31%;
  animation: 3.7s photo-out infinite ease;
}

@keyframes photo-out {
  0%, 20.27027027027027% { transform: scaleY(0); }
  40.54054054054054%, 70% { transform: scaleY(1); }
  80%, 100% { transform: translateY(70%); }
}

/* Polaroid */
.polaroid {
  position: relative;
  width: 220px;
  margin: -190px;
  margin-left: 75%;
}

.polaroid-frame {
  background: #302f2f;
  transform-origin: top right;
  padding: 10px;
  border-radius: 8px;
  width: 100%;
  box-shadow: 0px 8px 25px rgba(0, 0, 0, 0.45);
  text-align: center;
  transform: rotate(-3deg);
  animation: polaroidSwing 4s ease-in-out infinite;
}

@keyframes polaroidSwing {
  0% { transform: rotate(-3deg); }
  25% { transform: rotate(0.5deg); }
  50% { transform: rotate(-2deg); }
  75% { transform: rotate(1deg); }
  100% { transform: rotate(-3deg); }
}

.polaroid-photo {
  position: relative;
  width: 100%;
  height: 200px;
  border-radius: 4px;
  background: linear-gradient(145deg, #2f2840, #4a3a6a);
  overflow: hidden;
}

.polaroid-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--photo-url);
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 4s ease-in-out, transform 6s ease-in-out;
}

.polaroid-photo.animate::before {
  opacity: 1;
  transform: scale(1);
}

.polaroid-photo::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 2%;
  height: 100%;
  background: linear-gradient(
    120deg,
    rgba(255,255,255,0.6) 0%,
    rgba(255,255,255,0) 50%,
    rgba(255,255,255,0.6) 100%
  );
  opacity: 0.3;
  transform: translateX(20%);
  animation: lightFlash 4s ease-in-out infinite alternate;
}

@keyframes lightFlash {
  0% { transform: translateX(10%); opacity: 0.2; }
  50% { transform: translateX(30%); opacity: 0.35; }
  100% { transform: translateX(10%); opacity: 0.2; }
}

/* Подписи Polaroid */
.polaroid-label {
  margin-top: 10px;
  font-family: 'Muli', sans-serif;
  font-size: 16px;
  letter-spacing: 1.5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.polaroid-title {
  font-weight: 600;
  color: #eee;
}

.polaroid-date,
.polaroid-num {
  font-size: 13px;
  opacity: 0.7;
  font-family: 'Muli', sans-serif;
  font-weight: 300;
}

/* Дополнительные изящные стили для текста */
.about-container::after {
  position: absolute;
  bottom: -180px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Muli', sans-serif;
  font-size: 1.8rem;
  font-weight: 400;
  color: rgba(177, 156, 217, 0.3);
  letter-spacing: 6px;
  text-transform: uppercase;
}

/* Стили для заголовков в проектах */
.project-section h3 {
  font-family: 'Muli', sans-serif;
  font-size: 2rem;
  font-weight: 500;
  color: #b19cd9;
  margin-bottom: 20px;
  letter-spacing: 2px;
}

.project-section p {
  font-family: 'Muli', sans-serif;
  font-size: 1.1rem;
  line-height: 1.8;
  font-weight: 300;
}
