/* Reset and Base Styles */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&display=swap');

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px; /* Account for fixed header + some extra space */
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #fff;
    background: #1a1a1a;
    overflow-x: hidden;
}

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

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all 0.3s ease;
}

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

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-logo:hover {
    color: #22c55e;
}

.nav-profile-pic {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

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

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

.nav-link:hover {
    color: #fff;
}

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

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

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #1a222c; /*linear-gradient(135deg, #1a222c 0%, #404057 50%, #3a3a40 100%);*/
    overflow: hidden;
}

.particles-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-content {
    text-align: center;
    z-index: 2;
    max-width: 800px;
    padding: 0 20px;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 600;
    color: #fff;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.highlight {
    background: linear-gradient(135deg, #22c55e, #16a34a, #15803d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    color: #cbd5e1;
    margin-bottom: 0.5rem;
    font-weight: 300;
}

.headshot {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
}

.hero-animated-text {
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    color: #cbd5e1;
    margin-bottom: 2rem;
    font-weight: 400;
    min-height: 1.5em;
    display: flex;
    justify-content: center;
    align-items: center;
}

#animated-skill {
    font-family: 'Monaco', 'Menlo', monospace;
    min-height: 1.5em;
    min-width: 1ch;
    display: inline-block;
}

#animated-skill::after {
    content: '\200B'; /* Zero-width space to maintain layout when empty */
}

.hero-description {
    font-size: 1.1rem;
    color: #999;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.2);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(107, 114, 128, 0.3);
}

.cta-arrow {
    transition: transform 0.3s ease;
}

.cta-button:hover .cta-arrow {
    transform: translateY(2px);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.scroll-arrow {
    font-size: 2rem;
    color: #cbd5e1;
    animation: bounce 2s infinite;
    cursor: pointer;
    transition: color 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.scroll-arrow:hover {
    color: #22c55e;
    text-decoration: none;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    40% {
        transform: translateY(-8px);
        opacity: 1;
    }
    60% {
        transform: translateY(-4px);
        opacity: 0.8;
    }
}

/* Section Styles */
.experience, .blog {
    padding: 60px 0;
    background: #111;
}

.experience {
    background: #0a0a0a;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.2rem;
    color: #999;
    text-align: center;
    margin-bottom: 4rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Experience Toggle */
.experience-toggle-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.experience-toggle-btn {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: #fff;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.2);
}

.experience-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(107, 114, 128, 0.3);
}

.toggle-icon {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.experience-toggle-btn.expanded .toggle-icon {
    transform: rotate(180deg);
}

/* Experience Cards */
.experience-grid {
    display: grid;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
    transition: all 0.4s ease;
    overflow: hidden;
}

.experience-grid.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
}

.experience-grid.expanded {
    max-height: 2000px;
    opacity: 1;
    margin-top: 2rem;
    margin-bottom: 0;
}

.experience-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.experience-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.experience-header {
    position: relative;
    margin-bottom: 1rem;
    padding-right: 120px;
}

.experience-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.5rem;
}

.experience-company {
    color: #22c55e;
    font-weight: 500;
}

.experience-period {
    position: absolute;
    top: 0;
    right: 0;
    color: #999;
    font-size: 0.9rem;
    white-space: nowrap;
}

.experience-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.experience-content.expanded {
    max-height: 500px;
}

.experience-description {
    color: #ccc;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.experience-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.expand-icon {
    position: absolute;
    top: 1.5rem;
    right: 0;
    color: #666;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.experience-card.expanded .expand-icon {
    transform: rotate(180deg);
}

/* Blog Post Page */
.blog-post-section {
    padding: 120px 0 60px;
    background: #111;
    min-height: 100vh;
}

.blog-post-header {
    max-width: 800px;
    margin: 0 auto 3rem auto;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #22c55e;
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 2rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #16a34a;
}

.blog-post-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.blog-post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.blog-post-date {
    color: #999;
    font-size: 0.9rem;
}

.blog-post-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.blog-post-content {
    max-width: 800px;
    margin: 0 auto;
    color: #ccc;
    line-height: 1.8;
    font-size: 1.1rem;
}

.blog-post-content h1,
.blog-post-content h2,
.blog-post-content h3,
.blog-post-content h4,
.blog-post-content h5,
.blog-post-content h6 {
    color: #fff;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.blog-post-content h1 {
    font-size: 2rem;
}

.blog-post-content h2 {
    font-size: 1.7rem;
}

.blog-post-content h3 {
    font-size: 1.4rem;
}

.blog-post-content p {
    margin-bottom: 1.5rem;
}

.blog-post-content code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
}

.blog-post-content pre {
    background: #2d2d2d !important;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-post-content pre code {
    background: none !important;
    padding: 0;
    color: inherit;
}

/* Override Prism theme for better integration */
.blog-post-content pre[class*="language-"] {
    background: #2d2d2d !important;
    color: #ccc;
}

.blog-post-content code[class*="language-"] {
    color: inherit;
}

.blog-post-content blockquote {
    border-left: 4px solid #22c55e;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #aaa;
}

.blog-post-content ul,
.blog-post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.blog-post-content li {
    margin-bottom: 0.5rem;
}

.blog-post-content img {
    display: block;
    margin: 1.5rem auto;
    max-width: 100%;
    height: auto;
}

.blog-post-content table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
}

@media (max-width: 768px) {
    .blog-post-content table {
        font-size: 0.9rem;
        overflow-x: auto;
        display: block;
        white-space: nowrap;
    }
    
    .blog-post-content th,
    .blog-post-content td {
        padding: 6px !important;
        min-width: 120px;
    }
}

/* Wrapper for tables to handle horizontal scrolling on mobile */
.blog-post-content {
    overflow-x: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.blog-post-content > * {
    max-width: 100%;
}

/* Handle wide content elements */
.blog-post-content pre,
.blog-post-content table,
.blog-post-content .wide-content {
    overflow-x: auto;
    max-width: 100%;
}

/* Force text wrapping for long words/URLs */
.blog-post-content p,
.blog-post-content li,
.blog-post-content div,
.blog-post-content span {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

/* Mobile blog grid for home page */
.blog-grid-mobile {
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* Blog Navigation Wrapper (for home page) */
.blog-nav-wrapper {
    position: relative;
    margin-top: 3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Blog Horizontal Scroll (for home page) */
.blog-scroll {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-behavior: smooth;
    flex: 1;
    /* Hide scrollbar */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.blog-scroll::-webkit-scrollbar {
    display: none; /* WebKit */
}

.blog-scroll .blog-card {
    width: 350px;
    flex-shrink: 0;
}

/* Blog Navigation Buttons */
.blog-nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.blog-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.blog-nav-btn:active {
    transform: scale(0.95);
}

.blog-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
    pointer-events: none;
}

.blog-nav-btn i {
    font-size: 1rem;
}

.blog-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    backdrop-filter: blur(10px);
    margin-top: 5px; /* Add top margin to prevent clipping */
}

.blog-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.blog-card-content {
    padding: 1.5rem;
}

.blog-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.blog-excerpt {
    color: #ccc;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.blog-date {
    color: #999;
    font-size: 0.9rem;
}

.blog-read-time {
    color: #22c55e;
    font-size: 0.9rem;
}

.blog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.blog-tag {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.blog-cta {
    text-align: center;
    margin-top: 3rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: #111;
    border-radius: 15px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    color: #999;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #fff;
}

.modal-body {
    padding: 3rem;
    color: #ccc;
    line-height: 1.7;
}

.modal-body h1, .modal-body h2, .modal-body h3 {
    color: #fff;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.modal-body h1 {
    margin-top: 0;
}

.modal-body p {
    margin-bottom: 1.5rem;
}

.modal-body code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
}

.modal-body pre {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-body pre code {
    background: none;
    padding: 0;
}

/* Footer */
.footer {
    background: #0a0a0a;
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer p {
    color: #666;
    font-size: 0.9rem;
}

/* Floating Mobile Menu Styles */
.floating-hamburger {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-around;
    width: 44px;
    height: 44px;
    padding: 8px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.floating-hamburger:hover {
    background: rgba(10, 10, 10, 0.95);
    border-color: rgba(255, 255, 255, 0.3);
}

.hamburger-line {
    width: 100%;
    height: 2px;
    background: #fff;
    transition: all 0.3s ease;
    border-radius: 1px;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(15px);
    z-index: 999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 40px;
}

.mobile-nav-link {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.5rem;
    padding: 15px 30px;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.mobile-nav-link:hover {
    color: #22c55e;
    background: rgba(255, 255, 255, 0.05);
}

/* Hamburger animation when active */
.floating-hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

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

.floating-hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-menu.active {
    display: flex;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav {
        display: none;
    }
    
    .floating-hamburger {
        display: flex;
    }
    
    .hero-content {
        padding: 0 1rem;
    }
    
    .experience, .blog {
        padding: 60px 0;
    }
    
    .experience-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .modal-body {
        padding: 2rem 1.5rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .blog-nav-wrapper {
        gap: 0.5rem;
    }
    
    .blog-nav-btn {
        width: 40px;
        height: 40px;
    }
    
    .blog-nav-btn i {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .experience-card, .blog-card {
        margin: 0 10px;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .cta-button {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .blog-nav-wrapper {
        gap: 0.25rem;
        margin-top: 2rem;
    }
    
    .blog-nav-btn {
        width: 36px;
        height: 36px;
    }
    
    .blog-nav-btn i {
        font-size: 0.8rem;
    }
}
