html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans';
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
}

header {
    width: 100vw;
    height: 50vh;
    margin: 0;
    padding: 0;
}


header img {
    position: absolute;
    top: 0;
    left: 0;
    transform: translateY(-30%);
    width: 100%;
    height: 100%;
    object-fit: cover;
}

header #title {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    text-align: center;
    z-index: 1;
}

header #title h1 {
    font-size: 3rem;
    color: #bed8f0;
    text-shadow: -5px 5px 5px rgb(34, 38, 43);
    word-break: keep-all;
    white-space: nowrap;
}

main {
    position: relative;
    top:0;
    margin: 0;
    padding: 0;
    background-image: url("../resource/Background4.jpg");
    background-repeat: repeat-y;
    background-size: 100vw;
}

:root {
    --c1: rgb(47, 255, 210);
    --c2: rgb(71, 218, 255);
}

section h2 {
    position: relative;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    margin-left: 1vw;
    padding-left: 1vw;
}

section:first-child h2 {
    color: greenyellow;
    border-left: 3px solid greenyellow;
}

section:nth-child(2) h2 {
    color: var(--c1);
    border-left: 3px solid var(--c1);
}

section:nth-child(3) h2 {
    color: var(--c2);
    border-left: 3px solid var(--c2);
}

.File-Container {
    width: 80vw;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 3vw;
}

.block {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.block h3 {
    position: relative;
    text-align: center;
    font-size: 2rem;
    color: white;
    text-shadow: 1px 1px 5px black;
}

.file {
    width: 12vw;
    height: 12vw;
    margin: 10px;
    position: relative;
    perspective: 1000px;
    animation: float 3s ease-in-out infinite;
}


@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}


.file-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: flip 6s infinite linear;
}


@keyframes flip {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(360deg);
    }
}


.file-front,
.file-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background-size: cover;
    background-position: center;
}

.file-front {
    background-image: url('../resource/File.png');
}

.file-back {
    background-image: url('../resource/File.png');
    transform: rotateY(180deg);
    display: flex;
    justify-content: center;
    align-items: center;
}


.icon {
    width: 45%;
    height: 45%;
    border-radius: 50%;
    object-fit: cover;
}


.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 64;
}

.popup:target {
    visibility: visible;
    opacity: 1;
}

.popup-content {
    background-image: url("../resource/yellowpaper.jpg");
    background-size: cover;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    max-width: 80vw;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.popup-text {
    width: 60%;
    padding-left: 20px;
    color: black;
    max-height: 70vh;
    overflow-y: auto;
}

.popup-text h3, .popup-text p {
    text-shadow: 2px 2px 5px white;
}


.popup-text h3{
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    text-decoration-line: underline;
}

.popup-text p{
    font-size: clamp(1em, 1.5vw, 1.3rem);
}

.popup-image {
    width: 40%;
    height: auto;
    object-fit: contain;
}

.close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    text-decoration: none;
    color: white;
    font-size: 1.5em;
    font-style: bold;
}


@media (max-width: 1200px) {
    header #title {
        flex-direction: column;
        margin: 5px 0;
        width: 80vw;
    }

    header #title h1 {
        font-size: 2rem;
        line-height: 1.2;
        margin: 5px 0;
    }
}

@media (max-width: 768px) {
    section h2 {
        font-size: 1.5rem;
        margin-left: 2vw;
        padding-left: 2vw;
    }

    .block h3 {
        font-size: 1.2rem;
        text-align: center;
    }
}


