:root {
    --bg-color: #1a1a1a;
    --text-color: #f0f0f0;
    --accent-color: #d4af37;
    /* Gold */
    --card-bg: #2a2a2a;
    --transition-speed: 0.6s;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Lato', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    overflow: hidden;
    /* Prevent body scroll, scroll content instead */
}

/* Split Layout */
.profile-section {
    flex: 0 0 30%;
    background-image: url('index_profile.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

/* content-section moved to media query/animation block */

header {
    text-align: center;
    margin-bottom: 40px;
    background: transparent;
    padding: 0;
}

header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    margin: 0;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 2px;
}

header p {
    font-style: italic;
    color: #888;
    margin-top: 10px;
    font-size: 1.2rem;
}

/* Album Grid */
.album-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    max-width: 900px;
    /* Reduced max-width to keep them tighter */
    width: 100%;
}

.album-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    position: relative;
    margin: 0;

    /* Strict 3-column layout */
    flex: 0 0 calc(33.333% - 40px);
    /* Subtract margin/gap space */
    width: calc(33.333% - 40px);
    aspect-ratio: 1 / 1;

    /* Animation Entry */
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.album-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--accent-color);
}

.album-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
    opacity: 0.8;
}

.album-card:hover .album-cover {
    opacity: 1;
}

/* Paper Animation Styles */
.holder {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 5;
    pointer-events: none;
    /* Let clicks pass through to card */
}

.paper {
    background-color: #fff;
    padding: 6px 15px;
    margin-bottom: 2px;
    position: relative;
    display: table;
    /* Shrink to fit content */
    opacity: 0;
    transform: translateY(20px) rotateX(20deg);
    transform-origin: top center;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.paper .content {
    color: #222;
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 2;
}

.paper.category .content {
    font-family: 'Lato', sans-serif;
    font-size: 0.8rem;
    color: #666;
    font-weight: 400;
}

.paper .shadow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    z-index: 1;
    /* Optional: complex shadow effects could go here */
}

/* Hover States */
.album-card:hover .paper {
    opacity: 1;
    transform: translateY(0) rotateX(0);
}

.album-card:hover .paper.title {
    transition-delay: 0.1s;
}

.album-card:hover .paper.category {
    transition-delay: 0.2s;
}

/* Flipbook Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 3rem;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 2001;
    transition: color 0.3s;
}

.close-btn:hover {
    color: var(--accent-color);
}

.flipbook-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.flipbook {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.flipbook-view {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.flip-image {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    object-fit: contain;
}

/* Controls */
.controls {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 30px;
    color: white;
    font-family: 'Playfair Display', serif;
}

.controls button {
    background-color: transparent;
    color: white;
    border: 1px solid white;
    padding: 10px 30px;
    border-radius: 30px;
    cursor: pointer;
    font-family: 'Lato', sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.controls button:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: black;
}

.controls button:disabled {
    border-color: #555;
    color: #555;
    cursor: not-allowed;
    background-color: transparent;
}

/* Video Styling */
video.flip-image {
    background: black;
}

/* Responsive */
@media (max-width: 900px) {
    body {
        flex-direction: column;
        overflow: auto;
    }

    .profile-section {
        height: 50vh;
        flex: 0 0 30%;
        /* Changed from flex: none; */
    }

    .content-section {
        flex: none;
        min-height: 50vh;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.content-section {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;

    /* Livelier Background */
    background: linear-gradient(-45deg, #0f0c29, #302b63, #24243e, #1a1a1a);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

/* Staggered delays for up to 10 items */
.album-card:nth-child(1) {
    animation-delay: 0.1s;
}

.album-card:nth-child(2) {
    animation-delay: 0.2s;
}

.album-card:nth-child(3) {
    animation-delay: 0.3s;
}

.album-card:nth-child(4) {
    animation-delay: 0.4s;
}

.album-card:nth-child(5) {
    animation-delay: 0.5s;
}

.album-card:nth-child(6) {
    animation-delay: 0.6s;
}

.album-card:nth-child(7) {
    animation-delay: 0.7s;
}

.album-card:nth-child(8) {
    animation-delay: 0.8s;
}

.album-card:nth-child(9) {
    animation-delay: 0.9s;
}

.album-card:nth-child(10) {
    animation-delay: 1.0s;
}