@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    --bg-dark: #050505;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent: #ffffff;
    --frame-border: rgba(255, 255, 255, 0.1);
    --frame-bg: #111111;
    --transition-slow: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-medium: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Stylings for Portfolio Content */
body[data-page="portfolio"] {
    background-color: var(--bg-dark);
}

/* Ensure the immersive section has its own dark context without breaking global header/footer */
.portfolio-container {
    display: flex;
    flex-direction: column;
    gap: 15vh;
    padding: 5vh 0 15vh;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    position: relative;
    z-index: 10;
}

/* Project Section */
.project-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5vw;
}

.project-section:nth-child(even) {
    justify-content: flex-end;
}

.project-section:nth-child(odd) {
    justify-content: flex-start;
}

/* The Frame */
.project-frame {
    position: relative;
    width: 65vw;
    height: 75vh;
    background: var(--frame-bg);
    border: 1px solid var(--frame-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
    transition: var(--transition-slow);
    cursor: pointer;
}

.project-frame:hover {
    transform: scale(1.02) translateY(-10px);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.05), 0 60px 120px rgba(0, 0, 0, 0.9);
}

/* Browser UI */
.frame-header {
    height: 44px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--frame-border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 8px;
}

.frame-header .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

/* Content Inside Frame */
.frame-content {
    width: 100%;
    height: calc(100% - 44px);
    position: relative;
    overflow: hidden;
    background: #000;
}

.project-image {
    width: 100%;
    height: auto;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 12s cubic-bezier(0.45, 0, 0.55, 1);
}

.project-frame:hover .project-image {
    transform: translateY(calc(-100% + 75vh - 44px));
}

/* Project Info Overlay */
.project-info {
    position: absolute;
    bottom: 15%;
    left: 5vw;
    z-index: 10;
    opacity: 0;
    transform: translateY(30px);
    transition: var(--transition-medium);
    pointer-events: none;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.project-section:nth-child(even) .project-info {
    left: auto;
    right: 5vw;
    text-align: right;
}

.project-frame:hover+.project-info,
.project-info:hover {
    opacity: 1;
    transform: translateY(0);
}

.stars {
    color: #F5B301;
    font-size: 1.2rem;
    margin-bottom: 5px;
    letter-spacing: 2px;
}

.project-name {
    font-family: 'Readex Pro', 'Cairo', 'Tajawal', sans-serif;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 700;
    margin-bottom: 15px;
    color: #fff;
}

.live-link {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    pointer-events: auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 5px;
    transition: 0.3s;
}

.live-link:hover {
    color: #fff;
    border-color: #fff;
    letter-spacing: 0.4em;
}

/* Ending Text */
.closing-statement {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10vw;
    text-align: center;
}

.closing-statement h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.5rem, 3vw, 3rem);
    font-style: italic;
    font-weight: 400;
    color: #fff;
    opacity: 0.4;
}

/* Responsive Fixes */
@media (max-width: 1024px) {
    .project-frame {
        width: 80vw;
    }
}

@media (max-width: 768px) {
    .project-frame {
        width: 90vw;
        height: 50vh;
    }

    .project-info {
        position: relative;
        left: 0 !important;
        right: 0 !important;
        padding: 30px 5vw;
        opacity: 1;
        transform: none;
        text-align: left !important;
    }

    .project-image {
        transition: transform 8s linear;
    }

    .portfolio-container {
        gap: 5vh;
    }
}