/* --- GLOBAL STYLES & VARIABLES --- */
:root {
    --primary: #ff4d5a;
    --dark: #121212;
    --darker: #0a0a0a;
    --light: #f8f9fa;
    --gray: #a0a5b0;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--darker);
    color: var(--light);
    overflow-x: hidden;
    line-height: 1.6;
}

h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.2;
    font-weight: 800;
}

section {
    position: relative;
    overflow: hidden;
    scroll-margin-top: 80px;
}

.hidden {
    display: none;
}

/* --- NEW ANIMATED PRELOADER --- */
.preloader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #000; display: flex; align-items: center; justify-content: center;
    z-index: 9999; transition: opacity 0.8s ease, visibility 0.8s;
}
.preloader.fade-out { opacity: 0; visibility: hidden; }
.preloader-logo { width: 250px; max-width: 60%; animation: logo-pulse 2s infinite ease-in-out 1.5s; }
@keyframes logo-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.8; } }
.preloader-logo .icon-group rect { opacity: 0; transform-origin: center; animation: icon-pop-in 0.5s ease-out forwards; }
.preloader-logo .text-group { opacity: 0; animation: text-fade-in 0.7s ease-out forwards; animation-delay: 0.5s; }
@keyframes icon-pop-in { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes text-fade-in { from { opacity: 0; } to { opacity: 1; } }
#icon-rect-1 { animation-delay: 0s; } #icon-rect-2 { animation-delay: 0.1s; } #icon-rect-3 { animation-delay: 0.2s; } #icon-rect-4 { animation-delay: 0.3s; }

/* --- NAVIGATION --- */
.navbar { position: fixed; top: 0; left: 0; width: 100%; padding: 20px 5%; display: flex; justify-content: space-between; align-items: center; z-index: 1000; transition: padding 0.3s ease, background-color 0.3s ease, backdrop-filter 0.3s ease; }
.navbar.scrolled { padding: 15px 5%; background: rgba(10, 10, 10, 0.9); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.logo { font-family: 'Montserrat', sans-serif; font-size: 1.8rem; font-weight: 800; color: var(--light); text-decoration: none; }
.logo span { color: var(--primary); }
.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-links a { color: var(--light); text-decoration: none; font-weight: 500; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 1px; transition: color 0.3s ease; }
.nav-links a:hover { color: var(--primary); }
.menu-toggle { display: none; cursor: pointer; z-index: 1002; font-size: 1.8rem; color: white; }

/* --- REUSABLE COMPONENTS & SECTIONS --- */
.video-container { height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; }
.background-video { position: absolute; top: 50%; left: 50%; min-width: 100%; min-height: 100%; width: auto; height: auto; transform: translateX(-50%) translateY(-50%); z-index: -1; object-fit: cover; }
.video-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to bottom, rgba(18,18,18,0.6) 0%, rgba(18,18,18,0.3) 50%, rgba(18,18,18,0.6) 100%); }
.video-overlay.dark { background: rgba(10, 10, 10, 0.7); }
.content-wrapper, .hero-content { position: relative; z-index: 2; max-width: 900px; padding: 0 20px; }
.content-wrapper h1, .hero-content h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); margin-bottom: 1.5rem; text-transform: uppercase; text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7); }
.content-wrapper p, .hero-content p { font-size: clamp(1rem, 3vw, 1.5rem); margin: 0 auto 2.5rem auto; font-weight: 300; max-width: 700px; text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7); }
.cta-button { display: inline-block; background-color: var(--primary); color: white; padding: 16px 42px; border-radius: 50px; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; font-size: 1rem; text-decoration: none; border: 2px solid var(--primary); transition: var(--transition); }
.cta-button:hover { transform: translateY(-5px); background-color: transparent; }
.cta-button.secondary { background-color: transparent; color: var(--primary); }
.cta-button.secondary:hover { background-color: var(--primary); color: white; }
.section-header { text-align: center; max-width: 800px; margin: 0 auto 60px; }
.section-header h2 { font-size: clamp(2rem, 5vw, 3rem); text-transform: uppercase; }

/* Scroll Fade-in Animation */
.fade-in { opacity: 0; transform: translateY(50px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.fade-in.is-visible { opacity: 1; transform: translateY(0); }

/* --- NEW PORTFOLIO SECTION --- */
.portfolio-section {
    padding: 120px 5%;
    background-color: var(--darker);
}
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}
.portfolio-card {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    aspect-ratio: 16 / 9;
    background-color: var(--dark);
    color: var(--light);
    text-decoration: none;
}
.portfolio-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.portfolio-card:hover img {
    transform: scale(1.05);
}
.portfolio-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 25px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
    transition: background 0.3s ease;
}
.portfolio-card:hover .portfolio-card-overlay {
    background: linear-gradient(to top, rgba(0,0,0,1) 10%, rgba(0,0,0,0) 100%);
}
.portfolio-card-title {
    font-size: 1.2rem;
    font-weight: 600;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}


/* --- SHOWREEL SECTION --- */
@keyframes pulse-play { 0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 77, 90, 0.7); } 70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(255, 77, 90, 0); } 100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 77, 90, 0); } }
.play-button { display: inline-flex; align-items: center; justify-content: center; width: 80px; height: 80px; background: var(--primary); border-radius: 50%; color: white; font-size: 2rem; cursor: pointer; margin-top: 40px; border: 3px solid rgba(255, 255, 255, 0.3); animation: pulse-play 2s infinite; }
.play-button:hover { transform: scale(1.1); animation-play-state: paused; }
.play-button i { margin-left: 5px; }

/* --- ABOUT SECTION --- */
.about-section { padding: 120px 5%; background-color: var(--dark); }
.about-container { display: grid; grid-template-columns: 1fr 1.2fr; gap: 60px; max-width: 1200px; margin: 0 auto; align-items: center; }
.about-image img { width: 100%; height: 100%; max-height: 500px; object-fit: cover; border-radius: 20px; }
.about-content p { font-size: clamp(1rem, 2.5vw, 1.1rem); margin-bottom: 25px; color: var(--gray); }
.skills { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 30px; }
.skill-tag { background: rgba(255, 255, 255, 0.05); padding: 8px 20px; border-radius: 50px; font-size: 0.9rem; }

/* --- CONTACT SECTION --- */
.contact-section { min-height: 100vh; padding: 80px 5%; display: flex; align-items: center; justify-content: flex-end; }
.contact-content { position: relative; z-index: 2; padding: 50px; background: rgba(18, 18, 18, 0.8); border-radius: 20px; border: 1px solid rgba(255, 255, 255, 0.1); backdrop-filter: blur(15px); max-width: 600px; width: 100%; }
.contact-content h2 { font-size: clamp(2rem, 5vw, 2.8rem); margin-bottom: 1rem; }
.contact-content p { font-size: clamp(1rem, 2.5vw, 1.1rem); color: var(--gray); margin-bottom: 2.5rem; }
.highlight { color: var(--primary); font-weight: 600; }
#contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { grid-column: span 2; } .form-group.half { grid-column: span 1; }
#contact-form input, #contact-form textarea { width: 100%; padding: 16px 20px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; color: white; font-size: 1rem; font-family: 'Poppins', sans-serif; }
#contact-form textarea { height: 150px; resize: vertical; }
.submit-btn { grid-column: span 2; padding: 18px; background: var(--primary); color: white; border: none; border-radius: 10px; font-weight: 600; cursor: pointer; font-size: 1rem; font-family: 'Montserrat', sans-serif; transition: background-color 0.3s ease; }
.submit-btn:hover { background-color: #e0424f; } .submit-btn:disabled { background-color: #555; cursor: not-allowed; }

/* --- FOOTER --- */
.footer { padding: 50px 5%; text-align: center; background: #0a0a0a; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.social-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 25px; }
.social-links a { display: flex; align-items: center; justify-content: center; width: 50px; height: 50px; border-radius: 50%; background: rgba(255, 255, 255, 0.05); color: var(--gray); font-size: 1.2rem; text-decoration: none; transition: var(--transition); }
.social-links a:hover { background: var(--primary); color: white; transform: translateY(-5px); }
.copyright { color: var(--gray); font-size: 0.9rem; }

/* --- MODALS (For Showreel) --- */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.9); z-index: 2000; display: none; align-items: center; justify-content: center; padding: 20px; animation: fadeInModal 0.3s ease; }
@keyframes fadeInModal { from { opacity: 0; } to { opacity: 1; } }
.modal.visible { display: flex; }
.modal-content { position: relative; background: var(--dark); border-radius: 15px; max-width: 1100px; width: 100%; animation: scaleInModal 0.3s ease; }
@keyframes scaleInModal { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.close-modal { position: absolute; top: 15px; right: 20px; color: white; font-size: 2rem; cursor: pointer; z-index: 10; }
#video-container { width: 100%; padding-top: 56.25%; position: relative; }
#video-container video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* --- PROJECT DETAIL PAGE STYLES --- */
.project-detail-section { min-height: calc(100vh - 150px); padding: 140px 5% 80px; background-color: var(--dark); display: flex; align-items: center; justify-content: center; animation: fadeInPage 0.6s ease-out; }
@keyframes fadeInPage { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.project-detail-layout { display: grid; grid-template-columns: 1fr 1.5fr; gap: 60px; max-width: 1200px; width: 100%; align-items: center; }
.project-detail-text h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 1.5rem; }
.project-detail-text p { font-size: 1.1rem; color: var(--gray); line-height: 1.8; }
.back-to-portfolio-btn { display: inline-block; color: var(--gray); text-decoration: none; margin-bottom: 2rem; font-size: 1rem; transition: color 0.3s ease; }
.back-to-portfolio-btn:hover { color: var(--primary); }
.back-to-portfolio-btn i { margin-right: 8px; }
.project-detail-media { border-radius: 15px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.project-video-wrapper, .project-image-wrapper { width: 100%; position: relative; padding-top: 56.25%; }
.project-image-wrapper { padding-top: 66.66%; }
.project-detail-media video, .project-detail-media img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.project-not-found { text-align: center; }
.project-not-found h1 { font-size: 3rem; margin-bottom: 1rem; }
.project-not-found p { font-size: 1.2rem; color: var(--gray); margin-bottom: 2.5rem; }

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 992px) {
    .about-container { grid-template-columns: 1fr; text-align: center; }
    .skills { justify-content: center; }
    .contact-section { justify-content: center; }
    .project-detail-layout { grid-template-columns: 1fr; }
    .project-detail-text { text-align: center; order: 2; }
    .project-detail-media { order: 1; }
}
@media (max-width: 768px) {
    section { scroll-margin-top: 70px; }
    .portfolio-section, .about-section { padding: 80px 5%; }
    .contact-section { padding: 60px 5%; }
    .contact-content { padding: 30px; }
    #contact-form { grid-template-columns: 1fr; gap: 15px; }
    #contact-form .form-group.half, .submit-btn { grid-column: span 1; }
    .menu-toggle { display: block; }
    .nav-links { position: fixed; top: 0; right: -100%; height: 100vh; width: 70%; max-width: 300px; background: rgba(10, 10, 10, 0.98); backdrop-filter: blur(10px); flex-direction: column; justify-content: center; transition: right 0.4s ease-in-out; }
    .nav-links.active { right: 0; }
    .project-detail-section { padding: 120px 5% 60px; }
    .portfolio-grid { grid-template-columns: 1fr; }
}