:root {
    --transition-duration: 0.5s;
    --transition-ease: cubic-bezier(0.17, 0.84, 0.44, 1);
    --section-spacing: 2rem;
    --primary-color: #333;
    --secondary-color: #666;
    --accent-color: #4CAF50;
    --background-color: #fff;
    --background-color-alpha: rgba(255, 255, 255, 0.6);
    --border-color: #eee;
    --dark-bg: #e0e0e0;
    --bg-color: #ffffff;
    --text-color: #333333;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --primary-color: #fff;
    --secondary-color: #ccc;
    --accent-color: #4CAF50;
    --background-color: #1a1a1a;
    --background-color-alpha: rgba(26, 26, 26, 0.6);
    --border-color: #444;
    --dark-bg: #333;
}

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

html, body {
    max-height: calc(var(--vh, 1vh) * 100);
}

body {
    font-family: 'Play', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    line-height: 1.4;
    color: var(--text-color);
    background-color: var(--bg-color);
    font-size: 14px;
    font-weight: 400;
    transition: var(--transition-duration) var(--transition-ease);
    transition-property: background-color, color;
    overflow-y: scroll;
}

::selection {
    background-color: var(--accent-color) !important;
    color: var(--background-color) !important;
}

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

.header {
    display: flex;
    flex-direction: column;
    margin-bottom: var(--section-spacing);
    padding-bottom: .6rem;

    transform: scale(1);
    transition:  var(--transition-duration) var(--transition-ease);
    transition-property: transform, border-radius;
}
.isScrolled .header {
    position: sticky;
    top: 0;
    width: 950px;
    max-width: calc(100% - 4rem);
    z-index: 1000;
}

.header * {
    transition: var(--transition-duration) var(--transition-ease);
    transition-property: font-size, margin-left, margin-bottom;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -2rem;
    right: -2rem;
    bottom: 0;

    z-index: -1;
    pointer-events: none;
}
.isScrolled .header::before {
    border-radius: 1rem;
    background-color: var(--background-color-alpha);
    backdrop-filter: blur(30px);
    box-shadow: 0 0 10px var(--dark-bg), 0 0 50px var(--dark-bg);
}


.header-main h1 {
    font-family: 'Play', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: .8em;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    
    letter-spacing: 0.5px;
}

.isScrolled .header-main h1 {
    margin-bottom: 0.5rem;
}

.header-main h2 {
    font-size: .8rem;
    font-family: 'Play', sans-serif;
    color: var(--secondary-color);
    font-weight: 600;

    /* margin-bottom: 0.5rem; */
    letter-spacing: 0.25px;

}
.header-main-sub {
    transition: transform var(--transition-duration) var(--transition-ease);
    transform-origin: 0 50%;
}
.isScrolled .header-main-sub {
    transform: scale(.8) translateY(-.7rem);
}

.location {
    color: var(--secondary-color);
    font-size: 1rem;
    display: inline-block;
}

.header .location svg {
    margin-right: .3rem;
}

.contact-info {
    width: 100%;
    margin-top: .3rem;
    
    display: flex;
    flex-direction: column;
    /* gap: 1.5rem; */
}
.isScrolled .contact-info {
    margin-top: 0rem;
    margin-left: 0;
}

.contact-info a {
    transition: opcity var(--transition-duration) var(--transition-ease);
    color: var(--accent-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}
.isScrolled .contact-info a {
    margin-right: .7rem;
}

.isScrolled .header {
    z-index: 1000;
    
}

.isScrolled .header-main h1 {
    line-height: 1.4;
}


.isScrolled .contact-info {
    flex-direction: column;
    /* second column width */
}

.content {
    display: grid;
    /* grid-template-columns: 70fr 30fr; */
    gap: 2rem;
}

section {
    margin-bottom: var(--section-spacing);
}

h3 {
    font-family: 'Play', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: .8rem;
    text-transform: uppercase;
    border-bottom: 2px solid var(--secondary-color);
    /* padding-bottom: 0.5rem; */
    letter-spacing: 0.5px;
}

.period-location {
    display: flex;
    flex-direction: row;
    gap: .5rem;
}

.job {
    margin-bottom: 1.5rem;
}
/* .job p {
    padding-top: 0.5rem;
} */

.job-header {
    margin-bottom: 0.5rem;
}

.job-header h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}
.job-header h4 a {
    color: var(--primary-color) !important;
}

a:-webkit-any-link, a:hover, a:visited {
    color: var(--accent-color) !important;
    text-decoration: none;
}

a:hover, a:visited {
    opacity: 0.6;
}

.company {
    color: var(--accent-color);
    font-weight: 600;
}

.period, .location {
    color: var(--secondary-color);
    font-size: 0.8rem;
    white-space: nowrap;
}

.skill {
    padding-bottom: 1rem;
    transition: transform .5s ease-in-out;
}
.skill:hover {
    transform: scale(1.05);
}

.skill-name {
    font-family: 'Play', sans-serif;
    display: inline-block;
    margin-bottom: 0.25rem;
    font-weight: 500;
}


.skill-level {
    float: right;
    color: var(--secondary-color);
}

.progress-bar {
    height: 8px;
    background-color: var(--dark-bg);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    display: block;
    height: 100%;
    width: 0;
    background-color: var(--accent-color);
    border-radius: 4px;
    transition: width 1.5s cubic-bezier(0.17, 0.84, 0.44, 1);
}

.progress-bar.visible::after {
    width: var(--progress);
}


.project {
    margin-bottom: 1rem;
}

.project h4 {
    color: var(--accent-color);
    margin-bottom: 0.25rem;
}

.project p {
    font-size: 0.9rem;
}

.col-item {
    display: flex;
    flex-direction: column;
    break-inside: avoid;
    page-break-inside: avoid; /* For older browsers */
    margin-bottom: 2rem;
}

.technical-skills h3 {
    font-size: 1rem;
}
.technical-skills h3:first-child {
    margin-top: 0;
}

.technical-skills ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.technical-skills li {
    background-color: var(--border-color);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.job-header > div {
    display: inline;
}
.job-header > div + div::before {
    content: '|';
    margin: 0 .5rem;
}


.skills-container {
    column-width: 200px;
    column-gap: 2rem;
    max-width: 100%;
}

/* Prevent sections from breaking across columns */
.skills-container h3,
.skills-container .skill {
    break-inside: avoid;
    page-break-inside: avoid;
}

/* Remove the existing column classes as they're no longer needed */
.main-column-50,
.side-column-50 {
    width: 100%;
}

.theme-switcher {
    position: absolute;
    top: -20px;
    right: -50px;
    background: none;
    border: 0;
    width: 100px;
    height: 100px;
    cursor: pointer;
    color: var(--text-color);
    transition: color var(--transition-duration) var(--transition-ease);
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.theme-switcher:hover {
    opacity: 0.8;
}

.theme-switcher:focus {
    outline: none;
    color: var(--accent-color);
}

/* Show/hide icons based on theme */
.theme-switcher svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-switcher .sun-icon {
    display: none;
    fill: none; /* Sun icon should only use strokes */
}

[data-theme="dark"] .theme-switcher .sun-icon {
    display: inline;
}

[data-theme="dark"] .theme-switcher .moon-icon {
    display: none;
}

.location svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    vertical-align: middle;
}

.contact-info svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    margin-right: .2rem;
}

/* External link icon for links that open in new tab */
.content a[target="_blank"]::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 4px;
    vertical-align: middle;
    background-color: currentColor;
    mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>');
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
}



/* desktop */
@media (min-width: 768px) {
    .header {
        flex-direction: row;
    }
    .isScrolled .header {
        transform: scale(.9);
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    .header-main {
        flex: 1;
    }
    .header-main h1 {
        margin-left: -0.2rem;
    }
    .header-main h2, .location {
        display: flex;
        align-items: center;
    }
    
    .contact-info {
        width: 30%;
        justify-content: center;
        margin-left: 1rem;
    }
    .isScrolled .contact-info {
        padding-left: .6rem;
        width: 30%;
    }
    body:not(.isScrolled) .contact-info a {
        margin-right: 1rem;
    }
    
}

/* mobile */
@media (max-width: 768px) {
    /* .isScrolled .header-main h2 { */
        /* font-size: 0.8rem; */
        /* margin-bottom: .1rem; */
    /* } */
    .contact-info {
        width: 100%;
        display: flex;
        flex-direction: row !important;
        flex-wrap: wrap;
    }
    
    .contact-info a {
        margin-right: 1rem;
    }
    .isScrolled .header {
        position: fixed;
    }
    .isScrolled .summary {
        margin-top: 148px;
    }
    .isScrolled .contact-info a {
        margin-top: 0rem;
        margin-bottom: 0rem;
    }
    
    .content {
        grid-template-columns: 1fr;
    }
    .content .location svg {
        display: none;
    }
    
    .cv-container {
        margin: 1rem;
        padding: 0 1rem;
    }
}

h2 svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    margin-right: .5rem;
    vertical-align: middle;
}

.logo {
    height: 60px;
    width: 60px;
    margin: 0 auto;
    padding: 30px 0 100px;

    background-image: url('/logo.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;

    transition: transform var(--transition-duration) var(--transition-ease);
    cursor: pointer;
}

.logo:active {
    transform: scale(0.8);
}