/* ============================================================
   Anton Schahlou — CV
   Single-column by design: multi-column layouts confuse the ATS
   parsers most Polish recruiting platforms run before a human
   ever sees the document.
   ============================================================ */

:root {
    --ink:        #14171f;
    --ink-soft:   #3d4452;
    --ink-muted:  #6b7385;
    --rule:       #d8dce4;
    --rule-soft:  #e9ecf1;
    --accent:     #1f3a68;
    --accent-dim: #4a6591;
    --paper:      #ffffff;
    --ground:     #eceef2;

    --serif: "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
    --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono:  "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    padding: 32px 16px 64px;
    background: var(--ground);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 10.5pt;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

.page {
    max-width: 210mm;
    margin: 0 auto;
    padding: 16mm 15mm 14mm;
    background: var(--paper);
    box-shadow: 0 1px 2px rgba(20, 23, 31, .10), 0 12px 32px -8px rgba(20, 23, 31, .16);
    border-radius: 2px;
}

/* ---------- Masthead ---------------------------------------- */

.masthead {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 32px;
    align-items: flex-end;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 2.5px solid var(--accent);
}

.masthead-main { min-width: 0; }

.masthead h1 {
    margin: 0;
    font-family: var(--serif);
    font-size: 30pt;
    font-weight: 600;
    line-height: 1.02;
    letter-spacing: -0.015em;
    color: var(--accent);
}

.role {
    margin: 5px 0 0;
    font-size: 11.5pt;
    font-weight: 500;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.contacts {
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: right;
    font-size: 9.5pt;
    line-height: 1.65;
    color: var(--ink-soft);
}

.contacts .label {
    display: inline-block;
    min-width: 62px;
    margin-right: 8px;
    font-size: 7.5pt;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

/* ---------- Sections ---------------------------------------- */

.block { margin-top: 20px; }

.block h2 {
    margin: 0 0 10px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--rule);
    font-size: 9.5pt;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
}

.section-note {
    margin: -4px 0 12px;
    font-size: 9pt;
    color: var(--ink-muted);
}

.summary {
    margin: 0;
    font-family: var(--serif);
    font-size: 11pt;
    line-height: 1.58;
    color: var(--ink-soft);
    text-wrap: pretty;
}

.summary strong { color: var(--ink); }

/* ---------- Skills ------------------------------------------ */

.skills { margin: 0; }

.skill-row {
    display: grid;
    grid-template-columns: 118px 1fr;
    gap: 14px;
    padding: 4px 0;
    border-bottom: 1px solid var(--rule-soft);
}

.skill-row:last-child { border-bottom: 0; }

.skills dt {
    font-size: 8.5pt;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-dim);
    padding-top: 1px;
}

.skills dd {
    margin: 0;
    color: var(--ink-soft);
}

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

/* ---------- Experience -------------------------------------- */

.job { margin-bottom: 16px; }
.job:last-child { margin-bottom: 0; }

.job-head,
.project-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 16px;
}

.job-head h3 {
    margin: 0;
    font-family: var(--serif);
    font-size: 13.5pt;
    font-weight: 600;
    letter-spacing: -0.005em;
    color: var(--ink);
}

.job-title {
    font-family: var(--sans);
    font-size: 10.5pt;
    font-weight: 500;
    color: var(--ink-muted);
}

.dates {
    flex: none;
    font-size: 9pt;
    font-weight: 600;
    letter-spacing: 0.045em;
    color: var(--ink-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.job-note {
    margin: 4px 0 0;
    font-size: 9.5pt;
    color: var(--ink-muted);
    max-width: 62ch;
}

/* Client engagements nested under the employer */
.project {
    margin-top: 12px;
    padding-left: 14px;
    border-left: 2px solid var(--rule);
}

.project-head h4,
.project.compact h4 {
    margin: 0;
    font-size: 10.5pt;
    font-weight: 700;
    letter-spacing: 0.005em;
    color: var(--accent);
}

.stack {
    margin: 3px 0 6px;
    font-size: 9pt;
    color: var(--ink-muted);
}

.stack strong {
    color: var(--accent-dim);
    font-weight: 600;
}

.project ul {
    margin: 0;
    padding-left: 15px;
    list-style: none;
}

.project li {
    position: relative;
    margin-bottom: 3px;
    color: var(--ink-soft);
    text-wrap: pretty;
}

.project li::before {
    content: "";
    position: absolute;
    left: -13px;
    top: 0.62em;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-dim);
}

.project li strong { color: var(--ink); font-weight: 600; }

.job.break .job-note { max-width: 78ch; }
.job.break .job-note strong { color: var(--accent); }

/* ---------- Projects / Education / Profiles ----------------- */

.project.compact {
    margin-top: 9px;
    padding-left: 12px;
}

.project.compact p {
    margin: 2px 0 0;
    color: var(--ink-soft);
    max-width: 78ch;
    text-wrap: pretty;
}

code {
    font-family: var(--mono);
    font-size: 0.88em;
    padding: 0.5px 4px;
    border-radius: 3px;
    background: #f2f4f7;
    color: var(--accent);
}

.edu .job-head h3 { font-size: 12pt; }

.profiles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 28px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 9.5pt;
}

/* ---------- Links ------------------------------------------- */

a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(31, 58, 104, .28);
}

a:hover {
    color: var(--ink);
    border-bottom-color: currentColor;
}

/* A linked project title is already styled as a heading; the underline
   would read as a rule under the title rather than as a link. */
h4 a {
    color: inherit;
    border-bottom: 0;
}

h4 a:hover { border-bottom: 1px solid currentColor; }

/* ---------- Screen: narrow ---------------------------------- */

@media screen and (max-width: 700px) {
    body { padding: 0; font-size: 11pt; }

    .page {
        padding: 22px 18px 32px;
        box-shadow: none;
        border-radius: 0;
    }

    .masthead { align-items: flex-start; }
    .masthead h1 { font-size: 25pt; }
    .contacts { text-align: left; }
    .contacts .label { min-width: 0; }

    .skill-row {
        grid-template-columns: 1fr;
        gap: 1px;
        padding: 6px 0;
    }

    .job-head,
    .project-head { flex-direction: column; }
}

/* ---------- Print / PDF ------------------------------------- */

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

@media print {
    body {
        padding: 0;
        background: #fff;
        font-size: 9.6pt;
        line-height: 1.42;
    }

    .page {
        max-width: none;
        padding: 0;
        box-shadow: none;
        border-radius: 0;
    }

    .masthead h1 { font-size: 26pt; }
    .summary { font-size: 10pt; line-height: 1.48; }
    .block { margin-top: 12px; }
    .job { margin-bottom: 11px; }
    .project { margin-top: 9px; }
    .project.compact { margin-top: 7px; }

    /* Only guard elements that reliably fit on one page. Applying this to
       .block, the EPAM .job, or a long client .project pushes a
       taller-than-the-remaining-space element onto a fresh sheet and
       leaves the previous one half empty. Long work entries flow instead,
       with break-after on headings preventing an orphaned title. */
    .project.compact,
    .edu,
    .job.break,
    .skill-row { break-inside: avoid; page-break-inside: avoid; }

    h2, h3, h4,
    .stack { break-after: avoid; page-break-after: avoid; }

    p, li { orphans: 2; widows: 2; }

    /* Link text is already the readable URL, so no ::after expansion needed */
    a { color: var(--accent); border-bottom: 0; }

    code { background: transparent; padding: 0; }

    /* Force the accent colour to survive the print pipeline */
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
