:root {
    --primary-color: #111111;
    --secondary-color: #666666;
    --background-color: #f8f8f8;
    --background-rgb: 248, 248, 248;
    --background-alt: #fff;
    --accent-color: #333333;
    --primary-rgb: 17, 17, 17;
    --spacing-unit: 5rem;
    --max-width: 1200px;
    --transition-speed: 0.3s;
    --border-radius: 12px;
    --header-height: 5rem;
    --scroll-margin: calc(var(--header-height) + 2rem);
    --highlight-color: rgba(255, 107, 0, 0.8);
    --highlight-color-secondary: rgba(255, 165, 0, 0.9);
    --item-bg-light: rgba(0, 0, 0, 0.03);
    --item-bg-dark: rgba(255, 255, 255, 0.05);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) {
        --primary-color: #ffffff;
        --secondary-color: #a0a0a0;
        --background-color: #111111;
        --background-rgb: 17, 17, 17;
        --background-alt: #1a1a1a;
        --accent-color: #e0e0e0;
        --primary-rgb: 255, 255, 255;
    }
}

[data-theme='dark'] {
    --primary-color: #ffffff;
    --secondary-color: #a0a0a0;
    --background-color: #111111;
    --background-rgb: 17, 17, 17;
    --background-alt: #1a1a1a;
    --accent-color: #e0e0e0;
    --primary-rgb: 255, 255, 255;
    --item-bg-light: rgba(255, 255, 255, 0.05);
    --item-bg-dark: rgba(255, 255, 255, 0.08);
}

body {
    background-color: var(--background-color);
    color: var(--primary-color);
    font-family: 'Inter', sans-serif;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transform: translate3d(0, 0, 0);
}

#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    height: 24px;
    margin-left: 0.5rem;
    transition: color var(--transition-speed) ease, opacity var(--transition-speed) ease;
}

#theme-toggle:hover {
    opacity: 0.8;
}

#theme-toggle svg {
    width: 20px;
    height: 20px;
}

#theme-toggle .light-icon {
    display: none;
}

#theme-toggle .dark-icon {
    display: block;
}

[data-theme='dark'] #theme-toggle .light-icon {
    display: block;
}

[data-theme='dark'] #theme-toggle .dark-icon {
    display: none;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) #theme-toggle .light-icon {
        display: block;
    }
    
    :root:not([data-theme='light']) #theme-toggle .dark-icon {
        display: none;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.7;
    color: var(--primary-color);
    background-color: var(--background-color);
    padding: 0;
    margin: 0;
    overflow-x: hidden;
}

main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 5rem 2rem 0;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: transform;
}

header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.5rem 2rem;
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(var(--background-rgb), 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.08);
    transition: 
        background-color var(--transition-speed) ease,
        border-color var(--transition-speed) ease;
    /* Performance improvements */
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: backdrop-filter, transform;
}

header nav {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

header nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    position: relative;
    transition: opacity var(--transition-speed) ease;
}

header nav a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}

header nav a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

header .logo-container {
    height: 32px;
    width: 32px;
    margin-right: 1rem;
    position: relative;
}

header .logo-container img {
    height: 100%;
    width: auto;
    position: absolute;
}

header h1 {
    transition: none !important;
}

@media (max-width: 768px) {
    header .logo-container {
        height: 28px;
    }
    
    .name-group h1 {
        display: none;
    }
}

@media (max-width: 480px) {
    header .logo-container {
        height: 24px;
    }
    
    .name-group {
        gap: 0.15rem;
    }
}

section {
    margin: calc(var(--spacing-unit) * 2) 0;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: 
        opacity 0.6s ease-out,
        transform 0.6s ease-out,
        background-color var(--transition-speed) ease,
        color var(--transition-speed) ease;
    will-change: opacity, transform;
    scroll-margin-top: var(--scroll-margin);
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: transform, opacity;
}

section#projects {
    margin: calc(var(--spacing-unit) * 2) 0;
    scroll-margin-top: var(--scroll-margin);
}

section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

h1 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    transition: color var(--transition-speed) ease;
}

h1 a {
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity var(--transition-speed) ease;
}

h1 a:hover {
    opacity: 0.8;
}

h2 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 3rem;
    font-weight: 600;
    max-width: 1000px;
    letter-spacing: -0.02em;
    color: var(--primary-color);
    transition: color var(--transition-speed) ease;
}

h2 a {
    color: var(--secondary-color);
    text-decoration: none;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

h2 a:hover {
    opacity: 1;
}

#intro h2 {
    font-size: 4rem;
    line-height: 1;
    margin-bottom: 2rem;
}

#intro h2 a {
    color: var(--primary-color);
}

#approach h2 {
    font-size: 3.25rem;
    max-width: 800px;
    color: var(--secondary-color);
    font-weight: 500;
    line-height: 1.3;
}

#approach h2 a {
    color: var(--secondary-color);
}

.intro-text {
    font-size: 1.75rem;
    line-height: 1.4;
    max-width: 800px;
    color: var(--secondary-color);
    letter-spacing: -0.02em;
    margin-top: 1.5rem;
    font-weight: 400;
}

footer h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    max-width: 800px;
    letter-spacing: -0.02em;
}

#experience {
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    background: var(--background-color);
}

#experience h2 {
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem;
}

.scroll-container {
    position: relative;
    max-width: 100%;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: transform;
}

.company-grid {
    display: flex;
    overflow-x: auto;
    gap: 2rem;
    padding-top: 2rem;
    padding-bottom: 2rem;
    padding-left: max(2rem, calc((100vw + 3.5rem - var(--max-width)) / 2));
    padding-right: 2rem;
    margin: 0;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
    justify-content: flex-start;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: transform;
}

.company-grid::-webkit-scrollbar {
    display: none;
}

.company {
    flex: 0 0 400px;
    min-width: 400px;
    /* padding: 2rem; */
    transform: translateY(0);
    transition: transform var(--transition-speed) ease;
    opacity: 0;
    transform: translateY(20px);
    transition: 
        opacity 0.5s ease-out,
        transform 0.6s ease-out,
        color var(--transition-speed) ease;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: transform, opacity;
}

.company:hover {
    transform: translateY(-5px);
}

.company img {
    height: 64px;
    width: auto;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.company:hover img {
    opacity: 1;
}

.company h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: -0.01em;
}

.company p {
    font-size: 1rem;
    color: var(--secondary-color);
    line-height: 1.7;
}

.is-visible .company:nth-child(1) { transition-delay: 0.05s; }
.is-visible .company:nth-child(2) { transition-delay: 0.1s; }
.is-visible .company:nth-child(3) { transition-delay: 0.15s; }

.expertise-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin-top: 4rem;
    max-width: var(--max-width);
}

.expertise-item {
    padding: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: 
        transform var(--transition-speed) ease,
        opacity var(--transition-speed) ease,
        background-color var(--transition-speed) ease;
    will-change: opacity, transform;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
    background: var(--background-alt);
    border-radius: var(--border-radius);
}

.expertise-item:hover {
    transform: translateY(-5px);
}

.expertise-icon {
    margin-bottom: 1.5rem;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: var(--background-color);
    border-radius: 16px;
    transition: transform var(--transition-speed) ease;
}

.expertise-item:hover .expertise-icon {
    transform: scale(1.05);
}

.expertise-content h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: -0.02em;
}

.expertise-content p {
    font-size: 1rem;
    color: var(--secondary-color);
    line-height: 1.7;
}

.is-visible .expertise-item, .is-visible .expertise-item:hover {
    opacity: 1;
    transform: translateY(0);
}

.is-visible .expertise-item:nth-child(1) { transition-delay: 0.05s; }
.is-visible .expertise-item:nth-child(2) { transition-delay: 0.1s; }
.is-visible .expertise-item:nth-child(3) { transition-delay: 0.15s; }

footer {
    max-width: var(--max-width);
    margin: 10rem auto 6rem;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(2rem);
    transition: all 0.6s ease-out !important;
    will-change: opacity, transform;
}

footer.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.contact-links {
    margin-top: 2.5rem;
}

.contact-links a {
    color: var(--primary-color);
    text-decoration: none;
    margin-right: 3rem;
    font-weight: 500;
    font-size: 1.125rem;
    transition: transform var(--transition-speed) ease;
    position: relative;
}

.contact-links a:hover {
    color: var(--accent-color);
}

.contact-links a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--transition-speed) ease;
}

.contact-links a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

@media (max-width: 1024px) {
    .expertise-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }
}

@media (max-width: 768px) {
    :root {
        --spacing-unit: 3rem;
        --mobile-padding: 1.5rem;
        --header-height: 4rem;
        --scroll-margin: calc(var(--header-height) + 1rem);
    }

    main {
        display: flex;
        flex-direction: column;
        padding: 0 2rem;
        padding-top: 4rem;
    }

    /* Section order */
    #intro { order: 1; }
    #approach { order: 2; }
    #projects { order: 3; }
    #current { order: 4; }
    #experience { order: 5; }
    #expertise { order: 6; }

    /* Typography */
    h2 {
        font-size: 1.75rem;
        line-height: 1.3;
        margin-bottom: 2rem;
    }

    #intro h2 {
        font-size: 2rem;
        line-height: 1.2;
    }

    #approach h2 {
        font-size: 1.5rem;
        line-height: 1.4;
    }

    header {
        padding: 1rem var(--mobile-padding);
    }

    section {
        margin: var(--spacing-unit) 0;
        padding: 0;
    }

    #experience {
        width: 100%;
        left: auto;
        right: auto;
        margin: var(--spacing-unit) 0;
        /* padding: 0 1rem; */
        background: none;
    }

    #experience h2 {
        padding: 0;
        margin-bottom: 2rem;
    }

    footer {
        margin: 4rem 0;
        padding: 0 2rem;
    }


    .company-grid {
        display: flex;
        flex-direction: column;
        padding: 0;
        overflow: visible;
        gap: 2rem;
        margin: 0;
    }

    .company {
        flex: none;
        width: 100%;
        min-width: unset;
        padding: 1.5rem;
        margin: 0;
        background-color: var(--background-alt);
        border-radius: var(--border-radius);
    }

    .company img {
        /* max-width: 60px; */
        margin-bottom: 1.5rem;
    }

    /* Remove scroll functionality */
    .scroll-arrow {
        display: none;
    }

    /* Project grid */
    .project-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 2rem;
    }

    /* Expertise grid */
    .expertise-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-top: 2rem;
    }

    .current-role {
        padding: 1.5rem;
        background-color: var(--background-alt);
        border-radius: var(--border-radius);
    }

    .current-role img {
        max-width: 60px;
        margin-bottom: 1.5rem;
    }

    footer h2 {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }

    h2 a {
        font-size: 1.5rem;
    }

    .intro-text {
        font-size: 1.1rem;
        line-height: 1.6;
        margin: 1rem 0;
    }

    .intro-text .highlight {
        font-size: 1.1rem;
    }

    .expertise-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-top: 2rem;
    }

    .expertise-item {
        padding: 1.5rem;
    }

    .expertise-icon {
        width: 48px;
        height: 48px;
        border-radius: 12px;
        margin-bottom: 1.25rem;
    }

    .expertise-icon svg {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    :root {
        --header-height: 3.5rem;
        --scroll-margin: calc(var(--header-height) + 1rem);
    }

    main {
        padding: 0 1.5rem;
    }

    header {
        padding: 1rem 2rem;
    }

    header nav {
        gap: 1rem;
    }

    section {
        padding: 0 0.5rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    #intro h2 {
        font-size: 1.75rem;
    }

    .intro-text {
        font-size: 1rem;
        line-height: 1.5;
        margin: 0.75rem 0;
    }

    .intro-text .highlight {
        font-size: 1rem;
    }

    .company {
        flex: 0 0 100%;
        padding: 1.5rem;
    }

    .company img {
        height: 40px;
        width: auto;
    }

    footer {
        margin: 3rem auto;
        padding: 0 2rem;
    }

    .contact-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .current-role img {
        height: 40px;
        width: auto;
    }

    .current-role {
        padding: 1.5rem;
    }

    .project {
        padding: 1.5rem;
    }
}

/* Base theme transitions */
.company, .project, .expertise-item, header, body, .scroll-arrow, 
.company-details li, .company-details li::before, h1, h2, h3, p, a {
    transition: 
        all 0.3s ease !important;
}

/* Scroll fade-in animations */
section {
    margin: calc(var(--spacing-unit) * 2) 0;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: 
        opacity 0.6s ease-out,
        transform 0.6s ease-out,
        background-color var(--transition-speed) ease,
        color var(--transition-speed) ease;
    will-change: opacity, transform;
    scroll-margin-top: var(--scroll-margin);
}

section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Company cards fade-in */
.company {
    opacity: 0;
    transform: translateY(20px);
    transition: 
        opacity 0.5s ease-out,
        transform 0.6s ease-out,
        color var(--transition-speed) ease;
}

.is-visible .company {
    opacity: 1;
    transform: translateY(0);
}

/* Project cards fade-in */
.project {
    position: relative;
    border-radius: var(--border-radius);
    transition: transform var(--transition-speed) ease;
}

.project-link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 2rem;
    height: 100%;
    background: var(--background-alt);
    border-radius: var(--border-radius);
    transition: 
        background-color var(--transition-speed) ease,
        transform var(--transition-speed) ease;
}

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

.project .year {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.project h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.project p {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.project .description {
    margin-bottom: 1.5rem;
}

.project .expand {
    color: var(--secondary-color);
    font-weight: 500;
    display: inline-block;
    transition: opacity var(--transition-speed) ease;
}

.project:hover .expand {
    opacity: 0.8;
}

@media (max-width: 768px) {
    .project-link {
        padding: 0rem;
    }
    
    .project:hover .project-link {
        transform: none;
    }
}

/* Expertise items fade-in */
.expertise-item {
    opacity: 0;
    transform: translateY(20px);
    transition: 
        opacity 0.5s ease-out,
        transform 0.6s ease-out,
        background-color var(--transition-speed) ease,
        color var(--transition-speed) ease;
}

.is-visible .expertise-item {
    opacity: 1;
    transform: translateY(0);
}

/* Remove all transition delays */
.is-visible .company,
.is-visible .project,
.is-visible .expertise-item,
section.is-visible,
footer.is-visible {
    transition-delay: 0s !important;
}

/* Override delays during theme switch */
body[data-theme] section,
body[data-theme] .company,
body[data-theme] .project,
body[data-theme] .expertise-item,
body[data-theme] footer {
    transition-delay: 0s !important;
}

.project:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

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

.project .project-header img {
    height: 48px;
    width: auto;
    transition: transform var(--transition-speed) ease;
    margin-bottom: 0;
}

.project:hover .project-header img {
    transform: scale(1.05);
}

.project .year {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.project .expand,
.project-details .expand {
    display: inline-block;
    margin-top: 1rem;
    color: var(--secondary-color);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    position: relative;
    transition: color var(--transition-speed) ease;
}

.project .expand::after,
.project-details .expand::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: var(--secondary-color);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}

/* Show underline on both card hover and link hover */
.project:hover .expand::after,
.project .expand:hover::after,
.project-details .expand:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Remove transform and update opacity */
.project:hover .expand,
.project-details .expand:hover {
    transform: none;
    opacity: 1;
}

/* Remove old hover styles */
.project-details .expand {
    transform: none;
}

.project-details .expand:hover {
    transform: none;
}

.project-details h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.project-details p {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.project-details .description {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-bottom: 1rem;
}

.project-details .expand {
    display: inline-block;
    font-size: 0.875rem;
    color: var(--secondary-color);
    cursor: pointer;
    margin-top: 1rem;
    transition: opacity var(--transition-speed) ease;
    opacity: 0.9;
}

.project-details .expand:hover {
    opacity: 1;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
    margin-top: 4rem;
}

@media (max-width: 768px) {
    .project-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-top: 3rem;
    }

    .project {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .project {
        padding: 1.5rem;
    }
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--scroll-margin);
}

.company-details ul {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0 0;
}

.company-details li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.75rem;
    color: var(--secondary-color);
    font-size: 1rem;
    line-height: 1.6;
    transition: color var(--transition-speed) ease;
}

.company-details li:last-child {
    margin-bottom: 0;
}

.company-details li::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0.7rem;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: var(--highlight-color);
    transition: background-color var(--transition-speed) ease;
}

@media (max-width: 768px) {
    .company-details li {
        font-size: 0.95rem;
        padding-left: 1.5rem;
        margin-bottom: 0.6rem;
    }
    
    .company-details li::before {
        width: 4px;
        height: 4px;
        top: 0.65rem;
    }
}

@keyframes bounce {
    0% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(0.95); }
    100% { transform: translateY(-50%) scale(1); }
}

.scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--background-color);
    border: none;
    cursor: pointer;
    font-size: 2rem;
    line-height: 1;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: 
        background-color var(--transition-speed) ease,
        color var(--transition-speed) ease,
        transform var(--transition-speed) ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    padding-bottom: 4px;
}

.scroll-arrow:hover {
    background-color: var(--primary-color);
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.scroll-arrow.bounce {
    animation: bounce 0.3s cubic-bezier(0.36, 0, 0.66, -0.56) forwards;
}

.scroll-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.scroll-left {
    left: 24px;
    padding-right: 2px;
}

.scroll-right {
    right: 24px;
    padding-left: 2px;
}

@media (max-width: 768px) {
    .scroll-arrow {
        width: 40px;
        height: 40px;
    }
    
    .scroll-left {
        left: 20px;
    }
    
    .scroll-right {
        right: 20px;
    }
}

.current-role-grid {
    display: flex;
    gap: 2rem;
    padding: 2rem 0;
    margin: 0 auto;
    width: 100%;
}

.current-role {
    flex: 1;
    width: 100%;
    padding: 2rem 0;
    transition: transform var(--transition-speed) ease;
}

/* Remove hover effect */
.current-role:hover {
    transform: none;
}

.current-role img {
    height: 64px;
    width: auto;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.current-role h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: -0.01em;
}

.current-role p {
    font-size: 1rem;
    color: var(--secondary-color);
    line-height: 1.7;
    width: 100%;
}

@media (max-width: 768px) {
    .current-role {
        padding: 1.5rem;
        background-color: var(--background-alt);
        border-radius: var(--border-radius);
    }

    .current-role img {
        max-width: 60px;
        margin-bottom: 1.5rem;
    }

    .current-role-grid {
        padding: 0;
    }
}

@media (max-width: 480px) {
    .current-role {
        padding: 1.5rem;
    }

    .current-role img {
        height: 40px;
        width: auto;
    }
}

.highlight {
    color: var(--primary-color);
    font-weight: 600;
    position: relative;
    display: inline;
}

/* Performance optimizations */
/* Optimize header blur */
header {
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: backdrop-filter;
}

/* Optimize scrolling containers */
.scroll-container,
.company-grid,
main {
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: transform;
}

/* Optimize animated elements */
.company,
.project,
.expertise-item,
section {
    transform: translate3d(0, 2rem, 0);
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: transform, opacity;
}

/* Force GPU acceleration for smoother scrolling */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transform: translate3d(0, 0, 0);
}


/* Optimize scroll behavior */
.company-grid {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
}

/* Reduce paint operations */
* {
    -webkit-tap-highlight-color: transparent;
}

#intro, #approach, #current, #experience, #projects, #expertise {
    scroll-margin-top: var(--scroll-margin);
}

/* Logo theme variants */
.logo-container {
    display: flex;
    align-items: center;
    height: 32px;
    width: auto;
    text-decoration: none;
    transition: opacity var(--transition-speed) ease;
}

.logo-container:hover {
    opacity: 0.8;
}

.logo-container img {
    height: 100%;
    width: auto;
}

@media (max-width: 768px) {
    .logo-container {
        height: 28px;
    }
}

@media (max-width: 480px) {
    .logo-container {
        height: 24px;
    }
}

/* Show dark logo in dark theme */
[data-theme="dark"] .logo-dark {
    opacity: 1;
    visibility: visible;
}

[data-theme="dark"] .logo-light {
    opacity: 0;
    visibility: hidden;
}

/* Show light logo in light theme */
:root:not([data-theme="dark"]) .logo-light {
    opacity: 1;
    visibility: visible;
}

:root:not([data-theme="dark"]) .logo-dark {
    opacity: 0;
    visibility: hidden;
}

/* Company logo specific adjustments */
.company .logo-container {
    position: relative;
    width: 100%;
    height: 64px;
    margin-bottom: 1.5rem;
}

.company .logo-container img {
    height: 100%;
    width: auto;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
}

/* Project logo specific adjustments */
.project .logo-container {
    position: relative;
    width: 100%;
    height: 48px;
    margin-bottom: 1.5rem;
}

.project .logo-container img {
    position: absolute;
    top: 0;
    right: 0;
    left: auto;
    height: 100%;
    width: auto;
    object-fit: contain;
    transition: opacity var(--transition-speed) ease;
}

.project .logo-dark {
    opacity: 1;
    visibility: visible;
}

.project .logo-light {
    opacity: 0;
    visibility: hidden;
}

[data-theme="light"] .project .logo-dark {
    opacity: 0;
    visibility: hidden;
}

[data-theme="light"] .project .logo-light {
    opacity: 1;
    visibility: visible;
}

/* Current role logo specific adjustments */
.current-role .logo-container {
    position: relative;
    width: 100%;
    height: 64px;
    margin-bottom: 2rem;
}

.current-role .logo-container img {
    height: 100%;
    width: auto;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
}

@media (max-width: 768px) {
    .company .logo-container,
    .current-role .logo-container {
        height: 40px;
        margin-bottom: 1.5rem;
    }

    .project .logo-container {
        height: 32px;
        margin-bottom: 1.5rem;
    }
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

#approach .highlight {
    background: linear-gradient(
        120deg,
        var(--highlight-color) 0%,
        var(--highlight-color-secondary) 50%,
        var(--highlight-color) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient 8s ease infinite;
    padding: 0 0.1em;
}

[data-theme="light"] {
    --highlight-color: rgba(255, 107, 0, 0.7);
    --highlight-color-secondary: rgba(255, 165, 0, 0.8);
}

.current-role ul {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0 0;
}

.current-role li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.75rem;
    color: var(--secondary-color);
    font-size: 1rem;
    line-height: 1.6;
    transition: color var(--transition-speed) ease;
}

.current-role li:last-child {
    margin-bottom: 0;
}

.current-role li::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0.7rem;
    width: 5px;
    height: 5px;
    background-color: var(--highlight-color);
    border-radius: 50%;
    transition: background-color var(--transition-speed) ease;
}

@media (max-width: 768px) {
    .current-role li {
        font-size: 0.95rem;
        padding-left: 1.5rem;
        margin-bottom: 0.6rem;
    }
    
    .current-role li::before {
        width: 4px;
        height: 4px;
        top: 0.65rem;
    }
}

.current-role .company-details ul {
    list-style: none;
    padding: 0;
    margin: 2rem 0 0 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.current-role .company-details li {
    position: relative;
    padding: 1.5rem;
    margin: 0;
    background: var(--background-alt);
    border-radius: var(--border-radius);
    color: var(--secondary-color);
    font-size: 1rem;
    line-height: 1.6;
    transition: all var(--transition-speed) ease;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.current-role .company-details li::before {
    content: "";
    position: static;
    width: 24px;
    height: 24px;
    background: none;
    display: flex;
    align-items: flex-start;
    padding-top: 0.25rem;
    color: var(--primary-color);
    transition: color var(--transition-speed) ease;
    flex-shrink: 0;
}

.current-role .company-details li:nth-child(1)::before {
    content: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21 21H3V3M21 9L13 17L9 13L3 19' stroke='%23111111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

[data-theme="dark"] .current-role .company-details li:nth-child(1)::before {
    content: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21 21H3V3M21 9L13 17L9 13L3 19' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.current-role .company-details li:nth-child(2)::before {
    content: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21 15C21 15.5304 20.7893 16.0391 20.4142 16.4142C20.0391 16.7893 19.5304 17 19 17H7L3 21V5C3 4.46957 3.21071 3.96086 3.58579 3.58579C3.96086 3.21071 4.46957 3 5 3H19C19.5304 3 20.0391 3.21071 20.4142 3.58579C20.7893 3.96086 21 4.46957 21 5V15Z' stroke='%23111111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

[data-theme="dark"] .current-role .company-details li:nth-child(2)::before {
    content: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21 15C21 15.5304 20.7893 16.0391 20.4142 16.4142C20.0391 16.7893 19.5304 17 19 17H7L3 21V5C3 4.46957 3.21071 3.96086 3.58579 3.58579C3.96086 3.21071 4.46957 3 5 3H19C19.5304 3 20.0391 3.21071 20.4142 3.58579C20.7893 3.96086 21 4.46957 21 5V15Z' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.current-role .company-details li:nth-child(3)::before {
    content: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17 2H7C5.89543 2 5 2.89543 5 4V20C5 21.1046 5.89543 22 7 22H17C18.1046 22 19 21.1046 19 20V4C19 2.89543 18.1046 2 17 2Z' stroke='%23111111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M12 18H12.01' stroke='%23111111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

[data-theme="dark"] .current-role .company-details li:nth-child(3)::before {
    content: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17 2H7C5.89543 2 5 2.89543 5 4V20C5 21.1046 5.89543 22 7 22H17C18.1046 22 19 21.1046 19 20V4C19 2.89543 18.1046 2 17 2Z' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M12 18H12.01' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.current-role .company-details li:nth-child(4)::before {
    content: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='3' y='3' width='7' height='7' rx='1' stroke='%23111111' stroke-width='2'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1' stroke='%23111111' stroke-width='2'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1' stroke='%23111111' stroke-width='2'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1' stroke='%23111111' stroke-width='2'/%3E%3Cpath d='M10 6.5H14M17.5 10V14M6.5 10V14' stroke='%23111111' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

[data-theme="dark"] .current-role .company-details li:nth-child(4)::before {
    content: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='3' y='3' width='7' height='7' rx='1' stroke='%23ffffff' stroke-width='2'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1' stroke='%23ffffff' stroke-width='2'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1' stroke='%23ffffff' stroke-width='2'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1' stroke='%23ffffff' stroke-width='2'/%3E%3Cpath d='M10 6.5H14M17.5 10V14M6.5 10V14' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

@media (max-width: 768px) {
    .current-role .company-details ul {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .current-role .company-details li {
        padding: 1.25rem;
        font-size: 0.95rem;
        background-color: var(--item-bg-light);
    }

    [data-theme="dark"] .current-role .company-details li {
        background-color: var(--item-bg-dark);
    }
    
    .current-role .company-details li::before {
        width: 20px;
        height: 20px;
        padding-top: 0.2rem;
    }
}

.name-group {
    display: flex;
    align-items: center;
}

.name-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    color: var(--primary-color);
    transition: opacity var(--transition-speed) ease;
}

.name-link:hover {
    opacity: 0.8;
}

.name-link h1 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.logo-container {
    display: flex;
    align-items: center;
    height: 32px;
    width: auto;
}

.logo-container img {
    height: 100%;
    width: auto;
}

@media (max-width: 768px) {
    .logo-container {
        height: 28px;
    }
    
    .name-link h1 {
        display: none;
    }
}

@media (max-width: 480px) {
    .logo-container {
        height: 24px;
    }
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.read-time {
    font-size: 0.875rem;
    color: var(--secondary-color);
    opacity: 0.8;
}

.project .expand {
    color: var(--secondary-color);
    font-weight: 500;
    display: inline-block;
    transition: opacity var(--transition-speed) ease;
}

@media (max-width: 768px) {
    .project-footer {
        gap: 0.5rem;
    }

    .project .expand {
        margin-top: 0;
    }
} 