/* ============================================================================
   zroot.it — printable CV
   Screen: paper sheet on a neutral backdrop. Print: clean A4.
   ========================================================================= */

:root {
    --paper: #ffffff;
    --ink: #16202b;
    --ink-soft: #43535f;
    --ink-mute: #6b7b88;
    --rule: #d9e0e6;
    --rule-soft: #eaeef1;
    --accent: #0f6f95;
    --backdrop: #0a0e14;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}

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

body {
    font-family: var(--font);
    background: var(--backdrop);
    color: var(--ink);
    line-height: 1.5;
    font-size: 10.5pt;
    -webkit-font-smoothing: antialiased;
}

ul { list-style: none; }

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover { text-decoration: underline; }

/* ------------------------------------------------------------- Toolbar -- */

.toolbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    max-width: 210mm;
    margin: 0 auto;
    padding: 14px 12px;
    color: #a9b6c6;
    font-size: 0.86rem;
}

.toolbar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tb-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border-radius: 6px;
    border: 1px solid #2f3d52;
    background: #121822;
    color: #e6edf3;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

.tb-btn:hover {
    background: #172030;
    border-color: #38bdf8;
    text-decoration: none;
}

.tb-btn--primary {
    background: #38bdf8;
    border-color: #38bdf8;
    color: #06131c;
}

.tb-btn--primary:hover {
    background: #7dd3fc;
    border-color: #7dd3fc;
    color: #06131c;
}

/* --------------------------------------------------------------- Sheet -- */

.sheet {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto 40px;
    padding: 16mm 15mm;
    background: var(--paper);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

/* -------------------------------------------------------------- Header -- */

.cv-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18mm;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--ink);
    margin-bottom: 14px;
}

.cv-name {
    font-size: 24pt;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

.cv-title {
    font-size: 11.5pt;
    font-weight: 600;
    color: var(--accent);
    margin-top: 3px;
}

.cv-subtitle {
    font-size: 9.5pt;
    color: var(--ink-mute);
    margin-top: 1px;
}

.cv-contact {
    text-align: right;
    font-size: 9pt;
    color: var(--ink-soft);
    line-height: 1.75;
    white-space: nowrap;
}

.cv-contact div {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}

.cv-contact i {
    color: var(--ink-mute);
    width: 11px;
    font-size: 8.5pt;
}

.cv-available {
    display: inline-block;
    margin-top: 8px;
    padding: 2px 9px;
    border: 1px solid var(--accent);
    border-radius: 100px;
    color: var(--accent);
    font-size: 8pt;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: normal;
    text-align: center;
}

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

.cv-section {
    margin-bottom: 13px;
    break-inside: avoid;
}

.cv-section-title {
    font-family: var(--mono);
    font-size: 8.5pt;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    padding-bottom: 3px;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 8px;
}

.cv-summary p {
    margin-bottom: 5px;
    color: var(--ink-soft);
    text-align: justify;
}

.cv-summary p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------- Competences -- */

.cv-comp {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 20px;
}

.cv-comp-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    align-items: baseline;
    font-size: 9.5pt;
}

.cv-comp-item b {
    font-weight: 600;
    white-space: nowrap;
}

.cv-comp-item span {
    color: var(--ink-mute);
    font-size: 9pt;
}

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

.cv-entry {
    margin-bottom: 9px;
    break-inside: avoid;
}

.cv-entry:last-child { margin-bottom: 0; }

.cv-entry-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
}

.cv-entry-role {
    font-size: 10.5pt;
    font-weight: 650;
}

.cv-entry-org {
    font-size: 9.5pt;
    color: var(--ink-soft);
    font-weight: 500;
}

.cv-entry-dates {
    font-family: var(--mono);
    font-size: 8.5pt;
    color: var(--ink-mute);
    white-space: nowrap;
    flex-shrink: 0;
}

.cv-entry p {
    font-size: 9.5pt;
    color: var(--ink-soft);
    margin-top: 3px;
    text-align: justify;
}

.cv-bullets {
    margin-top: 4px;
}

.cv-bullets li {
    position: relative;
    padding-left: 12px;
    font-size: 9.5pt;
    color: var(--ink-soft);
    margin-bottom: 2px;
}

.cv-bullets li::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 6.5px;
    width: 3.5px;
    height: 3.5px;
    border-radius: 50%;
    background: var(--ink-mute);
}

.cv-group {
    margin-bottom: 11px;
}

.cv-group:last-child { margin-bottom: 0; }

.cv-group-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 3px;
    margin-bottom: 5px;
    border-bottom: 1px solid var(--rule-soft);
}

.cv-group-head h3 {
    font-size: 11pt;
    font-weight: 650;
}

.cv-group-sub {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 4px;
}

.cv-group-sub:last-child { margin-bottom: 0; }

.cv-group-sub-role {
    font-size: 9.5pt;
    font-weight: 550;
}

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

.cv-skills {
    display: grid;
    gap: 4px;
}

.cv-skill-row {
    display: grid;
    grid-template-columns: 34mm minmax(0, 1fr);
    gap: 10px;
    align-items: baseline;
    font-size: 9.5pt;
}

.cv-skill-row dt {
    font-weight: 600;
    color: var(--ink);
}

.cv-skill-row dd {
    color: var(--ink-soft);
}

/* ------------------------------------------------- Two-column footer -- */

.cv-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.cv-inline-list {
    font-size: 9.5pt;
    color: var(--ink-soft);
}

.cv-inline-list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 2px 0;
    border-bottom: 1px solid var(--rule-soft);
}

.cv-inline-list li:last-child { border-bottom: none; }

.cv-inline-list .muted {
    color: var(--ink-mute);
    font-size: 8.5pt;
    white-space: nowrap;
    flex-shrink: 0;
}

/* --------------------------------------------------------- Print rules -- */

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

@media print {
    body {
        background: #fff;
        font-size: 9.8pt;
    }

    .toolbar { display: none !important; }

    .sheet {
        width: auto;
        min-height: 0;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }

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

    .cv-section,
    .cv-entry,
    .cv-group {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .cv-section-title {
        color: var(--ink);
        border-bottom-color: #999;
    }

    .cv-title { color: var(--ink); }

    .cv-available {
        border-color: #666;
        color: var(--ink);
    }
}

@media (max-width: 820px) {
    .sheet {
        width: 100%;
        padding: 20px 18px;
    }

    .toolbar { padding: 14px 18px; }

    .cv-head {
        flex-direction: column;
        gap: 12px;
    }

    .cv-contact {
        text-align: left;
        white-space: normal;
    }

    .cv-contact div { justify-content: flex-start; }

    .cv-comp,
    .cv-cols {
        grid-template-columns: 1fr;
    }

    .cv-skill-row {
        grid-template-columns: 1fr;
        gap: 1px;
    }
}
