/* --- RESET & GLOBAL VARIABLES --- */
:root {
    --text-primary: #1a1a1a;
    --bg-white: #ffffff;
    --anim-timing: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-white);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- BACKGROUNDS --- */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    background-color: var(--bg-white);
}

/* --- ANIMATIONS --- */

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(1.5deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes float-bear {
    0% { transform: translateY(0px) rotate(-3deg); }
    50% { transform: translateY(-15px) rotate(3deg); }
    100% { transform: translateY(0px) rotate(-3deg); }
}

@keyframes pulse {
    0% { opacity: 0.4; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(5px); }
    100% { opacity: 0.4; transform: translateY(0); }
}

/* --- NAV FIXED STATE --- */
.nav-wrapper {
    min-height: 70px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.nav-images.is-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.5rem 0; /* Keep the padding identical to initial state or just enough spacing */
    margin-top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    justify-content: center;
}

/* --- LAYOUT: HERO SECTION --- */
.screen-height {
    height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.hero-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    z-index: 10;
}

.logo-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    position: relative;
    cursor: default;
}

.logo-group .main-title {
    max-width: 500px;
    width: 55vw;
    animation: float 7s ease-in-out infinite;
    filter: drop-shadow(5px 10px 20px rgba(0,0,0,0.25));
}

.logo-group .bear-img {
    height: 280px;
    margin-left: -60px; /* Overlaps text slightly */
    transform: rotate(-3deg);
    animation: float-bear 9s ease-in-out infinite;
    filter: drop-shadow(8px 12px 25px rgba(0,0,0,0.3));
    z-index: 2;
}

.hover-float:hover .main-title {
    animation-play-state: paused;
    transform: scale(1.02);
    transition: transform 0.3s ease;
}
.hover-float:hover .bear-img {
    animation-play-state: paused;
    transform: scale(1.05) rotate(5deg);
    transition: transform 0.3s ease;
}

.nav-images {
    display: flex;
    align-items: center;
    gap: 3rem;
    margin-top: 2rem;
}

.nav-images .nav-item img {
    height: 70px;
    transition: transform 0.3s var(--anim-timing), filter 0.3s ease;
    filter: grayscale(10%) opacity(0.9);
}

.nav-images .nav-item:hover img {
    transform: scale(1.15) translateY(-5px) rotate(4deg);
    filter: grayscale(0%) opacity(1) drop-shadow(0 8px 15px rgba(0,0,0,0.2));
}

.nav-socials {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-left: 3rem; /* Give some breathing room from the main links */
}

.nav-socials img {
    height: 48px;
    width: auto;
    transition: transform 0.3s var(--anim-timing);
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
}

.nav-socials a:hover img {
    transform: scale(1.15) rotate(-8deg);
}

/* Delay staggered animations for intro */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* Scroll Down Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: "Caveat", cursive;
    font-size: 1.4rem;
    color: var(--text-primary);
    opacity: 0.8;
    animation: pulse 2.5s infinite;
}

.arrow {
    width: 2px;
    height: 35px;
    background-color: var(--text-primary);
    margin-top: 8px;
    position: relative;
}

.arrow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -5px;
    width: 12px;
    height: 12px;
    border-bottom: 2px solid var(--text-primary);
    border-right: 2px solid var(--text-primary);
    transform: rotate(45deg);
}

/* --- LAYOUT: CONTENT SECTION (Grid) --- */
.content-section {
    background-color: var(--bg-white);
    position: relative;
    z-index: 1;
    padding-bottom: 0;
}

.sticky-nav {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 4rem;
    z-index: 100;
    transition: transform 0.3s ease;
}

.nav-center {
    display: flex;
    gap: 4rem;
}
.nav-center img {
    height: 45px;
    transition: transform 0.2s var(--anim-timing), opacity 0.2s;
    opacity: 0.8;
}

.nav-center:hover img {
    opacity: 0.5;
}

.nav-center img:hover {
    transform: scale(1.2) rotate(-2deg);
    opacity: 1 !important;
}



/* Grid Wrapper */
.journal-wrapper {
    max-width: 1250px;
    margin: 5rem auto 1.5rem;
    padding: 0 2rem;
    position: relative;
}


/* Artist rows matching Figma layout */
.artist-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.artist-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: flex-end;
}

/* Lankee and LankyAlmighty take 3/4 width; EuphoricLinux and 0nyx96 take 1/4 */
.lankee-group,
.lanky-group {
    grid-column: span 3;
}

.euphoric-group,
.onyx-group {
    grid-column: span 1;
}

/* Artist label row: title SVG + doodle icon side by side */
.artist-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.artist-label .artist-title {
    height: auto;
    width: 65%;
    display: block;
}

.artist-label .doodle-icon {
    height: auto;
    width: 25%;
    display: block;
}

/* Push Lankee title to sit above the second album (center of the 3-column group) */
.lankee-group .artist-label {
    width: calc((100% - 3rem) / 3);
    margin: 0 auto;
}

/* Push Lanky Almighty title to sit above the third album (right of the 3-column group) */
.lanky-group .artist-label {
    width: calc((100% - 3rem) / 3);
    margin-left: auto;
}

/* Album cells flex row inside each group */
.album-cells {
    display: flex;
    gap: 1.5rem;
}

.album-cells .grid-item {
    flex: 1;
    min-width: 0;
    aspect-ratio: 1 / 1;
}

.grid-item {
    position: relative;
    border-radius: 0; /* Match Figma sharp corners */
    transition: transform 0.5s var(--anim-timing);
    cursor: crosshair;
    background: #e0e0e0;
    overflow: hidden;
    
    /* Scroll reveal defaults */
    opacity: 0;
    transform: translateY(40px) scale(0.95);
}

.grid-item.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.grid-item:hover {
    transform: scale(1.04) translateY(-8px) rotate(1deg) !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    z-index: 5;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.grid-item:hover img {
    transform: scale(1.08);
}

/* Offset odds and evens for chaos */
.image-grid .grid-item:nth-child(2n) {
    margin-top: 30px;
    transform: translateY(40px) scale(0.95) rotate(-2deg);
}
.image-grid .grid-item:nth-child(3n) {
    margin-top: -15px;
    transform: translateY(40px) scale(0.95) rotate(1.5deg);
}

/* Ensure visibly triggered state retains offsets */
.image-grid .grid-item.visible:nth-child(1n) { transform: translateY(0) scale(1) rotate(0); }
.image-grid .grid-item.visible:nth-child(2n) { transform: translateY(30px) scale(1) rotate(-2deg); }
.image-grid .grid-item.visible:nth-child(3n) { transform: translateY(-15px) scale(1) rotate(1.5deg); }

/* Responsive adjustments */
@media (max-width: 992px) {
    .logo-group .main-title { width: 65vw; }
    .logo-group .bear-img { height: 200px; }
}

@media (max-width: 768px) {
    .socials.top-right { right: 1.5rem; top: 1.5rem; }
    
    .logo-group {
        flex-direction: column;
        gap: 0;
    }
    
    .logo-group .bear-img {
        height: 180px;
        margin-left: 0;
        margin-top: -30px;
    }
    
    .logo-group .main-title {
        width: 85vw;
    }

    .nav-images {
        flex-direction: row;
        gap: 1.5rem;
        flex-wrap: wrap; /* Let socials wrap if screen is very tight */
        justify-content: center;
    }
    
    .nav-images .nav-item img {
        height: 50px;
    }

    .nav-socials {
        margin-left: 0.5rem; /* reduce margin on mobile */
    }
    
    .nav-center {
        display: flex;
        gap: 2rem;
    }
    .sticky-nav {
        padding: 1rem;
    }

    .image-grid {
        grid-auto-rows: 200px;
    }
    
    .journal-wrapper {
        padding: 0 1rem;
        display: flex;
        flex-wrap: wrap;
        gap: 1.5rem;
    }
    
    .artist-row {
        display: contents; /* strip wrappers so order works globally */
    }
    
    .artist-group {
        display: flex;
        flex-direction: column;
        margin-bottom: 1.5rem;
        gap: 2vw; /* Scale gap proportionally to screen width */
    }

    /* Force full rows for 3-album groups and move them to front */
    .lankee-group, .lanky-group {
        width: 100%;
        order: 1;
        flex: none;
    }

    /* Match 1-album groups exactly to 1 column width and pack them to the back */
    .euphoric-group, .onyx-group {
        width: calc((100% - 3rem) / 3);
        order: 2;
        flex: none;
    }

    /* Inner Album Grids */
    .lankee-group .album-cells, .lanky-group .album-cells {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    .euphoric-group .album-cells, .onyx-group .album-cells {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Tags Base Sizing */
    .artist-label {
        width: 100% !important; /* Euphoric and Onyx labels fill their 1-col wrappers natively */
        margin: 0 0 2vw 0 !important; /* Proportional bottom margin */
        display: flex;
        flex-direction: row;
        align-items: flex-end !important; /* Anchor scaling to the bottom edge so it doesn't float up */
    }

    /* Lankee Tag: matches 1-col width tightly, centers over the block */
    .lankee-group .artist-label {
        width: calc((100% - 3rem) / 3) !important;
        margin: 0 auto 2vw auto !important;
    }

    /* Lanky Tag: matches 1-col width slightly, pins to right side */
    .lanky-group .artist-label {
        width: calc((100% - 3rem) / 3) !important;
        margin: 0 0 2vw auto !important;
    }

    .doodle { display: none; } /* keep mobile grid clean */
}

@media (max-width: 480px) {
    .nav-images {
        gap: 0.5rem;
    }
    
    .nav-images .nav-item img {
        height: 40px;
    }

    .image-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 300px;
    }
    .image-grid .grid-item:nth-child(2n),
    .image-grid .grid-item:nth-child(3n) {
        margin-top: 0;
    }
}

/* --- FOOTER --- */
.site-footer {
    text-align: center;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.4);
    letter-spacing: 0.04em;
}

.site-footer a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer a:hover {
    color: rgba(0, 0, 0, 0.75);
}
