/* DM Sans is self-hosted for matching web and PDF typography. License: fonts/dm-sans/OFL.txt. */
@font-face {
    font-family: 'DM Sans';
    src: url('fonts/dm-sans/DM-Sans-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'DM Sans';
    src: url('fonts/dm-sans/DM-Sans-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'DM Sans';
    src: url('fonts/dm-sans/DM-Sans-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fff;
    min-height: 100vh;
    padding: 20px;
}

.site-nav {
    max-width: 600px;
    width: 100%;
    margin: 0 auto 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.site-nav a {
    color: #333;
    text-decoration: none;
}

.site-nav a:hover {
    text-decoration: underline;
}

.site-nav a[aria-current="page"] {
    font-weight: 600;
}

.site-nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

a.btn-pdf {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border: 1px solid #333;
    border-radius: 3px;
    font-size: 0.9rem;
    text-decoration: none;
    color: #333;
    line-height: 1.3;
}

a.btn-pdf:hover {
    background: #333;
    color: #fff;
    text-decoration: none;
}

.home-main {
    padding-top: 12vh;
}

.container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}

h1 {
    font-size: 2rem;
    margin-bottom: 2rem;
    font-weight: 400;
}

.info {
    font-size: 1rem;
    line-height: 2;
}

.info p {
    margin-bottom: 0.5rem;
}

/* CV page */
.cv-page {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    padding-top: 1rem;
    padding-bottom: 3rem;
}

@media screen {
    .cv-page {
        max-width: 960px;
    }

    .cv-page .site-nav {
        max-width: none;
    }
}

.cv-header {
    margin-bottom: 1.5rem;
}

.cv-header h1 {
    margin-bottom: 0.75rem;
}

.cv-social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.25rem;
}

.cv-social a {
    color: #333;
    line-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cv-social img,
.cv-social svg {
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
    display: block;
    object-fit: contain;
}

.cv-social a:hover {
    opacity: 0.7;
}

/* Hidden on screen; visible in print / PDF (WeasyPrint uses print styles) */
.cv-contact-print-only {
    display: none;
}

.cv-lead {
    margin-bottom: 1.25rem;
}

.cv-lead p + p {
    margin-top: 0.75rem;
}

.cv-content h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
}

.cv-content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.25rem 0 0.5rem;
}

.cv-content p {
    margin-bottom: 0.75rem;
}

.cv-content ul {
    margin: 0.5rem 0 1rem 1.25rem;
}

.cv-content li {
    margin-bottom: 0.35rem;
}

.cv-content a {
    color: #333;
}

.cv-content .muted {
    font-style: italic;
    color: #555;
    font-size: 0.95rem;
}

/* WeasyPrint / PDF export (scripts/build-cv-pdf.py) */
@media print {
    body {
        padding: 0;
        font-size: 10.5pt;
        line-height: 1.35;
    }

    /* PDF: text links only - icons are for the web view (avoids duplicate row in WeasyPrint) */
    .cv-social {
        display: none;
    }

    .cv-contact-print-only {
        display: block;
        margin: 0 0 1.25rem;
        font-size: 10pt;
        line-height: 1.5;
    }

    .site-nav {
        display: none;
    }

    .cv-page {
        padding-top: 0;
        padding-bottom: 0;
    }

    .container {
        max-width: none;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .cv-content h2 {
        margin: 1rem 0 0.5rem;
        break-after: avoid;
    }

    .cv-content h3 {
        margin: 0.9rem 0 0.4rem;
        break-after: avoid;
    }

    .cv-content p {
        margin-bottom: 0.4rem;
        orphans: 3;
        widows: 3;
    }

    .cv-content ul {
        margin-top: 0.4rem;
        margin-bottom: 0.75rem;
    }

    .cv-content li {
        margin-bottom: 0.25rem;
        break-inside: avoid;
    }

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

/* Dark theme for the CV web page, matching the homepage. Screen only: print and the PDF stay light. */
@media screen {
    body {
        background: #0b0b0b;
        color: #a9a9a9;
        -webkit-font-smoothing: antialiased;
    }

    .cv-page h1,
    .cv-content h2,
    .cv-content h3,
    .cv-content strong {
        color: #ececec;
    }

    .site-nav {
        font-family: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace;
        font-size: 13px;
    }

    .site-nav a,
    .cv-content a {
        color: #ececec;
    }

    .site-nav a:hover,
    .cv-content a:hover {
        color: #ff6500;
        text-decoration: none;
    }

    a.btn-pdf {
        color: #ececec;
        border-color: rgba(255, 255, 255, .26);
        border-radius: 6px;
    }

    a.btn-pdf:hover {
        background: transparent;
        color: #ececec;
        border-color: #ff6500;
    }

    .cv-content h2 {
        padding-top: 1.25rem;
        border-top: 1px solid rgba(255, 255, 255, .11);
    }

    .cv-content .muted {
        color: #777;
    }

    /* Social icons are dark (#333) for print; lighten them on screen */
    .cv-social img,
    .cv-social svg {
        filter: invert(1) brightness(.92);
    }
}

/* Small portrait beside CV name */
.cv-identity {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 0.25rem;
}
.cv-portrait {
    width: 72px;
    height: 90px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,.12);
    filter: grayscale(1) contrast(1.08) brightness(.92);
}
@media screen {
    .cv-portrait {
        border-color: rgba(255,255,255,.11);
        filter: grayscale(1) contrast(1.08) brightness(.9);
    }
    .cv-portrait:hover { filter: none; }
}
@media print {
    .cv-portrait { filter: grayscale(1); }
}
