* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    scroll-behavior: smooth;
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    font-family: Arial, sans-serif;
    color: #ffffff;
	background-image: url('pic/top-left.webp'),
                      url('pic/top-right.webp'),
                      url('pic/bottom-left.webp'),
                      url('pic/bottom-right.webp'),
					  url('pic/fon9.jpg');
	background-position: top left, 
                         top right, 
                         bottom left, 
                         bottom right, 
                         center;
	background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
    background-size: 200px, 200px, 200px, 200px, cover;					 
    background-attachment: fixed;
}

body::after {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: url('pic/proba3.gif');
    background-size: contain;  /* Масштабирует изображение, сохраняя пропорции */
    background-position: center;
    background-repeat: no-repeat;
	transform: scale(0.6);  /* Уменьшение размера на 20% */
    transform-origin: center center;  /* Масштабирование от центра */
    z-index: 0;
}

.falling-text {
    font-size: 3em;
    font-weight: bold;
    display: inline-block;
}

.falling-text span {
    display: inline-block;
    opacity: 0;
    animation: fall 1s forwards;
}

.falling-text span:nth-child(1) {
    animation-delay: 0s;
}
.falling-text span:nth-child(2) {
    animation-delay: 0.1s;
}
.falling-text span:nth-child(3) {
    animation-delay: 0.2s;
}
.falling-text span:nth-child(4) {
    animation-delay: 0.3s;
}
.falling-text span:nth-child(5) {
    animation-delay: 0.4s;
}
.falling-text span:nth-child(6) {
    animation-delay: 0.5s;
}
.falling-text span:nth-child(7) {
    animation-delay: 0.6s;
}
.falling-text span:nth-child(8) {
    animation-delay: 0.7s;
}
.falling-text span:nth-child(9) {
    animation-delay: 0.8s;
}
.falling-text span:nth-child(10) {
    animation-delay: 0.9s;
}
.falling-text span:nth-child(11) {
    animation-delay: 1s;
}
.falling-text span:nth-child(12) {
    animation-delay: 1.1s;
}
.falling-text span:nth-child(13) {
    animation-delay: 1.2s;
}
.falling-text span:nth-child(14) {
    animation-delay: 1.3s;
}
.falling-text span:nth-child(15) {
    animation-delay: 1.4s;
}
.falling-text span:nth-child(16) {
    animation-delay: 1.5s;
}
.falling-text span:nth-child(17) {
    animation-delay: 1.6s;
}
.falling-text span:nth-child(18) {
    animation-delay: 1.7s;
}
.falling-text span:nth-child(19) {
    animation-delay: 1.8s;
}
.falling-text span:nth-child(20) {
    animation-delay: 1.9s;
}
.falling-text span:nth-child(21) {
    animation-delay: 2s;
}
.falling-text span:nth-child(22) {
    animation-delay: 2.1s;
}
.falling-text span:nth-child(23) {
    animation-delay: 2.2s;
}
.falling-text span:nth-child(24) {
    animation-delay: 2.3s;
}
.falling-text span:nth-child(25) {
    animation-delay: 2.4s;
}
.falling-text span:nth-child(26) {
    animation-delay: 2.5s;
}
.falling-text span:nth-child(27) {
    animation-delay: 2.6s;
}
.falling-text span:nth-child(28) {
    animation-delay: 2.7s;
}
.falling-text span:nth-child(29) {
    animation-delay: 2.8s;
}
.falling-text span:nth-child(30) {
    animation-delay: 2.9s;
}
.falling-text span:nth-child(31) {
    animation-delay: 3.0s;
}
.falling-text span:nth-child(32) {
    animation-delay: 3.1s;
}
.falling-text span:nth-child(33) {
    animation-delay: 3.2s;
}
.falling-text span:nth-child(34) {
    animation-delay: 3.3s;
}
.falling-text span:nth-child(35) {
    animation-delay: 3.4s;
}

@keyframes fall {
    0% {
        transform: translateY(-50px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

::-webkit-scrollbar {
    display: none;
}

.overlay {
    background: rgba(0, 0, 0, 0);
    min-height: 100vh;
    width: 100%;
    position: relative;
    z-index: 1;
}

header {
    width: 100%;
    padding: 20px 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
}

header h1 {
    font-family: sans-serif;
    font-weight: 700;
    background: linear-gradient(90deg, #090979, #090979);
    -webkit-background-clip: text;
    -webkit-text-fill-color: #86fce0f7;
    text-shadow: 0 0 5px #ffcf40,
                 0 0 10px #ffcf40,
                 0 0 20px #ff6c00,
                 0 0 30px #ff6c00;
    font-size: 2.5rem;
    transition: font-size 0.3s;
}

nav a {
    color: #fff;
    margin-left: 20px;
    text-decoration: none;
    font-size: 18px;
    transition: 0.3s;
	font-size: 1.5em;
}

nav a:hover { color: #f40606; }

nav p {
	font-weight: bold;
}
	
nav p:hover { color: #093cd5; }

.image-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.hover-image {
  display: none;
  width: 200px;
  height: auto;
}

.image-link:hover + .image-container .hover-image {
  display: block;
}

.btn-gallery {
    margin-top: 5px;
    padding: 12px 18px;
    background: linear-gradient(90deg, #e3212100, #5c697500);
    color: #ffffff;
    font-weight: bold;
    text-decoration: none;
    border-radius: 30px;
    transition: 0.3s;
}

.btn-gallery:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(244, 6, 6, 0.8);
}

.main-content { flex-grow: 1; padding: 10px; }

.hero {
    padding-top: 60px;
    text-align: center;
    animation: fadeIn 5s ease;
}

.hero h2 { 
        font-size: 48px;
        margin-bottom: 20px;
}

.hero p {
    font-size: 22px;
    max-width: 600px;
    margin: auto;
}

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

.folder-gallery h3 {
	text-align: center;
	font-weight: bold;
	color: #fff;
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    padding: 20px;
}

.folder-gallery {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.gallery-item {
    position: relative;
}

.folder-name {
    position: absolute;
    bottom: 0;
    width: 100%;
    background-color: rgb(0 0 0 / 0%);
    color: white;
    font-size: 20px;
    padding: 10px;
    font-weight: bold;
    text-align: center;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    pointer-events: none;
}

.gallery-thumb {
    width: 200px;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.2s;
	box-shadow: 15px 20px 10px 5px rgb(80 67 67 / 70%);
}

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

#viewer {
    position: fixed;
    inset: 0;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, .95);
    z-index: 9999;
}

#viewer.show {
    display: flex;
    overflow: hidden;
}

#viewerImg {
    max-width: 90%;
    max-height: 70vh;
    border-radius: 12px;
    position: relative;
    z-index: 10;
	transition: transform 0.3s ease;
}

#closeViewer {
    position: fixed;
    top: 15px;
    right: 15px;
    font-size: clamp(28px, 6vw, 50px);
    color: white;
    cursor: pointer;
    z-index: 100000;
    transition: transform 0.2s;
}

#closeViewer:hover {
    transform: scale(3.15);
    color: #FF0000;
}

#prevBtn, #nextBtn {
	display: none;
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    font-size: 60px;
    color: white;
    cursor: pointer;
    user-select: none;
    z-index: 10001;
}

#prevBtn { left: 20px; }
#nextBtn { right: 20px; }

#caption {
    color: #fff;
    margin-top: 10px;
    font-size: 18px;
    z-index: 20;
}
#prevBtn:hover, #nextBtn:hover { color: #48E888; }

#viewerVideo {
    width: 100%;
    max-width: 90%;
    max-height: 90vh;
    background-color: black;
    object-fit: contain;
    border-radius: 5px;
}

.video-gallery {
    display: flex;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 25px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    justify-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.video-item {
    display: flex;
	position: relative;
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
}

.video-thumbnail {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 15px 20px 10px 5px rgb(80 67 67 / 70%);
}

.video-thumbnail:hover { transform: scale(1.05); }

.video-description {
    font-size: 20px;
    color: #fff;
    margin-top: 10px;
	font-weight: bold;
    text-align: center;
	position: absolute;
    padding: 10px;
	pointer-events: none;
	background-color: rgb(0 0 0 / 0%);
}

footer {
    position: fixed;
    bottom: 10px;
    width: 100%;
    text-align: center;
    color: #ffffff;
    font-size: 0.4em;
    z-index: 2;

    pointer-events: none;
}

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

@keyframes swipeLeftClose {
    from { transform: translateX(0) scale(1); opacity: 1; }
    to   { transform: translateX(-150%) scale(0.8); opacity: 0; }
}
.swipe-left-close { animation: swipeLeftClose 0.4s ease forwards; }

@media (max-width: 768px) {
    nav a {font-size: large;}
	.hero h2 {font-size: 10vw;}
}

@media (max-width: 480px) {
    header {padding: 20px 0px; text-align: center;}
	.btn-gallery {padding: 12px 0px;}
}

@media (max-width: 1024px) {
    #closeViewer { font-size: 30px; }
    #viewerVideo { max-width: 95%; max-height: 85vh; }
}

@media (max-width: 768px) {
    #closeViewer { font-size: 25px; }
    #viewerVideo { max-height: 80vh; }
    .video-gallery { grid-template-columns: 1fr; }
    footer p { font-size: 14px; }
}

@media (max-width: 480px) {
    #closeViewer {
        font-size: clamp(40px, 12vw, 65px);
        top: 10px;
        right: 10px;
    }
    #viewerVideo { max-height: 75vh; }
    footer p { font-size: 12px; }
}

@media (max-width: 320px) {
    #closeViewer { font-size: 20px; }
    footer p { font-size: 10px; }
}

@media screen and (max-width: 768px) {
  body {
    background-size: 100px, 100px, 100px, 100px, cover;
  }
  body::after {
    background-image: url('pic/proba.gif');
  }	
}
