/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light mode variables */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --bg-card-secondary: #f8f9fa;
    --text-primary: #1a1a1a;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --accent-color: #1a1a1a;
    --link-color: #1a1a1a;
    --button-bg: #1a1a1a;
    --button-text: #ffffff;
}

body.dark-mode {
    /* Dark mode variables */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d3748;
    --bg-card: #4a5568;
    --bg-card-secondary: #2d3748;
    --text-primary: #e9ecef;
    --text-secondary: #e2e8f0;
    --text-muted: #cbd5e0;
    --border-color: #4a5568;
    --accent-color: #4299e1;
    --link-color: #4299e1;
    --button-bg: #4299e1;
    --button-text: #1a1a1a;
}

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

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

/* Typography */
h1, h2, h3 {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

h1 {
    font-size: 3rem;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.25rem;
}

/* Top Navigation */
.top-nav {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.nav-links {
    display: flex;
    justify-content: flex-end;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    transition: color 0.2s ease;
}

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

.theme-toggle {
    background: none;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    line-height: 1;
    display: flex;
    align-items: center;
}

.theme-toggle:hover {
    background-color: var(--bg-secondary);
}

.theme-toggle-icon {
    display: inline-block;
    transition: filter 0.2s ease;
}

/* Glow effect for sun icon in dark mode */
body.dark-mode .theme-toggle-icon {
    filter: drop-shadow(0 0 4px #fbbf24) drop-shadow(0 0 8px #f59e0b);
}

/* Buttons */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--button-bg);
    color: var(--button-text);
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background-color: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

.btn-secondary:hover {
    background-color: var(--accent-color);
    color: var(--button-text);
}

/* Hero Section */
.hero {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 4rem 0;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.hero-text {
    flex: 1;
}

.hero-photo {
    flex-shrink: 0;
}

.profile-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 400;
    color: var(--text-muted);
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

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

/* Highlights Section */
.highlights {
    padding: 3rem 0;
    background-color: white;
    border-bottom: 1px solid #e9ecef;
}

.highlights h2 {
    text-align: center;
    margin-bottom: 2rem;
}

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

.highlight-item {
    background: var(--bg-card-secondary);
    padding: 1.5rem;
    border-radius: 4px;
    text-align: center;
    border: 1px solid var(--border-color);
}

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

.highlight-item p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.highlight-link {
    display: inline-block;
    margin-top: 0.75rem;
    color: var(--link-color);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-bottom: 1px solid var(--link-color);
}

.highlight-link:hover {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/* Patents Section */
.patents {
    padding: 3rem 0;
    background-color: white;
    border-bottom: 1px solid #e9ecef;
}

.patents h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.patents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.patent-item {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    border-left: 3px solid #1a1a1a;
}

.patent-item h3 {
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.patent-number {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.patent-number a {
    color: #1a1a1a;
    text-decoration: none;
    border-bottom: 1px solid #1a1a1a;
}

.patent-number a:hover {
    color: #495057;
    border-bottom-color: #495057;
}

.patent-description {
    color: #495057;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0;
}

/* Experience Section */
.experience {
    padding: 3rem 0;
    background-color: #f8f9fa;
}

.experience h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.experience-timeline {
    max-width: 900px;
    margin: 0 auto;
}

.experience-item {
    background: white;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    border-left: 3px solid #1a1a1a;
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.experience-header h3 {
    margin-bottom: 0.25rem;
    flex: 1;
    font-size: 1.1rem;
}

.company {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 1rem;
}

.duration {
    color: #6c757d;
    font-size: 0.85rem;
    white-space: nowrap;
}

.experience-description {
    color: #495057;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.4;
}

.experience-highlights {
    list-style: none;
    margin-bottom: 1rem;
}

.experience-highlights li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.4rem;
    color: #495057;
    font-size: 0.9rem;
    line-height: 1.4;
}

.experience-highlights li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #1a1a1a;
    font-weight: bold;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.tech-stack:before {
    content: "Tech: ";
    font-weight: 600;
    color: #495057;
}

/* Open Source Section */
.open-source {
    padding: 3rem 0;
    background-color: #f8f9fa;
}

.open-source h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.open-source-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.open-source-item {
    background: white;
    padding: 1.5rem;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    border-left: 3px solid #1a1a1a;
}

.open-source-item h3 {
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.role {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.description {
    color: #495057;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.github-link {
    color: #1a1a1a;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 1px solid #1a1a1a;
}

.github-link:hover {
    color: #495057;
    border-bottom-color: #495057;
}

/* Speaking Section */
.speaking {
    padding: 3rem 0;
    background-color: white;
    border-bottom: 1px solid #e9ecef;
}

.speaking h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.speaking-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: start;
}

.speaking-highlights {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.speaking-item {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    border-left: 3px solid #1a1a1a;
}

.speaking-item h3 {
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.talk-title {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    font-style: italic;
}

.talk-description {
    color: #495057;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0;
}

.speaking-topics {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    height: fit-content;
}

.speaking-topics h3 {
    color: #1a1a1a;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.speaking-topics ul {
    list-style: none;
    padding-left: 0;
}

.speaking-topics li {
    color: #495057;
    font-size: 0.9rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #e9ecef;
    position: relative;
    padding-left: 1.25rem;
}

.speaking-topics li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #1a1a1a;
    font-weight: bold;
}

.speaking-topics li:last-child {
    border-bottom: none;
}

/* Writing Section */
.writing {
    padding: 3rem 0;
    background-color: #f8f9fa;
}

.writing h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.writing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.writing-item {
    background: white;
    padding: 1.5rem;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    border-left: 3px solid #1a1a1a;
}

.writing-item h3 {
    color: #1a1a1a;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.writing-description {
    color: #495057;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.writing-link {
    color: #1a1a1a;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 1px solid #1a1a1a;
}

.writing-link:hover {
    color: #495057;
    border-bottom-color: #495057;
}

/* Skills Section */
.skills {
    padding: 3rem 0;
    background-color: white;
    border-bottom: 1px solid #e9ecef;
}

.skills h2 {
    text-align: center;
    margin-bottom: 2rem;
}

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

.skill-category {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.skill-category h3 {
    margin-bottom: 1rem;
    color: #1a1a1a;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.5rem;
    font-size: 1.1rem;
}

.skill-category ul {
    list-style: none;
}

.skill-category li {
    padding: 0.4rem 0;
    color: #495057;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9rem;
}

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

/* Social Proof Section */
.social-proof {
    padding: 3rem 0;
    background-color: white;
    border-bottom: 1px solid #e9ecef;
}

.social-proof h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.testimonial-item {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    border-left: 3px solid #1a1a1a;
}

.testimonial-text {
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    font-style: italic;
}

.testimonial-author {
    color: #6c757d;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0;
}

/* Contact Section */
.contact {
    padding: 3rem 0;
    background-color: #f8f9fa;
    color: #1a1a1a;
}

.contact h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.contact-description {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: #6c757d;
}

.contact-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.contact-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem;
    background: white;
    border-radius: 4px;
    text-decoration: none;
    color: #1a1a1a;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.contact-link:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-color);
}

.contact-link span:first-child {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.contact-link span:last-child {
    font-size: 1rem;
    color: var(--text-primary);
}

/* Footer */
footer {
    background-color: #1a1a1a;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
}

footer p {
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Clean up individual component colors using variables */
.highlights {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.patents {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.experience {
    background-color: var(--bg-secondary);
}

.open-source {
    background-color: var(--bg-secondary);
}

.speaking {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.writing {
    background-color: var(--bg-secondary);
}

.skills {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.social-proof {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.contact {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

/* Card components */
.patent-item,
.experience-item,
.open-source-item,
.speaking-item,
.writing-item,
.skill-category,
.testimonial-item,
.contact-link,
.speaking-topics {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

/* Ensure all headings use primary text color */
.patent-item h3,
.experience-item h3,
.open-source-item h3,
.speaking-item h3,
.writing-item h3,
.skill-category h3,
.testimonial-item h3,
.speaking-topics h3 {
    color: var(--text-primary);
}

/* Text colors */
.patent-description,
.experience-description,
.experience-highlights li,
.description,
.talk-description,
.writing-description,
.skill-category li,
.testimonial-text,
.speaking-topics li,
.tech-stack,
.tech-stack:before,
.role,
.talk-title,
.testimonial-author,
.patent-number,
.company,
.duration,
.contact-description {
    color: var(--text-secondary);
}

.experience-highlights li:before,
.speaking-topics li:before {
    color: var(--text-secondary);
}

/* Links */
.patent-number a,
.github-link,
.writing-link {
    color: var(--link-color);
    border-bottom-color: var(--link-color);
}

.patent-number a:hover,
.github-link:hover,
.writing-link:hover {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        max-width: 280px;
    }
    
    .experience-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .highlights-grid {
        grid-template-columns: 1fr;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-links {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .nav-links {
        justify-content: center;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .highlights, .patents, .experience, .open-source, .speaking, .writing, .skills, .social-proof, .contact {
        padding: 2rem 0;
    }
    
    .speaking-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
    
    .profile-photo {
        width: 150px;
        height: 150px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2.5rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .experience-item {
        padding: 1.25rem;
    }
    
    .highlights, .experience, .skills, .contact {
        padding: 1.5rem 0;
    }
}