/* Enable buttery smooth scrolling for all anchor links site-wide */
html {
    scroll-behavior: smooth;
}
/* Reset and Base Styles */
body, html {
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #111111; /* Deep, cinematic dark mode */
    color: #ffffff;
    overflow-x: hidden;
}

/* --- CUSTOM CURSOR --- */
/* Hide the default system pointer on the body and clickable items */
body, a, button, .project-card {
    cursor: none !important;
}

/* If JS detects a touch device, restore the native pointer */
body.touch-device,
.touch-device a,
.touch-device button,
.touch-device .project-card {
    cursor: auto !important;
}

.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background-color: rgba(255, 51, 51, 0.5); /* Translucent Lucid Red */
    border: 2px solid #ff3333;
    border-radius: 50%;
    pointer-events: none; /* CRUCIAL: Lets the user actually click through the dot */
    z-index: 9999; /* Keeps it on top of everything */
    transform: translate(-50%, -50%); /* Centers the dot exactly on the mouse coordinates */
    transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
    backdrop-filter: blur(2px);
}

/* The "Expanded" state when hovering over projects or buttons */
.custom-cursor.cursor-grow {
    width: 70px;
    height: 70px;
    background-color: transparent;
    border-color: #ffffff;
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Positioning the SVG behind the text */
.svg-container.logo-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 55vw; /* Increased from 40vw */
    max-width: 550px; /* Increased from 400px */
    z-index: 0;
    opacity: 0.6;
}

/* Making the SVG glow slightly */
#hero-svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0px 0px 15px rgba(255, 51, 51, 0.4));
}

/* Allow the GSAP spring animation to expand past the SVG canvas */
.svg-logo {
    overflow: visible !important;
}

/* Foreground Content */
.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 900;
    letter-spacing: 2px;
    margin: 0;
    text-transform: uppercase;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: #aaaaaa;
    margin-top: 10px;
}

/* Section Titles */
.section-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 3.5rem);
    margin: 6rem 0 3rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding: 0 10%;
    margin-bottom: 6rem;
}

.service-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: #ff3333;
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    padding: 0 5%;
    margin-bottom: 5rem;
}

.project-card {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: #222;
    cursor: pointer;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-card:hover .project-image {
    transform: scale(1.08);
}

/* Slide-up Info Overlay */
.project-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 30px 20px 20px;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.project-card:hover .project-info {
    transform: translateY(0);
}

.project-info h3 {
    margin: 0 0 5px;
    font-size: 1.5rem;
}

.project-info p {
    margin: 0;
    color: #ff3333;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
}

/* Position the video exactly over the thumbnail */
.project-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.4s ease;
    z-index: 1; /* Sits above the image, but below the text info */
}

/* Ensure the text info stays on top of the video */
.project-info {
    z-index: 2;
}

/* Fade out the image and fade in the video on hover */
.project-card:hover .project-image {
    opacity: 0;
}

.project-card:hover .project-video {
    opacity: 1;
}

/* Contact Section */
.contact-section {
    padding: 0 5%;
    margin-bottom: 8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact-container {
    background: #1a1a1a;
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row input {
    flex: 1;
}

input, textarea {
    width: 100%;
    background: #222;
    border: 1px solid #333;
    color: #fff;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #ff3333;
}

.primary-btn {
    width: 100%;
    background: #ff3333;
    color: #fff;
    border: none;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.primary-btn:hover {
    background: #cc0000;
}

.primary-btn:disabled {
    background: #555;
    cursor: not-allowed;
}

/* Success SVG Styles */
.checkmark-svg {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    display: block;
}

.checkmark-circle {
    stroke: #ff3333;
    stroke-width: 2;
}

.checkmark-check {
    stroke: #ff3333;
    stroke-width: 4;
    stroke-linecap: round;
}

/* Project Detail Hero */
.project-hero {
    height: 70vh;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding: 5%;
}

/* Project Details Layout */
.project-details-section {
    display: flex;
    flex-wrap: wrap;
    gap: 50px;
    padding: 5% 10%;
    margin-bottom: 5rem;
}

.project-meta {
    flex: 1;
    min-width: 250px;
    background: rgba(255, 255, 255, 0.05);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: fit-content;
}

.meta-item {
    margin-bottom: 30px;
}

.meta-item h4 {
    color: #ff3333;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 5px 0;
    font-size: 0.9rem;
}

.meta-item p {
    margin: 0;
    font-size: 1.2rem;
    font-weight: bold;
}

.project-description {
    flex: 2;
    min-width: 300px;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #cccccc;
}

.project-description h2 {
    color: #ffffff;
    margin-top: 0;
}

.small-btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 0.9rem;
    text-decoration: none;
    text-align: center;
    margin-top: 10px;
}

.secondary-btn {
    display: inline-block;
    margin-top: 40px;
    color: #ffffff;
    text-decoration: none;
    border-bottom: 2px solid #ff3333;
    padding-bottom: 5px;
    transition: color 0.3s ease;
}

.secondary-btn:hover {
    color: #ff3333;
}

/* ==========================================
   MOBILE RESPONSIVENESS
========================================== */
@media screen and (max-width: 768px) {
    /* 1. Scale up the logo so it commands the phone screen */
    .svg-container.logo-container {
        width: 85vw;
    }

    /* 2. Prevent portfolio cards from overflowing narrow screens */
    .portfolio-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        padding: 0 5%;
        gap: 15px;
    }

    /* 3. Stack the contact form inputs vertically */
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* 4. Adjust the project detail page layout */
    .project-details-section {
        flex-direction: column;
        gap: 30px;
    }

    .project-meta {
        width: 100%;
    }
}

/* ==========================================
   FULL-SCREEN NAVIGATION
========================================== */

/* The Hamburger Button */
.menu-toggle {
    position: fixed;
    top: 40px;
    right: 5%;
    z-index: 9001; /* Keeps it above the overlay, but below the custom cursor (9999) */
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
}

.hamburger-line {
    width: 40px;
    height: 2px;
    background-color: #ffffff;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease, background-color 0.3s ease;
    transform-origin: left center;
}

/* Morph hamburger to 'X' when the '.active' class is added */
.menu-toggle.active .hamburger-line {
    background-color: #ff3333; /* Shifts to Lucid Red */
}
.menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(0px, -2px);
}
.menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}
.menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(0px, 2px);
}

/* The Dark Overlay */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(17, 17, 17, 0.98);
    backdrop-filter: blur(10px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden; /* Hidden by GSAP initially */
    opacity: 0;
}

.nav-links {
    display: flex;
    flex-direction: column;
    text-align: center;
    gap: 2rem;
}

.nav-link {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    color: #ffffff;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 2px;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #ff3333;
}