:root {
    --bg-color: #020617;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #0ea5e9;
    --accent-gradient: linear-gradient(135deg, #0ea5e9, #8b5cf6, #ec4899);
    --glass-bg: rgba(255, 255, 255, 0.02);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-hover: rgba(255, 255, 255, 0.04);
    --card-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.5);
    --font-main: 'Outfit', sans-serif;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light theme overrides */
body.light-theme {
    --bg-color: #f7fbff;
    --text-primary: #071024;
    --text-secondary: #475569;
    --accent-color: #0b84ff;
    --glass-bg: rgba(255,255,255,0.8);
    --glass-border: rgba(2,6,23,0.06);
    --glass-hover: rgba(2,6,23,0.03);
}

/* ===================== BASE STYLES ===================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

/* ===================== BACKGROUND SHAPES ===================== */
.bg-shapes {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, rgba(14, 165, 233, 0.03) 0%, transparent 60%);
}

.shape {
    position: absolute;
    filter: blur(140px);
    opacity: 0.55;
    border-radius: 50%;
    animation: drift 20s infinite alternate ease-in-out;
}

@keyframes drift {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-40px) scale(1.05); }
}

.shape-1 {
    top: -10%; left: -10%;
    width: 55vw; height: 55vw;
    background: rgba(14, 165, 233, 0.15);
}

.shape-2 {
    bottom: -10%; right: -10%;
    width: 65vw; height: 65vw;
    background: rgba(139, 92, 246, 0.15);
}

.shape-3 {
    top: 40%; left: 50%;
    width: 40vw; height: 40vw;
    background: rgba(236, 72, 153, 0.12);
    animation-duration: 25s;
    animation-direction: alternate-reverse;
}

/* ===================== UTILITIES & REUSABLE ===================== */
.gradient-text {
    background: var(--accent-gradient);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    animation: shine 5s linear infinite;
}

@keyframes shine {
    to { background-position: 200% center; }
}

.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    box-shadow: var(--card-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.glass-card:hover {
    background: var(--glass-hover);
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 1.05rem;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--accent-gradient);
    background-size: 200% auto;
    color: #fff;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
}

.btn-primary:hover {
    background-position: right center;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6);
    transform: translateY(-3px);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
    transform: translateY(-3px);
}

section {
    padding: 100px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
}

.section-subtitle {
    color: var(--text-secondary);
    margin-top: 10px;
    font-size: 1.1rem;
}

/* Reveal transition classes */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ===================== NAVIGATION ===================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(11, 17, 32, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    transition: var(--transition);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo i {
    color: var(--accent-color);
}

.nav-list {
    display: flex;
    gap: 30px;
}

.nav-link {
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--accent-gradient);
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Theme toggle button */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    font-size: 1rem;
}

.theme-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(11, 78, 162, 0.08);
}

/* ===================== HERO SECTION ===================== */
.home-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 80vh;
    padding-top: 60px;
}

.home-text {
    flex: 1;
    max-width: 600px;
}

.greeting {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.name {
    font-size: 4.5rem;
    line-height: 1.1;
    margin: 10px 0;
}

.role {
    font-size: 1.8rem;
    font-weight: 500;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.summary {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.action-btns {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.social-links-hero {
    display: flex;
    gap: 20px;
}

.social-links-hero a {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    font-size: 1.2rem;
    transition: var(--transition);
}

.social-links-hero a:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}

.home-img-wrapper {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.img-border {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    padding: 10px;
    background: var(--accent-gradient);
    animation: float 6s ease-in-out infinite, shineBorder 5s linear infinite;
    background-size: 200% auto;
}

.img-border img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 6px solid var(--bg-color);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes shineBorder {
    to { background-position: 200% center; }
}

/* ===================== ABOUT SECTION ===================== */
.about-container {
    display: flex;
    flex-direction: column;
    padding: 40px;
    gap: 30px;
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.highlight {
    color: var(--accent-color);
    font-weight: 600;
}

.about-stats {
    display: flex;
    justify-content: space-around;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

.stat-box h3 {
    font-size: 2.5rem;
    background: var(--accent-gradient);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 5s linear infinite;
}

.stat-box p {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===================== PROJECTS SECTION ===================== */
.projects-grid {
    display: grid;
    /* allow the grid to adapt: cards will wrap responsively */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.project-card {
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.project-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(14, 165, 233, 0.1);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: var(--transition);
}

.project-card:hover .project-icon {
    background: var(--accent-color);
    color: #fff;
    transform: rotate(10deg) scale(1.1);
    box-shadow: 0 5px 15px rgba(14, 165, 233, 0.4);
}

.project-links a {
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.project-links a:hover {
    color: var(--accent-color);
}

.project-card h3 {
    font-size: 1.4rem;
    margin-bottom: 5px;
}

/* subtle 3D tilt effect for project cards on pointer devices */
.project-card {
    transform-style: preserve-3d;
    will-change: transform;
}

.project-card.tilt {
    transition: transform 0.12s ease-out;
}

.project-date {
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-bottom: 15px;
    font-weight: 600;
}

.project-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    flex-grow: 1;
}

.project-features {
    margin-bottom: 20px;
}

.project-features li {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.project-features li i {
    color: var(--accent-color);
    margin-top: 4px;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tech-stack span {
    padding: 6px 14px;
    background: var(--bg-color);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* ===================== SKILLS SECTION ===================== */
.skills-grid-main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.skill-category {
    padding: 30px;
    text-align: center;
}

.category-icon {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.skill-category h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.skill-tag {
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.skill-tag:hover {
    background: rgba(14, 165, 233, 0.1);
    color: #fff;
    border-color: var(--accent-color);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 15px -5px var(--accent-color), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ===================== EDUCATION ===================== */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 24px;
    height: 100%;
    width: 2px;
    background: var(--glass-border);
}

.timeline-item {
    position: relative;
    padding: 30px;
    margin-left: 60px;
    margin-bottom: 30px;
}

.timeline-dot {
    position: absolute;
    left: -43px;
    top: 30px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-gradient);
    background-size: 200% auto;
    border: 4px solid var(--bg-color);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.3);
    transition: var(--transition);
}

.timeline-item:hover .timeline-dot {
    box-shadow: 0 0 15px 5px rgba(139, 92, 246, 0.4);
    transform: scale(1.2);
}

.timeline-date {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.timeline-item h3 {
    font-size: 1.4rem;
    margin-bottom: 5px;
}

.timeline-item h4 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.timeline-item p {
    color: var(--text-secondary);
}

.timeline-item strong {
    color: var(--text-primary);
}

/* ===================== EXTRA-CURRICULAR ===================== */
.ec-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.ec-card {
    padding: 30px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.ec-card i {
    font-size: 2.5rem;
    margin-top: 5px;
}

.ec-content h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.ec-content p {
    color: var(--text-secondary);
}

/* ===================== CERTIFICATES SECTION ===================== */
.new-certs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.cert-card-text {
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.cert-provider {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-color);
    font-weight: 700;
    margin-bottom: 10px;
}

.cert-card-text h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    flex-grow: 1;
}

.cert-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--glass-border);
    padding-top: 15px;
}

.cert-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.cert-link {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.cert-link:hover {
    text-decoration: underline;
}

.subsection-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.certificate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.certificate-img-card {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    cursor: pointer;
    border-radius: 16px;
    transition: var(--transition);
}

.certificate-img-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.cert-img-overlay {
    position: absolute;
    bottom: -100%;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.95), transparent);
    padding: 30px 20px 20px;
    transition: bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.certificate-img-card:hover img {
    transform: scale(1.1);
}

.certificate-img-card:hover .cert-img-overlay {
    bottom: 0;
}

.cert-img-overlay h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.cert-img-overlay p {
    font-size: 0.9rem;
    color: var(--accent-color);
}

/* ===================== CONTACT SECTION ===================== */
.contact-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    padding: 40px;
}

.contact-info {
    flex: 1;
    min-width: 300px;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.contact-info p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.contact-details .detail-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.detail-item i {
    width: 40px;
    height: 40px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.contact-form {
    flex: 1.5;
    min-width: 350px;
}

.input-group {
    position: relative;
    margin-bottom: 25px;
}

.input-group input,
.input-group textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 15px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

.input-group textarea {
    resize: vertical;
}

.input-group input:focus,
.input-group textarea:focus {
    border-color: var(--accent-color);
    background: rgba(59, 130, 246, 0.05);
}

.input-group label {
    position: absolute;
    left: 15px;
    top: 15px;
    color: var(--text-secondary);
    transition: var(--transition);
    pointer-events: none;
    background: var(--bg-color);
    padding: 0 5px;
}

.input-group input:focus~label,
.input-group textarea:focus~label,
.input-group input:not(:placeholder-shown)~label,
.input-group textarea:not(:placeholder-shown)~label {
    top: -10px;
    font-size: 0.85rem;
    color: var(--accent-color);
}

.w-100 {
    width: 100%;
    justify-content: center;
}

/* Back to top button */
#back-to-top {
    position: fixed;
    right: 18px;
    bottom: 20px;
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 8px 30px rgba(14,165,233,0.15);
    cursor: pointer;
    z-index: 1200;
}

#back-to-top.show {
    display: flex;
}

/* Typewriter caret */
.typewriter {
    border-right: 2px solid rgba(255,255,255,0.7);
    padding-right: 6px;
}

/* ===================== FOOTER ===================== */
.footer {
    border-top: 1px solid var(--glass-border);
    padding: 60px 5% 20px;
    background: rgba(0, 0, 0, 0.2);
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto 40px;
    gap: 40px;
}

.footer-brand p {
    color: var(--text-secondary);
    margin-top: 15px;
    max-width: 300px;
}

.footer-links h4 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links ul li a {
    color: var(--text-secondary);
    transition: var(--transition);
}

.footer-links ul li a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid var(--glass-border);
    padding-top: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===================== MEDIA QUERIES ===================== */
@media (max-width: 900px) {
    .home-content {
        flex-direction: column;
        text-align: center;
        padding-top: 100px;
    }

    .action-btns {
        justify-content: center;
    }

    .social-links-hero {
        justify-content: center;
    }

    .img-border {
        width: 300px;
        height: 300px;
        margin-top: 40px;
    }

    .name {
        font-size: 3.2rem;
    }
}

@media (max-width: 768px) {
    .nav-list {
        position: fixed;
        top: 70px;
        right: -100%;
        flex-direction: column;
        width: 100%;
        background: var(--bg-color);
        padding: 40px 0;
        text-align: center;
        border-bottom: 1px solid var(--glass-border);
        transition: 0.4s;
    }

    .nav-list.active {
        right: 0;
    }

    .hamburger {
        display: block;
    }

    .timeline::before {
        left: 15px;
    }

    .timeline-item {
        margin-left: 45px;
    }

    .timeline-dot {
        left: -34px;
    }

    .about-stats {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

/* Small screens: better spacing and sizing for project cards */
@media (max-width: 600px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .project-card {
        padding: 18px;
    }

    .project-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .project-card h3 {
        font-size: 1.15rem;
        margin-bottom: 8px;
    }

    .project-date {
        font-size: 0.85rem;
    }

    .project-features li {
        font-size: 0.9rem;
    }

    .tech-stack span {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
}