:root {
    --body-bg: #e3e7ed;
    --border: rgba(25, 34, 42, 0.12);
    --muted: #5e6a7a;
    --primary: #18709b;
    --primary-dark: #0f4c6b;
    --cv-heading: #18709bc1;
    --sidebar-bg: #f6f7f8;
    --sidebar-heading: #18709b;
    --sidebar-text: #495d7c;
    --content-heading: #495d7c;
    --content-text: #495d7c;
}

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

@page {
    size: A4;
    margin: 12mm;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--body-bg);
    font-family: "Segoe UI", "Inter", system-ui, sans-serif;
    font-size: 12px;
    line-height: 1.4;
    color: var(--content-text);
    display: flex;
    justify-content: center;
    padding: 12mm 0;
}

.page {
    width: 210mm;
    min-height: 297mm;
    background: #ffffff;
    box-shadow: 0 12px 35px rgba(15, 41, 68, 0.15);
    display: grid;
    grid-template-rows: auto 1fr;
    border-radius: 4px;
    overflow: hidden;
}

.hero {
    background: var(--cv-heading);
    color: #ffffff;
    padding: 3mm 5mm;
}

.hero-top {
    width: 100%;
    display: grid;
    grid-template-columns: 15% 50% 30%;
    align-items: center;
    gap: 8mm;
}

.hero-photo {
    width: 150px;
    height: 150px;
}

.photo-frame {
    width: 110px;
    height: 150px;
    padding: 2px;
    background: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-frame,
.photo-frame img {
    border-radius: 5%;
}

.hero-identity {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.hero-name {
    font-size: 2.2rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin: 0;
    text-align: center;
}

.hero-title {
    margin: 0;
    font-size: 1rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-align: center;
}

.hero-contact {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-self: center;
    min-width: 0;
}

.hero-contact .contact-list li,
.hero-links .contact-list li {
    color: #ffffff;
    margin-bottom: .5rem;
}

.hero-contact .contact-list li {
    color: #ffffff;
}


.hero-links-row {
    margin-top: 6mm;
    width: 100%;
}

.hero-links-row .hero-links {
    flex: 1;
}

.hero-links .contact-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 0;
    margin: 0;
}

.hero-links.contact-list li {
    display: inline-block;
    width: 20%;
    text-align: center;
}

.layout-grid {
    display: grid;
    grid-template-columns: 33% 67%;
    background: #ffffff;
    min-height: 100%;
}

.sidebar {
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 8mm;
    display: flex;
    flex-direction: column;
    border-right: 1px dashed var(--border);
}

.sidebar-section {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 10mm;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.75rem;
    margin-bottom: 6px;
}

.section-icon {
    width: 1.1em;
    height: 1.1em;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.section-icon .fa-stack {
    font-size: 0.9rem;
}

.section-icon .fa-stack .fa-circle,
.contact-label .fa-stack .fa-circle {
    color: var(--primary);
}

.section-icon .fa-stack .fa-stack-1x:not(.fa-circle),
.contact-label .fa-stack .fa-stack-1x:not(.fa-circle) {
    color: #ffffff;
}

.contact-label {
    width: 1.1em;
    height: 1.1em;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 5px;
}

.contact-label .fa-stack {
    font-size: 0.8rem;
}

.section-heading h2 {
    color: var(--sidebar-heading);
    margin: 0;
    font-size: 0.9rem;
}

.contact-list,
.personality-list,
.education-list,
.skills-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.personality-list li,
.education-list li {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.75rem;
    line-height: 1.3;
    margin-bottom: 4px;
}

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

.personality-list span {
    font-weight: 600;
    min-width: 70px;
    display: inline-block;
}

.hobbies-text {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.4;
}

.skills-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.skill-line {
    font-size: 0.72rem;
    line-height: 1.35;
    margin-bottom: .1rem;
    color: var(--sidebar-text);
}

.skill-line strong {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 2px;
}

.skills-category {
    font-size: 0.75rem;
}

.skills-category ul {
    display: grid;
    gap: 2px;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.skills-category li {
    font-size: 0.7rem;
    line-height: 1.3;
    padding-left: 10px;
    position: relative;
}

.skills-category li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-size: 0.9rem;
    line-height: 1;
}

.content {
    background: #ffffff;
    color: var(--content-text);
    display: flex;
    flex-direction: column;
    text-align: justify;
}

.summary-section {
    font-size: 0.85rem;
    line-height: 1.5;
}

.summary-text {
    margin: 0;
}

.summary-card {
    background: rgba(24, 112, 155, 0.08);
    padding: 6mm 7mm;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
    line-height: 1.5;
}

.experience-section {
    padding: 6mm;
}

.experience-list {
    display: flex;
    flex-direction: column;
    gap: 6mm;
}

.experience {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 5mm;
}

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

.experience-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 1rem;
}

.experience-header-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.experience-header-left {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-direction: row;
}

.experience-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.experience-job {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.experience-company {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 400;
    font-style: normal;
}

.experience-header-right {
    align-items: flex-end;
    text-align: right;
    justify-content: center;
}

.experience-location {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 2px;
}

.experience-dates {
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0;
}

.experience-header .role {
    color: var(--muted);
    font-weight: 500;
}

.experience-dates {
    font-size: 0.75rem;
    color: var(--muted);
}

.experience-location {
    margin: 0;
    font-size: 0.8rem;
    color: var(--muted);
}

.experience-logo {
    width: 50px;
    height: 50px;
    border-radius: 5%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.experience-company_logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.achievement-list {
    margin: 6px 0 0;
    padding-left: 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.achievement-list li {
    font-size: 0.7rem;
    margin-bottom: .5rem;
    line-height: 1.3;
    color: var(--content-text);
}

.achievement-list li::marker {
    color: var(--primary);
}

.main-heading,
.sidebar-section .section-heading {
    letter-spacing: 0.08em;
}

.section-heading .fa-stack {
    line-height: 1;
}

.json-source {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    visibility: hidden;
}

@media print {
    body {
        background: #ffffff;
        padding: 0;
    }

    .page {
        box-shadow: none;
        min-height: auto;
        height: auto;
        overflow: visible;
    }

    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .layout-grid {
        display: grid;
        grid-template-columns: 34% 66%;
        width: 100%;
        min-height: auto;
        align-items: start;
    }

    .sidebar,
    .content {
        display: block;
        vertical-align: top;
    }

    .sidebar {
        width: auto;
        background: #ffffff !important;
        padding-left: 0 !important;
    }

    .content {
        width: auto;
    }

    .experience-list,
    .sidebar {
        break-inside: auto;
        page-break-inside: auto;
    }

    .content {
        display: block;
    }

    .experience-list {
        display: block;
    }

    .hero {
        background: var(--cv-heading) !important;
        color: #ffffff !important;
    }

    .hero a {
        color: #ffffff !important;
    }

    .page a::after {
        content: "";
        display: none;
    }

    @supports (-webkit-touch-callout: none) {
        .layout-grid {
            display: table;
            table-layout: fixed;
            width: 100%;
        }

        .sidebar,
        .content {
            display: table-cell;
            vertical-align: top;
        }

        .sidebar {
            width: 34%;
        }

        .content {
            width: 66%;
        }

        .experience,
        .sidebar-section {
            break-inside: avoid;
            page-break-inside: avoid;
        }
    }
}