:root {
    --main-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
    --page-bg: #f6f6f3;
    --surface: #ffffff;
    --ink: #202426;
    --muted: #626b66;
    --soft: #8a938d;
    --rule: #d9ddd7;
    --rule-strong: #b8c0b8;
    --accent: #2f6257;
    --accent-soft: #e3ece8;
    --shadow: 0 18px 45px rgba(30, 35, 32, 0.06);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--page-bg);
    color: var(--ink);
    font-family: var(--main-font);
    font-size: 16px;
    line-height: 1.62;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--accent);
    text-decoration-color: rgba(47, 98, 87, 0.35);
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--ink);
    text-decoration-color: var(--ink);
}

header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(246, 246, 243, 0.92);
    border-bottom: 1px solid var(--rule);
    backdrop-filter: blur(14px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    width: min(100%, 1120px);
    margin: 0 auto;
    padding: 0.85rem clamp(1rem, 4vw, 2rem);
}

.left-content {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-width: 0;
}

header h1 {
    margin: 0;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}

.navigation ul {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.navigation li {
    margin: 0;
}

.navigation a {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.navigation a:hover,
.navigation a[aria-current="page"] {
    background: var(--accent-soft);
    color: var(--ink);
}

.social-links {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
}

.social-links a:hover {
    background: var(--accent-soft);
}

.social-links img {
    width: 18px;
    height: 18px;
    opacity: 0.78;
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--rule);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font: inherit;
}

main {
    width: min(100%, 960px);
    margin: 0 auto;
    padding: clamp(2.25rem, 6vw, 4.5rem) clamp(1rem, 4vw, 2rem);
}

.page-spacer {
    display: none;
}

section {
    margin: 0;
    padding: 1.55rem 0 1.8rem;
    border-top: 1px solid var(--rule);
}

section:first-of-type {
    border-top: 0;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1,
h2,
h3 {
    color: var(--ink);
    line-height: 1.18;
}

h2 {
    margin: 0 0 1rem;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h3 {
    margin: 0 0 0.35rem;
    font-size: 1.02rem;
    font-weight: 720;
}

p {
    margin: 0 0 0.85rem;
}

strong {
    color: var(--ink);
    font-weight: 700;
}

ul {
    margin: 0.65rem 0 0;
    padding-left: 1.15rem;
}

li {
    margin: 0 0 0.42rem;
    padding-left: 0.1rem;
}

li::marker {
    color: var(--accent);
}

footer {
    border-top: 1px solid var(--rule);
    color: var(--soft);
    font-size: 0.88rem;
    text-align: center;
    padding: 1.35rem 1rem 1.8rem;
}

.center {
    display: grid;
    gap: 0.3rem;
    margin-bottom: 1.75rem;
    padding: 0 0 1.75rem;
    border-bottom: 1px solid var(--rule-strong);
    text-align: left;
}

.center h1 {
    margin: 0 0 0.2rem;
    font-size: clamp(2.15rem, 6vw, 4.25rem);
    font-weight: 760;
    letter-spacing: 0;
}

.center p {
    max-width: 68ch;
    margin: 0;
    color: var(--muted);
}

.center p:first-of-type {
    color: var(--ink);
    font-size: clamp(1.02rem, 2.3vw, 1.25rem);
    font-weight: 620;
}

.cv-last-updated {
    color: var(--soft);
    font-size: 0.9rem;
}

.download-cv-button {
    justify-self: start;
    margin-top: 0.9rem;
    padding: 0.72rem 1.05rem;
    border: 1px solid var(--accent);
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.download-cv-button:hover {
    background: var(--ink);
    border-color: var(--ink);
    transform: translateY(-1px);
}

.download-cv-button:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
}

.summary-meta {
    margin-top: 0.8rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.summary-meta + .summary-meta {
    margin-top: 0.25rem;
}

.cv-page section > p,
.cv-page section li {
    font-size: 0.96rem;
}

.cv-page .job-meta,
.cv-page .date {
    font-size: 0.9rem;
}

.cv-page .summary-meta,
.cv-page .skill-group p {
    font-size: 0.92rem;
}

.job {
    margin-bottom: 1.55rem;
}

.job:last-child,
.skill-group:last-child {
    margin-bottom: 0;
}

.job-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(9rem, auto);
    gap: 0.5rem 1.5rem;
    align-items: baseline;
}

.job-title-group h3 {
    margin: 0;
}

.job-meta,
.date {
    color: var(--muted);
    font-size: 0.92rem;
}

.job-meta {
    margin: 0.16rem 0 0;
}

.date {
    margin: 0;
    line-height: 1.35;
    text-align: right;
}

.date span {
    display: block;
}

.skills-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.5rem;
}

.skill-group {
    margin: 0;
}

.skill-group h3 {
    font-size: 0.96rem;
}

.skill-group p {
    margin: 0;
    color: var(--muted);
    font-size: 0.94rem;
}

#about {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(14rem, 18rem);
    gap: clamp(1.5rem, 5vw, 3.25rem);
    align-items: start;
    padding-top: clamp(1rem, 4vw, 2.5rem);
    border-top: 0;
}

.text-content p:first-child {
    color: var(--ink);
    font-size: clamp(1.45rem, 4vw, 2.45rem);
    font-weight: 740;
    line-height: 1.16;
    margin-bottom: 1.25rem;
}

.text-content p {
    max-width: 68ch;
    color: var(--muted);
}

.image-content {
    position: sticky;
    top: 5.25rem;
}

.image-content img {
    display: block;
    width: 100%;
    max-width: 18rem;
    height: auto;
    border: 1px solid var(--rule);
    border-radius: 6px;
    box-shadow: var(--shadow);
}

@media (max-width: 768px) {
    .header-content {
        align-items: flex-start;
        padding-top: 0.7rem;
        padding-bottom: 0.7rem;
    }

    .left-content {
        display: grid;
        grid-template-columns: auto auto;
        gap: 0.65rem 0.9rem;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .navigation {
        display: none;
        grid-column: 1 / -1;
    }

    .navigation.active {
        display: block;
    }

    .navigation ul {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.2rem;
        padding-top: 0.25rem;
    }

    .navigation a {
        padding-left: 0;
        background: transparent;
    }

    .social-links {
        padding-top: 0.1rem;
    }

    main {
        padding-top: 2rem;
    }

    .job-header,
    .skills-list,
    #about {
        grid-template-columns: 1fr;
    }

    .date {
        text-align: left;
    }

    .image-content {
        position: static;
        order: -1;
    }

    .image-content img {
        max-width: 13rem;
    }
}

@media (max-width: 520px) {
    body {
        font-size: 15px;
    }

    .header-content {
        gap: 0.7rem;
    }

    .social-links a {
        width: 1.8rem;
        height: 1.8rem;
    }

    .center h1 {
        font-size: 2.2rem;
    }
}

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

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

    html,
    body {
        background: #fff;
        color: #000;
        font-size: 9.4pt;
        line-height: 1.42;
    }

    header,
    footer,
    .menu-toggle,
    .social-links,
    .navigation,
    .download-cv-button,
    .page-spacer {
        display: none !important;
    }

    main {
        background: #fff;
        width: auto;
        max-width: none;
        margin: 0;
        padding: 0;
    }

    section {
        margin: 0 0 0.9rem;
        padding: 0.85rem 0 0;
        border-top: 1px solid #c9c9c9;
        page-break-inside: avoid;
    }

    section:first-of-type {
        border-top: 0;
    }

    .job,
    .skill-group {
        page-break-inside: avoid;
    }

    .center {
        margin-bottom: 0.85rem;
        padding: 0 0 0.85rem;
        border-bottom: 1.5px solid #2f6257;
    }

    .center h1 {
        font-size: 23pt;
    }

    .center p,
    .job-meta,
    .date,
    .summary-meta,
    .skill-group p {
        font-size: 8.8pt;
    }

    h2 {
        margin-bottom: 0.5rem;
        color: #2f6257;
        font-size: 8pt;
    }

    h3 {
        font-size: 9.8pt;
    }

    p,
    li,
    a {
        color: #111;
    }

    h3 {
        color: #000;
    }

    .job-meta,
    .date,
    .summary-meta,
    .skill-group p,
    .cv-last-updated {
        color: #4d5752;
    }

    a {
        text-decoration: none;
    }

    ul {
        margin: 0.35rem 0 0;
        padding-left: 1rem;
    }

    li {
        margin-bottom: 0.25rem;
    }
}
