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

:root {
    /* Base colors */
    --ink: #1a1a1a;
    --muted: #6b6b6b;
    --faint: #ebebeb;
    --accent: #2fd690;
    --cream: #f9f7f4;
    --white: #ffffff;
    
    /* Typography */
    --serif: "DM Serif Display", Georgia, serif;
    --sans: "DM Sans", system-ui, sans-serif;
    
    /* Semantic tokens - Light theme */
    --bg-body: var(--cream);
    --bg-page: var(--white);
    --bg-sidebar: var(--ink);
    --text-primary: var(--ink);
    --text-secondary: var(--muted);
    --text-on-dark: var(--white);
    --border-faint: var(--faint);
}

.dark {
    /* Semantic tokens - Dark theme */
    --bg-body: #121212;
    --bg-page: #1e1e1e;
    --bg-sidebar: #0a0a0a;
    --text-primary: #e8e8e8;
    --text-secondary: #888888;
    --border-faint: #2a2a2a;
}

html {
    font-size: 15px;
}

body {
    background: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--sans);
    font-weight: 300;
    line-height: 1.6;
    padding: 48px 24px;
    min-height: 100vh;
}

.page {
    max-width: 860px;
    margin: 0 auto;
    background: var(--bg-page);
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.08);
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--bg-sidebar);
    color: var(--text-on-dark);
    padding: 28px 24px 28px 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.name-block .first {
    font-family: var(--serif);
    font-size: 2rem;
    line-height: 1.05;
    color: var(--text-on-dark);
    letter-spacing: -0.01em;
}

.name-block .last {
    font-family: var(--serif);
    font-size: 2rem;
    line-height: 1.05;
    color: var(--accent);
}

.name-block .role {
    margin-top: 10px;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

.sidebar-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.contact-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.contact-list li {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.7);
    display: grid;
    grid-template-columns: 24px 1fr;
    column-gap: 12px;
    align-items: center;
    padding: 3px 0;
}

.contact-list li.item--top {
    align-items: start;
}

.contact-list .icon-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
}

.contact-list .icon {
    width: 16px;
    height: 16px;
    opacity: 0.6;
    stroke-width: 1.8px;
}

.contact-list li.location-row {
    align-items: center;
}

.contact-list li.location-row .content {
    display: flex;
    align-items: center;
    gap: 6px;
}

.contact-list li.location-row .dot {
    opacity: 0.5;
}

.flag-icon {
    width: 18px !important;
    height: auto;
}

.contact-list a {
    color: inherit;
    text-decoration: none;
}

.print-only {
    display: none !important;
}

.lang-selector {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-selector .icon {
    width: 16px;
    flex-shrink: 0;
    opacity: 0.5;
}

.lang-links {
    display: flex;
    gap: 4px;
}

.lang-links a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.2s;
}

.lang-links a:hover {
    color: rgba(255, 255, 255, 0.8);
}

.lang-links a.active {
    color: var(--accent);
    font-weight: 500;
}

.theme-selector {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-selector .icon {
    width: 16px;
    flex-shrink: 0;
    opacity: 0.5;
}

.theme-links {
    display: flex;
    gap: 4px;
}

.theme-links a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.2s;
}

.theme-links a:hover {
    color: rgba(255, 255, 255, 0.8);
}

.theme-links a.active {
    color: var(--accent);
    font-weight: 500;
}

.skills-group {
    margin-bottom: 8px;
}

.skills-group-title {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 7px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag {
    font-size: 0.71rem;
    padding: 3px 8px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.75);
    font-weight: 400;
    line-height: 1.5;
}

.edu-item {
    margin-bottom: 8px;
}

.edu-item .degree {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    line-height: 1.4;
}

.edu-item .school {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 2px;
}

.edu-item .year {
    font-size: 0.7rem;
    color: var(--accent);
    opacity: 0.8;
    margin-top: 1px;
}

.main {
    padding: 32px 36px 32px 36px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.section-title {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-faint);
}

.job {
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-faint);
    position: relative;
}

.job:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2px;
    flex-wrap: wrap;
    gap: 4px;
}

.job-title {
    font-family: var(--serif);
    font-size: 1.05rem;
    color: var(--text-primary);
}

.job-period {
    font-size: 0.73rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.job-company {
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.job-bullets {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.job-bullets li {
    font-size: 0.78rem;
    color: var(--text-secondary);
    padding-left: 14px;
    position: relative;
    line-height: 1.5;
}

.job-bullets li::before {
    content: "–";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 600;
}

.profile-photo {
    width: 125px;
    height: 125px;
    border-radius: 4px;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.header-box {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 3rem;
}

.header-box .profile-photo {
    flex-shrink: 0;
}

.summary {
    text-align: justify;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    flex: 1;
}

@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .page {
        box-shadow: none;
        max-width: 100%;
        min-height: auto;
        grid-template-columns: 1fr;
        background: transparent;
    }

    .main {
        order: 1;
        padding: 0;
        background: var(--bg-page);
    }

    .sidebar {
        order: 2;
        padding: 24px 16px;
        flex-direction: column;
        gap: 20px;
    }

    .mobile-header {
        display: flex;
        align-items: center;
        gap: 16px;
        padding: 20px 16px;
        background: var(--bg-page);
    }

    .mobile-header .name-block {
        flex: 1;
    }

    .mobile-header .name-block .first {
        color: var(--text-primary);
    }

    .mobile-header .name-block .last {
        color: var(--accent);
    }

    .mobile-header .name-block .role {
        color: var(--text-secondary);
    }

    .mobile-header .profile-photo {
        width: 100px;
        height: 100px;
        flex-shrink: 0;
        display: block;
    }

    .header-box .profile-photo {
        display: none;
    }

    .sidebar .name-block {
        display: none;
    }

    .header-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 0 16px 20px;
        background: var(--bg-page);
    }

    .summary {
        font-size: 0.85rem;
        color: var(--text-secondary);
    }

    .section-title {
        font-size: 0.6rem;
        margin-bottom: 14px;
        color: var(--accent);
        padding: 0 16px;
    }

    .section-title::after {
        background: var(--border-faint);
    }

    .job {
        margin-bottom: 20px;
        padding: 0 16px 20px;
        border-bottom-color: var(--border-faint);
    }

    .job:last-child {
        border-bottom: none;
    }

    .job-title {
        font-size: 0.95rem;
        color: var(--text-primary);
    }

    .job-company {
        color: var(--text-secondary);
    }

    .job-bullets li {
        font-size: 0.82rem;
        color: var(--text-secondary);
    }

    .sidebar-section {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .sidebar-label {
        margin-bottom: 8px;
    }

    .contact-list {
        gap: 6px;
    }

    .skills-group {
        margin-bottom: 10px;
    }

    .name-block .first,
    .name-block .last {
        font-size: 1.4rem;
    }

    .section:first-of-type {
        padding-top: 20px;
    }
}

@media (min-width: 769px) {
    .sidebar .name-block {
        display: block;
    }

    .mobile-header {
        display: none;
    }

    .mobile-header .profile-photo {
        display: none;
    }
}

@media print {
    body {
        padding: 0;
        font-size: 13px;
        background: var(--bg-sidebar);
    }
    
    .page {
        box-shadow: none;
        max-width: 100%;
        min-height: 100vh;
        grid-template-columns: 260px 1fr;
    }
    
    .sidebar {
        padding: 30px 20px;
        gap: 20px;
        min-height: 100vh;
    }
    
    .main {
        min-height: 100vh;
    }

    .sidebar .name-block {
        display: block;
    }
    
    .main {
        padding: 30px 25px;
        gap: 20px;
    }

    .mobile-header {
        display: none;
    }

    .mobile-header .profile-photo {
        display: none;
    }
    
    .header-box .profile-photo {
        display: block;
    }
    
    .job {
        margin-bottom: 15px;
        padding-bottom: 15px;
    }
    
    .job-bullets {
        gap: 2px;
    }
    
    .job-bullets li {
        font-size: 0.8rem;
        line-height: 1.4;
    }
    
    .profile-photo {
        width: 90px;
        height: 90px;
    }
    
    .header-box {
        gap: 1.5rem;
        margin-bottom: 10px;
    }
    
    .summary {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    .job {
        page-break-inside: avoid;
    }

    .sidebar-section:has(.lang-selector),
    .sidebar-section:has(.theme-selector) {
        display: none;
    }

    .print-only {
        display: flex !important;
    }
}
