/* Fonts of the printed (PDF) version, hosted in fonts/ (variable fonts: one file for weights 400-700) */
@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/ibm-plex-sans-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/ibm-plex-sans-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Résumé laid out directly on the page: sidebar | divider | main column */
.resume {
    display: grid;
    grid-template-columns: minmax(280px, 360px) 1fr;
    min-height: calc(100vh - var(--nav-height));
    min-height: calc(100svh - var(--nav-height));
    font-size: 20px;
    line-height: 1.35;
}

/* Both columns may shrink below their content width; long words wrap instead of overflowing */
.side,
.resume_main {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Reset without specificity, so the rules below can set their own margins */
:where(.resume) :where(p, h1, h2, ul) {
    margin: 0;
}

.resume a {
    color: inherit;
    text-decoration: none;
}

.resume a:hover {
    color: var(--color-border);
}

/* ---------- Sidebar ---------- */
.side {
    padding: clamp(24px, 4vw, 48px) clamp(16px, 3vw, 32px);
    border-right: 3px solid var(--color-secondary);
}

.monogram {
    display: grid;
    place-items: center;
    width: 112px;
    height: 112px;
    margin-bottom: 40px;
    border-radius: 12px;
    background-color: var(--color-border);
    color: #FFFFFF;
    font-size: 56px;
}

.side-block {
    margin-bottom: 32px;
}

.side-head {
    margin-bottom: 8px;
    color: var(--color-border);
    font-size: 24px;
}

.contact {
    color: var(--color-secondary);
    word-break: break-word;
}

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

.chip {
    padding: 2px 10px;
    border: 2px solid var(--color-secondary);
    border-radius: 6px;
    font-size: 18px;
}

.side .sub {
    color: var(--color-secondary);
}

/* Keeps e.g. a date range together on one line */
.nowrap {
    white-space: nowrap;
}

/* Space between entries, e.g. two degrees under education */
.side .sub + .strong {
    margin-top: 12px;
}

/* ---------- Main column ---------- */
.resume_main {
    padding-bottom: 48px;
}

.resume_header {
    padding: clamp(24px, 4vw, 48px) clamp(16px, 4vw, 48px) 0;
}

.prompt {
    color: var(--color-border);
}

.name {
    font-size: clamp(40px, 9vw, 64px);
    font-weight: normal;
    line-height: 1.1;
}

.tagline {
    margin-bottom: 16px;
    font-size: clamp(22px, 3.5vw, 28px);
}

.summary {
    max-width: 800px;
    color: var(--color-secondary);
}

.resume_section {
    padding: 32px clamp(16px, 4vw, 48px) 0;
}

.main-head {
    margin-bottom: 12px;
    color: var(--color-border);
    font-size: 28px;
    font-weight: normal;
}

.rule-accent {
    height: 2px;
    margin-bottom: 12px;
    background-color: var(--color-border);
}

.rule-soft {
    height: 1px;
    margin-bottom: 12px;
    background-color: var(--color-secondary);
}

.job {
    margin-bottom: 20px;
}

.job-top {
    display: flex;
    flex-wrap: wrap;  /* the date drops below a long title instead of squeezing it */
    justify-content: space-between;
    align-items: baseline;
    gap: 4px 16px;
}

.job-title {
    font-size: 26px;
}

.job-date,
.job-org,
.muted {
    color: var(--color-secondary);
}

.job-date {
    white-space: nowrap;
}

.job ul {
    margin-top: 6px;
    padding-left: 24px;
}

.job li {
    margin-bottom: 4px;
}

.project-name {
    color: var(--color-border);
}

/* ---------- Save as PDF button ---------- */
.print_button {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    position: fixed;
    right: 24px;
    bottom: 24px;
    min-height: 44px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background-color: var(--color-border);
    color: #FFFFFF;
    font-family: var(--font-primary);
    font-size: 22px;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
}

@media (hover: hover) {
    .print_button:hover {
        filter: brightness(1.1);
    }
}

/* ---------- Narrow screens and portrait tablets: one column ---------- */
/* "screen" keeps these rules away from the A4 print layout below */
@media screen and (max-width: 900px) {
    .resume {
        grid-template-columns: 1fr;
    }

    /* Name and experience first, the sidebar follows */
    .side {
        order: 2;
        border-right: none;
        border-top: 3px solid var(--color-secondary);
    }

    .resume_main {
        padding-bottom: 32px;
    }

    .monogram {
        width: 80px;
        height: 80px;
        margin-bottom: 24px;
        font-size: 40px;
    }

    .side-block {
        margin-bottom: 24px;
    }

    /* Room at the bottom so the fixed PDF button does not cover the last lines */
    .side {
        padding-bottom: 112px;
    }
}

@media screen and (max-width: 760px) {
    .print_button {
        right: 16px;
        bottom: calc(var(--bottom-bar) + 16px);  /* above the tab bar */
        padding: 8px 12px;
        font-size: 20px;
    }
}

/* ---------- Print / PDF: light A4 layout (former LaTeX design) ---------- */
@page {
    size: A4;
    margin: 0;
}

@media print {
    nav,
    .print_button {
        display: none;
    }

    /* Page colour behind the main column */
    html {
        background-color: #FAFAF7;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body {
        background: none;
    }

    main {
        width: auto;
        margin: 0;
        padding: 0;
        background: none;
    }

    .resume {
        --accent: #0D99FF;
        --ink: #1C1917;
        --muted: #57534E;
        --soft: #44403C;
        --paper: #FAFAF7;
        --sidebar: #F0EFEA;
        --rule: #D6D3D1;
        --sideborder: #E7E5E4;
        --mono: "JetBrains Mono", "Fira Mono", monospace;

        /* No fixed A4 size: browsers that keep their own page margins
           (Safari) would otherwise spill onto a second page */
        grid-template-columns: 66mm 1fr;
        min-height: 0;
        color: var(--ink);
        font-family: "IBM Plex Sans", system-ui, sans-serif;
        font-size: 9pt;
        line-height: 1.4;
    }

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

    .resume a {
        color: inherit;
    }

    /* Sidebar. Its grey background is a fixed strip, because in print
       fixed elements fill the full height of every page */
    .side {
        padding: 14mm 6mm 14mm 8mm;
        border-right: none;
    }

    .resume::before {
        content: "";
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: -1;
        width: 66mm;
        background-color: var(--sidebar);
        border-right: 0.6pt solid var(--sideborder);
    }

    .monogram {
        width: 20mm;
        height: 20mm;
        margin-bottom: 18pt;
        border-radius: 3pt;
        background-color: var(--accent);
        color: #FFFFFF;
        font-family: var(--mono);
        font-weight: 700;
        font-size: 20pt;
    }

    .side-block {
        margin-bottom: 16pt;
    }

    .side-head {
        margin-bottom: 4pt;
        color: var(--accent);
        font-family: var(--mono);
        font-weight: 700;
        font-size: 9pt;
    }

    .contact {
        color: var(--soft);
        font-family: var(--mono);
        font-size: 8pt;
        line-height: 1.55;
    }

    .chips {
        gap: 4pt 3pt;
    }

    .chip {
        padding: 1.2pt 3.5pt;
        border: 0.5pt solid var(--rule);
        border-radius: 1.5pt;
        background-color: var(--paper);
        font-family: var(--mono);
        font-size: 7pt;
    }

    .side .strong {
        font-weight: 600;
    }

    .side .sub {
        color: var(--soft);
    }

    .side .sub + .strong {
        margin-top: 6pt;
    }

    /* Main column */
    .resume_main {
        padding-bottom: 0;
    }

    .resume_header {
        padding: 15mm 10.5mm 0;
    }

    .prompt {
        margin-bottom: 2pt;
        color: var(--accent);
        font-family: var(--mono);
        font-size: 8pt;
    }

    .name {
        margin-bottom: 3pt;
        font-family: var(--mono);
        font-weight: 700;
        font-size: 26pt;
        line-height: 1.15;
    }

    .tagline {
        margin-bottom: 14pt;
        font-size: 12pt;
    }

    .summary {
        max-width: none;
        margin-bottom: 16pt;
        color: var(--soft);
    }

    .resume_section {
        padding: 0 10.5mm;
        margin-bottom: 16pt;
    }

    .main-head {
        margin-bottom: 6pt;
        color: var(--accent);
        font-family: var(--mono);
        font-weight: 700;
        font-size: 10pt;
    }

    .rule-accent {
        height: 1.4pt;
        margin-bottom: 5pt;
        background-color: var(--accent);
    }

    .rule-soft {
        height: 0.5pt;
        margin-bottom: 5pt;
        background-color: var(--rule);
    }

    .job {
        margin-bottom: 9pt;
        break-inside: avoid;
    }

    .job-top {
        gap: 8pt;
    }

    .job-title {
        font-size: 11.5pt;
        font-weight: 700;
    }

    .job-date {
        font-family: var(--mono);
        font-size: 8pt;
    }

    .job-date,
    .job-org,
    .muted {
        color: var(--muted);
    }

    .job ul {
        margin-top: 3pt;
        padding-left: 12pt;
    }

    .job li {
        margin-bottom: 1.5pt;
    }

    .project-name {
        color: var(--ink);
        font-family: var(--mono);
        font-weight: 700;
    }
}
