:root {
    --sidebar-bg:   #0F2044;
    --sidebar-dark: #091630;
    --accent:       #F5C342;
    --accent-dark:  #D4A82E;
    --white:        #FFFFFF;
    --ink:          #1A1A2E;
    --muted:        #5A6480;
    --subtle:       #8892AA;
    --border:       #E4E8F0;
    --body-bg:      #CDD5E0;
    --sidebar-w:    38%;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'DM Sans', sans-serif;
    background: var(--body-bg);
    color: var(--ink);
    line-height: 1.4;
    padding: 24px 16px 48px;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.cv-container {
    width: 210mm;
    max-width: 100%;
    min-height: 297mm;
    margin: 0 auto;
    background: var(--white);
    box-shadow: 0 10px 50px rgba(0,0,0,.25);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: row;
}

.cv-left-column {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-photo-block {
    position: relative;
    background: var(--sidebar-dark);
    padding: 28px 20px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-photo-block::after {
    content: '';
    position: absolute;
    bottom: -10px; left: 0; right: 0;
    height: 10px;
    background: var(--accent);
    clip-path: polygon(0 0, 100% 0, 100% 30%, 0 100%);
    z-index: 1;
}

.sidebar-photo-block img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
}

.sidebar-inner {
    padding: 22px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
}

.sidebar-section { margin-bottom: 14px; }

.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,.08);
    margin: 0 0 14px;
}

.sidebar-title {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 9px;
}

.sidebar-title-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    flex-shrink: 0;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-bottom: 5px;
}

.contact-item .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    margin-top: 3px;
}

.contact-item p {
    font-size: 10.5px;
    color: rgba(255,255,255,.68);
    line-height: 1.5;
    margin: 0;
    word-break: break-all;
}

#cv-languages p,
.cv-left-column #cv-languages p {
    font-size: 10.5px !important;
    line-height: 1.45;
    margin-bottom: 3px;
}

#cv-languages strong,
.cv-left-column #cv-languages strong {
    font-size: 10.5px !important;
}

.cv-right-column {
    flex: 1;
    min-width: 0;
    background: var(--white);
    display: flex;
    flex-direction: column;
}

.main-header {
    padding: 22px 22px 14px;
    border-bottom: 3px solid var(--accent);
    position: relative;
}

.main-header::before {
    content: '';
    position: absolute;
    bottom: -3px; right: 0;
    width: 30px;
    height: 3px;
    background: var(--sidebar-bg);
}

.main-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.1;
}

.main-header h1 span.last-name {
    color: var(--sidebar-bg);
}

.main-header h2 {
    font-size: 9.5px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 2.5px;
    text-transform: uppercase;
    margin-top: 4px;
}

.main-body {
    padding: 14px 22px 22px;
    flex: 1;
}

.cv-section { margin-bottom: 12px; }

.section-title {
    font-size: 8.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}

.section-title-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    flex-shrink: 0;
}

#profile-about {
    font-size: 9.5px;
    color: var(--muted);
    line-height: 1.6;
}

.experience-item {
    margin-bottom: 9px;
    padding-bottom: 9px;
    border-bottom: 1px dashed var(--border);
}

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

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 1px;
}

.exp-header strong {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--ink);
}

.exp-header span {
    font-size: 7.5px;
    color: var(--subtle);
    white-space: nowrap;
    flex-shrink: 0;
    background: #EEF2FF;
    padding: 1px 6px;
    border-radius: 20px;
}

.exp-role {
    font-size: 9px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
}

.experience-item ul { padding-left: 0; }

.experience-item li {
    font-size: 9px;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 2px;
    padding-left: 11px;
    position: relative;
}

.experience-item li::before {
    content: '';
    position: absolute;
    left: 0; top: 6px;
    width: 5px; height: 2px;
    background: var(--accent-dark);
    border-radius: 1px;
}

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

.skill-group h4 {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px 10px;
}

.skill-row {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 16px;
}

.skill-row label {
    font-size: 8.5px;
    color: var(--muted);
    flex-shrink: 0;
    min-width: 52px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
    line-height: 1;
}

.skill-bar {
    flex: 1;
    height: 4px;
    min-height: 4px;
    max-height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    align-self: center;
}

.skill-bar-fill {
    height: 4px;
    background: var(--subtle);
    border-radius: 2px;
    transition: width 0.6s ease;
}

.cv-left-column strong,
.cv-left-column h4 {
    color: var(--white) !important;
}

.cv-left-column p,
.cv-left-column li,
.cv-left-column span:not(.sidebar-title-icon):not(.dot) {
    color: rgba(255, 255, 255, 0.65) !important;
}

.cv-left-column .education-item strong,
.cv-left-column .project-item strong {
    font-size: 11px;
    display: block;
    margin-bottom: 1px;
}

.cv-left-column .education-item p,
.cv-left-column .project-item p {
    font-size: 10px;
    line-height: 1.4;
    margin: 0 0 1px;
}

.cv-left-column .project-item {
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.10) !important;
}

.cv-left-column .project-item:last-child {
    border-bottom: none !important;
}

.cv-left-column .skill-group h4 {
    font-size: 11px;
}

.cv-left-column .skill-group p {
    font-size: 10px;
    line-height: 1.4;
}

.print-button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 13px 20px;
    background: rgba(0,0,0,.10);
    backdrop-filter: blur(4px);
    margin-bottom: 22px;
    border-radius: 4px;
}

.print-button,
.back-button {
    padding: 9px 22px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: transform .15s, box-shadow .15s;
}

.print-button {
    background: var(--sidebar-bg);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.print-button.secondary {
    background: var(--accent);
    color: var(--sidebar-bg);
}

.back-button {
    background: var(--white);
    color: var(--ink);
    border: 1px solid var(--border);
}

.print-button:hover,
.back-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
}

.theme-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid rgba(255,255,255,.25);
}

.theme-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,.75);
    white-space: nowrap;
}

.theme-swatches {
    display: flex;
    gap: 6px;
    align-items: center;
}

.swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    transition: transform .15s, border-color .15s, box-shadow .15s;
    outline: none;
}

.swatch[data-theme="navy-amber"]    { background: #0F2044; }
.swatch[data-theme="forest-gold"]   { background: #1B3A2D; }
.swatch[data-theme="burgundy-sand"] { background: #5C1A2E; }
.swatch[data-theme="slate-teal"]    { background: #1E3448; }
.swatch[data-theme="charcoal-rose"] { background: #2B2B2B; }

.swatch:hover {
    transform: scale(1.18);
    box-shadow: 0 2px 8px rgba(0,0,0,.35);
}

.swatch.active {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(255,255,255,.5);
    transform: scale(1.15);
}

@media print {
    *,
    *::before,
    *::after {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html, body {
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
        height: auto !important;
        overflow: visible !important;
    }

    .cv-container {
        box-shadow: none !important;
        border-radius: 0 !important;
        width: 210mm !important;
        min-height: 297mm !important;
        height: auto !important;
        overflow: visible !important;
        align-items: stretch !important;
    }

    .cv-left-column {
        min-height: 100% !important;
        height: auto !important;
        align-self: stretch !important;
        overflow: visible !important;
    }

    .cv-right-column,
    .cv-body {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

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

    @page {
        margin: 0;
        size: A4;
    }
}
