/* Three.js Canvas Background */
#webgl-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    opacity: 0.6;
}

/* Nav Fixes */
.nav-logo-text {
    font-family: var(--primaryFont);
    font-size: 2vw;
    color: white;
    letter-spacing: 2px;
    margin-top: 15px;
}

.nav-social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50px;
    border: 1px solid white;
    color: white;
    transition: .3s;
    text-decoration: none;
}

.nav-social-icon:hover {
    border: 1px solid #ad1222;
    background-color: #ad1222;
    color: white;
}

/* Hero Box Layout Adjustments */
.herobox h1.herobox-mainheading {
    z-index: 3;
    pointer-events: none;
    white-space: nowrap;
    font-size: 20vw; /* dynamically fits */
    width: 100%;
    text-align: center;
}
.herobox {
    z-index: 1 !important;
}
.hero-footer {
    z-index: 20 !important;
}
.grid {
    width: auto !important;
    opacity: 1 !important;
    white-space: nowrap;
}
.surname-text {
    font-family: var(--primaryFont);
    color: white;
    font-size: 3.5vw;
    letter-spacing: 5px;
    opacity: 0.8;
}
.section-1 {
    position: relative;
    z-index: 10 !important;
}
.character {
    z-index: 5;
    overflow: visible;
    width: 1260px; /* 40% bigger than 900px */
    bottom: -35%;
}
.character img {
    object-fit: contain;
}

/* Hide overlapping hero red circle */
.right-hero-content .cd {
    display: none;
}

/* Tech Strip */
.tech-strip {
    display: flex;
    align-items: center;
    justify-content: space-around;
    min-width: max-content;
    padding: 0 20px;
}
.tech-strip h1 {
    font-family: var(--primaryFont);
    color: white;
    font-size: 30px;
    margin: 0 40px;
    letter-spacing: 2px;
}

/* Skill Cards */
.card.skill-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    background: rgba(173, 18, 34, 0.85) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3) !important;
    border-radius: 15px;
}
.skill-content h3 {
    font-family: var(--primaryFont);
    color: white;
    font-size: 24px;
    margin-bottom: 10px;
}
.skill-content p {
    font-family: var(--secondaryFont);
    color: white;
    font-size: 14px;
    opacity: 0.8;
}

/* Education Marvel Section */
.about-uni {
    color: #ad1222;
    font-family: var(--primaryFont);
    font-size: 40px;
    display: flex;
    align-items: center;
    letter-spacing: 2px;
}

/* Stats Boxes */
.stat-box h2 {
    color: black !important;
}
.stat-box h1 {
    color: black !important;
}

.IMAX.stat-box h2, .IMAX.stat-box h1, 
.date.stat-box h2, .date.stat-box h1 {
    color: white !important;
}

/* Projects Grid */
.projects-grid {
    position: absolute;
    top: 35%;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    padding: 0 60px;
    z-index: auto; /* Allow overlays to interleave */
}
/* Blur overlay moved inside projects grid */
#blur-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    z-index: 990;
    opacity: 0;
    pointer-events: none;
    transition: 0.5s ease;
}
#blur-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.project-card-placeholder {
    width: 400px;
    height: 420px;
}
/* Project Flip Card Styles */
.project-card-ui {
    width: 400px;
    height: 420px;
    perspective: 1000px;
    background-color: transparent;
    border-radius: 20px;
    /* Removed overflow: hidden because it ruins 3D perspective */
    border: none;
    transition: 0.4s ease;
    cursor: pointer;
    /* For GSAP Initial State */
    transform: translateY(50px) scale(0.95);
    opacity: 0;
    filter: blur(5px);
    z-index: 5;
}
.project-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: left;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    border-radius: 20px;
}
.project-card-ui:hover .project-card-inner {
    box-shadow: 0 15px 40px rgba(173, 18, 34, 0.3);
}

.project-card-front, .project-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 20px;
    background-color: #111;
    border: 1px solid #333;
    overflow: hidden;
}

.project-card-back {
    transform: rotateY(180deg);
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-color: #ad1222;
}
.project-card-back h1 {
    font-family: var(--primaryFont);
    color: white;
    font-size: 32px;
    margin-bottom: 15px;
}
.project-card-back p {
    font-family: var(--secondaryFont);
    color: #ccc;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}
.project-card-back p.tech-stack-details {
    color: #ad1222;
    font-weight: bold;
}
.project-card-back a {
    color: white;
    font-family: var(--secondaryFont);
    text-decoration: none;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    align-self: flex-start;
    padding: 10px 20px;
    background-color: #ad1222;
    border-radius: 50px;
    transition: 0.3s;
}
.project-card-back a:hover {
    background-color: white;
    color: black;
}

/* Hero Button Redirection Hover */
#projects-btn {
    transition: 0.3s;
}
#projects-btn:hover {
    color: white !important;
    background-color: #ad1222 !important;
    border-color: #ad1222 !important;
}

/* Flipped Modal State */
.project-card-ui.flipped {
    position: fixed;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(1.2) !important;
    z-index: 1000 !important;
}
.project-card-ui.flipped .project-card-inner {
    transform: rotateY(180deg);
}
.project-img-wrapper {
    width: 100%;
    height: 250px;
    overflow: hidden;
    background-color: #000;
}
.project-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: 0.5s ease;
}
.project-card-ui:hover .project-img-wrapper img {
    transform: scale(1.05);
}
.project-info {
    padding: 25px;
    display: flex;
    flex-direction: column;
}
.project-info h1 {
    font-family: var(--primaryFont);
    color: white;
    font-size: 28px;
    margin-bottom: 10px;
    letter-spacing: 2px;
}
.project-info p {
    font-family: var(--secondaryFont);
    color: #ccc;
    font-size: 12px;
    line-height: 1.6;
    margin-bottom: 15px;
}
.project-info a {
    color: #ad1222;
    font-family: var(--secondaryFont);
    text-decoration: none;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    align-self: flex-start;
    border-bottom: 1px solid transparent;
    transition: 0.3s;
}
.project-info a:hover {
    border-bottom: 1px solid #ad1222;
}

.tech-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}
.tech-icon i {
    color: white;
    font-size: 20px;
}

.footer-links a.contact-btn {
    background-color: white;
    color: black;
    border: 2px solid #ad1222 !important;
    font-family: var(--secondaryFont);
    text-decoration: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: 0.3s;
}
.footer-links a.contact-btn:hover {
    background-color: #ad1222;
    color: white !important;
}

/* Scroll Up Button */
.scroll-up-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #ad1222;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    text-decoration: none;
    font-size: 24px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    transition: 0.3s;
    opacity: 0.8;
}
.scroll-up-btn:hover {
    opacity: 1;
    transform: translateY(-5px);
    color: white;
    box-shadow: 0 10px 25px rgba(173, 18, 34, 0.5);
}

/* Marquee Animations */
.tech-marquee {
    display: flex;
    width: max-content;
    animation: marquee 30s linear infinite;
}
.tech-marquee-reverse {
    animation: marquee-reverse 30s linear infinite;
}
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
@keyframes marquee-reverse {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}


/* Remove initial footer blur */
.footer-content {
    filter: none !important;
}

/* Education Timeline */
.education-timeline {
    position: relative;
    margin-left: 30px;
    margin-top: 20px;
    padding-left: 25px;
    border-left: 2px solid rgba(255, 255, 255, 0.3);
}
.timeline-item {
    position: relative;
    margin-bottom: 30px;
    transition: 0.3s;
}
.timeline-item:hover {
    transform: translateX(10px);
}
.timeline-item:last-child {
    margin-bottom: 0;
}
.timeline-dot {
    position: absolute;
    left: -33px; /* 25px padding + 1px half-border + 7.5px half-dot = 33.5px */
    top: 5px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.8);
    background-color: #ad1222;
    box-shadow: 0 0 10px rgba(173, 18, 34, 0.8);
}
.timeline-content {
    display: flex;
    flex-direction: column;
}
.timeline-title {
    font-family: var(--primaryFont);
    color: white;
    font-size: 32px;
    letter-spacing: 2px;
    text-transform: uppercase;
    line-height: 1.2;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
.timeline-subtitle {
    font-family: var(--secondaryFont);
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    letter-spacing: 1px;
    margin-top: 2px;
}


/* =========================================
   RESPONSIVE DESIGN (Tablets & Mobile)
   ========================================= */

html, body {
    overflow-x: hidden;
    width: 100vw;
    max-width: 100%;
}

@media (max-width: 1024px) {
    /* Herobox Elements */
    .herobox h1.herobox-mainheading {
        font-size: 25vw;
        top: 30%;
    }
    .surname-text {
        font-size: 6vw;
    }
    .character {
        width: 800px;
        bottom: -20%;
    }
    .herobox-content-container {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        top: 20%;
        padding: 0 20px;
    }
    .content-1, .content-2 {
        width: 100%;
        justify-content: space-around;
    }
    .content-1 h1, .content-2 h1 {
        font-size: 3.5vw;
    }
    
    /* Topbar & Hero Footer */
    .top-bar {
        padding: 0 20px;
    }
    .hero-footer {
        padding: 0 20px;
        position: absolute !important;
        bottom: 5% !important;
        top: auto !important;
        margin-top: 0;
        flex-direction: column;
        height: auto;
        gap: 20px;
        z-index: 10 !important;
    }
    .left-hero-content {
        width: 100%;
        height: auto !important;
        align-items: center;
        text-align: center;
    }
    .right-hero-content {
        width: 100%;
        height: auto !important;
        justify-content: center;
    }

    /* Section 1 Layout (About/Skills) */
    .section-1 {
        display: block !important;
        height: auto !important;
        min-height: 120vh !important;
        overflow: hidden !important;
        padding-top: 50px !important;
        padding-bottom: 50px !important;
    }
    .marvel-studio {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        bottom: auto !important;
        right: auto !important;
        margin: 40px auto !important;
        width: 90% !important;
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        opacity: 1 !important;
    }
    .education-timeline {
        margin-left: 0 !important;
        align-items: flex-start !important;
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
    }
    .date-status {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        bottom: auto !important;
        right: auto !important;
        transform: none !important;
        width: 100% !important;
        height: auto !important;
        margin: 40px auto !important;
        opacity: 1 !important;
        filter: none !important;
        display: flex !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 15px !important;
    }
    .section1-right-top-description {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        bottom: auto !important;
        right: auto !important;
        width: 90% !important;
        height: auto !important;
        margin: 40px auto !important;
        text-align: center !important;
        opacity: 1 !important;
        filter: none !important;
    }
    .left-section1-content {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        bottom: auto !important;
        right: auto !important;
        width: 90% !important;
        height: auto !important;
        margin: 40px auto !important;
        text-align: center !important;
        padding: 0 !important;
        opacity: 1 !important;
    }
    .socials {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        bottom: auto !important;
        right: auto !important;
        transform: none !important;
        margin: 40px auto !important;
        width: auto !important;
        height: auto !important;
        display: flex !important;
        justify-content: center !important;
        gap: 20px !important;
        opacity: 1 !important;
    }
    .section-1 h1.section-1footer-heading, 
    .section-1 h2.section-1footer-heading2, 
    .section-1 h1.section-1footer-heading3 {
        position: relative !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        text-align: center !important;
        margin: 40px auto !important;
        font-size: 10vw !important;
        line-height: 1.5 !important;
        height: auto !important;
        display: block !important;
    }
    .section-1 p.section-1footer-date {
        position: relative !important;
        bottom: auto !important;
        margin: 40px auto !important;
        text-align: center !important;
    }
    
    /* Red Diagonal Marquee */
    .section-1 .hero-slider {
        position: relative !important;
        top: 0 !important;
        margin-bottom: 50px !important;
        z-index: 10 !important;
    }
    
    /* Card Stack scaling */
    .card-container {
        position: relative !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        margin: 50px auto !important;
        transform: scale(0.8) !important;
        transform-origin: top center !important;
        height: 350px !important;
    }

    /* Section 2 (Projects) */
    .section-2 {
        height: auto;
        padding-bottom: 100px;
    }
    .section-2-users {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        display: flex !important;
        justify-content: center !important;
        margin: 40px auto !important;
        width: 100% !important;
    }
    .left-users {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        opacity: 1 !important;
    }
    .section-2 h1.section-2-mainHeading {
        font-size: 40px;
        width: 90%;
        line-height: 45px;
        margin: 0 auto;
        text-align: center;
        position: relative;
        top: 20px;
        left: 0;
    }
    .section2-counting {
        position: relative;
        left: 0;
        top: 0;
        display: flex;
        justify-content: space-between;
        padding: 20px;
        width: 100%;
    }
    .projects-grid {
        position: relative;
        top: 50px;
        margin: 0 auto;
        gap: 40px;
    }
    
    /* Footer */
    .footer-content h1 {
        font-size: 60px;
        text-align: center;
    }
}

@media (max-width: 768px) {
    /* Navbar */
    nav ul {
        display: none;
    }
    .nav-icons {
        width: auto;
    }
    .nav-logo-text {
        font-size: 18px;
    }
    
    /* Hero */
    .herobox h1.herobox-mainheading {
        font-size: 20vw;
        letter-spacing: -2px;
        top: 35%;
    }
    .surname-text {
        font-size: 7vw;
    }
    .character {
        width: 450px !important;
        bottom: -5% !important;
    }
    .content-1 h1, .content-2 h1 {
        font-size: 5vw;
    }
    .right-hero-content p, .cd, .topbar-buttons, .top-bar p {
        display: none !important; /* Hide decorative non-essential elements on mobile */
    }

    /* Skills Card Stack */
    .card-container {
        transform: scale(0.65) !important;
        margin: 10px auto !important;
        height: 280px !important;
    }
    
    /* Project Cards Mobile Overrides */
    .projects-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 40px !important;
    }
    .project-card-placeholder {
        display: none !important;
    }
    .project-card-ui {
        position: relative !important;
        width: 90vw !important;
        height: 400px !important;
        min-height: 400px !important;
        margin-bottom: 40px !important;
    }
    .project-card-back {
        padding: 20px;
        height: 100% !important;
        overflow-y: auto !important;
    }
    .project-card-back h1 {
        font-size: 24px;
    }
    .project-card-back p {
        font-size: 13px;
    }
    
    /* Expanded Flipped State Mobile */
    .project-card-ui.flipped {
        position: fixed !important;
        width: 90vw !important;
        height: 500px !important;
        transform: translate(-50%, -50%) scale(1) !important; 
        left: 50% !important;
        top: 50% !important;
        z-index: 100 !important;
        margin-bottom: 0 !important;
    }
    
    /* Blur Effect Fix */
    .blur-bg {
        filter: none !important;
    }
    .blur-bg::before {
        content: "";
        position: fixed !important;
        top: 0 !important; 
        left: 0 !important; 
        right: 0 !important; 
        bottom: 0 !important;
        background: rgba(0,0,0,0.7) !important;
        backdrop-filter: blur(5px) !important;
        z-index: 90 !important;
    }
    
    /* Misc Adjustments */
    .stat-box {
        width: 90px;
        height: 90px;
    }
    .stat-box h1 {
        font-size: 32px;
    }
    .section-2 h1.section-2-mainHeading {
        font-size: 28px;
        line-height: 36px;
    }
    
    /* Footer & Contact */
    .footer-content h1 {
        font-size: 40px;
        text-align: center;
        line-height: 1.1;
        margin-bottom: 20px;
    }
    .footer-content p {
        font-size: 14px;
    }
    .footer-date h2 {
        font-size: 16px;
    }
    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 15px !important;
    }
}

