/* Sliding Gallery - Minimal Elegant RTL Marquee */

:root {
    --rg-speed: 28s;
    --header-h: 100px;
    --color-primary: #6AD1E1;
    --color-text: #0b0b0d;
    --color-text-secondary: #375259;
    --color-dark: #182540;
    --blur-header: 8px;
}

@media (max-width: 768px) {
    :root {
        --header-h: 80px;
    }
}

/* Page Background */
body {
    background: linear-gradient(to bottom right, #f9fcff 0%, #e8f3ff 100%);
    min-height: 100vh;
    opacity: 0;
    animation: fadeInPage 1.2s ease-in-out forwards;
}

@keyframes fadeInPage {
    from {
        opacity: 0;
        filter: brightness(1.1);
    }
    to {
        opacity: 1;
        filter: brightness(1);
    }
}

/* Fixed Header - Optimized Blur */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(var(--blur-header));
    -webkit-backdrop-filter: blur(var(--blur-header));
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    color: #0b0b0d;
    opacity: 0;
    transform: translateY(-12px);
    animation: headerFadeIn 1s ease-out forwards;
    animation-delay: 0.3s;
}

@keyframes headerFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.site-header .header-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-header a,
.site-header h3,
.site-header .nav-link {
    color: #0b0b0d;
}

/* Main Content */
.page {
    padding-top: calc(var(--header-h) + 4rem);
    padding-bottom: clamp(48px, 8vw, 96px);
    min-height: 100vh;
    background: transparent;
}

/* Gallery Section - Performance Optimized */
.rtl-gallery {
    max-width: 1600px;
    margin: 0 auto;
    padding: clamp(48px, 8vw, 80px) clamp(16px, 4vw, 48px);
    content-visibility: auto;
    contain-intrinsic-size: 800px 1200px;
}

/* Header - Centered Typography with Breathable Gaps */
.rg-head {
    text-align: center;
    margin-bottom: clamp(32px, 6vw, 56px);
}

.rg-title {
    font-family: 'Bigilla', serif;
    font-size: clamp(28px, 4vw, 48px);
    margin: 0 0 clamp(12px, 2vw, 20px);
    color: var(--color-dark);
    font-weight: 400;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.rg-intro {
    font-family: 'Didot', serif;
    font-size: clamp(1rem, 1.6vw, 1.3rem);
    max-width: 70ch;
    margin: 0 auto;
    opacity: 0.8;
    color: var(--color-text-secondary);
    line-height: 1.7;
    font-weight: 300;
    padding: 0 clamp(16px, 4vw, 32px);
}

/* Galleries Container */
.rg-galleries {
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 3vw, 24px);
    margin-top: clamp(24px, 4vw, 40px);
}

/* Viewport - Clean Cursor */
.rg-viewport {
    cursor: default;
    overflow: hidden;
    border-radius: 18px;
    background: transparent;
    position: relative;
}

/* Track - Seamless RTL Animation with GPU Optimization */
.rg-track {
    display: inline-flex;
    gap: 20px;
    padding: 10px 0;
    will-change: transform;
    animation: rg-marquee var(--rg-speed) linear infinite;
    white-space: nowrap;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Seamless RIGHT→LEFT Animation - GPU Optimized */
@keyframes rg-marquee {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(-50%, 0, 0);
    }
}

/* Second row - same direction for consistency */
.rg-track-reverse {
    animation: rg-marquee var(--rg-speed) linear infinite;
}

/* Image Tiles - Horizontal Rectangle Format (30% Smaller) - Performance Optimized */
.rg-img {
    height: clamp(112px, 16.8vw, 210px);
    width: clamp(182px, 26.6vw, 336px);
    border-radius: 16px;
    display: block;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    max-width: var(--nw, 100%);
}

.rg-img:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 0 2px var(--color-primary), 0 4px 12px rgba(106, 209, 225, 0.2);
}

/* Footer Styles */
footer {
    background: linear-gradient(135deg, #f8fbfd 0%, #e8f4f8 50%, #d9eff7 100%);
    border-top: 1px solid rgba(106, 209, 225, 0.2);
    position: relative;
    overflow: hidden;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 2rem 2rem;
}

.footer-main {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(106, 209, 225, 0.15);
}

.footer-info {
    max-width: 400px;
}

.footer-logo {
    margin-bottom: 1.5rem;
}

.designer-name {
    font-family: 'Bigilla', serif;
    font-size: 2rem;
    color: #2c5f96;
    margin-bottom: 0.5rem;
    font-weight: normal;
    letter-spacing: 0.5px;
}

.footer-tagline {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    color: #5a8fb5;
    line-height: 1.6;
    font-weight: 300;
}

.footer-nav {
    display: contents;
}

.footer-links h4,
.footer-social h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #357ABD;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.footer-links ul,
.footer-social ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    color: #5a8fb5;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, #4A90E2, #64BCE0);
    transition: width 0.3s ease;
}

.footer-links a:hover {
    color: #4A90E2;
    transform: translateX(5px);
}

.footer-links a:hover::after {
    width: 100%;
}

.social-icons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-icons li a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(106, 209, 225, 0.1), rgba(100, 188, 224, 0.15));
    color: #4A90E2;
    font-size: 1.1rem;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    border: 1px solid rgba(106, 209, 225, 0.2);
}

.social-icons li a:hover {
    background: linear-gradient(135deg, #4A90E2, #64BCE0);
    color: white;
    transform: translateY(-5px) rotate(5deg);
    box-shadow: 0 10px 25px rgba(74, 144, 226, 0.3);
    border-color: transparent;
}

.footer-bottom {
    text-align: center;
    padding: 1.5rem 0;
}

.footer-bottom p {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    color: #5a8fb5;
    font-weight: 300;
}

/* Responsive Design */
@media (max-width: 992px) {
    .footer-main {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }

    .footer-info {
        grid-column: 1 / -1;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .footer-container {
        padding: 3rem 1.5rem 1.5rem;
    }

    .footer-main {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        margin-bottom: 2rem;
        padding-bottom: 2rem;
    }

    .designer-name {
        font-size: 1.8rem;
    }

    .social-icons {
        justify-content: flex-start;
    }
    
    .rtl-gallery {
        padding: 3rem clamp(16px, 4vw, 32px);
    }
    
    .rg-galleries {
        gap: clamp(12px, 2.5vw, 20px);
    }
    
    .rg-img {
        height: clamp(98px, 15.4vw, 182px);
        width: clamp(154px, 24.5vw, 294px);
    }
    
    .next-projects-nav {
        gap: clamp(16px, 3vw, 24px);
        padding: clamp(40px, 6vw, 80px) clamp(16px, 3vw, 24px);
    }
    
    .next-project-widget {
        width: 70px;
        height: 70px;
    }
    
    .next-project-widget text {
        font-size: 8.4px;
    }
    
    .lightbox-close {
        top: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .rg-img {
        height: clamp(84px, 19.6vw, 154px);
        width: clamp(126px, 31.5vw, 252px);
    }
    
    .rg-galleries {
        gap: clamp(10px, 2vw, 16px);
    }
    
    .next-project-widget {
        width: 60px;
        height: 60px;
    }
    
    .next-project-widget text {
        font-size: 7.35px;
    }
}

/* Reduce Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
    
    body {
        opacity: 1;
    }
    
    .site-header {
        opacity: 1;
        transform: none;
    }
    
    .rg-track,
    .rg-track-reverse {
        animation: none !important;
    }
    
    .rg-img:hover {
        transform: none;
    }
    
    .next-project-widget:hover {
        transform: none;
    }
    
    .next-project-widget svg {
        animation: none !important;
    }
}

/* Smooth Scrolling with Performance Optimization */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

body {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 75%;
    max-height: 80%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
}

.lightbox.active .lightbox-content {
    transform: scale(1);
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
    z-index: 10001;
    line-height: 1;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg) scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Next Project Navigation Widgets - Small Dots with Curved Text */
.next-projects-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(30px, 5vw, 50px);
    padding: clamp(60px, 8vw, 100px) clamp(20px, 4vw, 40px);
    margin: clamp(40px, 6vw, 80px) auto 0;
    max-width: 1400px;
    flex-wrap: wrap;
    position: relative;
}

.next-project-widget {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    text-decoration: none;
}

/* Small Dot */
.next-project-widget::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2;
}

.next-project-widget:hover::before {
    width: 10px;
    height: 10px;
    background: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(106, 209, 225, 0.3);
}

/* Curved Text SVG */
.next-project-widget svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    pointer-events: none;
    animation: rotateText 20s linear infinite;
}

.next-project-widget:hover svg {
    animation-play-state: paused;
}

.next-project-widget text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 9.5px;
    font-weight: 500;
    fill: var(--color-text-secondary);
    letter-spacing: 1px;
    opacity: 0.6;
    transition: opacity 0.4s ease, fill 0.4s ease;
}

.next-project-widget:hover text {
    fill: var(--color-accent);
    opacity: 1;
}

@keyframes rotateText {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.next-project-label {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    font-weight: 500;
    color: var(--color-text-secondary);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.next-project-widget:hover .next-project-label {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

@media (prefers-reduced-motion: reduce) {
    html,
    body {
        scroll-behavior: auto;
    }
    
    .lightbox {
        transition: none;
    }
    
    .lightbox-content {
        animation: none;
    }
    
    .next-project-widget:hover {
        transform: none;
    }
}

