:root {
    --primary-color: #4a9eff;
    --secondary-color: #3a7dd0;
    --background-color: rgb(12, 12, 24);
    --card-bg-color: rgba(30, 30, 50, 0.7);
    --text-color: #ffffff;
    --accent-color: #61dafb;
    --transition-speed: 0.3s;
}

/* Visibility Utilities (force with higher specificity) */
.projects-grid .mobile-only { display: none !important; }
.projects-grid .desktop-only { display: flex; flex-direction: column; }

@media (max-width: 768px) {
    .projects-grid .mobile-only { display: flex !important; flex-direction: column; }
    .projects-grid .desktop-only { display: none !important; }
}

@media (min-width: 769px) {
    .projects-grid .mobile-only { display: none !important; }
    .projects-grid .desktop-only { display: flex !important; }
}

/* Global Resets and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Accessibility utilities */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: #fff;
    padding: 8px 16px;
    z-index: 2000;
    border-radius: 0 0 6px 0;
    text-decoration: none;
    font-weight: 600;
    transition: top 0.3s ease;
}
.skip-link:focus {
    top: 0;
}

/* Improve default focus outline for interactive elements */
a:focus, button:focus, input:focus, textarea:focus {
    outline: 2px dashed var(--primary-color);
    outline-offset: 3px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    animation: fadeIn 1s ease-in;
}

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

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    z-index: 1000;
    background: rgba(12, 12, 24, 0.85);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    padding: 0.75rem 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.logo-img {
    max-height: 50px;
    transition: max-height 0.3s ease;
}

.navbar.scrolled .logo-img {
    max-height: 40px;
}

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

.nav-links li {
    margin: 0 1.5rem;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color var(--transition-speed);
    position: relative;
    padding-bottom: 5px;
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    transition: width var(--transition-speed);
}

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

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

.burger div {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px;
    transition: all 0.3s ease;
}

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

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 4rem;
}

.hero-text {
    max-width: 600px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.8);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: inline-block;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

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

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.hero-image {
    text-align: center;
}

.profile-image {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--primary-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(74, 158, 255, 0.3);
}

.social-links {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

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

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

/* Sections */
.featured-projects-section, .expertise-section, .education-section {
    padding: 80px 0;
}

h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 3rem;
    color: var(--text-color);
    position: relative;
    padding-bottom: 1rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--primary-color);
}

h2 i {
    margin-right: 10px;
    color: var(--primary-color);
}

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

/* Make entire project card clickable (anchor styled as block) */
.project-card {
    background: var(--card-bg-color);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text-color);
    position: relative;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
}

.project-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

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

.project-card p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1.5rem;
}

/* Call to action inside card */
.project-cta {
    margin-top: auto;
    font-weight: 600;
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.3s ease, transform 0.3s ease;
}
.project-card:hover .project-cta i,
.project-card:focus .project-cta i {
    transform: translateX(5px);
}
.project-card:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
}

/* Expertise Section */
.expertise-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.expertise-card {
    background: var(--card-bg-color);
    border-radius: 15px;
    padding: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

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

.expertise-list {
    list-style: none;
    padding-left: 1.5rem;
}

.expertise-list li {
    margin-bottom: 1rem;
    position: relative;
}

.expertise-list li::before {
    content: '✓';
    color: var(--primary-color);
    position: absolute;
    left: -1.5rem;
}

.skill-groups h4 {
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.skill-tags {
    color: rgba(255, 255, 255, 0.8);
}

/* Education Timeline */
.education-timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.education-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary-color);
    transform: translateX(-50%);
}

.timeline-item {
    padding: 1rem 3rem;
    position: relative;
    width: 50%;
}

.timeline-item:nth-child(odd) {
    left: 0;
    padding-left: 0;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-dot {
    width: 20px;
    height: 20px;
    background: var(--background-color);
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    position: absolute;
    top: 20px;
    z-index: 1;
}

.timeline-item:nth-child(odd) .timeline-dot {
    right: -10px;
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -10px;
}

.timeline-content {
    background: var(--card-bg-color);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-year {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.timeline-content h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.timeline-content h4 {
    font-size: 1rem;
    font-weight: normal;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
}

.focus {
    font-size: 0.9rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.6);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 50px;
    background: rgba(20, 20, 40, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    transform: translateY(20px);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--secondary-color);
}

/* Contact Form */
.contact-section {
    padding: 80px 0;
    background: var(--card-bg-color);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-form {
    max-width: 700px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

/* Scroll Down Arrow */
.scroll-down {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 2rem;
    animation: bounce 2s infinite;
    cursor: pointer;
    z-index: 10;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-20px);
    }
    60% {
        transform: translateX(-50%) translateY(-10px);
    }
}

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

    .hero-image {
        order: -1;
        margin-bottom: 2rem;
    }

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

    .expertise-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero-section {
        min-height: auto;
        padding-top: 100px;
        padding-bottom: 60px;
    }

    .scroll-down {
        display: none;
    }

    .nav-links {
        position: fixed;
        right: 0;
        top: 0;
        height: 100vh;
        background: var(--background-color);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 60%;
        display: flex;
        transform: translateX(100%);
        transition: transform 0.5s ease-in;
        z-index: 1001;
    }

    .nav-links li {
        margin: 2rem 0;
    }

    .burger {
        display: block;
    }

    .hero-title {
        font-size: 2.5rem;
    }

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

    .education-timeline::before {
        display: none; /* Hide timeline on mobile */
    }

    .timeline-item, .timeline-item:nth-child(even) {
        width: 100%;
        left: 0;
        padding: 0;
        margin-bottom: 1.5rem;
        text-align: left;
    }

    .timeline-dot {
        display: none; /* Hide dots on mobile */
    }

    .timeline-content {
        box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    }
}

.nav-links.nav-active {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    background: var(--background-color);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60%;
    display: flex;
    transform: translateX(0%);
    transition: transform 0.5s ease-in;
}

.burger.toggle .line1 {
    transform: rotate(-45deg) translate(-5px, 6px);
}
.burger.toggle .line2 {
    opacity: 0;
}
.burger.toggle .line3 {
    transform: rotate(45deg) translate(-5px, -6px);
}
