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

:root {
    --color-bg: #FFFFFF;
    --color-bg-alt: #F7FAFC;
    --color-text: #1A202C;
    --color-text-muted: #596776;
    --color-primary: #4A5568;
    --color-primary-dark: #2D3748;
    --color-accent: #2B7AB8;
    --color-border: #E2E8F0;

    /* Accent colors */
    --accent-qa: #4A5568;
    --accent-dev: #2B7AB8;
    --accent-data: #2F855A;
    --accent-ai: #C05621;
    --accent-leadership: #6B46C1;

    /* Proficiency colors */
    --level-expert: #1D6FA4;
    --level-expert-bg: rgba(29, 111, 164, 0.08);
    --level-expert-border: rgba(29, 111, 164, 0.3);
    --level-advanced: #2A7A4B;
    --level-advanced-bg: rgba(42, 122, 75, 0.08);
    --level-advanced-border: rgba(42, 122, 75, 0.3);
    --level-intermediate: #7A5600;
    --level-intermediate-bg: rgba(122, 86, 0, 0.08);
    --level-intermediate-border: rgba(122, 86, 0, 0.3);

    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    --max-width: 1100px;
    --nav-height: 64px;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Skip Navigation Link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 1001;
    padding: 0.75rem 1.5rem;
    background: var(--color-primary-dark);
    color: #FFFFFF;
    font-weight: 600;
    border-radius: 0 0 8px 8px;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
    color: #FFFFFF;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
}

/* Typography */
h1, h2, h3, h4 {
    line-height: 1.2;
    font-weight: 600;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    margin-bottom: 2rem;
    text-align: center;
}

h3 {
    font-size: 1.25rem;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-primary-dark);
}

/* Container */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.nav-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--color-accent);
    text-decoration: none;
}

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

.nav-links a {
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.2s ease;
}

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

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    transition: all 0.3s ease;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(var(--nav-height) + 2rem) 1.5rem 4rem;
    background: linear-gradient(135deg, #FFFFFF 0%, #EBF8FF 100%);
}

.hero-content {
    max-width: 700px;
}

.hero h1 {
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--color-text) 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.location {
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

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

/* Scroll Indicator */
.scroll-indicator {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    color: var(--color-text-muted);
    opacity: 0.6;
    transition: opacity 0.3s ease, color 0.3s ease;
    animation: bounce 2s infinite;
}

.scroll-indicator:hover {
    opacity: 1;
    color: var(--color-accent);
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

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

.btn-primary:hover {
    background: var(--color-primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 55, 72, 0.3);
}

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

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

a.btn-linkedin,
a.btn-linkedin:visited,
a.btn-linkedin:active {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--color-primary) !important;
    color: #FFFFFF !important;
    padding: 1rem 1.5rem;
    font-size: 1rem;
}

a.btn-linkedin:hover {
    background: var(--color-primary-dark) !important;
    color: #FFFFFF !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 55, 72, 0.3);
}

.btn-linkedin svg {
    flex-shrink: 0;
}

/* Sections */
.section {
    padding: 6rem 0;
}

.section-alt {
    background: var(--color-bg-alt);
}

.lead {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    max-width: 700px;
    margin: 0 auto 1.5rem;
    text-align: center;
}

#about > .container > p:not(.lead) {
    max-width: 800px;
    margin: 0 auto 1.5rem;
    text-align: center;
}

/* About Section - Photo */
.about-photo {
    display: block;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 2rem;
    border: 4px solid var(--color-accent);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* About Section - Expertise Cards with Color Accents */
.expertise-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
}

.expertise-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.expertise-card:hover,
.expertise-card:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.expertise-card:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.card-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.accent-qa { background: var(--accent-qa); }
.accent-dev { background: var(--accent-dev); }
.accent-data { background: var(--accent-data); }
.accent-ai { background: var(--accent-ai); }
.accent-leadership { background: var(--accent-leadership); }

.expertise-card h3 {
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

.expertise-card p {
    font-size: 0.95rem;
    color: var(--color-text-muted);
}

/* Timeline */
.timeline {
    width: 100%;
}

.timeline-item {
    border-bottom: 1px solid var(--color-border);
    transition: all 0.3s ease;
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-item.active {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    margin: 1rem 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.timeline-item.active + .timeline-item {
    border-top: none;
}

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    cursor: pointer;
    gap: 1rem;
    transition: padding 0.3s ease;
    user-select: none;
}

.timeline-item:not(.active) .timeline-header {
    padding-left: 0;
    padding-right: 0;
}

.timeline-header:hover {
    opacity: 0.8;
}

.timeline-title {
    flex: 1;
}

.timeline-title h3 {
    margin-bottom: 0.25rem;
    transition: font-size 0.3s ease;
}

.timeline-item.active .timeline-title h3 {
    font-size: 1.4rem;
    color: var(--color-accent);
}

.company {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.timeline-date {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.expand-icon {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--color-text-muted);
    transition: transform 0.3s ease, color 0.3s ease;
    width: 24px;
    text-align: center;
    pointer-events: none;
}

.timeline-item.active .expand-icon {
    transform: rotate(45deg);
    color: var(--color-accent);
}

.timeline-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
}

.timeline-content.expanded {
    max-height: 1200px;
    padding: 0 1.5rem 1.5rem;
}

.timeline-content ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1.25rem;
}

.timeline-content li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.timeline-content li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
    opacity: 0.6;
}

/* Job Skills Tags */
.job-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.job-skill-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 100px;
    font-weight: 500;
}

.job-skill-tag[data-level="expert"] {
    background: var(--level-expert-bg);
    color: var(--level-expert);
    border: 1px solid var(--level-expert-border);
}

.job-skill-tag[data-level="advanced"] {
    background: var(--level-advanced-bg);
    color: var(--level-advanced);
    border: 1px solid var(--level-advanced-border);
}

.job-skill-tag[data-level="intermediate"] {
    background: var(--level-intermediate-bg);
    color: var(--level-intermediate);
    border: 1px solid var(--level-intermediate-border);
}

/* Skills Section */
.proficiency-legend {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--color-text-muted);
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    padding: 0.35rem 0.75rem;
    border-radius: 100px;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    user-select: none;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.expert { background: var(--level-expert); }
.legend-dot.advanced { background: var(--level-advanced); }
.legend-dot.intermediate { background: var(--level-intermediate); }

.legend-item:hover {
    background: var(--color-bg-alt);
    border-color: var(--color-border);
}

.legend-item:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.legend-item.active-filter {
    border-color: currentColor;
}

.legend-item.active-filter.filter-expert {
    background: var(--level-expert-bg);
    border-color: var(--level-expert-border);
    color: var(--level-expert);
}

.legend-item.active-filter.filter-advanced {
    background: var(--level-advanced-bg);
    border-color: var(--level-advanced-border);
    color: var(--level-advanced);
}

.legend-item.active-filter.filter-intermediate {
    background: var(--level-intermediate-bg);
    border-color: var(--level-intermediate-border);
    color: var(--level-intermediate);
}

/* Skill tag filtering */
.skill-tag {
    transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.skill-tag.filtered-out {
    opacity: 0;
    transform: scale(0.85);
    pointer-events: none;
}

.skill-tag.filtered-hidden {
    display: none;
}

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

.skill-category:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
    border-radius: 8px;
}

.skill-category h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

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

.skill-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 500;
}

.skill-tag::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skill-tag[data-level="expert"] {
    background: var(--level-expert-bg);
    border: 1px solid var(--level-expert-border);
    color: var(--level-expert);
}

.skill-tag[data-level="expert"]::before {
    background: var(--level-expert);
}

.skill-tag[data-level="advanced"] {
    background: var(--level-advanced-bg);
    border: 1px solid var(--level-advanced-border);
    color: var(--level-advanced);
}

.skill-tag[data-level="advanced"]::before {
    background: var(--level-advanced);
}

.skill-tag[data-level="intermediate"] {
    background: var(--level-intermediate-bg);
    border: 1px solid var(--level-intermediate-border);
    color: var(--level-intermediate);
}

.skill-tag[data-level="intermediate"]::before {
    background: var(--level-intermediate);
}

.skill-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    margin-top: 2rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.contact-item a,
.contact-item p {
    font-size: 1rem;
    color: var(--color-text);
}

.linkedin-cta {
    margin-top: 0.5rem;
}

.contact-note {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-top: 1rem;
    font-style: italic;
}

/* Contact Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.form-group input,
.form-group textarea {
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: white;
    color: var(--color-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(43, 122, 184, 0.2);
}

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

/* Footer */
.footer {
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--color-border);
}

.footer p {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .job-skills {
        display: none;
    }

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

    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--color-bg);
        flex-direction: column;
        align-items: center;
        padding: 2rem;
        gap: 1.5rem;
        border-bottom: 1px solid var(--color-border);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

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

    .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .hero {
        min-height: auto;
        padding-top: calc(var(--nav-height) + 4rem);
        padding-bottom: 4rem;
    }

    .section {
        padding: 4rem 0;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .timeline-header {
        flex-wrap: wrap;
    }

    .timeline-date {
        width: 100%;
        order: 3;
        margin-top: 0.25rem;
    }

    .expand-icon {
        order: 2;
    }

    .proficiency-legend {
        gap: 1rem;
    }
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(74, 85, 104, 0.3);
    z-index: 999;
}

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

.scroll-to-top:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(45, 55, 72, 0.4);
}

.scroll-to-top:active {
    transform: translateY(0);
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #1A202C;
        --color-bg-alt: #2D3748;
        --color-text: #F7FAFC;
        --color-text-muted: #A0AEC0;
        --color-primary: #90CDF4;
        --color-primary-dark: #63B3ED;
        --color-accent: #63B3ED;
        --color-border: #4A5568;

        --level-expert: #63B3ED;
        --level-expert-bg: rgba(99, 179, 237, 0.15);
        --level-expert-border: rgba(99, 179, 237, 0.4);
        --level-advanced: #68D391;
        --level-advanced-bg: rgba(104, 211, 145, 0.15);
        --level-advanced-border: rgba(104, 211, 145, 0.4);
        --level-intermediate: #F6C05C;
        --level-intermediate-bg: rgba(246, 192, 92, 0.15);
        --level-intermediate-border: rgba(246, 192, 92, 0.4);
    }

    /* Hero */
    .hero {
        background: linear-gradient(135deg, #1A202C 0%, #2D3748 100%);
    }

    .hero h1 {
        background: none;
        -webkit-text-fill-color: #90CDF4;
    }

    /* Navbar */
    .navbar {
        background: rgba(26, 32, 44, 0.95);
        border-bottom: 1px solid var(--color-border);
    }

    /* Buttons */
    .btn-primary {
        background: var(--color-accent);
        color: #1A202C;
    }

    .btn-secondary {
        border-color: #F7FAFC;
        color: #F7FAFC;
    }

    /* Cards */
    .expertise-card {
        background: #2D3748;
        border-color: #4A5568;
    }

    /* Timeline */
    .timeline-item.active {
        background: #2D3748;
        border-color: #4A5568;
    }

    /* Skill tags without data-level */
    .skill-tag:not([data-level]) {
        background: #2D3748;
        color: #F7FAFC;
    }

    /* Job skill tags */
    .job-skill-tag {
        background: #1A202C;
        border-color: #4A5568;
        color: #A0AEC0;
    }

    .job-skill-tag[data-level="expert"] {
        background: var(--level-expert-bg);
        border-color: var(--level-expert-border);
        color: var(--level-expert);
    }

    .job-skill-tag[data-level="advanced"] {
        background: var(--level-advanced-bg);
        border-color: var(--level-advanced-border);
        color: var(--level-advanced);
    }

    .job-skill-tag[data-level="intermediate"] {
        background: var(--level-intermediate-bg);
        border-color: var(--level-intermediate-border);
        color: var(--level-intermediate);
    }

    /* Form */
    .contact-form input,
    .contact-form textarea {
        background: #2D3748;
        border-color: #4A5568;
        color: #F7FAFC;
    }

    .contact-form input::placeholder,
    .contact-form textarea::placeholder {
        color: #718096;
    }

    /* Footer */
    .footer {
        background: #171923;
        color: #A0AEC0;
    }

    /* Scroll to top */
    .scroll-to-top {
        background: #2D3748;
        color: #F7FAFC;
    }
}

/* Focus Visible Styles */
a:focus-visible,
button:focus-visible,
.timeline-header:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .hero-cta,
    .contact-form,
    .expand-icon {
        display: none;
    }

    .section {
        padding: 2rem 0;
    }

    .timeline-content {
        max-height: none;
        padding-bottom: 1rem;
    }

    .timeline-item.active {
        background: none;
        box-shadow: none;
        border: none;
    }
}
