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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #e0e0e0;
    background-color: #0a0a0a;
    overflow-x: hidden;
}

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

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 1000;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-brand a {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 40px;
}

.nav-link {
    color: #b0b0b0;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #ffffff;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #ffffff;
    transition: width 0.3s ease;
}

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

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    touch-action: manipulation;
}

.hamburger:hover,
.hamburger:focus {
    background-color: rgba(255, 255, 255, 0.1);
}

.bar {
    width: 25px;
    height: 3px;
    background: #ffffff;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    position: relative;
    padding-top: 70px;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23333" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
    padding: 40px 0;
}

.hero-name {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 20px;
    letter-spacing: -2px;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: #b0b0b0;
    margin-bottom: 30px;
    font-weight: 400;
}

.hero-description {
    font-size: 1.15rem;
    color: #a0a0a0;
    max-width: 650px;
    margin: 0 auto 40px;
    line-height: 1.8;
    font-weight: 400;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-block;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: #ffffff;
    color: #0a0a0a;
}

.btn-primary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: #ffffff;
    border: 2px solid #ffffff;
}

.btn-secondary:hover {
    background: #ffffff;
    color: #0a0a0a;
    transform: translateY(-2px);
}

/* Section Styles */
section {
    padding: 100px 0;
}

section:not(.hero-section) {
    scroll-margin-top: 90px;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    margin-bottom: 60px;
    letter-spacing: -1px;
}

/* Projects Section */
.projects-section {
    background: #111111;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 50px;
    margin-top: 60px;
}

.project-card {
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #2a2a2a;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.project-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.project-image svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-content {
    padding: 35px;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 15px;
}

.project-description {
    color: #b0b0b0;
    margin-bottom: 25px;
    line-height: 1.6;
}

.project-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.project-role {
    color: #e0e0e0;
    font-size: 0.95rem;
}

.project-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    background: #2a2a2a;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #404040;
}

/* Internship Section */
.internship-section {
    background: #0a0a0a;
}

.experience-card {
    max-width: 800px;
    margin: 0 auto;
    background: #1a1a1a;
    border-radius: 12px;
    padding: 40px;
    border: 1px solid #2a2a2a;
}

.experience-header {
    margin-bottom: 30px;
    text-align: center;
}

.experience-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 10px;
}

.experience-company {
    display: block;
    font-size: 1.2rem;
    color: #b0b0b0;
    margin-bottom: 5px;
}

.experience-duration {
    color: #888;
    font-size: 1rem;
}

.experience-description {
    color: #b0b0b0;
    margin-bottom: 30px;
    line-height: 1.7;
    font-size: 1.05rem;
}

.experience-role,
.experience-learning {
    margin-bottom: 25px;
}

.experience-role h4,
.experience-learning h4 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.experience-role ul,
.experience-learning ul {
    color: #b0b0b0;
    padding-left: 20px;
}

.experience-role li,
.experience-learning li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.experience-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

/* About Section */
.about-section {
    background: #111111;
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 50px;
}

.about-text p {
    color: #b0b0b0;
    margin-bottom: 25px;
    line-height: 1.7;
    font-size: 1.05rem;
}

.about-skills h3 {
    color: #ffffff;
    font-size: 1.5rem;
    margin-bottom: 30px;
    text-align: center;
}

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

.skill-category h4 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Footer */
.footer {
    background: #0a0a0a;
    padding: 40px 0;
    border-top: 1px solid #2a2a2a;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-content p {
    color: #888;
}

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

.footer-links a {
    color: #b0b0b0;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #ffffff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .nav-container {
        padding: 0 20px;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        padding: 40px 0;
        gap: 25px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

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

    .hamburger {
        display: flex;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero-content {
        padding: 60px 0 40px;
    }

    .hero-name {
        font-size: clamp(2.5rem, 12vw, 4rem);
        margin-bottom: 25px;
    }

    .hero-subtitle {
        font-size: clamp(1rem, 4vw, 1.3rem);
        margin-bottom: 25px;
    }

    .hero-description {
        font-size: 1rem;
        margin-bottom: 35px;
        padding: 0 10px;
    }

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

    .project-content {
        padding: 25px;
    }

    .project-title {
        font-size: 1.3rem;
    }

    .project-description {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .btn {
        width: 220px;
        text-align: center;
        padding: 14px 30px;
        font-size: 1rem;
    }

    .experience-card {
        padding: 30px 25px;
    }

    .experience-title {
        font-size: 1.5rem;
    }

    .experience-company {
        font-size: 1.1rem;
    }

    .about-content {
        gap: 40px;
    }

    .about-text p {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 25px;
    }

    .footer-content {
        text-align: center;
        flex-direction: column;
        gap: 15px;
    }

    section {
        padding: 80px 0;
    }

    .section-title {
        font-size: clamp(2rem, 8vw, 2.8rem);
        margin-bottom: 50px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 18px;
    }

    .nav-container {
        padding: 0 18px;
    }

    .hero-content {
        padding: 50px 0 30px;
    }

    .hero-name {
        font-size: clamp(2rem, 14vw, 3.5rem);
        letter-spacing: -1px;
    }

    .hero-subtitle {
        font-size: clamp(0.9rem, 5vw, 1.2rem);
        padding: 0 10px;
    }

    .hero-description {
        font-size: 0.95rem;
        padding: 0 5px;
        max-width: 100%;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .project-content {
        padding: 20px;
    }

    .project-title {
        font-size: 1.2rem;
    }

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

    .skill-tag {
        font-size: 0.8rem;
        padding: 5px 10px;
    }

    .experience-card {
        padding: 25px 18px;
    }

    .experience-title {
        font-size: 1.3rem;
    }

    .experience-company {
        font-size: 1rem;
    }

    .about-text p {
        font-size: 0.95rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .skill-category h4 {
        font-size: 1rem;
    }

    .section-title {
        font-size: clamp(1.8rem, 10vw, 2.5rem);
        margin-bottom: 40px;
    }

    section {
        padding: 60px 0;
    }

    .btn {
        width: 200px;
        padding: 12px 25px;
        font-size: 0.95rem;
    }

    .nav-menu {
        padding: 35px 0;
        gap: 20px;
    }

    .nav-link {
        font-size: 1.1rem;
        padding: 10px 0;
    }
}

/* Scroll animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

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

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #404040;
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Desktop optimizations */
@media (min-width: 1200px) {
    .container {
        max-width: 1300px;
        padding: 0 40px;
    }

    .nav-container {
        max-width: 1300px;
        padding: 0 40px;
    }

    .hero-name {
        font-size: clamp(4rem, 7vw, 7rem);
    }

    .hero-subtitle {
        font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    }

    .hero-description {
        font-size: 1.2rem;
        max-width: 700px;
    }

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

    .project-content {
        padding: 40px;
    }

    .section-title {
        font-size: clamp(3rem, 4vw, 4rem);
        margin-bottom: 80px;
    }

    .experience-card {
        padding: 50px;
        max-width: 900px;
    }

    .about-content {
        gap: 60px;
    }

    .skills-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 40px;
    }
}

/* Performance optimizations */
.project-card,
.experience-card,
.skill-tag,
.btn {
    will-change: transform;
}

/* Improved focus states for accessibility */
.nav-link:focus,
.btn:focus,
.skill-tag:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Better hover effects */
.project-card {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-tag {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Technical Writeup Styles */
.technical-writeup {
    margin-top: 25px;
    border-top: 1px solid #333;
    padding-top: 20px;
}

.technical-toggle {
    width: 100%;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 1px solid #404040;
    color: #e0e0e0;
    padding: 15px 20px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.technical-toggle:hover {
    background: linear-gradient(135deg, #20254a, #1e2951);
    border-color: #555;
    transform: translateY(-1px);
}

.technical-toggle:active {
    transform: translateY(0);
}

.technical-toggle i {
    margin-right: 10px;
}

.toggle-icon {
    transition: transform 0.3s ease;
    margin-left: 10px !important;
    margin-right: 0 !important;
}

.technical-toggle.active .toggle-icon {
    transform: rotate(180deg);
}

.technical-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out;
    background: rgba(20, 20, 20, 0.5);
    border-radius: 0 0 8px 8px;
    border: 1px solid #404040;
    border-top: none;
}

.technical-content.active {
    max-height: 2000px;
    padding: 25px;
}

.technical-section {
    margin-bottom: 25px;
}

.technical-section:last-child {
    margin-bottom: 0;
}

.technical-section h4 {
    color: #ffffff;
    font-size: 1.1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    font-weight: 600;
}

.technical-section h4 i {
    margin-right: 10px;
    color: #4a9eff;
    font-size: 1rem;
}

.technical-section h5 {
    color: #d0d0d0;
    font-size: 1rem;
    margin: 15px 0 10px 0;
    font-weight: 500;
}

.technical-section p {
    color: #b0b0b0;
    line-height: 1.6;
    margin-bottom: 15px;
}

.technical-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.technical-section li {
    color: #a0a0a0;
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
    line-height: 1.6;
}

.technical-section li:before {
    content: "▸";
    color: #4a9eff;
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0;
}

.technical-section strong {
    color: #e0e0e0;
    font-weight: 600;
}

/* Mobile responsiveness for technical writeup */
@media (max-width: 768px) {
    .technical-toggle {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .technical-content.active {
        padding: 20px;
    }
    
    .technical-section h4 {
        font-size: 1rem;
    }
    
    .technical-section {
        margin-bottom: 20px;
    }
}
