/* Global Variables & Reset */
:root {
    --bg-color: #0a0f14;
    --bg-secondary: #11161d;
    --accent-color: #00f3ff;
    --accent-glow: rgba(0, 243, 255, 0.5);
    --text-primary: #e0e6ed;
    --text-secondary: #94a3b8;
    --font-heading: 'Exo 2', sans-serif;
    --font-body: 'Roboto', sans-serif;
    --nav-height: 70px;
    --transition-speed: 0.3s;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: transparent;
    /* Make body transparent so canvas shows */
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: var(--bg-color);
    /* Apply background color here */
    opacity: 1;
    /* Full opacity, let Three.js handle transparency */
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-speed);
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    transition: all var(--transition-speed);
    cursor: pointer;
    font-size: 0.9rem;
}

.btn:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
    box-shadow: 0 0 15px var(--accent-glow);
}

.btn-primary {
    background-color: rgba(0, 243, 255, 0.1);
}

.section {
    padding: 80px 0;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--text-primary);
    border-left: 4px solid var(--accent-color);
    padding-left: 15px;
}

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

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

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 1000;
    transition: background-color var(--transition-speed);
}

header.scrolled {
    background-color: rgba(10, 15, 20, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

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

.logo a {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.main-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-links li a {
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width var(--transition-speed);
}

.nav-links li a:hover::after,
.nav-links li a.active::after {
    width: 100%;
}

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

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--text-primary);
    transition: all 0.3s ease-in-out;
}

/* Mobile Nav */
.mobile-nav {
    position: fixed;
    top: var(--nav-height);
    left: 100%;
    width: 100%;
    height: calc(100vh - var(--nav-height));
    background-color: var(--bg-secondary);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: left 0.4s ease;
}

.mobile-nav.active {
    left: 0;
}

.mobile-nav-links {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.mobile-nav-links a {
    font-size: 1.5rem;
    font-family: var(--font-heading);
}

/* Hero Section */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--nav-height);
    background: radial-gradient(circle at top right, rgba(0, 243, 255, 0.05), transparent 40%);
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
    gap: 50px;
}

.greeting {
    font-family: var(--font-heading);
    color: var(--accent-color);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.name {
    font-family: var(--font-heading);
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 15px;
}

.role {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
    font-weight: 400;
}

.hero-description {
    max-width: 500px;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 50px;
}

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

.social-links a {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

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

.hero-metrics {
    display: flex;
    gap: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
}

.metric-item {
    display: flex;
    flex-direction: column;
}

.metric-number {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--accent-color);
    font-weight: 700;
}

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

.hero-image {
    position: relative;
}

.hero-image img {
    width: 100%;
    max-width: 400px;
    height: 400px;
    object-fit: cover;
    border-radius: 20px;
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.3);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.hero-image img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.5);
}

.image-placeholder {
    width: 100%;
    height: 400px;
    background: linear-gradient(45deg, var(--bg-secondary), #1a232e);
    border: 1px solid var(--accent-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 5rem;
    color: rgba(0, 243, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.1);
    position: relative;
}

.image-placeholder::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 25px;
    background: linear-gradient(45deg, var(--accent-color), transparent, var(--accent-color));
    z-index: -1;
    opacity: 0.3;
    filter: blur(10px);
}

/* About Section */
.about-content {
    max-width: 800px;
    font-size: 1.1rem;
}

.about-content p {
    margin-bottom: 20px;
}

/* Projects Section */
.projects-grid {
    display: grid;
    gap: 40px;
}

.project-card {
    background-color: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 30px;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    border-radius: 8px;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(0, 243, 255, 0.3);
}

.project-image .img-placeholder {
    width: 100%;
    height: 200px;
    background-color: #0a0f14;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    color: var(--text-secondary);
    border-radius: 4px;
}

.project-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.project-desc {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.project-tags li {
    background-color: rgba(0, 243, 255, 0.1);
    color: var(--accent-color);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

.project-quote {
    font-style: italic;
    color: var(--text-secondary);
    border-left: 3px solid var(--accent-color);
    padding-left: 15px;
}

/* Experience Section */
.experience-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.experience-card {
    background-color: var(--bg-secondary);
    padding: 30px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.exp-role {
    font-family: var(--font-heading);
    font-size: 1.3rem;
}

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

.exp-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-left: auto;
}

.exp-bullets {
    list-style: disc;
    margin-left: 20px;
    color: var(--text-secondary);
}

.exp-bullets li {
    margin-bottom: 8px;
}

/* Education & Coursework */
.education-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.edu-block {
    background-color: var(--bg-secondary);
    padding: 30px;
    border-radius: 8px;
}

.degree {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.institution {
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 5px;
}

.grad-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.edu-details {
    list-style: disc;
    margin-left: 20px;
    color: var(--text-secondary);
}

.coursework-block h3 {
    font-family: var(--font-heading);
    margin-bottom: 20px;
}

.course-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.course-category h4 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.course-category ul li {
    margin-bottom: 8px;
    color: var(--text-secondary);
    position: relative;
    padding-left: 15px;
}

.course-category ul li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-size: 0.8rem;
}

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

.skill-category {
    background-color: var(--bg-secondary);
    padding: 25px;
    border-radius: 8px;
    border-top: 3px solid var(--accent-color);
}

.skill-category h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.skill-category ul li {
    margin-bottom: 10px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 5px;
}

.skill-category ul li:last-child {
    border-bottom: none;
}

/* Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

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

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-link {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-link:hover {
    color: var(--accent-color);
}

.contact-form {
    background-color: var(--bg-secondary);
    padding: 30px;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-family: var(--font-heading);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    background-color: var(--bg-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-radius: 4px;
    font-family: var(--font-body);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.1);
}

/* Footer */
footer {
    background-color: var(--bg-secondary);
    padding: 40px 0;
    margin-top: 50px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-container {
    text-align: center;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-nav a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

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

.copyright {
    color: var(--text-secondary);
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Animations */
.fade-in-up {
    opacity: 1;
    /* Changed from 0 to 1 for fallback visibility */
    transform: none;
    /* Changed from translateY(30px) */
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* Only hide if JS successfully adds this class, or we can use the intersection observer to add a 'hidden' class initially? 
   Better approach: Let's keep it simple. If JS runs, it can add a class to body. 
   For now, to fix the user's "invisible" issue immediately, we default to visible. 
   We can re-add the animation logic by having JS set opacity to 0 initially.
*/

.fade-in-up.hidden-initial {
    opacity: 0;
    transform: translateY(30px);
}

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

.delay-200 {
    transition-delay: 0.2s;
}

/* Modal System */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: block;
    opacity: 1;
}

.modal-content {
    background-color: var(--bg-secondary);
    margin: 5% auto;
    padding: 40px;
    border: 1px solid var(--accent-color);
    width: 80%;
    max-width: 900px;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(0, 243, 255, 0.2);
    position: relative;
    transform: translateY(-50px);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.close-modal {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--accent-color);
}

.hidden-content {
    display: none;
}

.btn-text {
    background: none;
    border: none;
    color: var(--accent-color);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 15px;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.3s;
}

.btn-text:hover {
    gap: 12px;
}

/* Modal Typography */
.modal-header-content h2 {
    font-family: var(--font-heading);
    color: var(--accent-color);
    margin-bottom: 10px;
    font-size: 2rem;
}

.modal-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 20px;
}

.modal-links {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.btn-sm {
    padding: 8px 15px;
    font-size: 0.8rem;
}

.modal-body-content h3 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    margin: 25px 0 15px;
    font-size: 1.4rem;
    border-left: 3px solid var(--accent-color);
    padding-left: 10px;
}

.modal-body-content h4 {
    color: var(--accent-color);
    margin: 20px 0 10px;
    font-size: 1.1rem;
}

.modal-body-content p {
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.7;
}

.modal-body-content ul {
    list-style: disc;
    margin-left: 20px;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.modal-body-content ul li {
    margin-bottom: 8px;
}

.tech-stack-list li strong {
    color: var(--text-primary);
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 25px;
    }

    .modal-header-content h2 {
        font-size: 1.5rem;
    }
}

/* Responsive Design */
@media (max-width: 992px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-metrics {
        justify-content: center;
        flex-wrap: wrap;
    }

    .hero-image img {
        max-width: 300px;
        height: 300px;
    }

    .project-card {
        grid-template-columns: 1fr;
    }

    .education-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    /* Fix navbar overlap and visibility */
    .hero-section {
        height: auto;
        min-height: 100vh;
        padding-top: calc(var(--nav-height) + 30px);
        padding-bottom: 40px;
    }

    .hero-container {
        padding-top: 20px;
    }

    .nav-links,
    .btn-resume {
        display: none;
    }

    .hamburger {
        display: block;
    }

    /* Adjust hero text sizes for mobile */
    .greeting {
        font-size: 1.2rem;
    }

    .name {
        font-size: 2.5rem;
        margin-bottom: 10px;
    }

    .role {
        font-size: 1.1rem;
        margin-bottom: 20px;
    }

    .hero-description {
        font-size: 1rem;
        margin-bottom: 25px;
        max-width: 100%;
    }

    .hero-actions {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 30px;
    }

    .social-links {
        gap: 20px;
    }

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

    /* Fix image sizing on mobile */
    .hero-image {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .hero-image img {
        max-width: 280px;
        height: 280px;
    }

    /* Make metrics stack better on small screens */
    .hero-metrics {
        gap: 20px;
        padding-top: 20px;
    }

    .metric-number {
        font-size: 1.5rem;
    }

    .metric-label {
        font-size: 0.8rem;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

    .course-lists {
        grid-template-columns: 1fr;
    }

    /* Ensure sections have proper padding on mobile */
    .section {
        padding: 60px 0;
    }

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

/* Extra small screens */
@media (max-width: 480px) {
    .name {
        font-size: 2rem;
    }

    .hero-image img {
        max-width: 240px;
        height: 240px;
    }

    .hero-metrics {
        gap: 15px;
    }

    .metric-item {
        min-width: 80px;
    }
}