:root {
    --glass-high: rgba(255, 255, 255, 0.95);
    --glass-med: rgba(255, 255, 255, 0.85);
    --glass-low: rgba(255, 255, 255, 0.1);
    --text-main: #111;
    --text-sec: #222;
    --blur: blur(20px) saturate(180%);
    --shadow: inset 0 2px 4px rgba(255,255,255,0.3), 0 8px 32px rgba(0,0,0,0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Inter', sans-serif; color: white; min-height: 100vh; overflow-x: hidden;
    background: url('images/background3.jpg') center/cover fixed;
}
::-webkit-scrollbar { display: none; }

/* UI Components */
.glass-panel {
    background: var(--glass-high); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    border-radius: clamp(1rem, 3vw, 1.5rem); border: 1px solid rgba(255,255,255,0.4); 
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1);
    color: var(--text-sec); padding: clamp(1.5rem, 4vw, 2.5rem); transition: transform 0.3s;
    position: relative;
    transform-style: preserve-3d;
    will-change: transform;
}

@keyframes subtleTilt {
    0%, 100% {
        transform: perspective(1000px) rotateX(0deg) rotateY(0deg) translateZ(0);
    }
    25% {
        transform: perspective(1000px) rotateX(4deg) rotateY(-4deg) translateZ(5px);
    }
    50% {
        transform: perspective(1000px) rotateX(0deg) rotateY(0deg) translateZ(0);
    }
    75% {
        transform: perspective(1000px) rotateX(-4deg) rotateY(4deg) translateZ(5px);
    }
}

@keyframes subtleTiltWithLift {
    0%, 100% {
        transform: perspective(1000px) rotateX(0deg) rotateY(0deg) translateY(-5px) translateZ(10px);
    }
    25% {
        transform: perspective(1000px) rotateX(4deg) rotateY(-4deg) translateY(-5px) translateZ(15px);
    }
    50% {
        transform: perspective(1000px) rotateX(0deg) rotateY(0deg) translateY(-5px) translateZ(10px);
    }
    75% {
        transform: perspective(1000px) rotateX(-4deg) rotateY(4deg) translateY(-5px) translateZ(15px);
    }
}

.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 25px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
    z-index: 1;
    opacity: 0.6;
}

.glass-panel > * {
    position: relative;
    z-index: 2;
}
#hero-section { height: 100vh; display: flex; justify-content: center; align-items: center; position: relative; }
#background-container { position: absolute; inset: 0; background: url('images/background1.jpeg') center/cover no-repeat; z-index: -2; }
#content-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); z-index: -1; }

/* Name Animation */
#name-display {
    position: absolute; bottom: 7vh; left: 7vw; font: 700 clamp(3rem, 8vw, 8rem) 'Oswald';
    line-height: 1; pointer-events: none;
}
#name-display span {
    display: inline-block; opacity: 0; transform: translateY(-50px); margin: 0 3px;
    color: rgba(255,255,255,0.5); -webkit-text-stroke: 1.5px rgba(255,255,255,0.3);
}
@keyframes fallIn { to { opacity: 1; transform: translateY(0); } }
@keyframes navFade { to { opacity: 1; transform: translate(-50%, 0); } }

/* Navigation - 10% bigger */
#main-nav {
    position: absolute; top: 30px; left: 50%; transform: translate(-50%, -20px);
    padding: 16.5px 33px; border-radius: 50px; display: flex; gap: 11px; z-index: 1000;
    background: var(--glass-low); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.3);
    opacity: 0; transition: all 0.3s;
}
#main-nav.fixed-nav { position: fixed; top: 20px; background: var(--glass-med); transform: translate(-50%, 0); opacity: 1; }
#main-nav a {
    color: white; text-decoration: none; font-weight: 500; padding: 8.8px 22px; border-radius: 25px;
    font-size: 1.1rem; transition: all 0.3s ease; opacity: 0; transform: translateY(-20px);
    position: relative;
}
#main-nav.fixed-nav a { color: var(--text-sec); opacity: 1; transform: none; }
#main-nav a:hover { background: rgba(255,255,255,0.15); transform: scale(1.05); }
#main-nav a.active {
    background: rgba(255,255,255,0.35);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15), inset 0 1px 2px rgba(255,255,255,0.5);
    transform: scale(1.08);
    font-weight: 600;
}
#main-nav.fixed-nav a.active {
    background: rgba(0, 102, 204, 0.25);
    color: #0066cc;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2), inset 0 1px 2px rgba(255,255,255,0.3);
}
#main-nav a.active::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% + 8px);
    height: calc(100% + 8px);
    border-radius: 30px;
    background: rgba(0, 102, 204, 0.2);
    z-index: -1;
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 0.2; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.3; transform: translate(-50%, -50%) scale(1.05); }
}
.hamburger { display: none; flex-direction: column; width: 30.8px; height: 26.4px; background: none; border: none; justify-content: space-around; z-index: 1001; }
.hamburger span { height: 3.3px; background: white; width: 100%; border-radius: 3px; transition: 0.3s; }
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(6px, 6px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

/* Scroll Logic */
#main-content { height: 650vh; position: relative; }
section { 
    position: fixed; 
    top: 50%; 
    left: 0; 
    right: 0;
    display: flex; 
    justify-content: center; 
    align-items: center; 
    padding: 0 5vw; 
    opacity: 0; 
    pointer-events: none; 
    will-change: transform;
    transform: translateY(-50%);
}

/* Content Specifics - Better Typography */
.content-card { max-width: 1000px; width: 92%; }
.content-card.glass-panel { padding: clamp(1.25rem, 2.5vw, 1.75rem) clamp(2rem, 4vw, 2.5rem); }
.content-card:hover,
.contact-card:hover,
.social-card:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.25), 
                inset 0 2px 4px rgba(255,255,255,0.3),
                0 0 30px rgba(0, 102, 204, 0.3); /* Highlight glow */
    transform: translateY(-5px);
    transition: all 0.3s ease;
}
.content-card h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; margin-bottom: clamp(0.5rem, 1.5vw, 1rem); color: var(--text-main); line-height: 1.2; }
.content-card h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 600; margin-top: clamp(0.75rem, 2vw, 1.5rem); margin-bottom: clamp(0.4rem, 1.2vw, 0.75rem); color: var(--text-main); line-height: 1.3; }
.content-card p { font-size: clamp(0.95rem, 2vw, 1.1rem); line-height: 1.5; margin-bottom: clamp(0.4rem, 1.2vw, 0.75rem); color: var(--text-sec); }
.content-card .bio { font-size: clamp(1rem, 2.2vw, 1.15rem); line-height: 1.6; margin-bottom: clamp(0.5rem, 1.5vw, 1rem); }
.content-card .item { margin-bottom: clamp(0.5rem, 1.5vw, 1rem); padding-bottom: clamp(0.4rem, 1.2vw, 0.75rem); border-bottom: 1px solid rgba(0,0,0,0.1); }
.content-card .item:last-child { border-bottom: none; }
.content-card .item strong { display: block; font-size: clamp(1.1rem, 2.5vw, 1.3rem); font-weight: 600; color: var(--text-main); margin-bottom: clamp(0.2rem, 0.8vw, 0.4rem); }
.content-card .item .date { display: block; font-size: clamp(0.85rem, 1.8vw, 0.95rem); color: #666; font-style: italic; margin-bottom: clamp(0.2rem, 0.8vw, 0.4rem); }
.content-card .item p { margin-top: clamp(0.2rem, 0.8vw, 0.4rem); }
.content-card .experience-detail { margin-bottom: clamp(0.75rem, 2vw, 1.5rem); padding-bottom: clamp(0.5rem, 1.5vw, 1rem); border-bottom: 1px solid rgba(0,0,0,0.1); }
.content-card .experience-detail:last-child { border-bottom: none; }
.content-card .experience-detail h3 { margin-top: 0; }
.content-card .experience-detail .company { font-weight: 600; color: #555; margin-bottom: clamp(0.4rem, 1.2vw, 0.6rem); }
.content-card .experience-detail ul { margin-left: clamp(1rem, 2.5vw, 1.5rem); margin-top: clamp(0.4rem, 1.2vw, 0.6rem); }
.content-card .experience-detail li { line-height: 1.4; margin-bottom: clamp(0.2rem, 0.8vw, 0.4rem); }
.content-card a { color: #0066cc; text-decoration: none; transition: color 0.2s; }
.content-card a:hover { color: #004499; text-decoration: underline; }

/* Skills Grid Styles */
.skills-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(1rem, 3vw, 1.5rem); /* Space between icons - responsive */
    margin-top: clamp(0.5rem, 1.5vw, 1rem);
    padding-top: clamp(0.4rem, 1.2vw, 0.75rem);
    border-top: 1px solid rgba(0,0,0,0.1); /* Separator line */
}

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.4rem, 1.5vw, 0.5rem);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* This creates the bounce */
    cursor: default;
}

.skill-item i {
    font-size: clamp(2rem, 5vw, 3rem); /* Icon size - responsive to zoom */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.4s ease;
    /* If icons are too dark for your theme, uncomment line below */
    /* filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); */
}

.skill-item span {
    font-size: clamp(0.75rem, 1.5vw, 0.85rem);
    font-weight: 500;
    color: #666;
    opacity: 0; /* Hide text by default for cleaner look */
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

/* Hover Effects - Jelly Pop */
.skill-item:hover {
    transform: scale(1.2) translateY(-10px); /* Grows and floats up */
}

.skill-item:hover i {
    transform: rotate(10deg); /* Slight tilt for the icon only */
    filter: drop-shadow(0 5px 15px rgba(0, 102, 204, 0.4));
}

.skill-item:hover span {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Adjustment */
@media (max-width: 768px) {
    .skills-wrapper {
        gap: 15px;
        justify-content: center;
    }
    .skill-item i {
        font-size: 2.5rem;
    }
    .skill-item span {
        opacity: 1; /* Always show text on mobile */
        transform: translateY(0);
    }
}

.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 2.5vw, 1.25rem); max-width: 1400px; width: 95%; }
.project-card { padding: clamp(1.25rem, 3vw, 1.5rem); min-height: clamp(10rem, 25vw, 11.25rem); }
.project-card h3 { font-size: clamp(1.1rem, 2.5vw, 1.25rem); font-weight: 700; margin-bottom: clamp(0.4rem, 1.2vw, 0.6rem); color: var(--text-main); line-height: 1.3; }
.project-card .tech-stack { font-size: clamp(0.75rem, 1.8vw, 0.85rem); color: #666; font-style: italic; margin-bottom: clamp(0.5rem, 1.5vw, 0.75rem); font-weight: 500; }
.project-card p { font-size: clamp(0.85rem, 2vw, 0.95rem); line-height: 1.5; color: var(--text-sec); }
.project-card a { color: #0066cc; text-decoration: none; transition: color 0.2s; }
.project-card a:hover { color: #004499; text-decoration: underline; }
.project-card:hover { 
    box-shadow: 0 12px 40px rgba(0,0,0,0.25), 
                inset 0 2px 4px rgba(255,255,255,0.3),
                0 0 30px rgba(0, 102, 204, 0.3); /* Highlight glow */
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.contact-container { width: 90%; max-width: 700px; display: flex; flex-direction: column; gap: clamp(1rem, 2.5vw, 1.25rem); }
.contact-card h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); font-weight: 700; margin-bottom: clamp(0.75rem, 2vw, 1.5rem); color: var(--text-main); }
.contact-info p { font-size: clamp(0.95rem, 2.2vw, 1.1rem); line-height: 1.7; margin-bottom: clamp(0.5rem, 1.5vw, 0.75rem); color: var(--text-sec); }
.contact-info a { color: #0066cc; text-decoration: none; transition: color 0.2s; }
.contact-info a:hover { color: #004499; text-decoration: underline; }
.social-card h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); font-weight: 600; margin-bottom: clamp(0.5rem, 1.5vw, 1rem); color: var(--text-main); text-align: center; }
.social-links { display: flex; justify-content: center; gap: clamp(2rem, 5vw, 2.5rem); margin-top: clamp(0.5rem, 1.5vw, 0.625rem); }
.social-link { display: flex; flex-direction: column; align-items: center; color: var(--text-main); text-decoration: none; transition: 0.3s; outline: none; border: none; background: none; }
.social-link:focus { outline: none; border: none; }
.social-link svg { transition: all 0.3s ease; filter: drop-shadow(0 0 0 rgba(0, 102, 204, 0)); outline: none; border: none; }
.social-link:hover { transform: none; box-shadow: none; outline: none; border: none; }
.social-link:hover svg { 
    filter: drop-shadow(0 0 8px rgba(0, 102, 204, 0.8)) drop-shadow(0 0 15px rgba(0, 102, 204, 0.6));
    transform: scale(1.1);
    outline: none;
}
.social-link span { font-weight: 600; font-size: 1rem; margin-top: 0.5rem; }

/* Custom Scrollbar */
#custom-scrollbar {
    position: fixed; right: 20px; top: 50%; transform: translateY(-50%);
    width: 12px; height: 60%; background: var(--glass-low); backdrop-filter: blur(10px);
    border-radius: 20px; z-index: 999;
}
#custom-scrollbar-thumb { width: 100%; background: rgba(255,255,255,0.4); border-radius: 20px; position: absolute; cursor: grab; }

/* Mobile / Tablet */
@media (max-width: 1024px) { 
    .projects-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
    .project-card { padding: 22px; min-height: 160px; }
    .project-card h3 { font-size: 1.15rem; }
    .project-card p { font-size: 0.9rem; }
    #name-display { 
        top: 50%; 
        left: 50%; 
        transform: translate(-50%, -50%); 
        text-align: center; 
        bottom: auto;
    }
    .hamburger { display: flex; cursor: pointer; }
    .nav-links { display: none; flex-direction: column; position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); width: 90vw; max-width: 350px; background: var(--glass-high); border-radius: 15px; padding: 10px; box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
    .nav-links.active { display: flex; }
    #main-nav { 
        top: 20px; 
        left: 50%; 
        transform: translateX(-50%); 
        width: auto; 
        flex-direction: row; 
        align-items: center; 
        justify-content: center;
        padding: 12px 20px; 
        gap: 15px; 
        position: absolute; 
    }
    #main-nav a { color: #333; opacity: 1; transform: none; width: 100%; text-align: left; font-size: 1rem; padding: 9.9px 22px; }
    #main-nav a.active { background: rgba(0, 102, 204, 0.15); color: #0066cc; }
    #main-nav.fixed-nav { 
        background: var(--glass-high); 
        left: 50%; 
        transform: translateX(-50%); 
        top: 20px;
        position: fixed;
    }
    #main-nav.fixed-nav .hamburger span { background: #333; }
    #main-nav.fixed-nav a { color: #333; }
    #main-nav.fixed-nav a.active { background: rgba(0, 102, 204, 0.2); color: #0066cc; }
}
@media (max-width: 768px) {
    body { background-attachment: scroll; }
    #hero-section { height: 100vh; }
    #name-display { 
        top: 50%; 
        left: 50%; 
        transform: translate(-50%, -50%); 
        text-align: center; 
        font-size: clamp(3rem, 12vw, 6rem);
        bottom: auto;
    }
    .hamburger { display: flex; cursor: pointer; }
    .nav-links { display: none; flex-direction: column; position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); width: 90vw; max-width: 300px; background: var(--glass-high); border-radius: 15px; padding: 10px; box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
    .nav-links.active { display: flex; }
    #main-nav { 
        top: 20px; 
        left: 50%; 
        transform: translateX(-50%); 
        width: auto; 
        flex-direction: row; 
        align-items: center; 
        justify-content: center;
        padding: 12px 18px; 
        gap: 15px; 
        position: absolute; 
    }
    #main-nav a { color: #333; opacity: 1; transform: none; width: 100%; text-align: left; font-size: 1.05rem; padding: 9.9px 22px; }
    #main-nav a.active { background: rgba(0, 102, 204, 0.15); color: #0066cc; }
    #main-nav.fixed-nav { 
        background: var(--glass-high); 
        left: 50%; 
        transform: translateX(-50%); 
        top: 20px;
    }
    #main-nav.fixed-nav .hamburger span { background: #333; }
    #main-nav.fixed-nav a { color: #333; }
    #main-nav.fixed-nav a.active { background: rgba(0, 102, 204, 0.2); color: #0066cc; }
    
    /* Stack Layout */
    #main-content { height: auto; }
    section { position: relative; opacity: 1; pointer-events: auto; height: auto; min-height: 100vh; padding: 100px 5vw; transform: none !important; }
    .content-card h2 { font-size: 2rem; }
    .content-card h3 { font-size: 1.5rem; }
    .content-card p, .content-card .bio { font-size: 1rem; line-height: 1.6; }
    .project-card { padding: 20px; min-height: 150px; }
    .project-card h3 { font-size: 1.1rem; }
    .project-card p { font-size: 0.9rem; }
    .contact-card h2 { font-size: 1.75rem; }
    .projects-grid { grid-template-columns: 1fr; }
    #custom-scrollbar { display: none; }
}