:root {
    --bg-color: #050505;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-color: #8b5cf6; /* Vibrant purple */
    --accent-color-hover: #7c3aed;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --font-primary: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    letter-spacing: -0.01em; /* Professional sleek typography */
}

/* Three.js Canvas */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none; /* Let clicks pass through to content */
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 6rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 50%;
    height: 3px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* Glassmorphism Panel */
.glass-panel {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 2rem;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease, box-shadow 0.4s ease;
}

.glass-panel:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Typography & Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent-color);
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background: var(--accent-color-hover);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-outline:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    padding: 1.5rem 0;
    background: transparent;
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.navbar.scrolled {
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    border-bottom: 1px solid var(--glass-border);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -1px;
}

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 250px;
    height: 100vh;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(15px);
    z-index: 99;
    transition: right 0.3s ease;
    padding: 6rem 2rem;
    border-left: 1px solid var(--glass-border);
}

.mobile-menu.active {
    right: 0;
}

.mobile-nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.mobile-nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 500;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px; /* offset for nav */
}

.hero-content {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.greeting {
    color: var(--text-secondary);
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.gradient-text {
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1.05;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #a3a3a3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
}

.typewriter {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    min-height: 2.2rem; /* prevent layout shift */
}

.cursor {
    display: inline-block;
    width: 3px;
    background-color: var(--accent-color);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 500px;
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    color: var(--text-secondary);
    font-size: 1.5rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
    color: var(--accent-color);
    transform: translateY(-3px);
}

.hero-visual {
    /* Kept empty as Three.js handles the background, but this div can be used for UI elements overlaid on top if needed */
}

/* About & Education */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.card-icon {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.about-card h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.about-text {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Timelines */
.timeline {
    position: relative;
    padding-left: 1.5rem;
    border-left: 2px solid var(--glass-border);
}

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

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -1.85rem;
    top: 0.2rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-color);
    border: 2px solid var(--bg-color);
}

.timeline-item h4 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.timeline-item h5 {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.timeline-item .date {
    font-size: 0.85rem;
    color: var(--accent-color);
}

.exp-list {
    margin-top: 1rem;
    padding-left: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.exp-list li {
    margin-bottom: 0.5rem;
}

.exp-list-item {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

/* Certificate download icon */
.cert-download {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: 0.4rem;
    transition: color 0.3s ease;
    vertical-align: middle;
}

.cert-download:hover {
    color: var(--accent-color);
}

/* Inline links in experience */
.inline-link {
    color: var(--accent-color);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.inline-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 0.02em;
}

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

.skill-category h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.skill-category h3 i {
    color: var(--accent-color);
}

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

.skill-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.skill-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.project-header h3 {
    font-size: 1.3rem;
}

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

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

.project-award {
    font-size: 0.85rem;
    color: #fbbf24; /* yellow/gold */
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.project-subtitle {
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.project-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.project-tech {
    margin-top: auto;
}

/* Experience */
.exp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.column-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.experience .timeline-item.glass-panel {
    margin-bottom: 1.5rem;
    border-left: 1px solid var(--glass-border);
}

.experience .timeline-dot {
    left: -2.35rem; /* adjusted for padding in glass panel */
}

/* Footer */
.footer {
    border-top: 1px solid var(--glass-border);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
    background: rgba(5, 5, 5, 0.5);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.footer-info h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.footer-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.footer-info p i {
    margin-right: 0.5rem;
    color: var(--accent-color);
}

.footer-socials {
    display: flex;
    gap: 1rem;
}

.footer-socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.footer-socials a:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
}

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

/* ==========================================
   Responsive Design
   ========================================== */

/* Scroll Animation */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Tablet & Small Laptop (max-width: 992px) --- */
@media (max-width: 992px) {
    .hero-content, .about-grid, .exp-grid {
        grid-template-columns: 1fr;
    }

    .hero-visual {
        display: none;
    }

    .hero {
        padding-top: 100px;
        text-align: center;
    }

    .hero-desc {
        margin-left: auto;
        margin-right: auto;
    }

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

    .gradient-text {
        font-size: 3.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

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

/* --- Mobile (max-width: 768px) --- */
@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }

    .nav-links {
        display: none;
    }

    .hamburger {
        display: block;
    }

    .section {
        padding: 3.5rem 0;
    }

    .gradient-text {
        font-size: 2.8rem;
    }

    .typewriter {
        font-size: 1.2rem;
        min-height: 1.8rem;
    }

    .hero-desc {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }

    .glass-panel {
        padding: 1.5rem;
    }

    /* Disable hover transforms on touch devices */
    .glass-panel:hover {
        transform: none;
    }

    .about-card h3 {
        font-size: 1.25rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .exp-grid {
        gap: 2rem;
    }

    .column-title {
        font-size: 1.25rem;
        margin-bottom: 1.25rem;
    }

    /* Ensure timeline dots align properly on mobile */
    .experience .timeline-dot {
        left: -1.85rem;
    }

    .footer {
        padding: 3rem 0 1.5rem;
        margin-top: 2rem;
    }

    .footer-info h2 {
        font-size: 1.25rem;
    }

    .footer-socials a {
        width: 44px; /* Bigger touch target */
        height: 44px;
    }
}

/* --- Small Mobile (max-width: 480px) --- */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .gradient-text {
        font-size: 2rem;
    }

    .greeting {
        font-size: 1rem;
    }

    .typewriter {
        font-size: 1.05rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .hero-actions .btn {
        width: 100%;
        text-align: center;
    }

    .section {
        padding: 2.5rem 0;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .glass-panel {
        padding: 1.25rem;
        border-radius: 10px;
    }

    .tag {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }

    .skill-item {
        padding: 0.4rem 0.9rem;
        font-size: 0.85rem;
    }

    .project-header h3 {
        font-size: 1.15rem;
    }

    .project-desc {
        font-size: 0.9rem;
    }

    .timeline-item h4 {
        font-size: 1rem;
    }

    .timeline-item h5 {
        font-size: 0.85rem;
    }

    .exp-list {
        font-size: 0.85rem;
    }

    .social-links {
        gap: 1.25rem;
    }

    .social-links a {
        font-size: 1.3rem;
    }

    .navbar {
        padding: 1rem 0;
    }

    .navbar.scrolled {
        padding: 0.75rem 0;
    }

    .logo {
        font-size: 1.25rem;
    }
}
