/* Résumé on screen: two outlined cards side by side, sidebar | main column.
   (The fonts come from general.css; the print layout below has its own look.) */
main {
    width: calc(100% - 2 * var(--gutter));
    padding-bottom: 96px;
}

.resume {
    display: grid;
    grid-template-columns: minmax(280px, 360px) 1fr;
    align-items: start;
    gap: clamp(20px, 3vw, 32px);
    margin-top: clamp(24px, 3vw, 32px);
    color: var(--ink-soft);
    font-size: 17px;
    line-height: 1.5;
}

/* Both columns may shrink below their content width; long words wrap instead of overflowing */
.side,
.resume_main {
    min-width: 0;
    overflow-wrap: anywhere;
    border: var(--line) solid var(--ink);
    border-radius: var(--radius);
    background-color: var(--card);
    box-shadow: var(--shadow) var(--shadow) 0 var(--ink);
}

/* 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: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.resume a:hover {
    background-color: var(--yellow);
    color: var(--on-fill);
}

/* ---------- Sidebar ---------- */
.side {
    padding: clamp(20px, 3vw, 28px);
}

.monogram {
    display: grid;
    place-items: center;
    width: 104px;
    height: 104px;
    margin-bottom: 32px;
    box-sizing: border-box;
    border: var(--line) solid var(--ink);
    border-radius: var(--radius);
    background-color: var(--yellow);
    box-shadow: 4px 4px 0 var(--ink);
    color: var(--on-fill);
    font-family: var(--font-display);
    font-size: 60px;
    rotate: -3deg;
}

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

/* Section labels: mono, on a coloured strip */
.side-head,
.main-head {
    display: inline-block;
    margin-bottom: 12px;
    padding: 2px 10px;
    border: 2px solid var(--ink);
    background-color: var(--mint);
    color: var(--on-fill);
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.main-head {
    background-color: var(--pink);
    font-size: 16px;
}

.contact {
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.7;
    word-break: break-word;
}

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

.chip {
    padding: 2px 10px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background-color: var(--card);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    box-shadow: 2px 2px 0 var(--ink);
}

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

.side .sub {
    color: var(--ink-muted);
    font-size: 15px;
}

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

.side .sub + .strong {
    margin-top: 12px;
}

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

.resume_header {
    padding: clamp(20px, 3vw, 32px) clamp(16px, 3vw, 32px) 24px;
    border-bottom: var(--line) solid var(--ink);
    background-color: var(--yellow);
    color: var(--on-fill);
}

.prompt {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
}

.name {
    margin: 4px 0 2px !important;
    font-family: var(--font-display);
    font-size: clamp(48px, 9vw, 80px);
    font-weight: normal;
    line-height: 1;
}

.tagline {
    margin-bottom: 14px;
    font-family: var(--font-display);
    font-size: clamp(24px, 3vw, 30px);
}

.summary {
    max-width: 800px;
    font-size: 17px;
}

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

.rule-accent {
    height: var(--line);
    margin-bottom: 14px;
    background-color: var(--ink);
}

.rule-soft {
    height: 0;
    margin-bottom: 14px;
    border-top: 2px dashed var(--ink-muted);
}

.job {
    margin-bottom: 22px;
}

.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 {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 30px;
    line-height: 1.1;
}

.job-date {
    padding: 0 8px;
    border: 2px solid var(--ink);
    background-color: var(--paper);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.job-org {
    margin-top: 2px;
    color: var(--ink-muted);
    font-family: var(--font-mono);
    font-size: 14px;
}

.muted {
    color: var(--ink-muted);
}

.job ul {
    margin-top: 8px;
    padding-left: 22px;
}

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

.job li::marker {
    content: "■  ";
    font-size: 0.8em;
}

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

/* ---------- Save as PDF button ---------- */
.print_button {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 18px 10px;
    border: var(--line) solid var(--ink);
    border-radius: var(--radius);
    background-color: var(--blue);
    color: var(--on-fill);
    font-family: var(--font-display);
    font-size: 26px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 5px 5px 0 var(--ink);
    transition: translate 0.08s, box-shadow 0.08s;
}

@media (hover: hover) {
    .print_button:hover {
        translate: -2px -2px;
        box-shadow: 7px 7px 0 var(--ink);
    }
}

.print_button:active {
    translate: 5px 5px;
    box-shadow: 0 0 0 var(--ink);
}

/* ---------- 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;
    }

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

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

@media screen and (max-width: 760px) {
    main {
        padding-bottom: 96px;  /* the PDF button does not cover the last lines */
    }

    .print_button {
        right: 16px;
        bottom: calc(var(--bottom-bar) + 16px);  /* above the tab bar */
        font-size: 22px;
    }
}

/* ---------- 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;
        max-width: none;
        min-height: 0;
        margin: 0;
        padding: 0;
        background: none;
    }

    /* Undo the screen cards */
    .resume {
        gap: 0;
        margin: 0;
        color: var(--ink);
    }

    .side,
    .resume_main {
        border: 0;
        border-radius: 0;
        background: none;
        box-shadow: none;
    }

    .resume a,
    .resume a:hover {
        background: none;
        text-decoration: none;
    }

    .monogram {
        border: 0;
        box-shadow: none;
        rotate: none;
    }

    .side-head,
    .main-head {
        display: block;
        padding: 0;
        border: 0;
        background: none;
        letter-spacing: 0;
        text-transform: none;
    }

    .resume_header {
        border: 0;
        background: none;
        color: var(--ink);
    }

    .tagline,
    .job-title {
        font-family: inherit;
    }

    .job-date {
        padding: 0;
        border: 0;
        background: none;
        font-weight: 400;
    }

    .job li::marker {
        content: normal;
        font-size: inherit;
    }

    .rule-soft {
        border: 0;
    }

    .chip {
        box-shadow: none;
        color: inherit;
        font-weight: 400;
    }

    .contact {
        line-height: 1.55;
    }

    /* Screen font sizes that would otherwise leak into print */
    .side .sub,
    .summary {
        font-size: inherit;
    }

    .job-org {
        margin-top: 0;
        font-family: inherit;
        font-size: inherit;
    }

    .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;
    }
}
