:root {
    --cv-bg: #ffffff;
    --cv-page-bg: #f3f4f6;
    --cv-text-main: #111827;
    --cv-text-muted: #4b5563;
    --cv-text-light: #6b7280;
    --cv-border: #e5e7eb;
    --cv-button-bg: #111827;
    --cv-button-hover: #1f2937;
    --cv-font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--cv-page-bg);
    color: var(--cv-text-main);
    font-family: var(--cv-font-sans);
    line-height: 1.55;
}

a {
    color: inherit;
}

.nav-container {
    width: 100%;
    max-width: 1100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.back-link {
    color: var(--cv-text-muted);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
}

.back-link:hover {
    color: var(--cv-text-main);
}

.resume-controls {
    display: flex;
    gap: 12px;
}

.btn {
    font: inherit;
}

.btn-small {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--cv-border);
    border-radius: 6px;
    background: #ffffff;
    color: var(--cv-text-main);
    font-size: 0.86rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-small:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.btn-primary {
    background: var(--cv-button-bg);
    border-color: var(--cv-button-bg);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--cv-button-hover);
    border-color: var(--cv-button-hover);
    color: #ffffff;
}

.resume-container {
    width: 100%;
    max-width: 1100px;
    padding: 60px;
    border-radius: 10px;
    background: var(--cv-bg);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.cv-document {
    display: none;
}

.cv-document.active {
    display: block;
}

.cv-header {
    display: flex;
    align-items: center;
    gap: 32px;
    padding-bottom: 24px;
    margin-bottom: 32px;
    border-bottom: 2px solid var(--cv-text-main);
}

.cv-photo {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
}

.cv-name {
    margin: 0 0 4px;
    font-size: 2.55rem;
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.cv-role {
    margin: 0;
    font-size: 1.28rem;
    color: var(--cv-text-muted);
    font-weight: 400;
}

.cv-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

.cv-sidebar {
    font-size: 0.94rem;
}

.cv-main {
    min-width: 0;
    font-size: 0.98rem;
}

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

.cv-section:last-child,
.cv-job:last-child,
.cv-contact-list li:last-child,
.cv-skill-item:last-child,
.cv-education-list li:last-child,
.cv-list li:last-child {
    margin-bottom: 0;
}

.cv-section-title {
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--cv-border);
    font-size: 1.08rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.cv-contact-list,
.cv-education-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cv-contact-list li,
.cv-education-list li {
    margin-bottom: 12px;
    line-height: 1.45;
}

.cv-contact-label,
.cv-education-list strong,
.cv-skill-item strong {
    color: var(--cv-text-main);
    font-weight: 700;
}

.cv-contact-link {
    overflow-wrap: anywhere;
    text-decoration: none;
}

.cv-contact-link:hover {
    text-decoration: underline;
}

.cv-skills-block {
    color: var(--cv-text-muted);
}

.cv-skill-item {
    margin-bottom: 14px;
    line-height: 1.55;
}

.cv-main p {
    margin: 0;
}

.cv-job {
    margin-bottom: 28px;
}

.cv-job-header,
.cv-role-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 20px;
}

.cv-job-title {
    margin: 0;
    font-size: 1.18rem;
    line-height: 1.2;
    font-weight: 700;
}

.cv-job-date,
.cv-role-date {
    color: var(--cv-text-light);
    white-space: nowrap;
    flex-shrink: 0;
}

.cv-job-company {
    margin-top: 4px;
    font-weight: 500;
    color: var(--cv-text-muted);
}

.cv-job-role {
    margin-top: 18px;
}

.cv-role-title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.25;
    font-weight: 700;
    color: var(--cv-text-main);
}

.cv-list {
    margin: 10px 0 0;
    padding-left: 20px;
    color: var(--cv-text-muted);
}

.cv-list li {
    margin-bottom: 8px;
}

.cv-list strong {
    color: var(--cv-text-main);
    font-weight: 600;
}

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

    .nav-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .resume-controls {
        width: 100%;
    }

    .btn-small {
        justify-content: center;
        flex: 1;
    }

    .resume-container {
        padding: 32px 24px;
    }

    .cv-header {
        gap: 20px;
    }

    .cv-photo {
        width: 104px;
        height: 104px;
    }

    .cv-name {
        font-size: 2rem;
    }

    .cv-role {
        font-size: 1.08rem;
    }

    .cv-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .cv-job-header,
    .cv-role-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

@media (max-width: 560px) {
    .resume-container {
        padding: 28px 18px;
    }

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

    .cv-photo {
        width: 92px;
        height: 92px;
    }
}
