* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-bg: #0b1216; /* slightly darker deep navy */
    --panel: rgba(255,255,255,0.03);
    --text-primary: #e9e9e9; /* brighter primary text for contrast */
    --text-secondary: rgb(255, 248, 239); /* slightly desaturated secondary */
    --accent: #58c9ff; /* keep accent but slightly adjusted */
    --accent-2: #7b61ff;
    --accent-light: #a8e9ff;
    --border: rgba(255,255,255,0.06);
    --card-bg: rgba(10,15,20,0.5);
    --glow: 0 0 8px rgba(122,200,255,0.12);
    --grid-min-width: 320px;
    --grid-gap: 2rem;
    --grid-max-width: 1100px;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
    line-height: 1.6;
    color: var(--text-primary);
    background: radial-gradient(ellipse at 10% 10%, rgba(122,97,255,0.06), transparent 10%),
                radial-gradient(ellipse at 90% 80%, rgba(106,211,255,0.04), transparent 15%),
                var(--primary-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.3s ease, color 0.2s ease;
    padding-top: 0;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* stronger global overlay to darken background and improve contrast */
    background: rgba(0, 0, 0, 0.54);
    z-index: -1;
}

#app {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    touch-action: none;
}

#canvas {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    overflow: hidden;
}

/* Dim the animated canvas slightly so foreground text reads easier */
#canvas {
    opacity: 0.85;
    filter: brightness(0.86) contrast(0.98);
}

/* (video background removed) */

h1, h2, h3 {
    font-family: Georgia, Garamond, 'Times New Roman', serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Navigation */
nav {
    position: absolute;
    top: 0;
    width: 100%;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(255,255,255,0.03);
    z-index: 1000;
    padding: 0.6rem 0;
}

nav .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.contact-content p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    text-shadow: var(--glow);
}

.contact-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.contact-links a {
    color: var(--accent);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.contact-links a:hover {
    color: var(--accent-light);
    transform: translateY(-2px);
}

nav .logo {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--accent);
}

/* Hero Section */
.hero {
    padding: 4.2rem 2rem 2.5rem;
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 2rem;
    align-items: start; /* was center */
    justify-items: start;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.hero h1 {
    font-size: 2.6rem;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.hero .cta {
    display: inline-block;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    /* single solid accent color instead of gradient */
    background: var(--accent);
    color: #042028; /* dark text for contrast on accent */
    font-weight: 600;
    margin-right: 0.6rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.hero .cta.ghost {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.hero-panel {
    display: flex;
    align-items: flex-start; /* align contact card to top */
    justify-content: center;
}

.button.primary {
    display: inline-block;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    background: var(--accent);
    color: #042028;
    text-decoration: none;
    font-weight: 600;
}

/* click ripple effect */
.cta, .button.primary {
    -webkit-tap-highlight-color: transparent;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 600ms ease-out;
    background: rgba(255,255,255,0.35);
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* active/pressed state */
.cta:active, .button.primary:active {
    transform: translateY(1px) scale(0.995);
    box-shadow: none;
}

.hero .subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    animation: slideInUp 1s ease-out 0.2s both;
}

.hero .tagline {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 40ch;
    margin-bottom: 1.2rem;
}

.hero .contact-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeIn 1s ease-out 0.6s both;
}

.hero .contact-links a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.hero .contact-links a:hover {
    color: var(--accent-light);
    transform: translateY(-2px);
}

.contact-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    padding: 1.6rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin: 1.6rem auto 0;
    max-width: 640px;
    text-align: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: var(--glow);
}

.contact-card:hover {
    transform: translateY(-6px);
}

.contact-card:hover h3,
.contact-card:hover p,
.contact-card:hover .contact-links a {
    text-shadow: var(--glow);
}

.contact-card h3 {
    font-size: 1.3rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

/* Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Section */
section {
    padding: 4rem 2rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

section h2 {
    font-size: 2rem;
    margin-bottom: 2.5rem;
    color: var(--text-primary);
    text-align: center;
    position: relative;
}

section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--accent);
    margin: 0.8rem auto 0;
    animation: growWidth 1s ease-out 0.8s both;
}

@keyframes growWidth {
    from {
        width: 0;
    }
    to {
        width: 60px;
    }
}

/* About Section */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-content p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.research-interests {
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(35px);
    backdrop-filter: blur(35px);
    padding: 2rem;
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    margin-top: 2rem;
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

.research-interests:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: translateY(-15px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.research-interests:hover h3,
.research-interests:hover p {
    text-shadow: var(--glow);
}

.research-interests h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.research-interests p {
    font-size: 1rem;
    line-height: 1.8;
}

/* Education Section */
.education-timeline {
    max-width: 800px;
    margin: 0 auto;
}

.education-item {
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
}

/* Reusable glass card style used across the site */
.glass-card, .project-card, .contact-card, .research-interests, .education-item {
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(35px);
    backdrop-filter: blur(35px);
    padding: 1.8rem;
    border-radius: 15px;
    /* clearer border for non-hover state */
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}

.education-item:hover {
    background: rgba(0, 0, 0, 0.44);
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6);
    border-color: rgba(255,255,255,0.18);
}

/* Hover/active state for all glass cards */
.glass-card:hover, .project-card:hover, .contact-card:hover, .research-interests:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(11, 21, 30, 0.6);
    border-color: rgba(255,255,255,0.18);
}

.education-item:hover .degree,
.education-item:hover .institution,
.education-item:hover .duration,
.education-item:hover ul li {
    text-shadow: var(--glow);
}

.education-item .degree {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.education-item .institution {
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.education-item .duration {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}



.education-item ul {
    list-style: none;
    padding-left: 0;
}

.education-item ul li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.education-item ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
    text-shadow: var(--glow);
}

.education-item .institution a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

.education-item .institution a:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    grid-auto-rows: auto;
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.skill-category {
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(35px);
    backdrop-filter: blur(35px);
    padding: 1.8rem;
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    min-height: 430px;
}

.skill-category:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: translateY(-15px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.skill-category:hover h3,
.skill-category:hover .skills-list {
    text-shadow: var(--glow);
}

.skill-category h3 {
    font-size: 1.2rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.skill-category .skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.skill-tag {
    background-color: var(--primary-bg);
    color: var(--text-primary);
    padding: 0.4rem 0.9rem;
    border-radius: 4px;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    transition: background-color 0.3s ease, color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-tag:hover {
    background-color: var(--accent);
    color: var(--primary-bg);
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--grid-min-width), 1fr));
    grid-auto-rows: 1fr;
    gap: var(--grid-gap);
    max-width: var(--grid-max-width);
    margin: 0 auto;
}

.project-card {
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(35px);
    backdrop-filter: blur(35px);
    padding: 2rem;
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

a.project-card {
    text-decoration: none;
    color: inherit;
    display: block;
}

a.project-card:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: translateY(-15px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

a.project-card:hover h3,
a.project-card:hover p {
    text-shadow: var(--glow);
}

a.project-card h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

a.project-card .tech-stack {
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

a.project-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.project-readmore {
    display: inline-block;
    margin-top: 0.75rem;
    color: var(--accent);
    font-size: 0.95rem;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.project-readmore:hover {
    border-bottom-color: var(--accent);
}

/* Footer */
footer {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 0.5rem 1.4rem;
    text-align: center;
    margin-top: 2rem;
    box-shadow: var(--glow);
}

footer p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Projects Page Specific Styles */
.projects-page .projects-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.projects-page .project-card {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 2rem;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.2);
    -webkit-backdrop-filter: blur(25px);
    backdrop-filter: blur(25px);
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.projects-page .project-card:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: translateY(-15px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.projects-page .project-card:hover .project-header h3,
.projects-page .project-card:hover .project-content p,
.projects-page .project-card:hover .project-content .project-link {
    text-shadow: var(--glow);
}

.projects-page .project-header {
    flex: 0 0 250px;
}

.projects-page .project-header h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.projects-page .project-header .tech-stack {
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 0;
}

.projects-page .project-content {
    flex: 1;
}

.projects-page .project-content p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.projects-page .project-content ul {
    margin-bottom: 1rem;
}

.projects-page .project-content .project-link {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.95rem;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
    text-shadow: var(--glow);
}

.projects-page .project-content .project-link:hover {
    border-bottom-color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.2rem;
    }

    .hero .subtitle {
        font-size: 1.1rem;
    }

    nav ul {
        gap: 1rem;
    }

    nav .container {
        flex-direction: column;
        gap: 1rem;
    }

    section {
        padding: 3rem 1.5rem;
    }

    .skills-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .projects-page .project-card {
        flex-direction: column;
        gap: 1rem;
    }

    .projects-page .project-header {
        flex: none;
    }
}

/* Mobile: edge-to-edge cards and remove container side padding */
@media (max-width: 480px) {
    /* remove default container side padding so content is flush with viewport */
    .container {
        padding-left: 0.5rem; /* tiny breathing room */
        padding-right: 0.5rem;
    }

    /* sections should use minimal vertical padding and no horizontal inset */
    section {
        padding: 1rem 0.25rem;
    }

    /* make grids edge-to-edge by removing gaps and letting cards take full width */
    .skills-grid, .projects-grid {
        gap: 0;
        margin-left: 0;
        margin-right: 0;
    }

    /* normalize card spacing so they touch the screen edges */
    .skill-category, .project-card, .education-item, .contact-card, .research-interests {
        margin: 0;
        border-radius: 0;
        padding: 1rem; /* keep internal padding but remove outer radius */
        min-height: unset;
    }

    /* ensure hero padding is reduced on tiny screens */
    .hero {
        padding: 2rem 0.5rem 1rem;
        grid-template-columns: 1fr;
    }

    .hero-panel {
        justify-content: stretch;
        align-items: flex-start;
    }
}
