:root {
    /* Colors */
    --dark-navy: #050a14;
    --light-navy: #0f1a2e;
    --slate: #94a3b8;
    --light-slate: #e2e8f0;
    --accent: #00f2ff;
    --accent-glow: rgba(0, 242, 255, 0.2);
    --secondary-accent: #7000ff;
    
    /* Responsive Spacing Scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Responsive Typography Scale (Mobile-first) */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    
    /* Container widths */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
    
    /* Touch target sizes */
    --touch-target-min: 44px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
}

/* Tablet and up */
@media (min-width: 768px) {
    :root {
        --space-lg: 2rem;
        --space-xl: 3rem;
        --space-2xl: 4rem;
        --space-3xl: 6rem;
        
        --text-3xl: 2.25rem;
        --text-4xl: 3rem;
        --text-5xl: 4rem;
    }
}

/* Desktop and up */
@media (min-width: 1024px) {
    :root {
        --text-4xl: 3.5rem;
        --text-5xl: 5rem;
    }
}

/* Smooth scrolling with reduced motion support */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Reduce animations for users who prefer */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--dark-navy);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(112, 0, 255, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(0, 242, 255, 0.08), transparent 25%);
    color: #b8c5d6;
    font-size: var(--text-base);
    line-height: 1.7;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    font-weight: 400;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent horizontal scroll on mobile */
    max-width: 100vw;
    /* Improve touch scrolling */
    -webkit-overflow-scrolling: touch;
}
body.light-mode {
    background: #f0f4f8;
    color: #1e293b;
    --dark-navy: #f8fafc;
    --light-navy: #ffffff;
    --slate: #475569;
    --light-slate: #0f172a;
    --accent: #0077ff;
    --accent-glow: rgba(0, 119, 255, 0.15);
    --secondary-accent: #6200ea;
}
/* Grid Background Overlay */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(0, 242, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 242, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -2;
    pointer-events: none;
}
#particle-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 1;
    pointer-events: none;
    will-change: transform;
}
.font-mono { font-family: 'Roboto Mono', monospace; }
.font-orbitron { font-family: 'Orbitron', sans-serif; letter-spacing: 0.05em; }
.font-rajdhani { font-family: 'Poppins', sans-serif; }
.font-poppins { font-family: 'Poppins', sans-serif; }
.font-inter { font-family: 'Inter', sans-serif; }

.text-glow { color: var(--accent); text-shadow: 0 0 10px var(--accent-glow), 0 0 20px var(--accent); }

.card {
    position: relative;
    background: rgba(15, 26, 46, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 242, 255, 0.1);
    transition: transform .3s, box-shadow .3s, border-color .3s;
    border-radius: 4px; /* Sharper corners for robotics look */
    overflow: hidden;
    transform: perspective(1000px) rotateX(0) rotateY(0) scale(1);
    transform-style: preserve-3d;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* Corner Accents for Tech Look */
.card::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 4px;
    background: 
        linear-gradient(to right, var(--accent) 2px, transparent 2px) 0 0,
        linear-gradient(to bottom, var(--accent) 2px, transparent 2px) 0 0,
        linear-gradient(to left, var(--accent) 2px, transparent 2px) 100% 0,
        linear-gradient(to bottom, var(--accent) 2px, transparent 2px) 100% 0,
        linear-gradient(to right, var(--accent) 2px, transparent 2px) 0 100%,
        linear-gradient(to top, var(--accent) 2px, transparent 2px) 0 100%,
        linear-gradient(to left, var(--accent) 2px, transparent 2px) 100% 100%,
        linear-gradient(to top, var(--accent) 2px, transparent 2px) 100% 100%;
    background-size: 10px 10px;
    background-repeat: no-repeat;
    opacity: 0.5;
    transition: opacity 0.3s;
    pointer-events: none;
}

.card:hover { 
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 0 25px rgba(0, 242, 255, 0.15);
}
.card:hover::after {
    opacity: 1;
}
.nav-link { transition: color .3s; font-size: 1.1rem; font-family: 'Rajdhani', sans-serif; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.nav-link:hover, .nav-link.active { color: var(--accent); text-shadow: 0 0 8px var(--accent-glow); }
.section-title {
    display: flex; 
    align-items: center; 
    gap: 0.75rem;
    font-family: 'Orbitron', sans-serif; 
    color: var(--light-slate);
    font-size: var(--text-xl);
    margin-bottom: var(--space-xl);
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-wrap: wrap;
}

@media (min-width: 640px) {
    .section-title {
        font-size: var(--text-2xl);
        gap: 1rem;
        letter-spacing: 2px;
    }
}

@media (min-width: 768px) {
    .section-title {
        font-size: 2.2rem;
        margin-bottom: 2.5rem;
    }
}
.light-mode .section-title {
    color: var(--light-slate);
}
.section-title::after {
    content: ""; flex: 1;
    height: 1px; 
    background: linear-gradient(to right, rgba(0, 242, 255, 0.5), transparent);
    box-shadow: 0 0 5px var(--accent);
}
.light-mode .section-title::after {
    background: linear-gradient(to right, #cbd5e0, var(--accent));
}
.fade-in-section {
    opacity: 0; transform: translateY(20px);
    transition: opacity .6s ease-out, transform .6s ease-out;
}
.fade-in-section.is-visible { opacity: 1; transform: none; }
.skill-tag {
    background: rgba(0, 242, 255, .08);
    color: var(--accent);
    padding: .3rem .8rem; 
    border: 1px solid rgba(0, 242, 255, 0.3);
    border-radius: 2px;
    font-size: .85rem; font-family: 'Roboto Mono', monospace; margin: .35rem;
    display: inline-block;
    transition: all 0.3s;
    text-transform: uppercase;
}
.light-mode .skill-tag {
    background: rgba(0, 119, 255, 0.1);
    color: var(--accent);
    border-color: rgba(0, 119, 255, 0.3);
}
.skill-tag:hover {
    background: var(--accent);
    color: #000;
    box-shadow: 0 0 10px var(--accent-glow);
    transform: translateY(-2px);
}
@keyframes spin-slow { to { transform: rotate(360deg); } }
.animate-fade-in {
animation: fadeIn 1.5s ease-in-out forwards;
}

/* Glitch Effect */
.glitch {
    position: relative;
    color: var(--light-slate);
}
.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-navy);
}
.glitch::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}
.glitch::after {
    left: -2px;
    text-shadow: -1px 0 #00fff9;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}
@keyframes glitch-anim {
    0% { clip: rect(30px, 9999px, 10px, 0); }
    5% { clip: rect(78px, 9999px, 89px, 0); }
    10% { clip: rect(10px, 9999px, 70px, 0); }
    15% { clip: rect(45px, 9999px, 20px, 0); }
    20% { clip: rect(23px, 9999px, 98px, 0); }
    25% { clip: rect(1px, 9999px, 83px, 0); }
    30% { clip: rect(16px, 9999px, 40px, 0); }
    35% { clip: rect(98px, 9999px, 10px, 0); }
    40% { clip: rect(29px, 9999px, 73px, 0); }
    45% { clip: rect(48px, 9999px, 5px, 0); }
    50% { clip: rect(72px, 9999px, 19px, 0); }
    55% { clip: rect(59px, 9999px, 92px, 0); }
    60% { clip: rect(33px, 9999px, 3px, 0); }
    65% { clip: rect(19px, 9999px, 58px, 0); }
    70% { clip: rect(81px, 9999px, 2px, 0); }
    75% { clip: rect(2px, 9999px, 63px, 0); }
    80% { clip: rect(65px, 9999px, 85px, 0); }
    85% { clip: rect(49px, 9999px, 32px, 0); }
    90% { clip: rect(13px, 9999px, 50px, 0); }
    95% { clip: rect(99px, 9999px, 10px, 0); }
    100% { clip: rect(34px, 9999px, 27px, 0); }
}
@keyframes glitch-anim2 {
    0% { clip: rect(65px, 9999px, 100px, 0); }
    5% { clip: rect(52px, 9999px, 74px, 0); }
    10% { clip: rect(79px, 9999px, 85px, 0); }
    15% { clip: rect(15px, 9999px, 10px, 0); }
    20% { clip: rect(10px, 9999px, 2px, 0); }
    25% { clip: rect(80px, 9999px, 51px, 0); }
    30% { clip: rect(2px, 9999px, 80px, 0); }
    35% { clip: rect(35px, 9999px, 19px, 0); }
    40% { clip: rect(90px, 9999px, 64px, 0); }
    45% { clip: rect(20px, 9999px, 38px, 0); }
    50% { clip: rect(6px, 9999px, 93px, 0); }
    55% { clip: rect(36px, 9999px, 4px, 0); }
    60% { clip: rect(48px, 9999px, 72px, 0); }
    65% { clip: rect(93px, 9999px, 53px, 0); }
    70% { clip: rect(18px, 9999px, 10px, 0); }
    75% { clip: rect(7px, 9999px, 95px, 0); }
    80% { clip: rect(38px, 9999px, 22px, 0); }
    85% { clip: rect(56px, 9999px, 65px, 0); }
    90% { clip: rect(82px, 9999px, 90px, 0); }
    95% { clip: rect(10px, 9999px, 88px, 0); }
    100% { clip: rect(92px, 9999px, 11px, 0); }
}

@keyframes float {
0%   { transform: translateY(0px); }
50%  { transform: translateY(-25px); }  /* was -15px */
100% { transform: translateY(0px); }
}
.floating {
animation: float 4s ease-in-out infinite; /* faster and smoother */
}

@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
p { margin-bottom: 1.2rem; }
@media (min-width: 768px) {
    .hero-title { font-size: 4.5rem; }
    .hero-subtitle { font-size: 2.5rem; }
    .section-title { font-size: 2.5rem; }
}
.text-highlight { color: var(--accent); font-weight: 600; }
.grade-table td { padding: 0.75rem 0; font-family: 'Roboto Mono', monospace; }
footer { 
    background: #02040a; 
    border-top: 1px solid rgba(0, 242, 255, 0.1); 
    position: relative;
}
footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.5;
}
.light-mode footer {
    background: #e2e8f0;
    border-top: 1px solid #cbd5e0;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.gallery-item {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(0, 242, 255, 0.2);
    filter: grayscale(0.4) contrast(1.1);
}
.gallery-item:hover {
    opacity: 1;
    filter: grayscale(0) contrast(1);
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.3);
    transform: scale(1.02);
}
.hero-glow {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 242, 255, 0.15) 0%, transparent 60%);
    transform: translate(-50%, -50%);
    z-index: 0;
    filter: blur(80px);
    animation: pulse 4s ease-in-out infinite;
}
.light-mode .hero-glow {
    background: radial-gradient(circle, rgba(0, 119, 255, 0.15) 0%, transparent 60%);
}
#mobile-menu { transition: all 0.3s ease; backdrop-filter: blur(10px); background: rgba(5, 10, 20, 0.95); }
.project-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 242, 255, 0.05);
    color: var(--accent);
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--accent);
    border-radius: 4px;
    font-weight: 600;
    margin-top: var(--space-md);
    transition: all var(--transition-base);
    font-family: 'Orbitron', monospace;
    letter-spacing: 0.5px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    z-index: 1;
    text-transform: uppercase;
    font-size: var(--text-sm);
    /* Touch-friendly sizing */
    min-height: var(--touch-target-min);
    min-width: var(--touch-target-min);
    /* Prevent text selection on tap */
    -webkit-user-select: none;
    user-select: none;
    /* Remove tap highlight on mobile */
    -webkit-tap-highlight-color: transparent;
    /* Full width on mobile */
    width: 100%;
}

@media (min-width: 640px) {
    .project-btn {
        width: auto;
        padding: 0.6rem 1.4rem;
        font-size: 0.85rem;
        letter-spacing: 1px;
    }
}
.light-mode .project-btn {
    background: rgba(0, 119, 255, 0.05);
    color: var(--accent);
}
.project-btn:hover {
    background: var(--accent);
    color: #000;
    box-shadow: 0 0 15px var(--accent-glow);
}
.project-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 245, 212, 0.2), transparent);
    transition: 0.5s;
    z-index: -1;
}
.light-mode .project-btn::before {
    background: linear-gradient(90deg, transparent, rgba(49, 130, 206, 0.2), transparent);
}
.project-btn:hover::before {
    left: 100%;
}
.project-btn:hover {
    background: rgba(0, 245, 212, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 245, 212, 0.2);
}
.light-mode .project-btn:hover {
    background: rgba(49, 130, 206, 0.2);
    box-shadow: 0 5px 15px rgba(49, 130, 206, 0.2);
}
.project-btn i { margin-right: 8px; }

.project-modal-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--light-slate);
}
.project-modal-content {
    line-height: 1.7;
}
.tech-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 245, 212, 0.1);
    color: var(--accent);
    border-radius: 4px;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}
.light-mode .tech-badge {
    background: rgba(49, 130, 206, 0.1);
    color: var(--accent);
}
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 1rem;
}
.tech-item {
    background: rgba(17, 34, 64, 0.7);
    border: 1px solid #233554;
    border-radius: 8px;
    padding: 0.8rem;
    text-align: center;
    transition: all 0.3s;
}
.light-mode .tech-item {
    background: rgba(226, 232, 240, 0.7);
    border: 1px solid #cbd5e0;
}
.tech-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 245, 212, 0.1);
    border-color: var(--accent);
}
.section-divider {
    height: 2px;
    background: linear-gradient(to right, transparent, var(--accent), transparent);
    margin: 5rem 0;
    border: none;
}
.quote-mark {
    font-size: 5rem;
    color: var(--accent);
    opacity: 0.2;
    line-height: 0;
    position: absolute;
    top: -20px;
    left: -15px;
    font-family: Georgia, serif;
}
.light-mode .quote-mark {
    color: var(--accent);
}

/* Enhanced animations and graphics */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}
@keyframes pulse {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 0.7; }
}
@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideInLeft {
    from { transform: translateX(-50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideInRight {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
@keyframes rotateIn {
    from { transform: rotate(5deg) translateY(20px); opacity: 0; }
    to { transform: rotate(0) translateY(0); opacity: 1; }
}
@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
    
}
@keyframes bubbleUpDown {
0%   { transform: translate(calc(-50% + 60px), -50%) translateY(80px); opacity: 0.7; }
50%  { transform: translate(calc(-50% + 60px), -50%) translateY(-80px); opacity: 1; }
100% { transform: translate(calc(-50% + 60px), -50%) translateY(80px); opacity: 0.7; }
}

.bubble-floating {
animation: bubbleUpDown 10s ease-in-out infinite;
position: absolute;
left: 50%;
top: 50%;


}

@keyframes fadeInUp {
0% {
opacity: 0;
transform: translateY(20px);
}
100% {
opacity: 1;
transform: translateY(0);
}
}

.animate-fade-in-up {
animation-name: fadeInUp;
animation-duration: 0.7s;
animation-fill-mode: forwards;
animation-timing-function: ease-out;
opacity: 0; /* start hidden */
}

/* New elements */
.floating {
    animation: float 5s ease-in-out infinite;
}
.pulse {
    animation: pulse 2s ease-in-out infinite;
}
.gradient-text {
    background: linear-gradient(90deg, #00f5d4, #00b4d8, #90e0ef);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient 4s ease infinite;
}
.light-mode .gradient-text {
    background: linear-gradient(90deg, #3182ce, #4299e1, #63b3ed);
}
.gradient-border {
    position: relative;
    border-radius: 12px;
}
.gradient-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #00f5d4, #00b4d8, #90e0ef);
    z-index: -1;
    border-radius: 14px;
    animation: gradient 5s ease infinite;
}
.light-mode .gradient-border::before {
    background: linear-gradient(45deg, #3182ce, #4299e1, #63b3ed);
}
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 1000;
}
.progress-bar {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.2s ease;
}
.scroll-top {
    position: fixed;
    bottom: 20px;
    right: 16px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--light-navy);
    border: 1px solid var(--accent);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-base);
    box-shadow: 0 0 10px var(--accent-glow);
    z-index: 99;
    -webkit-tap-highlight-color: transparent;
}

@media (min-width: 768px) {
    .scroll-top {
        bottom: 30px;
        right: 30px;
        width: 50px;
        height: 50px;
    }
}
.light-mode .scroll-top {
    background: var(--light-navy);
    border: 1px solid var(--accent);
    color: var(--accent);
}
.scroll-top.show {
    opacity: 1;
    transform: translateY(0);
}
.cursor {
    display: inline-block;
    width: 8px;
    height: 1em;
    background: var(--accent);
    margin-left: 4px;
    animation: blink 1s infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
.glow-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent);
    display: inline-block;
    margin-right: 10px;
    animation: pulse 1.5s infinite;
}
.featured-project {
    position: relative;
    overflow: hidden;
}
.featured-project::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0,245,212,0.1) 0%, transparent 70%);
    transform: rotate(30deg);
    z-index: -1;
    animation: spin-slow 15s linear infinite;
}
.light-mode .featured-project::after {
    background: radial-gradient(circle, rgba(49, 130, 206, 0.1) 0%, transparent 70%);
}
.parallax {
    transition: transform 0.1s ease;
}
.shape-blob {
    background: linear-gradient(45deg, #00f5d4, #00b4d8);
    height: 200px;
    width: 200px;
    border-radius: 30% 50% 20% 40%;
    position: absolute;
    opacity: 0.1;
    z-index: -1;
    filter: blur(30px);
    animation: blob-animate 20s ease infinite;
}
.light-mode .shape-blob {
    background: linear-gradient(45deg, #3182ce, #4299e1);
}
.shape-blob.one {
    top: 10%;
    left: 10%;
    transform: rotate(-90deg);
    animation-delay: 0s;
}
.shape-blob.two {
    top: 60%;
    right: 15%;
    transform: rotate(180deg);
    animation-delay: -5s;
}
.shape-blob.three {
    bottom: 10%;
    left: 20%;
    transform: rotate(0deg);
    animation-delay: -10s;
}
@keyframes blob-animate {
    0%, 100% { border-radius: 30% 50% 20% 40%; transform: translate(0,0) rotate(0deg); }
    25% { border-radius: 50% 30% 40% 20%; transform: translate(50px, -50px) rotate(90deg); }
    50% { border-radius: 40% 20% 30% 50%; transform: translate(0, -100px) rotate(180deg); }
    75% { border-radius: 20% 40% 50% 30%; transform: translate(-50px, -50px) rotate(270deg); }
}

/* Dark mode toggle */
.theme-toggle {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--light-navy);
    border: 1px solid var(--accent);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99;
    box-shadow: 0 0 10px var(--accent-glow);
    transition: all 0.3s ease;
}
.light-mode .theme-toggle {
    background: var(--light-navy);
    border: 1px solid var(--accent);
    color: var(--accent);
}
.theme-toggle:hover {
    transform: scale(1.1);
}

/* Typewriter animation */
.animate-slide-up {
animation: slideUp 1s ease-out forwards;
}
@keyframes slideUp {
from { 
    opacity: 0;
    transform: translateY(20px);
}
to { 
    opacity: 1;
    transform: translateY(0);
}
}
@keyframes typewriter {
    from { width: 0 }
    to { width: 100% }
}
@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--accent); }
}

/* Testimonial cards */
.testimonial-card {
    background: rgba(17, 34, 64, 0.85);
    border: 1px solid #233554;
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
}
.light-mode .testimonial-card {
    background: rgba(226, 232, 240, 0.9);
    border: 1px solid #cbd5e0;
}
.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 245, 212, 0.1);
}
.light-mode .testimonial-card:hover {
    box-shadow: 0 10px 20px rgba(49, 130, 206, 0.1);
}
.testimonial-quote {
    position: relative;
    padding-left: 1.5rem;
    border-left: 3px solid var(--accent);
}
.testimonial-author {
    display: flex;
    align-items: center;
    margin-top: 1.5rem;
}
.testimonial-author img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1rem;
    border: 2px solid var(--accent);
}
.lottie-container {
    width: 100%;
    height: 200px;
    margin: 0 auto;
}

.project-card.floating {
animation: float 5s ease-in-out infinite;
transform-style: preserve-3d;
transition: transform 0.5s ease, box-shadow 0.5s ease;
will-change: transform;
}
.project-card:hover {
transform: translateY(-10px) scale(1.03) rotateX(1deg) rotateY(1deg);
background: linear-gradient(135deg, rgba(0,245,212,0.1), rgba(0,245,212,0.02));
border: 1px solid var(--accent);
box-shadow: 0 10px 30px var(--accent-glow);
}


/* Scroll-triggered fade-in for cards */
.project-card {
opacity: 0;
transform: translateY(30px);
transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.project-card.aos-animate {
opacity: 1;
transform: translateY(0);
}

/* --- NEW: Professional Modal Animations --- */
.modal-overlay {
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
background: rgba(10, 25, 47, 0.95);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
opacity: 0;
visibility: hidden;
transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
}
.light-mode .modal-overlay {
background: rgba(248, 250, 252, 0.95);
}
.modal-overlay.active {
opacity: 1;
visibility: visible;
}

.modal-content {
background: var(--light-navy);
border-radius: 12px;
width: 90%;
max-width: 700px;
max-height: 90vh;
overflow-y: auto;
padding: 2rem;
position: relative;
box-shadow: 0 0 30px rgba(0, 245, 212, 0.3);
border: 1px solid var(--accent);

/* Animation State */
opacity: 0;
transform: scale(0.9);
transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease-out;
}
.light-mode .modal-content {
background: var(--light-navy);
border: 1px solid #cbd5e0;
}
.modal-overlay.active .modal-content {
opacity: 1;
transform: scale(1);
}

/* Staggered animation for the content inside the modal */
.modal-overlay.active .modal-content > * {
animation: modalContentFadeInUp 0.5s 0.2s ease-out forwards;
opacity: 0;
}

@keyframes modalContentFadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}

.modal-close {
position: absolute;
top: 15px;
right: 15px;
font-size: 1.5rem;
color: var(--accent);
cursor: pointer;
background: none;
border: none;
transition: transform 0.3s, color 0.3s;
}
.modal-close:hover {
transform: rotate(90deg) scale(1.1);
color: white;
}
/* --- End of Professional Modal Animations --- */
/* ====================================
   MOBILE-FIRST RESPONSIVE UTILITIES
   ==================================== */

/* Container responsive padding */
.container {
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 768px) {
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Hero glow responsive */
.hero-glow {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 242, 255, 0.15) 0%, transparent 60%);
    transform: translate(-50%, -50%);
    z-index: 0;
    filter: blur(60px);
    animation: pulse 4s ease-in-out infinite;
}

@media (min-width: 768px) {
    .hero-glow {
        width: 600px;
        height: 600px;
        filter: blur(80px);
    }
}

/* Mobile Menu improvements */
#mobile-menu {
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(5, 10, 20, 0.98);
    /* Safe area insets for notched phones */
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

/* Gallery grid mobile */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 480px) {
    .gallery-grid {
        gap: 1rem;
    }
}

@media (min-width: 640px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1.25rem;
    }
}

@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}

.gallery-item {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(0, 242, 255, 0.2);
    filter: grayscale(0.4) contrast(1.1);
}

@media (min-width: 640px) {
    .gallery-item {
        height: 180px;
    }
}

@media (min-width: 768px) {
    .gallery-item {
        height: 220px;
    }
}

/* Modal mobile improvements */
.modal-content {
    width: 95%;
    max-width: 700px;
    max-height: 85vh;
    padding: 1.25rem;
    border-radius: 12px;
    margin: 0 auto;
}

@media (min-width: 640px) {
    .modal-content {
        width: 90%;
        padding: 1.5rem;
    }
}

@media (min-width: 768px) {
    .modal-content {
        padding: 2rem;
        max-height: 90vh;
    }
}

/* Skill tags responsive */
.skill-tag {
    background: rgba(0, 242, 255, .08);
    color: var(--accent);
    padding: 0.25rem 0.6rem;
    border: 1px solid rgba(0, 242, 255, 0.3);
    border-radius: 2px;
    font-size: 0.75rem;
    font-family: 'Roboto Mono', monospace;
    margin: 0.25rem;
    display: inline-block;
    transition: all 0.3s;
    text-transform: uppercase;
}

@media (min-width: 768px) {
    .skill-tag {
        padding: 0.3rem 0.8rem;
        font-size: 0.85rem;
        margin: 0.35rem;
    }
}

/* Tech grid responsive */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 0.75rem;
}

@media (min-width: 640px) {
    .tech-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
        margin-top: 1rem;
    }
}

@media (min-width: 768px) {
    .tech-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

.tech-item {
    background: rgba(17, 34, 64, 0.7);
    border: 1px solid #233554;
    border-radius: 6px;
    padding: 0.6rem;
    text-align: center;
    transition: all 0.3s;
    font-size: 0.8rem;
}

@media (min-width: 768px) {
    .tech-item {
        border-radius: 8px;
        padding: 0.8rem;
        font-size: inherit;
    }
}

/* Shape blobs - smaller on mobile but still visible */
.shape-blob {
    display: block;
    background: linear-gradient(45deg, #00f5d4, #00b4d8);
    height: 120px;
    width: 120px;
    border-radius: 30% 50% 20% 40%;
    position: absolute;
    opacity: 0.08;
    z-index: -1;
    filter: blur(25px);
    animation: blob-animate 20s ease infinite;
}

@media (min-width: 640px) {
    .shape-blob {
        height: 150px;
        width: 150px;
        opacity: 0.1;
        filter: blur(30px);
    }
}

@media (min-width: 768px) {
    .shape-blob {
        height: 200px;
        width: 200px;
        opacity: 0.1;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .shape-blob,
    .floating,
    .glitch::before,
    .glitch::after {
        animation: none !important;
    }
    
    .hero-glow {
        animation: none !important;
    }
    
    * {
        scroll-behavior: auto !important;
    }
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Hide focus outline for mouse users */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
    outline: none;
}

/* Safe area insets for modern phones */
.fixed-bottom {
    padding-bottom: env(safe-area-inset-bottom);
}

/* Print styles */
@media print {
    .enhanced-nav,
    .scroll-top,
    .theme-toggle,
    #particle-canvas,
    .shape-blob {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    a {
        text-decoration: underline;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --accent: #00ffff;
        --accent-glow: rgba(0, 255, 255, 0.3);
    }
    
    .card,
    .club-card,
    .stat-card,
    .event-card {
        border-width: 2px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Disable hover effects on touch devices */
    .card:hover,
    .club-card:hover,
    .stat-card:hover,
    .project-btn:hover {
        transform: none;
    }
    
    /* Larger touch targets */
    .nav-link,
    .nav-link-mobile {
        min-height: 48px;
        display: flex;
        align-items: center;
    }
}

/* Landscape phone orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-institutional {
        min-height: auto;
        padding: 2rem 0;
    }
    
    .stat-card {
        padding: 1rem;
    }
}