@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Oswald:wght@200..700&display=swap');

/* High-End Cinematic Palette */
:root {
    --bg-color: #050505;
    --accent-red: #ff0000;
    --accent-red-muted: #6d0f0f;
    --accent-red-bright: #ff3c3c;
    --accent-dev: #00e5ff;
    --accent-dev-muted: #073b4c;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --glass-bg: rgba(10, 10, 10, 0.8);
    --glass-border: rgba(255, 255, 255, 0.05);
    
    /* Fluid Design System */
    --fs-base: clamp(1rem, 0.9rem + 0.3vw, 1.1rem);
    --fs-h1: clamp(4rem, 2rem + 10vw, 12rem);
    --fs-h2: clamp(2.5rem, 2rem + 4vw, 6rem);
    --fs-h3: clamp(1.2rem, 1rem + 1vw, 2rem);
    
    --side-padding: clamp(2rem, 8vw, 12%);
    --side-padding-mobile: 1.2rem;
    --card-radius: 12px;
}

body.dev-mode {
    --bg-color: #02040a;
    --accent-red: var(--accent-dev);
    --accent-red-bright: #7df9ff;
    --design-gradient: radial-gradient(circle at top right, rgba(0, 229, 255, 0.1), transparent 60%);
}

/* Global Reset & Cinematic Base */
html { scroll-behavior: smooth; }
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
    line-height: 1.5;
    font-size: var(--fs-base);
}

/* Background Texture (Cinematic Noise) */
body::after {
    content: '';
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('https://grainy-gradients.vercel.app/noise.svg');
    opacity: 0.03; pointer-events: none; z-index: 9999;
}

/* Global Typography Overhaul */
h1, .hero-h1, h2, .section-title, .portal-h2, .about-text h2, .subsection-title {
    font-family: 'Bebas Neue', sans-serif;
    text-transform: uppercase;
    line-height: 0.85;
    letter-spacing: -0.01em;
}

h2.section-title {
    font-size: var(--fs-h2);
    margin-bottom: 5rem;
    position: relative;
    display: inline-block;
}

h2.section-title::after {
    content: '';
    position: absolute; bottom: -15px; left: 0;
    width: 80px; height: 5px;
    background: var(--accent-red);
}

/* Dev Mode Specific Corrections */
body.dev-mode .section-title::after {
    background: var(--accent-dev);
}

body.dev-mode .project-card:hover {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 229, 255, 0.2);
}

/* Bento Grid (Dev Mode Restored Aesthetic) */
.dev-section { padding: 100px var(--side-padding); }
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: var(--bento-min-height);
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.bento-item {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.bento-item:hover {
    transform: translateY(-8px);
    border-color: var(--accent-dev);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 229, 255, 0.1);
}

.bento-item.large { grid-column: span 2; grid-row: span 2; }
.bento-item.wide { grid-column: span 2; }
.bento-item.tall { grid-row: span 2; }

.bento-item h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    margin-bottom: 5px;
    z-index: 2;
    color: white;
}

.bento-item p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    z-index: 2;
    font-weight: 300;
}

.bento-video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0.3;
    transition: opacity 0.5s ease, transform 0.8s ease;
}

.bento-item:hover .bento-video { 
    opacity: 0.8;
    transform: scale(1.05);
}

.bento-tags { display: flex; gap: 10px; margin-top: 15px; z-index: 2; flex-wrap: wrap; }
.bento-tags span {
    font-size: 0.7rem;
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.2);
    padding: 4px 12px;
    border-radius: 50px;
    text-transform: uppercase;
    color: var(--accent-dev-bright);
    letter-spacing: 0.05em;
}

.featured-badge {
    position: absolute;
    top: 25px; right: 25px;
    background: var(--accent-dev);
    color: white;
    font-size: 0.65rem;
    font-family: 'Bebas Neue', sans-serif;
    padding: 5px 15px;
    border-radius: 50px;
    text-transform: uppercase;
    z-index: 3;
    letter-spacing: 0.1em;
}

/* Navigation - Ultra Minimal */
.navbar {
    position: fixed; top: 0; left: 0; width: 100%;
    padding: 30px var(--side-padding);
    display: flex; justify-content: flex-end;
    z-index: 2000;
    transition: all 0.5s ease;
}

.navbar.scrolled {
    padding: 15px var(--side-padding);
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.navbar ul { display: flex; list-style: none; gap: 3rem; }
.navbar a {
    color: var(--text-secondary); text-decoration: none;
    font-size: 0.75rem; font-weight: 400; text-transform: uppercase;
    letter-spacing: 0.2em; transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.navbar a:hover { color: var(--text-primary); transform: translateY(-2px); }

/* Hero - Cinematic Impact */
.hero-section {
    position: relative; height: 100svh; width: 100%;
    display: flex; align-items: center; padding: 0 var(--side-padding);
    overflow: hidden;
}

.hero-video {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; z-index: -1;
    filter: brightness(0.4) saturate(1.2);
}

.hero-content { max-width: 1000px; position: relative; }
.hero-h1 { font-size: var(--fs-h1); margin-left: -5px; }

.hero-subtitle {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.5rem, 1rem + 2vw, 3rem);
    color: var(--accent-red);
    letter-spacing: 0.1em;
    margin-top: 1rem;
    text-transform: uppercase;
}

body.dev-mode .hero-subtitle {
    color: var(--accent-dev);
}

.hero-p {
    font-size: clamp(1rem, 0.8rem + 0.5vw, 1.3rem);
    color: var(--text-secondary); margin-top: 2rem;
    max-width: 500px; font-weight: 200;
    border-left: 2px solid var(--accent-red); padding-left: 2rem;
}

/* Projects - Dynamic Masonry Exhibition */
.projects-section { padding: 150px var(--side-padding); }

.filter-bar {
    display: flex; gap: 2rem; margin-bottom: 6rem;
}

.filter-btn {
    background: none; border: none; color: var(--text-secondary);
    font-family: 'Bebas Neue', sans-serif; font-size: 1.5rem;
    letter-spacing: 0.1em; cursor: pointer; transition: 0.4s;
    position: relative; padding-bottom: 5px;
}

.filter-btn::after {
    content: ''; position: absolute; bottom: 0; left: 0;
    width: 0; height: 2px; background: var(--accent-red);
    transition: 0.4s;
}

.filter-btn:hover, .filter-btn.active { color: var(--text-primary); }
.filter-btn.active::after { width: 100%; }

.projects-container {
    columns: 3; column-gap: 2.5rem; width: 100%;
}

.project-card {
    break-inside: avoid; margin-bottom: 2.5rem;
    background: #111; border-radius: var(--card-radius);
    overflow: visible; /* Cinematic foreground pop allowed */
    position: relative;
    transition: transform 0.6s cubic-bezier(0.2, 1, 0.3, 1), box-shadow 0.6s ease;
}

.project-card:hover {
    z-index: 1000 !important; /* Jump to absolute foreground */
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(255, 0, 0, 0.3);
}

.card-img-container {
    width: 100%; height: 100%; border-radius: var(--card-radius);
    overflow: hidden; position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    background: #000;
}

.project-card img {
    width: 100%; height: 100%; object-fit: cover;
    display: block; transition: 0.8s cubic-bezier(0.2, 1, 0.3, 1);
}

.project-card:hover img { opacity: 0.2; filter: blur(10px); }

.hover-video {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(1.1);
    width: 120% !important; height: auto !important;
    opacity: 0; pointer-events: none;
    transition: all 0.6s cubic-bezier(0.2, 1, 0.3, 1);
    z-index: 5000;
    object-fit: cover;
}

.project-card:hover .hover-video {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.25);
}

/* Specific Fix for Cyberpunk (Refined Contained Size) */
.project-card.card-no-pop:hover .hover-video {
    width: 100% !important;
    transform: translate(-50%, -50%) scale(0.9) !important;
}

/* About - Editorial Layout */
.about-section { padding: 150px var(--side-padding); background: #080808; }
.about-container {
    display: grid; grid-template-columns: 1.2fr 1fr; gap: 6rem; align-items: center;
}

.about-text h3 { margin-bottom: 2rem; color: var(--accent-red); letter-spacing: 0.1em; }
.about-text p { font-weight: 200; margin-bottom: 1.5rem; color: #ccc; }

.profile-circle {
    width: 100%; aspect-ratio: 1; border-radius: 20px;
    object-fit: cover; filter: grayscale(1) contrast(1.1);
    transition: 1s ease; border: 1px solid var(--glass-border);
}

.profile-circle:hover { filter: grayscale(0) contrast(1); }

/* Toolkit & Skills - Clean Typography Tags */
.SkillsSection { padding: 150px var(--side-padding); }
.software-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 3rem; margin: 4rem 0;
}

.software-item {
    display: flex; flex-direction: column; align-items: center; gap: 1rem;
    transition: 0.4s;
}

.software-item img {
    width: 50px; height: 50px; object-fit: contain;
    filter: grayscale(1) brightness(0.6); transition: 0.4s;
}

.software-item span { font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: #555; }
.software-item:hover img { filter: grayscale(0) brightness(1); transform: translateY(-5px); }
.software-item:hover span { color: var(--text-primary); }

.skills-list {
    display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center;
}

.skills-list li {
    list-style: none; padding: 0.8rem 2rem;
    border: 1px solid var(--glass-border); border-radius: 100px;
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em;
    background: rgba(255,255,255,0.02); transition: 0.4s;
}

.skills-list li:hover { background: var(--accent-red); border-color: var(--accent-red); color: white; }

/* Contact - Dramatic Form */
.ContactSection { padding: 150px var(--side-padding); align-items: flex-start; }
.ContactForm {
    max-width: 800px; width: 100%; display: grid; gap: 3rem;
    background: none; border: none; padding: 0; box-shadow: none;
}

.form-group { display: flex; flex-direction: column; gap: 1rem; }
.ContactLabel { font-family: 'Bebas Neue', sans-serif; font-size: 1.2rem; letter-spacing: 0.1em; color: #444; }

.ContactInput, .ContactTextArea {
    background: none; border: none; border-bottom: 1px solid #333;
    border-radius: 0; padding: 1.5rem 0; font-size: 1.2rem; color: white;
    transition: 0.4s;
}

.ContactInput:focus, .ContactTextArea:focus {
    outline: none; border-color: var(--accent-red); background: rgba(255,0,0,0.02);
}

.ContactSubmitBtn {
    justify-self: center;
    background: var(--accent-red);
    color: white;
    padding: 1.2rem 4rem;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.6rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    transition: all 0.5s cubic-bezier(0.2, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    margin-top: 2rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.ContactSubmitBtn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.6s;
}

.ContactSubmitBtn:hover {
    background: var(--accent-red-bright);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px rgba(255, 0, 0, 0.4);
    letter-spacing: 0.2em;
}

body.dev-mode .ContactSubmitBtn:hover {
    box-shadow: 0 15px 40px rgba(0, 229, 255, 0.4);
}

.ContactSubmitBtn:hover::before {
    left: 100%;
}

.ContactSubmitBtn:active {
    transform: translateY(-2px) scale(0.98);
}

/* --- Entry Portal - Cinematic Diagonal Masterpiece --- */
.portal-body { height: 100vh; overflow: hidden; }
.portal-overlay { 
    position: fixed; inset: 0; display: flex; background: #000; 
}
.portal-link { 
    width: 50%; height: 100%; text-decoration: none; color: inherit;
    display: flex; align-items: center; justify-content: center;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), z-index 0s;
    position: relative; overflow: hidden;
}
.art-side { 
    background: #050505; 
    clip-path: polygon(0 0, 100% 0, 80% 100%, 0 100%);
    z-index: 2;
    border-right: 2px solid var(--accent-red);
}
.dev-side { 
    background: #02040a; 
    margin-left: -10%; 
    clip-path: polygon(20% 0, 100% 0, 100% 100%, 0 100%); 
    width: 60%;
    z-index: 1;
    border-left: 2px solid var(--accent-dev);
}
.portal-link:hover { width: 70% !important; z-index: 10; }

.portal-content { 
    text-align: center; transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); 
    max-width: 80%;
}
.portal-link:hover .portal-content { transform: scale(1.1); }

.portal-h2 { font-size: clamp(3rem, 8vw, 8rem); color: white; margin-bottom: 1rem; }
.portal-p { 
    font-family: 'Poppins', sans-serif; font-weight: 200; 
    color: var(--text-secondary); margin-bottom: 3rem; 
    letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.9rem;
}
.portal-btn { 
    display: inline-block; padding: 1.2rem 3rem; 
    border: 1px solid rgba(255, 255, 255, 0.2); color: white; 
    font-family: 'Bebas Neue', sans-serif; font-size: 1.8rem; 
    letter-spacing: 0.1em; background: rgba(255, 255, 255, 0.03); 
    transition: 0.4s;
}
.art-side:hover .portal-btn { background: var(--accent-red); border-color: var(--accent-red); box-shadow: 0 0 40px rgba(255, 0, 0, 0.3); }
.dev-side:hover .portal-btn { background: var(--accent-dev); border-color: var(--accent-dev); box-shadow: 0 0 40px rgba(0, 229, 255, 0.3); }

/* Portal Hover Glows */
.portal-link::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at center, var(--accent-color-hover) 0%, transparent 70%);
    opacity: 0; transition: opacity 0.8s ease;
}
.art-side { --accent-color-hover: rgba(255, 0, 0, 0.1); }
.dev-side { --accent-color-hover: rgba(0, 229, 255, 0.05); }
.portal-link:hover::before { opacity: 1; }

/* --- Ultra-Refined Responsive System (Non-Destructive) --- */

/* Tablet & Smaller Desktops */
@media (max-width: 1200px) {
    :root { --side-padding: 6vw; }
    .projects-container { columns: 2; column-gap: 2rem; }
    .bento-grid { 
        grid-template-columns: repeat(2, 1fr); 
        grid-auto-rows: minmax(250px, auto);
    }
}

/* Mobile & Small Tablets */
@media (max-width: 768px) {
    :root { 
        --side-padding: var(--side-padding-mobile); 
        --fs-h1: 4.5rem; /* Tighter headers for mobile */
    }

    /* Portal Overhaul for Mobile */
    .portal-overlay { flex-direction: column; }
    .portal-link { 
        width: 100% !important; 
        height: 50vh; 
        margin: 0; 
        clip-path: none !important; 
        border: none;
    }
    .art-side { border-bottom: 2px solid var(--accent-red); }
    .dev-side { border-top: 2px solid var(--accent-dev); }
    
    .portal-h2 { font-size: 3.5rem; }
    .portal-p { font-size: 0.75rem; margin-bottom: 1.5rem; }

    /* Navigation Mobile Polish */
    .navbar { 
        top: auto; bottom: 0; left: 0; transform: none;
        width: 100%; max-width: 100%; border-radius: 0;
        padding: 15px 0; border-top: 1px solid var(--glass-border);
        justify-content: center;
        background: rgba(0, 0, 0, 0.95);
    }
    .navbar ul { gap: 1.5rem; }
    .navbar a { font-size: 0.65rem; letter-spacing: 0.15em; }

    /* Layout & Content Mobile Adjustments */
    .hero-section { text-align: center; justify-content: center; }
    .hero-p { border-left: none; border-top: 2px solid var(--accent-red); padding-left: 0; padding-top: 2rem; margin-inline: auto; }
    body.dev-mode .hero-p { border-top-color: var(--accent-dev); }

    .projects-section { padding-top: 80px; }
    .projects-container { columns: 1; }
    .project-card { margin-bottom: 1.5rem; }

    .about-container { grid-template-columns: 1fr; gap: 3rem; text-align: center; }
    .about-text { order: 2; }
    .about-image { order: 1; max-width: 280px; margin-inline: auto; }

    .software-grid { gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
    
    /* Bento Grid Mobile Collapse */
    .bento-grid { grid-template-columns: 1fr; }
    .bento-item.large, .bento-item.wide, .bento-item.tall { grid-column: span 1; grid-row: span 1; }
    .bento-item { padding: 2rem; min-height: 300px; }

    /* Contact Mobile Polish */
    .ContactSection { padding-bottom: 120px; } /* Space for fixed nav */
    .ContactSubmitBtn { width: 100%; text-align: center; }
}

/* Fix for Ultra-Small Devices */
@media (max-width: 480px) {
    :root { --fs-h1: 3.5rem; }
    .navbar ul { gap: 1rem; }
    .portal-h2 { font-size: 2.5rem; }
    .floating-toggle-btn { bottom: 85px; right: 20px; width: 50px; height: 50px; } /* Elevate for nav */
}

/* Footer - Cinematic Minimalism */
.footer {
    padding: 6rem var(--side-padding);
    text-align: center;
    border-top: 1px solid var(--glass-border);
    background: #000;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-links svg {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    fill: #555;
    display: block;
    transition: all 0.4s ease;
}

.social-links a:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 0, 0, 0.2);
}

body.dev-mode .social-links a:hover {
    background: var(--accent-dev);
    border-color: var(--accent-dev);
    box-shadow: 0 10px 30px rgba(0, 229, 255, 0.2);
}

.social-links a:hover svg {
    fill: white;
    transform: scale(1.1);
}

.footer p {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: #333;
}

/* --- Portal Toggle - High-End Navigation --- */
.floating-toggle-btn {
    position: fixed; 
    bottom: 40px; 
    right: 40px; 
    width: 65px; 
    height: 65px;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5000;
    transition: all 0.6s cubic-bezier(0.2, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    text-decoration: none;
}

.floating-toggle-btn svg {
    width: 26px;
    height: 26px;
    fill: #888;
    transition: all 0.4s ease;
}

/* Mode Specific Interactions */
.art-mode .floating-toggle-btn:hover {
    background: var(--accent-red); /* Match Art Identity */
    border-color: var(--accent-red);
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 0 40px rgba(255, 0, 0, 0.4);
}

.dev-mode .floating-toggle-btn:hover {
    background: var(--accent-dev); /* Match Dev Identity */
    border-color: var(--accent-dev);
    transform: scale(1.1) rotate(-15deg);
    box-shadow: 0 0 40px rgba(0, 229, 255, 0.4);
}

.floating-toggle-btn:hover svg {
    fill: white;
    transform: scale(1.1);
}

/* Tooltip for the Button */
.floating-toggle-btn::after {
    content: attr(title);
    position: absolute;
    right: 80px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 0.1em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: 0.4s;
    transform: translateX(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

.floating-toggle-btn:hover::after {
    opacity: 1;
    transform: translateX(0);
}

/* Mobile Adjustments for Toggle */
@media (max-width: 768px) {
    .floating-toggle-btn {
        bottom: 25px;
        right: 25px;
        width: 55px;
        height: 55px;
    }
    .floating-toggle-btn::after { display: none; }
}

