:root {
    --bar-gray: #595959;
    --ink: #000000;
    --muted: #4a4a4a;
    --rule: #d9d9d9;
    --page-bg: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color-adjust: exact;
}

body {
    font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
    color: var(--ink);
    background: #e9e9e9;
    line-height: 1.32;
    -webkit-font-smoothing: antialiased;
}

.page {
    max-width: 900px;
    margin: 30px auto;
    background: var(--page-bg);
    box-shadow: 0 6px 24px rgba(0,0,0,0.18);
}

/* --- Header --- */
.header {
    background: var(--bar-gray);
    color: #ffffff;
    padding: 28px 40px 20px;
}
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
}
.header h1 {
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1.1;
}
.header .title {
    margin-top: 6px;
    font-size: 1rem;
    font-weight: 700;
}
.header .contact {
    text-align: right;
    font-size: 0.82rem;
    line-height: 1.6;
}
.header .contact a { color: #ffffff; text-decoration: none; }
.header .contact a:hover { text-decoration: underline; }
.header .contact i { margin-right: 4px; }

/* --- Info row --- */
.info-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 14px 40px;
    border-bottom: 1px solid var(--rule);
}
.info-cell { text-align: center; }
.info-label {
    font-size: 0.78rem;
    font-weight: 700;
}
.info-value {
    font-size: 0.82rem;
    margin-top: 2px;
}

/* --- Section bars --- */
.section { padding: 0 40px 14px; }
.bar {
    background: var(--bar-gray);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 6px 40px;
    margin: 0 -40px 12px;
    break-after: avoid;
    page-break-after: avoid;
}
.section-final { padding-bottom: 0; }
.bar-final {
    margin-top: 4px;
    margin-bottom: 0;
}

/* --- Profile --- */
.profile-text { font-size: 0.9rem; }

/* --- Skills --- */
.skill-line { font-size: 0.9rem; margin-bottom: 6px; }
.skill-line:last-child { margin-bottom: 0; }

/* --- Entries (employment / education) --- */
.entry { margin-bottom: 9px; break-inside: avoid; page-break-inside: avoid; }
.entry:last-child { margin-bottom: 0; }
.entry-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px 20px;
    flex-wrap: nowrap;
}
.entry-role { font-size: 0.9rem; font-weight: 700; flex: 1 1 auto; min-width: 0; }
.entry-date { font-size: 0.85rem; font-style: italic; color: var(--muted); white-space: nowrap; flex: 0 0 auto; text-align: right; }

.dash-list {
    list-style: none;
    padding-left: 16px;
    margin-top: 2px;
}
.dash-list li { font-size: 0.88rem; position: relative; }
.dash-list li::before {
    content: '-';
    position: absolute;
    left: -14px;
}

/* --- Projects --- */
.project-entry { margin-bottom: 8px; }
.project-title { font-size: 0.9rem; font-weight: 700; }
.project-desc { font-size: 0.88rem; }

/* --- Honours --- */
.honours-list li { margin-bottom: 4px; }
.honours-list li:last-child { margin-bottom: 0; }

@media (max-width: 700px) {
    .header, .section, .info-row { padding-left: 20px; padding-right: 20px; }
    .bar { margin-left: -20px; margin-right: -20px; padding-left: 20px; padding-right: 20px; }
    .info-row { grid-template-columns: 1fr; gap: 10px; }
    .header-row { flex-direction: column; }
    .header .contact { text-align: left; }
}

@media print {
    body { background: #fff; }
    .page { box-shadow: none; margin: 0; max-width: 100%; }
}

@page { size: A4; margin: 0; }
