.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 9999;
    pointer-events: none;
    transition: opacity 0.6s ease-in-out;
}

.page-transition-overlay.fade-out {
    opacity: 0;
}

.page-transition-overlay.fade-in {
    opacity: 1;
    pointer-events: all;
}

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

body {
    font-family: "IM Fell English SC", serif;
    color: #e0e0e0;
    background: black;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.parallax-container {
    position: relative;
    height: 110vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.parallax-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center,
            rgba(0, 0, 0, 0) 20%,
            rgba(0, 0, 0, 0.4) 70%,
            rgba(0, 0, 0, 0.8) 100%);
    z-index: 6;
    pointer-events: none;
}

.layer {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background-size: cover;
    background-position: center;
    will-change: transform;
}

.layer-1 {
    background-image: url('../pic/parallax/Parallax1.png');
}

.layer-3 {
    background-image: url('../pic/parallax/Parallax3.png');
}

.layer-4 {
    background-image: url('../pic/parallax/Parallax4.png');
    z-index: 7;
}

.layer-5 {
    background-image: url('../pic/parallax/Parallax5.png');
    z-index: 9;
}

.layer-6 {
    background-image: url('../pic/parallax/Parallax6.png');
    z-index: 11;
}

.main-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 60px);
    font-family: 'Cinzel', serif;
    font-size: clamp(40px, 10vw, 120px);
    letter-spacing: clamp(0.2rem, 2vw, 1rem);
    color: white;
    text-shadow: 0 0 40px black, 0 0 10px rgba(255, 255, 255, 0.5);
    opacity: 0;
    transition: all 1.5s cubic-bezier(.22, 1, .36, 1);
    z-index: 10;
    pointer-events: none;
    text-align: center;
    width: 100%;
    padding: 0 20px;
}

.main-title.show {
    opacity: 1;
    transform: translate(-50%, -50%);
}

.fade-overlay {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 200px;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.8), black);
    z-index: 12;
}

.content-section {
    position: relative;
    padding: 80px 8%;
    max-width: 1100px;
    margin: auto;
    font-size: clamp(1.1rem, 2.5vw, 1.45rem);
    line-height: 1.7;
    text-align: justify;
}

@media (min-width: 768px) {
    .content-section {
        text-align-last: center;
        padding: 120px 6%;
    }
}

.content-section::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url('../pic/parallax/Parallax1.png');
    background-size: cover;
    background-position: center;
    filter: blur(40px) brightness(0.15);
    z-index: -1;
}

#story h1 {
    font-family: 'Cinzel', serif;
    font-size: clamp(2.2rem, 6vw, 4rem);
    color: #bdab8d;
    text-align: center;
    margin: 80px 0 40px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.content-section h2 {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    margin-top: 60px;
    margin-bottom: 25px;
    text-align: center;
    color: #fff;
    border-bottom: 1px solid rgba(189, 171, 141, 0.3);
    display: inline-block;
    width: 100%;
    padding-bottom: 10px;
}

.content-section p {
    margin-bottom: 30px;
    color: #d1d1d1;
}

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s cubic-bezier(.22, 1, .36, 1);
    will-change: opacity, transform;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.music-control {
    position: fixed;
    top: 25px;
    left: 25px;
    z-index: 10001;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.music-control:hover {
    border-color: rgba(180, 220, 255, 0.6);
    transform: scale(1.1);
    text-shadow: 0 0 10px #fff;
}

.music-control.playing {
    border-color: rgba(0, 200, 255, 0.8);
    color: #00d2ff;
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.4), inset 0 0 10px rgba(0, 210, 255, 0.2);
    animation: musicPulse 2s infinite ease-in-out;
}

@keyframes musicPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(0, 210, 255, 0.3);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 25px rgba(0, 210, 255, 0.6);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(0, 210, 255, 0.3);
    }
}

.music-control.playing::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 1px solid rgba(0, 210, 255, 0.3);
    animation: rotateRing 4s linear infinite;
}

@keyframes rotateRing {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.back-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;

    background: #2d2d2d;
    color: #fff;

    padding: 12px 20px;
    border-radius: 8px;

    text-decoration: none;

    transition: 0.3s;
}

.back-btn:hover {
    background: #444;
    transform: scale(1.05);
}

@media (max-width: 480px) {
    .back-btn {
        right: 10px;
        bottom: 10px;
        padding: 10px 16px;
        font-size: 14px;
        background: rgba(45, 45, 45, 0.9);
        backdrop-filter: blur(5px);
    }
}