:root {
    --color-sidebar: #0f2744;
    --color-sidebar-soft: #1a3a64;
    --color-accent: #06b6d4;
    --color-accent-strong: #0ea5e9;
    --color-on-dark: #e2e8f0;
    --color-on-dark-soft: #cbd5e1;

    --color-bg: #f1f5f9;
    --color-surface: #ffffff;
    --color-surface-soft: #f8fafc;
    --color-ink: #1e293b;
    --color-ink-soft: #475569;
    --color-muted: #94a3b8;
    --color-line: #e2e8f0;
    --color-heading: #0f2744;

    --shadow-card: 0 20px 45px -25px rgba(15, 39, 68, 0.35);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --font-sans: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

    --page-width: 1180px;
    --sidebar-width: 320px;
}

[data-theme="dark"] {
    --color-bg: #050a14;
    --color-surface: #0f1a2c;
    --color-surface-soft: #142339;
    --color-ink: #e2e8f0;
    --color-ink-soft: #94a3b8;
    --color-muted: #64748b;
    --color-line: #1e3050;
    --color-heading: #f1f5f9;

    --shadow-card: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --color-bg: #050a14;
        --color-surface: #0f1a2c;
        --color-surface-soft: #142339;
        --color-ink: #e2e8f0;
        --color-ink-soft: #94a3b8;
        --color-muted: #64748b;
        --color-line: #1e3050;
        --color-heading: #f1f5f9;

        --shadow-card: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
    }
}

* {
    box-sizing: border-box;
}

.print-skills,
.print-languages {
    display: none;
}

button {
    font: inherit;
    border: none;
    cursor: pointer;
    background: none;
    color: inherit;
}

.action-cluster {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.print-action,
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--color-sidebar), #1a3a64);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 12px 30px -10px rgba(6, 182, 212, 0.55), 0 4px 12px -4px rgba(15, 39, 68, 0.4);
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.print-action svg,
.theme-toggle svg {
    width: 18px;
    height: 18px;
    fill: var(--color-accent);
}

.print-action:hover,
.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px -10px rgba(6, 182, 212, 0.7), 0 6px 16px -4px rgba(15, 39, 68, 0.5);
}

.print-action:active,
.theme-toggle:active {
    transform: translateY(0);
}

.theme-toggle .icon-moon {
    display: none;
}

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

[data-theme="dark"] .theme-toggle .icon-moon {
    display: inline-block;
}

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

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--color-bg);
    color: var(--color-ink);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 120ms ease, color 120ms ease;
}

a:hover {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

h1,
h2,
h3 {
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.01em;
}

p {
    margin: 0;
}

/* ---------- Page shell ---------- */

.cv-page {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    max-width: var(--page-width);
    margin: 40px auto;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

/* ---------- Sidebar ---------- */

.sidebar {
    background: var(--color-sidebar);
    color: var(--color-on-dark);
    padding: 36px 28px 40px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: relative;
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-strong));
}

.profile {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.photo-wrap {
    width: 210px;
    height: 210px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--color-sidebar-soft);
    border: 4px solid var(--color-accent);
    box-shadow: 0 18px 36px -16px rgba(6, 182, 212, 0.6);
}

.photo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile h1 {
    font-size: 22px;
    line-height: 1.2;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.profile h1 .surname {
    color: var(--color-accent);
    font-weight: 700;
}

.profile .headline {
    font-size: 12.5px;
    color: var(--color-on-dark-soft);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar h2 {
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar section + section h2 {
    margin-top: 4px;
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 13.5px;
    color: var(--color-on-dark-soft);
}

.contact-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    word-break: break-word;
}

.contact-list svg {
    width: 16px;
    height: 16px;
    fill: var(--color-accent);
    flex-shrink: 0;
}

.contact-list a {
    color: var(--color-on-dark);
}

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

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.badges li {
    font-size: 11.5px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.35);
    color: #e0f7ff;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.skills h2:not(:first-of-type) {
    margin-top: 22px;
}

.lang-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.lang-list li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 8px;
    align-items: center;
}

.lang-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #ffffff;
}

.lang-level {
    font-size: 11.5px;
    color: var(--color-accent);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.lang-bar {
    grid-column: 1 / -1;
    display: block;
    width: 100%;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    margin-top: 2px;
}

.lang-bar > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-strong));
    border-radius: inherit;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chips li {
    font-size: 12px;
    padding: 4px 9px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-on-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chips--accent li {
    background: rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.4);
    color: #e0f7ff;
}

.chips--muted li {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.18);
    color: var(--color-on-dark-soft);
}

/* ---------- Main content ---------- */

.main {
    padding: 44px 48px 48px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.section h2 {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 20px;
    color: var(--color-heading);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-line);
}

.section-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--color-sidebar);
    color: var(--color-accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    flex-shrink: 0;
}

.section--profile p + p {
    margin-top: 10px;
}

.section--profile p {
    color: var(--color-ink-soft);
    font-size: 14.5px;
}

/* ---------- Experience ---------- */

.section--experience {
    display: flex;
    flex-direction: column;
}

.job {
    position: relative;
    padding: 18px 0 18px 22px;
    border-left: 2px solid var(--color-line);
}

.job::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 26px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-accent);
    border: 3px solid var(--color-surface);
    box-shadow: 0 0 0 1px var(--color-accent);
}

.job + .job {
    margin-top: 4px;
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.job-company {
    font-size: 15.5px;
    color: var(--color-heading);
    font-weight: 700;
    line-height: 1.3;
}

.job-role {
    font-size: 13.5px;
    color: var(--color-accent-strong);
    font-weight: 600;
    margin-top: 2px;
}

.job-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-size: 12px;
    color: var(--color-ink-soft);
    text-align: right;
}

.job-dates {
    font-weight: 600;
    color: var(--color-ink);
    letter-spacing: 0.02em;
}

.job-location {
    color: var(--color-muted);
}

.job-tag {
    display: inline-block;
    margin-top: 2px;
    padding: 2px 8px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #052f3a;
    background: var(--color-accent);
    border-radius: 999px;
}

[data-theme="dark"] .job-tag {
    color: #ffffff;
    background: rgba(6, 182, 212, 0.35);
    box-shadow: inset 0 0 0 1px rgba(6, 182, 212, 0.65);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .job-tag {
        color: #ffffff;
        background: rgba(6, 182, 212, 0.35);
        box-shadow: inset 0 0 0 1px rgba(6, 182, 212, 0.65);
    }
}

.job-bullets {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: var(--color-ink-soft);
    font-size: 13.5px;
}

.job-bullets li {
    position: relative;
    padding-left: 16px;
}

.job-bullets li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
}

/* ---------- Education ---------- */

.education-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.education-list li {
    padding: 14px 16px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    background: var(--color-surface-soft);
}

.education-list h3 {
    font-size: 14px;
    color: var(--color-heading);
    margin-bottom: 4px;
}

.edu-meta {
    font-size: 12.5px;
    color: var(--color-ink-soft);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .cv-page {
        grid-template-columns: 1fr;
        margin: 20px;
        border-radius: var(--radius-md);
    }

    .action-cluster {
        top: 12px;
        right: 12px;
        gap: 8px;
    }

    .print-action,
    .theme-toggle {
        padding: 10px 14px;
        font-size: 13px;
    }

    .print-action span,
    .theme-toggle-label {
        display: none;
    }

    .photo-wrap {
        width: 170px;
        height: 170px;
    }

    .sidebar {
        padding: 32px 24px;
    }

    .main {
        padding: 32px 24px;
        gap: 28px;
    }

    .education-list {
        grid-template-columns: 1fr;
    }

    .job-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .job-meta {
        align-items: flex-start;
        text-align: left;
    }
}
