/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow-x: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

body {
    font-family: 'JetBrains Mono', monospace;
    background: #000;
    color: #fff;
    min-height: calc(var(--vh, 1vh) * 100);
    overflow-x: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
    position: relative;
    width: 100%;
}

body::-webkit-scrollbar {
    display: none;
}

*::-webkit-scrollbar {
    display: none;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.custom-loading-gif {
    max-width: 120px;
    max-height: 120px;
    width: 100px;
    height: 100px;
    display: block;
    margin: 0 auto;
    z-index: 10001;
}

.main-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #333;
    border-top: 4px solid #ff6b6b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header - Fixed height */
.header {
    width: 100%;
    padding: 0.5rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    transition: background 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    height: 70px;
}

.header.blurred {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.7);
}

.header.album-mode {
    background: rgba(0, 0, 0, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translateX(-50%) translateY(-50%);
    max-width: 120px;
    max-height: 50px;
    width: auto;
    height: auto;
    border: none !important;
    outline: none !important;
    opacity: 1;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-fallback {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translateX(-50%) translateY(-50%);
    color: #fff;
    font-size: 2rem;
    font-weight: bold;
    display: none;
    border: none !important;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.header.profile-mode .logo {
    left: 7rem;
    transform: translateX(0) translateY(-50%);
}

.header.profile-mode .logo-fallback {
    left: 7rem;
    transform: translateX(0) translateY(-50%);
}

.profile-picture {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translateX(-50%) translateY(-50%) scale(0);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header.profile-mode .profile-picture {
    transform: translateX(-50%) translateY(-50%) scale(1);
    opacity: 1;
}

.profile-info-box {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(to bottom, 
        rgba(0,0,0,0.95) 0%, 
        rgba(0,0,0,0.8) 50%, 
        rgba(0,0,0,0.4) 80%, 
        transparent 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 1600;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-30px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.profile-info-box.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-content {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
}

.profile-content h3 {
    font-size: 1.1rem;
    font-weight: normal;
    color: #fff;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.profile-content p {
    font-size: 1.1rem;
    color: #ccc;
    margin: 0;
    text-shadow: 0 1px 5px rgba(0,0,0,0.6);
}

.red-circle {
    position: absolute;
    right: 7rem;
    top: 35px;
    width: 12px;
    height: 12px;
    background: #EF5350;
    border-radius: 50%;
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0px;
    font-weight: bold;
    color: white;
    overflow: hidden;
    transform-origin: center center;
    transform: scale(0.5);
}

.red-circle.animate {
    opacity: 1;
    transform: scale(1);
}

.red-circle.close-mode {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #EF5350;
    font-size: 18px;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: scale(1);
}

.red-circle.close-mode::after {
    content: '×';
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s ease;
}

.red-circle:not(.close-mode)::after {
    content: '×';
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease;
}

.red-circle:hover {
    background: #d32f2f;
    transform: scale(1.05);
}

.red-circle.close-mode:hover {
    background: #d32f2f;
    transform: scale(1.1);
}
.red-circle.scroll-top-mode {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #FFC107;
    font-size: 18px;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: scale(1);
}

.red-circle.scroll-top-mode::after {
    content: '↑';
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s ease;
}

.red-circle.scroll-top-mode:hover {
    background: #FFD54F;
    transform: scale(1.1);
}

/* Album Loading Overlay */
.album-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1800;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.album-loading-overlay.active {
    display: flex;
    opacity: 1;
}

.album-loading-gif {
    max-width: 120px;
    max-height: 120px;
    width: 100px;
    height: 100px;
    display: block;
    margin: 0 auto 1rem auto;
}

.album-loading-fallback-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: albumSpin 1s linear infinite;
    margin-bottom: 1rem;
    display: none;
}

@keyframes albumSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.album-loading-text {
    color: #fff;
    font-size: 1rem;
    opacity: 0.8;
    text-align: center;
}

.album-loading-progress {
    color: #fff;
    font-size: 0.9rem;
    opacity: 0.6;
    margin-top: 0.5rem;
}

.album-title-box {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    padding: 1.5rem 2rem;
    background: linear-gradient(to bottom, 
        rgba(0,0,0,0.9) 0%, 
        rgba(0,0,0,0.7) 50%, 
        rgba(0,0,0,0.3) 80%, 
        transparent 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 1600;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.album-title-box.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.album-title-box h2 {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    margin: 0;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

/* Main Content */
.main-content {
    min-height: calc(var(--vh, 1vh) * 100);
    padding: 5rem 2rem 60vh;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.main-content.fade-out {
    opacity: 0;
    transform: translateY(-20px);
}

.main-content.fade-in-smooth {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInSmooth 0.4s ease-out forwards;
}

@keyframes fadeInSmooth {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.intro-text {
    text-align: center;
    margin-bottom: 2rem; 
    font-size: 1.2rem;
    color: #ccc;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                margin 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform, max-height, margin;
    max-height: 100px;
    overflow: hidden;
}

.intro-text.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    max-height: 0;
    margin-bottom: 0;
    margin-top: 0;
}

/* Albums Grid */
.albums-grid {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-bottom: 4rem;
    opacity: 1 !important;
    visibility: visible !important;
    position: relative;
    z-index: 2;
    width: 100%;
    overflow: visible;
}

.albums-grid.loading {
    opacity: 0.5 !important;
}

.album-card {
    position: relative;
    cursor: pointer;
    overflow: visible;
    display: flex !important;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
    opacity: 0;
    visibility: visible !important;
    will-change: transform, opacity;
    min-height: 220px;
    width: 100%;
    max-width: 700px;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.album-card.initial-animate {
    opacity: 1;
    transform: translateY(0);
}

.album-preview {
    position: relative;
    height: 200px;
    width: 100%;
    max-width: 650px;
    border-radius: 15px;
    overflow: visible;
    margin: 0 auto;
}

.image-stack {
    position: relative;
    width: 100%;
    height: 100%;
}

.stack-image {
    position: absolute;
    width: 90%;
    height: 90%;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    top: 50%;
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

.album-card.stack-right .stack-image {
    left: 200%;
    transform: translateY(-50%);
}

.album-card.stack-right .stack-image:nth-child(1) {
    transition-delay: 0ms;
}
.album-card.stack-right .stack-image:nth-child(2) {
    transition-delay: 100ms;
}
.album-card.stack-right .stack-image:nth-child(3) {
    transition-delay: 200ms;
}
.album-card.stack-right .stack-image:nth-child(4) {
    transition-delay: 300ms;
}
.album-card.stack-right .stack-image:nth-child(5) {
    transition-delay: 400ms;
}
.album-card.stack-right .stack-image:nth-child(6) {
    transition-delay: 500ms;
}

.album-card.stack-left .stack-image {
    left: -100%;
    transform: translateY(-50%);
}

.album-card.stack-left .stack-image:nth-child(1) {
    transition-delay: 0ms;
}
.album-card.stack-left .stack-image:nth-child(2) {
    transition-delay: 100ms;
}
.album-card.stack-left .stack-image:nth-child(3) {
    transition-delay: 200ms;
}
.album-card.stack-left .stack-image:nth-child(4) {
    transition-delay: 300ms;
}
.album-card.stack-left .stack-image:nth-child(5) {
    transition-delay: 400ms;
}
.album-card.stack-left .stack-image:nth-child(6) {
    transition-delay: 500ms;
}

.album-card.stack-right.scroll-animated .stack-image:nth-child(1) {
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    opacity: 1;
    z-index: 6;
}
.album-card.stack-right.scroll-animated .stack-image:nth-child(2) {
    left: 52%;
    transform: translateX(-50%) translateY(-50%);
    opacity: 1;
    z-index: 5;
}
.album-card.stack-right.scroll-animated .stack-image:nth-child(3) {
    left: 54%;
    transform: translateX(-50%) translateY(-50%);
    opacity: 1;
    z-index: 4;
}
.album-card.stack-right.scroll-animated .stack-image:nth-child(4) {
    left: 56%;
    transform: translateX(-50%) translateY(-50%);
    opacity: 1;
    z-index: 3;
}
.album-card.stack-right.scroll-animated .stack-image:nth-child(5) {
    left: 58%;
    transform: translateX(-50%) translateY(-50%);
    opacity: 1;
    z-index: 2;
}
.album-card.stack-right.scroll-animated .stack-image:nth-child(6) {
    left: 60%;
    transform: translateX(-50%) translateY(-50%);
    opacity: 1;
    z-index: 1;
}

.album-card.stack-left.scroll-animated .stack-image:nth-child(1) {
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    opacity: 1;
    z-index: 6;
}
.album-card.stack-left.scroll-animated .stack-image:nth-child(2) {
    left: 48%;
    transform: translateX(-50%) translateY(-50%);
    opacity: 1;
    z-index: 5;
}
.album-card.stack-left.scroll-animated .stack-image:nth-child(3) {
    left: 46%;
    transform: translateX(-50%) translateY(-50%);
    opacity: 1;
    z-index: 4;
}
.album-card.stack-left.scroll-animated .stack-image:nth-child(4) {
    left: 44%;
    transform: translateX(-50%) translateY(-50%);
    opacity: 1;
    z-index: 3;
}
.album-card.stack-left.scroll-animated .stack-image:nth-child(5) {
    left: 42%;
    transform: translateX(-50%) translateY(-50%);
    opacity: 1;
    z-index: 2;
}
.album-card.stack-left.scroll-animated .stack-image:nth-child(6) {
    left: 40%;
    transform: translateX(-50%) translateY(-50%);
    opacity: 1;
    z-index: 1;
}

.album-title {
    position: absolute;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
    z-index: 10;
    top: 50%;
    transform: translateY(-50%);
    letter-spacing: 0.1em;
    opacity: 0.7;
    transition: color 0.4s ease, opacity 0.4s ease, text-shadow 0.4s ease;
}

.album-card.title-left .album-title {
    left: -2rem;
}

.album-card.title-right .album-title {
    right: -2rem;
}

.album-card.center-highlight .album-title {
    color: #EF5350;
    opacity: 1;
    text-shadow: 0 0 10px rgba(239, 83, 80, 0.5);
}

/* Album View Styles */
.album-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 1500;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.album-view.active {
    display: block;
    opacity: 1;
}

.album-view.fade-out {
    opacity: 0;
}

.album-content {
    padding: 120px 2rem 2rem;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 2rem auto 0;
}

.photo-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.4s ease,
                opacity 0.3s ease;
    opacity: 0;
    transform: translateY(40px) scale(0.9);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.photo-item.animate-in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.photo-item.animate-out {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
    transition: all 0.15s ease-out;
}

.photo-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.photo-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.photo-item:hover img {
    transform: scale(1.05);
}

.expand-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-item:hover .expand-overlay {
    opacity: 1;
}

.expand-btn {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    transform: scale(0.8);
}

.expand-btn:hover {
    background: rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1);
}

/* Fullscreen Modal */
.fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
    overflow: hidden;
}

.fullscreen-modal.active {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

.fullscreen-modal.true-fullscreen {
    background: rgba(0, 0, 0, 1);
}

.fullscreen-image-container {
    position: relative;
    max-width: 95%;
    max-height: 85%;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: pan-x pan-y pinch-zoom;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.fullscreen-modal.active .fullscreen-image-container {
    opacity: 1;
    transform: scale(1);
}

.fullscreen-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    transition: transform 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
}

/* Prevent image selection and right-click */
.fullscreen-image-container img,
.photo-item img,
.stack-image {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    pointer-events: none;
}

/* Re-enable pointer events for the container so controls work */
.fullscreen-image-container,
.photo-item,
.album-preview {
    pointer-events: auto;
}

/* Fullscreen Modal */
.fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
    overflow: hidden;
}

.fullscreen-modal.active {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

.fullscreen-modal.true-fullscreen {
    background: rgba(0, 0, 0, 1);
}

.fullscreen-image-container {
    position: relative;
    width: 90vw;
    height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: pan-x pan-y pinch-zoom;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.fullscreen-modal.active .fullscreen-image-container {
    opacity: 1;
    transform: scale(1);
}

.fullscreen-image-container img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: scale-down;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    transition: transform 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
}

/* Bottom Controls Container - Smaller on Desktop */
.fullscreen-controls-bottom {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 12px 20px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 2001;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.fullscreen-modal.active .fullscreen-controls-bottom {
    opacity: 1;
    transition-delay: 0.3s;
}

.fullscreen-controls-bottom.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(150px);
    pointer-events: none;
}

.control-btn {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 1;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.control-btn:active {
    transform: scale(0.95);
}

#fullscreenToggle {
    font-size: 18px;
}

.empty-state {
    text-align: center;
    color: #cfcfcf;
    margin-top: 3rem;
    display: none;
}

.empty-state p:first-child {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.empty-state p:last-of-type {
    margin-bottom: 2rem;
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    html {
        position: fixed;
        overflow: hidden;
        width: 100vw;
        height: 100dvh;
        height: 100vh;
    }
    
    body {
        position: fixed;
        width: 100vw;
        height: 100dvh;
        height: 100vh;
        overflow: hidden;
        touch-action: pan-y;
    }
    
    .main-content {
        height: calc(100dvh - 60px);
        height: calc(100vh - 60px);
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        margin-top: 10px;
        width: 100%;
        box-sizing: border-box;
        transform: translateZ(0);
        will-change: scroll-position;
    }
    
    .header.blurred {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        background: rgba(0, 0, 0, 0.8);
    }
    
    .loading-screen {
        position: fixed;
        width: 100vw;
        height: 100vh;
        overflow: hidden;
    }

    .header {
        padding: 1rem 0;
        height: 80px;
        align-items: center;
    }
    
    .header.album-mode {
        background: rgba(0, 0, 0, 1);
    }
    
    .album-title-box {
        top: 80px;
        padding: 0.5rem 0.5rem;
        z-index: 1600;
        min-height: 50px;
        left: 0;
        right: 0;
        width: 100%;
        box-sizing: border-box;
        background: linear-gradient(to bottom, 
            rgba(0,0,0,0.95) 0%, 
            rgba(0,0,0,0.85) 70%, 
            rgba(0,0,0,0.6) 90%, 
            transparent 100%);
    }
    
    .album-title-box h2 {
        font-size: 1rem;
        line-height: 1.2;
        text-align: center;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        max-width: calc(100% - 2rem);
        margin: 0 1rem;
        padding: 0.25rem 0;
        white-space: normal;
    }

    .album-content {
        padding: 110px 1rem 6rem;
        height: calc(100vh - 60px);
        margin-top: 10px;
        transform: translateZ(0);
        will-change: scroll-position;
    }

/* End of albums indicator */
.end-indicator {
    text-align: center;
    padding: 4rem 2rem;
    margin-top: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    pointer-events: none;
}

.end-indicator.visible {
    opacity: 1;
    transform: translateY(0);
}

.end-indicator p {
    color: #EF5350;
    font-size: 1.5rem;
    letter-spacing: 0.3em;
    text-transform: lowercase;
    font-weight: 300;
}

@media (max-width: 768px) {
    .end-indicator {
        padding: 3rem 1rem;
    }
    
    .end-indicator p {
        font-size: 1.2rem;
        letter-spacing: 0.2em;
    }
}

.end-indicator.visible {
    opacity: 0.5;
    transform: translateY(0);
}

.end-indicator p {
    color: #888;
    font-size: 1.5rem;
    letter-spacing: 0.3em;
    text-transform: lowercase;
    font-weight: 300;
}

@media (max-width: 768px) {
    .end-indicator {
        padding: 3rem 1rem;
    }
    
    .end-indicator p {
        font-size: 1.2rem;
        letter-spacing: 0.2em;
    }
}

    .logo {
        max-width: 90px;
        max-height: 50px;
    }
    
    .logo-fallback {
        font-size: 1.5rem;
    }

    .red-circle {
        right: 2rem;
        top: 50%;
        transform: translateY(-50%) scale(0.5);
    }
    
    .red-circle.animate {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }

    .red-circle.close-mode {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: #EF5350;
        font-size: 18px;
        transform: translateY(-50%) scale(1);
        transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .red-circle:hover {
        background: #d32f2f;
        transform: translateY(-50%) scale(1.05);
    }

    .red-circle.close-mode:hover {
        background: #d32f2f;
        transform: translateY(-50%) scale(1.1);
    }
    .red-circle.scroll-top-mode {
        transform: translateY(-50%) scale(1);
    }

    .red-circle.scroll-top-mode:hover {
        background: #FFD54F;
        transform: translateY(-50%) scale(1.1);
    }
    .header.profile-mode .logo {
        left: 1rem;
        transform: translateX(0) translateY(-50%);
    }

    .header.profile-mode .logo-fallback {
        left: 1rem;
        transform: translateX(0) translateY(-50%);
    }

    .profile-picture {
        width: 50px;
        height: 50px;
    }

    .profile-info-box {
        top: 80px;
        padding: 1.5rem;
    }

    .profile-content h3 {
        font-size: 1rem;
        font-weight: normal;
    }

    .profile-content p {
        font-size: 1rem;
    }

    .intro-text {
        font-size: 1rem;
        margin-bottom: 2rem; 
        padding: 0 1rem;
        transition: opacity 0.3s ease, 
                    transform 0.3s ease,
                    max-height 0.3s ease,
                    margin 0.3s ease;
        max-height: 80px;
    }
    
    .intro-text.hidden {
        transform: translateY(-15px);
        max-height: 0;
        margin-bottom: 1rem;
        margin-top: 0;
        padding-top: 0;
        padding-bottom: 0;
    }

    .albums-grid {
        gap: 5rem;
        width: 100%;
        overflow: visible;
    }

    .album-card {
        margin: 0 0 0.5rem 0;
        width: 100%;
        min-height: 90px;
        max-width: 100%;
        box-sizing: border-box;
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    .album-preview {
        height: 80px;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }

    .album-title {
        font-size: 0.85rem;
        font-weight: 600;
        letter-spacing: 0.1em;
        padding: 0.5rem;
        background: rgba(0, 0, 0, 0.3);
        border-radius: 4px;
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }

    .album-card.title-left .album-title {
        left: -2.5rem;
    }

    .album-card.title-right .album-title {
        right: -2.5rem;
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 1rem;
    }

    .photo-item img {
        height: 220px;
    }

    .stack-image {
        width: 90%;
        height: 150%;
        transition: all 0.4s ease;
    }
    
    .photo-item:hover {
        transform: none;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    }
    
    .photo-item:hover img {
        transform: none;
    }
    
    .expand-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
.fullscreen-image-container {
        width: 100vw;
        height: 90vh;
    }
    
    .fullscreen-image-container img {
        border-radius: 4px;
    }
    
    .fullscreen-controls-bottom {
        bottom: 25px;
        gap: 10px;
        padding: 10px 18px;
    }
    
    .control-btn {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }
    
    #fullscreenToggle {
        font-size: 17px;
    }
}

@media screen and (max-width: 430px) and (min-height: 900px) {
    .albums-grid {
        gap: 3rem;
    }
    
    .album-card {
        min-height: calc(var(--vh, 1vh) * 100);
        margin: 0 0 0.25rem 0;
    }
    
    .album-preview {
        height: 80px;
        max-width: 280px;
    }
    
    .album-title {
        font-size: 0.75rem;
        font-weight: 600;
        padding: 0.4rem;
    }
    
    .album-card.title-left .album-title {
        left: -2.2rem;
    }

    .album-card.title-right .album-title {
        right: -2.2rem;
    }
    
    .album-title-box {
        padding: 0.25rem 0.5rem;
        min-height: 40px;
    }
    
    .album-content {
        padding: 100px 1rem 2rem;
    }
    
    .album-title-box h2 {
        padding: 0.1rem 0;
        margin: 0 0.5rem;
    }
}

/* Safari-specific fixes */
@supports (-webkit-touch-callout: none) {
    body {
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
        position: fixed;
        width: 100%;
        overflow: hidden;
    }
    
    .main-content {
        height: calc(100vh - 70px);
        height: calc((var(--vh, 1vh) * 100) - 70px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .header {
        position: fixed;
        top: 0;
        width: 100%;
        z-index: 2000;
    }
}

/* Use the dynamic viewport height for iOS */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari specific */
    .main-content {
        height: calc(100vh - 60px);
        height: calc(var(--vh, 1vh) * 100 - 60px);
    }
    
    body {
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
    }
}

@media screen and (max-height: 500px) and (orientation: landscape) {
    body {
        height: 100vh;
        overflow: hidden;
    }
    
    .main-content {
        height: calc(100vh - 60px);
        margin-top: 60px;
    }
    
    .header {
        height: 60px;
        padding: 0.5rem 0;
    }
    
    .album-content {
        padding: 100px 1rem 1rem;
        margin-top: 60px;
    }
    
    .profile-info-box {
        top: 60px;
        padding: 1rem;
    }
    
    .profile-content h3 {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
    }
    
    .profile-content p {
        font-size: 0.9rem;
    }
    
    .profile-picture {
        width: 40px;
        height: 40px;
    }
}