:root {
    --bg-color: #050505;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-color: #00f2ff;
    --accent-glow: rgba(0, 242, 255, 0.4);
    --card-bg: rgba(255, 255, 255, 0.05);
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Montserrat', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow: hidden; /* Prevent scrollbar completely */
    line-height: 1.6;
}

/* Header & Nav */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 4%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(5, 5, 5, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: 0.4s;
}

.scroll-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent-color);
    box-shadow: 
        0 0 10px var(--accent-color),
        0 0 20px var(--accent-glow),
        0 0 30px var(--accent-glow);
    transition: width 0.1s ease-out;
    position: relative;
}

/* Subtle laser tip effect */
.progress-bar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px; /* Smaller and more subtle */
    height: 6px;
    background: var(--accent-color); /* Changed from white to accent */
    border-radius: 50%;
    filter: blur(2px);
    box-shadow: 0 0 15px var(--accent-color);
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 2px;
    z-index: 1001;
    pointer-events: auto;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
    transition: 0.3s;
}

.nav a.active {
    opacity: 1;
    color: var(--accent-color);
}

.lang-switcher button {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: 0.3s;
}

.lang-switcher button.active {
    background: var(--accent-color);
    color: black;
    border-color: var(--accent-color);
}

/* Container & Sections */
.container {
    height: 100vh;
    width: 100%;
    position: relative;
}

.section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 10%;
    z-index: 1;
    overflow: hidden;
    background: transparent; /* Changed from solid to transparent */
}

.section-content {
    max-width: 1400px; /* Increased to allow larger Hero image and breathing room */
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    z-index: 2;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 120px 40px 100px 40px; /* Added left padding to prevent clipping at the edge */
    pointer-events: auto;
}

/* Smart centering: use auto-margins to center short content */
/* If content overflows, auto margins resolve to 0 and content stays at the top */
.section-content > *:first-child {
    margin-top: auto;
}

.section-content > *:last-child {
    margin-bottom: auto;
}

/* Hide scrollbar for section-content but keep functionality */
/* Hide scrollbars but keep functionality */
.section-content {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.section-content::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}


/* TYPOGRAPHY */
h2 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 2rem;
    text-transform: uppercase;
    border-left: 5px solid var(--accent-color);
    padding-left: 20px;
}

/* HERO */
.hero-grid {
    display: grid;
    grid-template-columns: minmax(320px, 1.2fr) 1.5fr; /* Ensure image column never collapses below 320px */
    gap: 2rem;
    align-items: center;
}

.hero-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: clamp(20px, 5vw, 80px); /* Adaptive padding to save space on smaller screens */
    position: relative;
    overflow: visible;
}

.hero-image {
    width: 100%;
    max-width: 520px; /* Even larger while maintaining circle and glow space */
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    position: relative;
    border-radius: 50%;
    padding: 15px;
    background: linear-gradient(135deg, rgba(0, 242, 255, 0.2), transparent);
    box-shadow: 0 0 50px rgba(0, 242, 255, 0.1);
    flex-shrink: 0;
}

/* Light Frame / Lens Effect */
.hero-image::before {
    content: '';
    position: absolute;
    inset: 0; /* Ensures it perfectly fills the square */
    border-radius: 50%;
    background: conic-gradient(from 0deg at 50% 50%, transparent 0%, var(--accent-color) 25%, transparent 50%);
    opacity: 0.4;
    animation: rotate 6s linear infinite; /* Slightly faster for more energy */
    mask: radial-gradient(circle, transparent 68%, black 70%);
    -webkit-mask: radial-gradient(circle, transparent 68%, black 70%);
    filter: blur(2px);
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hero-image-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    z-index: 2;
    border: 4px solid #050505;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) contrast(1.1);
    transition: 0.8s cubic-bezier(0.2, 1, 0.3, 1);
    transform: scale(1.1);
}

.hero-image:hover img {
    filter: grayscale(0%) contrast(1);
    transform: scale(1);
}

.hero-image:hover {
    box-shadow: 0 0 80px var(--accent-glow);
}

.hero-text h1 {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 900;
    line-height: 1.05;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.specialization {
    color: var(--accent-color);
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    letter-spacing: 2px;
    white-space: nowrap; /* Keep on one line on desktop */
}

.cta-button {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 1rem 2rem;
    text-transform: uppercase;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.cta-button:hover {
    background: var(--accent-color);
    color: black;
    box-shadow: 0 0 30px var(--accent-glow);
}

/* ABOUT */
.about-text {
    font-size: 1.5rem;
    max-width: 900px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* SKILLS */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

/* SKILLS - Modern Bento Glass Style */
.skills-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    perspective: 1000px;
}

.skill-category {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    transition: all 0.5s cubic-bezier(0.2, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.skill-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(0, 242, 255, 0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.skill-category:hover {
    transform: scale(1.02) rotateX(4deg) rotateY(-4deg); /* Removed translateY to fix jumping */
    border-color: rgba(0, 242, 255, 0.5);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.skill-category:hover::before {
    opacity: 1;
}

.skill-category h3 {
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
}

.skill-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    list-style: none;
}

.skill-items li {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    transition: 0.3s;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
}

.skill-category:hover .skill-items li {
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.skill-items li:hover {
    background: var(--accent-color);
    color: #000 !important;
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--accent-glow);
}

@media (max-width: 768px) {
    .skills-container {
        grid-template-columns: 1fr;
    }
    .skill-category {
        padding: 1.5rem;
    }
}

/* EXPERIENCE */
.experience-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.exp-card {
    background: var(--card-bg);
    padding: 1.5rem 2rem;
    border-radius: 10px;
    display: grid;
    grid-template-columns: 80px 150px 1fr;
    gap: 2rem;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.03);
}

.exp-logo {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.exp-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1); /* Assume logos look better white on dark */
}

.exp-period {
    color: var(--accent-color);
    font-weight: 700;
    font-size: 0.9rem;
}

.exp-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.2rem;
}

.exp-role {
    display: block;
    font-size: 0.9rem;
    opacity: 0.6;
    margin-bottom: 1rem;
}

/* PROJECTS */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 3rem;
    padding: 20px 10px; /* Space for hover scaling */
}

.project-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    transition: 0.4s cubic-bezier(0.2, 1, 0.3, 1);
    cursor: pointer;
    position: relative;
}

/* Invisible overlay to capture clicks regardless of content */
.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.project-media {
    width: 100%;
    aspect-ratio: 16/9;
    background: #111;
    position: relative;
    overflow: hidden;
}

.project-media img, .project-media iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
    transition: 0.5s;
}

.video-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 242, 255, 0.8);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: black;
    font-size: 1.2rem;
    pointer-events: none;
    box-shadow: 0 0 20px var(--accent-glow);
    opacity: 0.8;
    z-index: 5;
    transition: 0.3s;
}

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

.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.project-info p {
    font-size: 0.9rem;
    opacity: 0.7;
}

.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

/* CONTACT */
.contact-item {
    text-decoration: none;
    color: inherit;
    display: block;
    margin-bottom: 2rem;
}

.contact-item .label {
    display: block;
    font-size: 0.8rem;
    opacity: 0.5;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.contact-item .value {
    font-size: clamp(1.5rem, 5vw, 3rem);
    font-weight: 900;
    transition: 0.3s;
}

.contact-item:hover .value {
    color: var(--accent-color);
}

.icons {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.icon-link {
    color: white;
    opacity: 0.6;
    transition: 0.3s;
}

.icon-link:hover {
    opacity: 1;
    color: var(--accent-color);
    transform: translateY(-5px);
}

/* BACKGROUNDS */
.parallax-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1; /* Place behind sections */
    pointer-events: none;
    background-color: var(--bg-color); /* Base layer */
}

.blob {
    position: absolute;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.25; /* Slightly increased visibility */
}

.blob-1 { top: -20%; left: -10%; }
.blob-2 { bottom: -20%; right: -10%; }

.light-beam {
    position: absolute;
    top: -50%;
    left: 30%;
    width: 1px;
    height: 200%;
    background: linear-gradient(to bottom, transparent, var(--accent-color), transparent);
    transform: rotate(35deg);
    opacity: 0.15;
    box-shadow: 0 0 30px var(--accent-color);
}

/* RESPONSIVE */
@media (max-width: 1300px) {
    .specialization { white-space: normal; } /* Allow wrap slightly earlier to save space for photo */
}

@media (max-width: 1200px) {
    .section-content { padding: 120px 40px 100px 40px; }
    .hero-text h1 { font-size: 3.8rem; }
    .hero-grid { gap: 2rem; }
}

@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 0;
    }
    .hero-image-container { padding: 40px; }
    .hero-image { max-width: 320px; }
    .hero-text h1 { font-size: 3.5rem; margin-top: 1rem; }
    .specialization { white-space: normal; } /* Allow wrapping on mobile */
    .about-text { font-size: 1.2rem; }
    .skills-container { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .header { padding: 1rem 5%; }
    .nav { display: none; }
    .section { padding: 0 5%; }

    .section-content {
        padding: 100px 20px 40px 20px; /* Better mobile padding */
    }

    .hero-grid { 
        padding-top: 0;
    }

    .hero-image { 
        width: 200px;
        height: 200px;
        margin: 0 auto; 
    }
    
    .hero-text h1 { 
        font-size: clamp(2rem, 8vw, 2.8rem); 
        line-height: 1.1;
    }
    
    .specialization {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    h2 { 
        font-size: clamp(1.5rem, 6vw, 2rem);
        margin-bottom: 1.2rem;
        padding-left: 12px;
    }

    .exp-card { 
        grid-template-columns: 1fr; 
        gap: 0.5rem;
        padding: 1rem;
    }

    .exp-logo {
        width: 60px;
        height: 60px;
    }

    .projects-grid { 
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    .contact-item .value { font-size: 1.2rem; }
}

/* Extra small devices */
@media (max-width: 380px) {
    .section-content {
        padding: 100px 15px 40px 0;
    }
    .hero-image {
        width: 160px;
        height: 160px;
    }
}

/* MODAL */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none; /* Controlled by JS */
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85); /* Slightly less dark to see the blur */
    backdrop-filter: blur(20px);
}

.modal-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(8px) brightness(0.4); /* Further reduced blur for more clarity */
    opacity: 0;
    transition: opacity 0.8s ease, background-image 0.5s ease; /* Smooth bg transition */
    z-index: 1;
}

.modal.active .modal-bg-image {
    opacity: 0.6;
}

.modal-container {
    position: relative;
    width: 100%;
    max-width: 1200px; /* Wider modal */
    width: 95%;
    max-height: 90vh;
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    z-index: 10;
    transform: scale(0.9);
    opacity: 0;
    transition: 0.5s cubic-bezier(0.2, 1, 0.3, 1);
}

.modal.active .modal-container {
    transform: scale(1);
    opacity: 1;
}

.modal-close {
    display: block;
    width: 100%;
    margin-top: 2rem;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: 0.3s cubic-bezier(0.2, 1, 0.3, 1);
    text-align: center;
}

.modal-close:hover {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-2px);
}

.modal-close:hover {
    background: var(--accent-color);
    color: black;
}

.modal-content {
    display: grid;
    grid-template-columns: 1.4fr 0.6fr; /* Even more space for media */
    height: 100%;
    max-height: 90vh;
    overflow: hidden;
}

.modal-media-container {
    position: relative;
    width: 100%;
    height: 100%; /* Fill the grid cell */
    min-height: 500px; /* Strong minimum for desktop */
    overflow: hidden;
    background: #050505;
}

.modal-media {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    position: relative;
}

.modal-media::-webkit-scrollbar {
    display: none;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 15;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    padding: 0;
    transition: 0.3s;
    backdrop-filter: blur(5px);
    font-family: Arial, sans-serif;
}

.slider-arrow span {
    display: block;
    position: relative;
    top: -2px; /* Nudge arrows to visually center */
}

.slider-arrow:hover {
    background: var(--accent-color);
    color: black;
}

.slider-arrow.prev { left: 15px; }
.slider-arrow.next { right: 15px; }

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 15;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: 0.3s;
}

.dot.active {
    background: var(--accent-color);
    transform: scale(1.3);
    box-shadow: 0 0 10px var(--accent-glow);
}

.gallery-item {
    min-width: 100%;
    max-width: 100%;
    height: 100%;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    background: #000;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-item iframe {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border: none;
    pointer-events: all;
    background: #000;
}

.modal-details {
    padding: 3rem;
    overflow-y: auto;
    height: 100%;
    background: #0a0a0a;
    /* Custom Scrollbar for Modal Details */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) rgba(255, 255, 255, 0.05);
}

.modal-details::-webkit-scrollbar {
    width: 6px;
}

.modal-details::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.modal-details::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: 0.3s;
}

.modal-details::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

.modal-details h2 {
    border-left: none;
    padding-left: 0;
    padding-right: 0; /* No more overlap with 'X' button */
    font-size: 2.2rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.modal-details p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.modal-info-grid {
    display: grid;
    grid-template-columns: 1fr; /* Stacked vertical layout */
    gap: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
}

.info-block h4 {
    color: var(--accent-color);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 2px;
    margin-bottom: 1rem;
}

.info-block ul {
    list-style: none;
}

.info-block ul li {
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    opacity: 0.8;
}

.info-block p {
    font-size: 1rem;
    color: white;
    margin-bottom: 0;
}

@media (max-width: 1200px) {
    .modal-content {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
        height: 100%;
        overflow: hidden; /* Parent no longer scrolls */
    }
    .modal-media-container {
        height: 40vh; /* Fixed height part */
        min-height: 250px;
        flex-shrink: 0;
    }
    .modal-details {
        flex: 1; /* Occupy remaining space */
        overflow-y: auto; /* Only this part scrolls */
        padding: 2rem;
    }
    .modal-details h2 {
        font-size: 1.8rem;
    }
    .modal-info-grid {
        grid-template-columns: 1fr;
    }
    .modal {
        padding: 1rem;
    }
}


@media (max-height: 600px) and (orientation: landscape) {
    .hero-image { display: none; }
    .hero-grid { grid-template-columns: 1fr; }
    .section { align-items: flex-start; overflow-y: auto; }
}



