html {
  scroll-behavior: smooth;
  scroll-padding-top: 0;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

/* ===== SPACING SYSTEM ===== */
/* 8px-based modular scale for consistent spacing */
:root {
  --space-xs: 4px;    /* 0.5 * 8px */
  --space-sm: 8px;    /* 1 * 8px */
  --space-md: 16px;   /* 2 * 8px */
  --space-lg: 24px;   /* 3 * 8px */
  --space-xl: 32px;   /* 4 * 8px */
  --space-2xl: 48px;  /* 6 * 8px */
  --space-3xl: 64px;  /* 8 * 8px */
  --space-4xl: 96px;  /* 12 * 8px */
  
  /* Container padding */
  --container-padding: var(--space-lg); /* 24px left/right */
  
  /* External spacing - между основными секциями */
  --external-gap: var(--space-4xl); /* 96px между секциями */
  
  /* Internal spacing - внутри проектов */
  --internal-gap: var(--space-xl);  /* 32px между элементами внутри проекта */
  
  /* Element spacing patterns */
  --spacing-image-to-heading: var(--space-md); /* 16px - image to heading */
  --spacing-heading-to-text: var(--space-sm);  /* 8px - heading to text */
  --spacing-text-to-button: var(--space-lg);   /* 24px - text to button */
}



body.fon {
  background: #1a1a1a;
  min-height: 100vh;
  font-family: 'SF Pro Display', 'SF Pro Text', 'San Francisco', 'Segoe UI', 'Arial', sans-serif;
  color: #e8e8e8;
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
}

/* ===== MAIN LAYOUT STRUCTURE ===== */
.main-container {
  max-width: 1700px;
  margin: 0 auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--internal-gap);
  padding-left: 8px;
  padding-right: 8px;
  align-items: center;

}

.project-container {
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
}

.project-container > * {
  margin-bottom: var(--internal-gap);
}

.project-container > *:last-child {
  margin-bottom: 0;
}

/* ===== HERO SECTION ===== */
.hero {
  display: flex;
  max-width: 1400px;
  margin: 16px auto 16px auto;
  justify-content: center;
  align-items: flex-start;
  min-height: 0;
  padding-top: var(--space-2xl); /* 48px */
  padding-bottom: var(--space-lg);
}

.hero-canvas-wrap {
  position: relative;
  width: clamp(320px, 92vw, 1400px);
  aspect-ratio: 1400 / 550;
  min-height: 420px;
  max-height: 620px;
  height: auto;
  max-width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: var(--space-md);
  overflow: hidden;
}

#hero-webgl {
  width: 100%;
  height: 100%;
  border-radius: var(--space-md);
  box-sizing: border-box;
  position: absolute;
  top: 0; left: 0;
  z-index: 1;
  pointer-events: all;
  overflow: hidden;
}

.hero-contact {
  position: absolute;
  left: var(--space-lg); /* 24px */
  bottom: var(--space-lg); /* 24px */
  display: inline-block;
  background: #2a2a2a;
  color: #e8e8e8;
  font-size: 22px;
  font-weight: 500;
  padding: var(--space-md) var(--space-lg); /* 16px 24px */
  border-radius: var(--space-md); /* 16px */
  text-decoration: none;
  transition: color 0.5s ease-in-out, background 0.5s ease-in-out;
  overflow: hidden;
  z-index: 2;
  border: none;
}

.hero-contact:hover {
  color: #fff;
  background: #3a5aff;
}

.hero-contact::after {
  display: none;
}

.hero-static {
  display: none;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-md) 0;
  width: 100%;
  box-sizing: border-box;
  max-width: 600px;
  margin: 0 auto var(--space-xl);
}

.hero-static-media {
  position: relative;
  width: 100%;
  height: clamp(420px, 130vw, 640px);
  border-radius: var(--space-md);
  overflow: hidden;
}

.hero-static-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  display: block;
  filter: saturate(1.05);
}

.hero-static-cta {
  position: absolute;
  left: var(--space-lg);
  bottom: var(--space-lg);
  z-index: 2;
}

/* ===== ABOUT SECTION ===== */
.about {
  display: grid;
  grid-template-columns: clamp(320px, 47vw, 700px) 1fr;
  gap: 32px;
  align-items: start;
  max-width: 1400px;
  margin: 0 auto;
}

.zagolovok {
  font-size: 40px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
  color: #e8e8e8;
  /* для выравнивания по силовой линии */
  align-self: start;
}

.tekst, .opisanie, .proekt-opisanie, .proekt-itog {
  font-size: 22px;
  line-height: 1.4;
  color: #e8e8e8;
  margin: 0;
}

/* Сброс отступов для текста и заголовков */
p, h1, h2, h3, h4, h5, h6 {
  margin-block-start: 0;
  margin-block-end: 0;
  margin-top: 0;
  margin-bottom: var(--space-md); /* 16px - consistent paragraph spacing */
}

.ssylka {
  color: #a0a0a0;
  text-decoration: none;
  position: relative;
  display: inline-block;
  transition: color 0.3s ease;
}

.ssylka::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background-color: #a0a0a0;
  transform: scaleX(1);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.ssylka:hover {
  color: #5a7fff;
}

.ssylka:hover::after {
  transform: scaleX(0);
  transform-origin: right;
}

/* ===== PROJECT SECTION ===== */
.project {
  background: #252525;
  padding: 24px;
  border-radius: 28px;
  margin-bottom: 18px;
}

/* PROJECT MAIN: двухколоночная система с силовой линией */
.project-main {
  display: grid;
  grid-template-columns: clamp(320px, 45vw, 754px) 1fr;
  gap: 32px;
  align-items: start;
}

.project-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.project-title {
  font-size: 28px;
  font-weight: 700;
  color: #e8e8e8;
}

.project-tag {
  font-size: 16px;
  color: #b0b0b0;
  margin-bottom: 16px;
}

.project-description {
  flex: 1 1 0;
}

.project-gallery {
  margin-top: var(--space-xl);
}

/* ===== GALLERY SECTION ===== */
.gallery {
  max-width: 1400px;
  min-height: 550px;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin: 0 auto;
  box-sizing: border-box;
}

/* Убираем margin у галереи внутри project-container */
.project-container .gallery {
  margin: 0;
}

/* Убираем gap у последнего элемента в project-container */
.project-container > *:last-child {
  margin-bottom: 0;
}

.gallery-main {
  width: 100%;
  margin-bottom: var(--space-md);
}

.gallery-main img,
.gallery-main video {
  width: 100%;
  height: auto;
  border-radius: 18px;
  object-fit: cover;
  display: block;
}

.gallery-icons {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Возвращаем две колонки */
  gap: var(--space-md);
  width: 100%;
}

.gallery-icons img,
.gallery-icons .gallery-video {
  width: 100%;
  aspect-ratio: 1/1; /* Квадратные картинки */
  object-fit: cover;
  border-radius: 18px;
  box-sizing: border-box;
  display: block;
}

.gallery-final {
  display: flex;
  justify-content: center;
}

.gallery-final img {
  width: 100%;
  max-width: 1024px;
  border-radius: 18px;
  display: block;
}

/* ===== GLASS FOLDER STYLES ===== */
.glass-folder {
  position: relative;
  width: 372px;
  height: 68px;
  background: #F6B39C;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px 0 rgba(0,0,0,0.3);
  margin: 0 auto;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.glass-folder:hover {
  transform: translateY(-16px) scale(1.08);
  box-shadow: 0 12px 32px 0 rgba(0,0,0,0.5);
}

.glass-folder:hover .glass-photo:nth-child(1) {
  transform: translateY(-18px) scale(1.04);
  transition-delay: 0.08s;
  transform: translateX(-50%);
}

.glass-folder:hover .glass-photo:nth-child(2) {
  transform: translateY(-18px) scale(1.04);
  transition-delay: 0.18s;
  transform: translateX(-50%);

}

.glass-photo {
  transition-delay: 0s;
}

.glass-folder:not(:hover) .glass-photo:nth-child(1),
.glass-folder:not(:hover) .glass-photo:nth-child(2) {
  transform: none;
  transition-delay: 0.18s;
}

.glass-svg-blur {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 372px;
  height: 97px;
  transform: translateX(-50%);
  z-index: 2;
  pointer-events: none;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  clip-path: path('M0 30.3401L165.397 2.4715C179.036 0.173361 192.964 0.173364 206.603 2.4715L372 30.3401V83C372 90.732 365.732 97 358 97H14C6.26802 97 0 90.732 0 83V30.3401Z');
}

.glass-svg-overlay {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 372px;
  height: 100px;
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
}

/* ===== CUSTOM CURSOR ===== */
.custom-cursor {
  position: fixed;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%) scale(0) rotate(180deg);
  transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.5s ease;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  opacity: 0;
}

.custom-cursor.active {
  transform: translate(-50%, -50%) scale(1.3) rotate(0deg);
  transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.4s ease;
  opacity: 1;
}

.custom-cursor.active {
  animation: cursorPulse 2s ease-in-out infinite;
}

@keyframes cursorPulse {
  0%, 100% {
    box-shadow: 
      0 8px 32px rgba(0, 0, 0, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
  50% {
    box-shadow: 
      0 12px 40px rgba(0, 0, 0, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.4),
      0 0 20px rgba(255, 255, 255, 0.2);
  }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1400px) {
  .hero {
    max-width: 98vw;
  }
  .gallery {
    max-width: 98vw;
  }
}

@media (max-width: 1200px) {
  .hero {
    max-width: 98vw;
    min-height: 320px;
  }
  .gallery {
    max-width: 98vw;
    min-height: 320px;
  }
  .hero-contact {
    left: var(--space-lg);
  }
  body.fon {
    font-size: 28px;
  }
  .zagolovok {
    font-size: 32px;
  }
  .tekst, .opisanie, .proekt-opisanie, .proekt-itog {
    font-size: 22px;
  }
  .main-container {
    max-width: 98vw;
    gap: 64px;
  }
  .gallery-final img {
    max-width: 100vw;
  }
  
  /* Уменьшаем отступы между секциями на планшетах */
  :root {
    --external-gap: var(--space-3xl); /* 64px */
    --internal-gap: var(--space-xl);  /* 32px */
  }
  
  /* Применяем ту же логику для project-container на планшетах */
  .project-container > * {
    margin-bottom: var(--internal-gap);
  }
  
  .project-container > *:last-child {
    margin-bottom: 0;
  }
}

@media (max-width: 700px) {

  .hero {
    min-height: 180px;
    padding-top: var(--space-sm);
    padding-bottom: 8px;
  }
  .hero-canvas-wrap {
    width: min(100vw, 640px);
    height: clamp(360px, 60vw, 520px);
    min-height: unset;
    max-height: unset;
    aspect-ratio: auto;
  }
  #hero-webgl {
    border-radius: var(--space-sm);
  }
  .gallery {
    gap: var(--space-sm);
  }
  .gallery-icons {
    grid-template-columns: 1fr; /* Одна колонка на мобильных */
    gap: var(--space-sm);
  }
  .gallery-icons img,
  .gallery-icons .gallery-video {
    aspect-ratio: 1/1; /* Квадратные картинки на мобильных */
  }
  body.fon {
    font-size: 16px;
  }
  .zagolovok {
    font-size: 22px;
  }
  .tekst, .opisanie, .proekt-opisanie, .proekt-itog {
    font-size: 18px;
  }
  .hero-contact {
    font-size: 15px;
    padding: var(--space-sm) var(--space-md);
  }
  .ssylka {
    font-size: 18px;
  }

  .gallery-main {
    margin-bottom: var(--space-sm);
  }
  
  /* Уменьшаем отступы между секциями на мобильных */
  :root {
    --external-gap: var(--space-2xl); /* 48px */
    --internal-gap: var(--space-lg);  /* 24px */
  }
  
  /* Применяем ту же логику для project-container на мобильных */
  .project-container > * {
    margin-bottom: var(--internal-gap);
  }
  
  .project-container > *:last-child {
    margin-bottom: 0;
  }
  .about,
  .project-main {
    gap: 22px;
  }
}

@media (max-width: 999px) {
  .hero-webgl {
    display: none;
  }
  .hero-static {
    display: flex;
    width: 100%;
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }
  .hero-static-media {
    height: clamp(420px, 140vw, 720px);
  }
  .hero-static-cta {
    width: fit-content;
  }
}

@media (max-width: 500px) {
  .hero-static-media {
    height: clamp(420px, 160vw, 760px);
  }
  .hero-static-cta {
    font-size: 15px;
  }
}

@media (max-width: 420px) {
  .glass-folder {
    width: 280px;
    height: 52px;
    border-radius: 14px;
  }

  .main-container {
    gap: var(--space-2xl);
  }
  
  .glass-photo {
    width: 100px;
    height: 100px;
    border-radius: 28px;
  }
  
  .glass-svg-blur,
  .glass-svg-overlay {
    width: 280px;
    height: 74px;
  }
  
  /* Еще больше уменьшаем отступы на маленьких экранах */
  :root {
    --external-gap: 128px; /* 32px */
    --internal-gap: var(--space-md); /* 16px */
  }
  
  /* Применяем ту же логику для project-container на маленьких экранах */
  .project-container > * {
    margin-bottom: var(--internal-gap);
  }
  
  .project-container > *:last-child {
    margin-bottom: 0;
  }
}

@media (max-width: 800px) {
  .project-main {
    flex-direction: column;
    gap: 20px;
  }
  .project-gallery {
    margin-top: 32px;
  }
  .project {
    padding: 16px;
    border-radius: 18px;
  }
}

@media (max-width: 500px) {
  .project {
    padding: 10px;
    border-radius: 12px;
  }
  .project-main {
    gap: 14px;
  }
  .project-gallery {
    margin-top: 24px;
  }
}

.project-logo .glass-svg-overlay {
  width: 100%;
  height: auto;
  display: block;
}

.project-logo .glass-svg-blur {
  position: absolute;
  top: 0;
  left: 0;
  width: 150px;
  height: 150px;
  z-index: 1;
  filter: blur(18px) brightness(1.2);
  pointer-events: none;
}

  .project-logo .glass-photo {
    position: relative;
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 18px;
    z-index: 2;
    transition: transform 0.25s cubic-bezier(.4,2,.6,1), box-shadow 0.25s cubic-bezier(.4,2,.6,1);
    box-shadow: 0 2px 12px 0 rgba(0,0,0,0.3);
  }

.project-logo:hover .glass-photo {
  transform: scale(1.06) rotate(-2deg);
  box-shadow: 0 6px 24px 0 rgba(0,0,0,0.4);
}

.project-logo .glass-svg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 150px;
  height: 80px;
  z-index: 3;
  pointer-events: none;
}

.project-logo, .glass-folder {
  width: 150px;
  height: 150px;
  position: relative;
  overflow: visible;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0px;
}

.project-logo .image {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 18px;
  z-index: 2;
  box-shadow: none;
  border: none;
  position: static;
  /* центрируем через flex */
  transform: rotate(-8deg);
  transition:
    transform 0.9s cubic-bezier(0.3, 1.8, 0.4, 1),
    filter 1.1s cubic-bezier(0.3, 1.8, 0.4, 1),
    box-shadow 0.7s cubic-bezier(0.3, 1.8, 0.4, 1);
  transform-origin: center center;
  display: block;
  margin: 0 auto;
}

.project-logo:hover .image,
.project-info:has(.ssylka:hover) .project-logo .image {
  transform: translateY(-32px) rotate(0deg);
  filter: brightness(1.08);
  box-shadow: 0 12px 32px 0 rgba(60,80,255,0.25), 0 2px 8px 0 rgba(0,0,0,0.3);
  transition-delay: 0s;
}

.project-logo .blur-overlay {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 150px;
  height: 80px;
  z-index: 1;
  pointer-events: none;
}

.project-logo .svg-overlay {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 150px;
  height: 80px;
  z-index: 3;
  pointer-events: none;
  -webkit-backdrop-filter: blur(4px);
  clip-path: path('M18 80H132C141.941 80 150 71.9411 150 62V26.4545C150 24.2453 148.209 22.4545 146 22.4545H116.205C109.918 22.4545 103.815 20.3389 98.8767 16.4483L85.6233 6.00621C80.6852 2.11561 74.5815 0 68.2949 0H4C1.79086 0 0 1.79086 0 4V62C0 71.9411 8.05888 80 18 80Z');
  -webkit-clip-path: path('M18 80H132C141.941 80 150 71.9411 150 62V26.4545C150 24.2453 148.209 22.4545 146 22.4545H116.205C109.918 22.4545 103.815 20.3389 98.8767 16.4483L85.6233 6.00621C80.6852 2.11561 74.5815 0 68.2949 0H4C1.79086 0 0 1.79086 0 4V62C0 71.9411 8.05888 80 18 80Z');

}

.project-logo .blur-bg {
  width: 100%;
  height: 100%;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  background: rgba(255,255,255,0.08);
}

.project-logo .blur-shape {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 150px;
  height: 80px;
  z-index: 3;
  pointer-events: none;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  background: transparent;
  clip-path: path('M18 80H132C141.941 80 150 71.9411 150 62V26.4545C150 24.2453 148.209 22.4545 146 22.4545H116.205C109.918 22.4545 103.815 20.3389 98.8767 16.4483L85.6233 6.00621C80.6852 2.11561 74.5815 0 68.2949 0H4C1.79086 0 0 1.79086 0 4V62C0 71.9411 8.05888 80 18 80Z');
  -webkit-clip-path: path('M18 80H132C141.941 80 150 71.9411 150 62V26.4545C150 24.2453 148.209 22.4545 146 22.4545H116.205C109.918 22.4545 103.815 20.3389 98.8767 16.4483L85.6233 6.00621C80.6852 2.11561 74.5815 0 68.2949 0H4C1.79086 0 0 1.79086 0 4V62C0 71.9411 8.05888 80 18 80Z');
}

.descriptor {
  padding-top: var(--space-xl);
  font-size: 22px;
  color: #e8e8e8;
}


@media (max-width: 900px) {

  .descriptor {
    padding-top: 0;
  }
  
  .about,
  .project-main {
    grid-template-columns: 1fr;
    padding-left: 0;
    gap: 32px;
  }
  .project-info {
    align-items: center;
    text-align: center;
  }

  .project-logo, .glass-folder {
      margin-left: auto;
  }

}


.project-meta {
  display: flex;
  flex-direction: column;
  gap: 0px;
}

.glass-folder:hover .image {
  transform: translateY(-24px) scale(1.08);
  transition-delay: 0.08s;
  box-shadow: 0 12px 32px 0 rgba(0,0,0,0.5);
  transition: 
  transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, box-shadow;
}

