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

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e0;
    --accent: #1a202c;
    --highlight: #0d9488;
    --highlight-soft: #f0fdfa;
    --shadow: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --border-color: #30363d;
    --border-hover: #484f58;
    --accent: #58a6ff;
    --highlight: #2dd4bf;
    --highlight-soft: #0f2d2b;
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 4rem;
}

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

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-bottom: 1.5rem;
    border: 3px solid #e2e8f0;
}

h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1a202c;
}

.tagline {
    font-size: 1.2rem;
    color: #4a5568;
    margin-bottom: 1rem;
    font-weight: 400;
}

.bio {
    font-size: 1rem;
    color: #4a5568;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.social-links a {
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.social-links a:hover {
    color: #2d3748;
    background-color: #f7fafc;
}

.resume-link {
    background-color: #ed64a6 !important;
    color: white !important;
    cursor: pointer;
}

.resume-link:hover {
    background-color: #d53f8c !important;
    color: white !important;
}

/* Main Content */
main {
    margin-bottom: 4rem;
}

section {
    margin-bottom: 5rem;
}

h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1a202c;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.section-desc {
    color: #4a5568;
    margin-bottom: 2.5rem;
    font-style: italic;
}

/* Detailed Project Cards */
.project-detailed {
    background: #f8fafc;
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 3rem;
    transition: all 0.3s ease;
}

.project-detailed:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.project-header h3 {
    font-size: 1.5rem;
    margin: 0;
}

.project-header h3 a {
    color: #2d3748;
    text-decoration: none;
    font-weight: 600;
}

.project-header h3 a:hover {
    color: #4299e1;
}

.demo-link {
    background: #48bb78;
    color: white !important;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.75rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.demo-link:hover {
    background: #38a169;
    color: white !important;
}

.project-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.stars,
.year {
    font-size: 0.9rem;
    color: #718096;
    font-weight: 500;
}

.project-summary {
    color: #4a5568;
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

/* Image Grid Styles - Vertical Stack Like README */
.project-images-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem 0;
}

.project-images-grid img {
    width: 100%;
    max-height: 450px;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: white;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-images-grid img:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Single Image */
.project-image {
    margin: 2rem 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.project-image img {
    width: 100%;
    height: auto;
    display: block;
    background: white;
}

.tech-details {
    margin: 2rem 0;
}

.tech-details h4 {
    color: #2d3748;
    font-size: 1.1rem;
    margin: 1.5rem 0 1rem 0;
    font-weight: 600;
}

.tech-details ul {
    list-style: none;
    padding: 0;
}

.tech-details li {
    color: #4a5568;
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.7;
}

.tech-details li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: #4299e1;
    font-weight: bold;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.metric {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.metric-value {
    display: block;
    font-size: clamp(0.9rem, 3vw, 1.5rem);
    font-weight: 700;
    color: #4299e1;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    line-height: 1.2;
}

.metric-label {
    display: block;
    font-size: 0.85rem;
    color: #718096;
    font-weight: 500;
}

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

.project-card {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--highlight);
}

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

.project-card h3 a {
    color: #2d3748;
    text-decoration: none;
    font-weight: 600;
}

.project-card h3 a:hover {
    color: #4299e1;
}

.project-card p {
    color: #4a5568;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.tech-stack {
    font-size: 0.85rem;
    color: #718096;
    font-weight: 500;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

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

.skill-category {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--highlight);
}

.skill-category h3 {
    color: #2d3748;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

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

.skill-tags span {
    background: white;
    color: #4a5568;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.skill-tags span:hover {
    background: #4299e1;
    color: white;
    border-color: #4299e1;
}

.skill-tags span.skill-primary {
    background: var(--highlight-soft);
    color: var(--highlight);
    border-color: var(--highlight);
    font-weight: 600;
}

/* Experience Section */
.experience-item {
    background: #f7fafc;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid #805ad5;
}

.exp-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.exp-header h3 {
    color: #1a202c;
    margin: 0;
    font-size: 1.2rem;
}

.company {
    color: #805ad5;
    font-weight: 600;
}

.duration {
    color: #718096;
    font-size: 0.9rem;
    margin-left: auto;
}

.experience-item p {
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.achievements {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.achievement {
    background: white;
    color: #805ad5;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
}

/* Achievements Section */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.achievement-card {
    background: var(--bg-primary);
    padding: 2rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    color: var(--text-primary);
    transition: all 0.25s ease;
}

.achievement-card:hover {
    border-color: var(--highlight);
    box-shadow: 0 6px 20px var(--shadow);
    transform: translateY(-2px);
}

.achievement-number {
    font-size: 2.25rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1;
}

.achievement-number .accent {
    color: var(--highlight);
    font-weight: 500;
    margin-left: 0.15em;
}

.achievement-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Education Section */
.education-item {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid #48bb78;
}

.education-item h3 {
    color: #1a202c;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.institution {
    color: #48bb78;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.coursework {
    color: #4a5568;
    line-height: 1.7;
    margin-top: 1rem;
}

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

.blog-card {
    background: #f0f4f8;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #3182ce;
}

.blog-card h3 {
    margin-bottom: 1rem;
}

.blog-card h3 a {
    color: #2d3748;
    text-decoration: none;
    font-weight: 600;
}

.blog-card h3 a:hover {
    color: #3182ce;
}

.blog-card p {
    color: #4a5568;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.status {
    background: #fed7d7;
    color: #c53030;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Testimonial Section */
.testimonial-section {
    margin-bottom: 3rem;
}

.testimonial {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 12px;
    border-left: 4px solid #4299e1;
}

.testimonial blockquote {
    font-size: 1.05rem;
    color: #4a5568;
    line-height: 1.8;
    font-style: italic;
    margin: 0 0 1.5rem 0;
}

.testimonial-author {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.testimonial-author strong {
    color: #1a202c;
    font-size: 1rem;
}

.testimonial-author span {
    color: #718096;
    font-size: 0.9rem;
}

.certificate-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.cert-link {
    color: #4299e1;
    font-size: 0.9rem;
    text-decoration: none;
    font-weight: 500;
}

.cert-link:hover {
    text-decoration: underline;
}

/* Contact Section */
.contact-section {
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.contact-note {
    color: #1a202c;
    font-size: 1.1rem;
    font-weight: 500;
    max-width: 600px;
    margin: 0 auto;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid #e2e8f0;
    color: #718096;
}

footer a {
    color: #4a5568;
    text-decoration: none;
}

footer a:hover {
    color: #2d3748;
}

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

    h1 {
        font-size: 2rem;
    }

    .tagline {
        font-size: 1.1rem;
    }

    .social-links {
        gap: 1rem;
    }

    .project-detailed {
        padding: 1.5rem;
    }

    .project-header {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .project-images-grid img {
        height: 200px;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .project-grid,
    .skills-grid,
    .achievements-grid,
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .exp-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .duration {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .avatar {
        width: 100px;
        height: 100px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .social-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    .project-images-grid img {
        height: 180px;
    }

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

    .achievement-number {
        font-size: 2rem;
    }
}

/* Navigation Bar */
.main-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    padding: 1rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.nav-link {
    text-decoration: none;
    color: #4a5568;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.85rem 0;
    position: relative;
    transition: color 0.2s ease;
}

.nav-short {
    display: none;
}

.nav-link:hover {
    color: #1a202c;
}

.nav-link.active {
    color: #1a202c;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #1a202c;
}

/* Preview Cards for Home Page */
.quick-links {
    margin-bottom: 4rem;
}

.preview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.preview-card {
    display: block;
    padding: 1.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    position: relative;
}

.preview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e0;
}

.preview-icon {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.preview-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1a202c;
}

.preview-card p {
    font-size: 0.9rem;
    color: #4a5568;
    line-height: 1.5;
}

.preview-arrow {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.preview-card:hover .preview-arrow {
    transform: translateY(-50%) translateX(4px);
}

/* Fade-in Animation */
.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered animation delays */
.fade-in:nth-child(1) {
    animation-delay: 0.1s;
}

.fade-in:nth-child(2) {
    animation-delay: 0.2s;
}

.fade-in:nth-child(3) {
    animation-delay: 0.3s;
}

.fade-in:nth-child(4) {
    animation-delay: 0.4s;
}

.fade-in:nth-child(5) {
    animation-delay: 0.5s;
}

.fade-in:nth-child(6) {
    animation-delay: 0.6s;
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #4a5568;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #1a202c;
}

/* Responsive Navigation */
@media (max-width: 480px) {
    .main-nav {
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.85rem;
    }

    .nav-full {
        display: none;
    }

    .nav-short {
        display: inline;
    }

    .preview-cards {
        grid-template-columns: 1fr;
    }
}

/* Dark Mode Toggle */
.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 100;
}

.theme-toggle:hover {
    border-color: var(--border-hover);
    transform: scale(1.05);
}

/* Featured Project Preview */
.featured-preview {
    margin-bottom: 3rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.featured-preview:hover {
    border-color: var(--highlight);
    box-shadow: 0 8px 28px var(--shadow);
    transform: translateY(-3px);
}

.featured-preview h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.featured-preview h3 a {
    color: inherit;
    text-decoration: none;
}

.featured-preview h3 a:hover {
    color: var(--accent);
}

.preview-media {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.preview-caption {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.preview-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.preview-link:hover {
    text-decoration: underline;
}

/* Featured Previews Grid - Stacked Layout */
.featured-previews-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.featured-preview .preview-media {
    width: 100%;
    max-height: 350px;
    object-fit: contain;
    background: #000;
}

/* Update existing elements to use CSS variables */
.preview-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.preview-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 4px 12px var(--shadow);
}

.preview-card h3 {
    color: var(--text-primary);
}

.preview-card p {
    color: var(--text-secondary);
}

.preview-arrow {
    color: var(--text-muted);
}

.main-nav {
    border-bottom: 1px solid var(--border-color);
}

.nav-link {
    color: var(--text-secondary);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    background-color: var(--accent);
}

footer {
    color: var(--text-muted);
}

footer a {
    color: var(--text-secondary);
}

/* OSS Contributions */
.oss-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.oss-card {
    background: var(--highlight-soft);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--highlight);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    transition: all 0.2s ease;
}

.oss-card:hover {
    box-shadow: 0 4px 16px var(--shadow);
    transform: translateY(-2px);
}

.oss-pr {
    display: inline-block;
    background: var(--highlight);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    margin-bottom: 0.6rem;
    letter-spacing: 0.02em;
}

.oss-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.oss-card h3 a {
    color: var(--text-primary);
    text-decoration: none;
}

.oss-card h3 a:hover {
    color: var(--highlight);
}

.oss-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Demo Link - Warm Amber/Gold Style */
.demo-amber {
    background: linear-gradient(135deg, #d69e2e 0%, #b7791f 100%);
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(214, 158, 46, 0.3);
}

.demo-amber:hover {
    background: linear-gradient(135deg, #ecc94b 0%, #d69e2e 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(214, 158, 46, 0.4);
}

.preview-link.demo-amber {
    margin-top: 0.5rem;
}
