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

:root {
    --bg:      #0a0a0a;
    --surface: #111111;
    --border:  rgba(0,255,135,0.15);
    --text:    #e0ffe0;
    --muted:   #4a6a4a;
    --accent:  #00ff87;
    --dim:     #2a3a2a;
}

/* Force background color in print (color-adjust is the legacy Firefox alias) */
* { -webkit-print-color-adjust: exact; color-adjust: exact; print-color-adjust: exact; }

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

/* Firefox never prints html/body backgrounds (they propagate to the page
   canvas, which is always white in print). Paint the background from a
   fixed layer instead — it repeats on every printed page. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--bg);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5pt;
    line-height: 1.55;
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 12mm 14mm 12mm 14mm;
}

/* ── Header ── */
.cv-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 1rem;
    padding-bottom: 5mm;
    border-bottom: 1px solid var(--border);
    margin-bottom: 5mm;
}

.cv-name {
    font-size: 22pt;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
    line-height: 1;
}

.cv-name .prompt { color: var(--muted); font-weight: 300; font-size: 14pt; }

.cv-title {
    font-size: 9pt;
    color: var(--accent);
    margin-top: 3px;
    letter-spacing: 0.06em;
}

.cv-contact {
    text-align: right;
    font-size: 8pt;
    color: var(--muted);
    line-height: 1.8;
}

.cv-contact a { color: var(--muted); text-decoration: none; }
.cv-contact .acc { color: var(--accent); }

/* ── Layout: two columns ── */
.cv-body {
    display: grid;
    grid-template-columns: 1fr 2.1fr;
    gap: 0 8mm;
}

/* ── Section label ── */
.label {
    font-size: 7pt;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: 3mm;
    margin-top: 3.5mm;
    display: block;
}

.label::before { content: '// '; color: var(--accent); }

.left .label:first-child,
.right .label:first-child { margin-top: 0; }

/* ── Skill tags ── */
.skill-group { margin-bottom: 2.5mm; }

.skill-group-name {
    font-size: 7pt;
    color: var(--muted);
    margin-bottom: 2mm;
    letter-spacing: 0.05em;
}

.skill-group-name::before { content: '> '; color: var(--accent); opacity: 0.7; }

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5px;
}

.tag {
    font-size: 7.5pt;
    color: var(--accent);
    border: 1px solid rgba(0,255,135,0.2);
    border-radius: 1px;
    padding: 1px 5px;
    background: rgba(0,255,135,0.05);
    white-space: nowrap;
}

.tag::before { content: '['; opacity: 0.4; margin-right: 1px; }
.tag::after  { content: ']'; opacity: 0.4; margin-left: 1px; }

/* ── Divider ── */
hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 5mm 0;
}

/* ── Timeline ── */
.timeline-item {
    display: grid;
    grid-template-columns: 6px 1fr;
    gap: 0 4mm;
    margin-bottom: 4mm;
    page-break-inside: avoid;
}

.timeline-item:last-child { margin-bottom: 0; }

.t-line {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 3px;
}

.t-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    background: var(--bg);
    flex-shrink: 0;
}

.t-track {
    flex: 1;
    width: 1px;
    background: var(--border);
    margin-top: 3px;
}

.timeline-item:last-child .t-track { display: none; }

/* ── Timeline: grouped company block (promotions) ── */
.timeline-group {
    display: grid;
    grid-template-columns: 6px 1fr;
    gap: 0 4mm;
    margin-bottom: 4mm;
    page-break-inside: avoid;
}

.t-dot.main { background: var(--accent); }

.t-company-header {
    font-size: 9.5pt;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
}

.t-range {
    font-size: 7pt;
    font-weight: 400;
    color: var(--muted);
    letter-spacing: 0.03em;
}

.t-role {
    position: relative;
    margin-top: 2mm;
    padding-left: 2mm;
}

/* sub-dot sitting on the vertical track */
.t-role::before {
    content: '';
    position: absolute;
    left: calc(-4mm - 6px);
    top: 3px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    border: 1px solid var(--muted);
    background: var(--bg);
}

/* horizontal connector from track to role text */
.t-role::after {
    content: '';
    position: absolute;
    left: -4mm;
    top: 6px;
    width: calc(4mm + 1mm);
    height: 1px;
    background: var(--border);
}

.t-role.current::before {
    border-color: var(--accent);
    background: var(--accent);
}

.t-role.head::before { border-color: var(--accent); }

.t-promoted {
    color: var(--accent);
    opacity: 0.9;
}

.t-meta {
    font-size: 7pt;
    color: var(--muted);
    margin-bottom: 1px;
    letter-spacing: 0.03em;
}

.t-meta::before { content: '// '; color: var(--accent); opacity: 0.5; }

.t-title {
    font-size: 9pt;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.3;
}

.t-company {
    font-size: 8pt;
    color: var(--accent);
    opacity: 0.85;
    margin: 1px 0 3px;
}

.t-desc {
    font-size: 7.5pt;
    color: #5a7a5a;
    line-height: 1.5;
}

/* ── About ── */
.about-text {
    font-size: 8pt;
    color: #7a9a7a;
    line-height: 1.55;
}

/* ── Vibe Coding block ── */
.vibe-block {
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 3mm 4mm;
    background: var(--surface);
    font-size: 7.5pt;
    color: #5a7a5a;
    line-height: 1.55;
    page-break-inside: avoid;
}

.vibe-block .p  { color: var(--muted); }
.vibe-block .hl { color: var(--accent); }

/* ── Bottom grid: education + certifications side by side ── */
.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 6mm;
    page-break-inside: avoid;
}

.bottom-grid .label { margin-top: 1mm; }

/* ── Education ── */
.edu-item { margin-bottom: 2.5mm; }
.edu-item:last-child { margin-bottom: 0; }

.edu-degree {
    font-size: 8.5pt;
    font-weight: 600;
    color: #ffffff;
}

.edu-school {
    font-size: 7.5pt;
    color: var(--accent);
    opacity: 0.8;
}

.edu-year {
    font-size: 7pt;
    color: var(--muted);
}

/* ── Certs ── */
.cert-item {
    font-size: 7.5pt;
    color: #5a7a5a;
    line-height: 1.55;
}

.cert-item::before { content: '✓  '; color: var(--accent); }

/* ── Languages ── */
.lang-item {
    font-size: 7.5pt;
    color: #5a7a5a;
    line-height: 1.7;
}

.lang-code {
    color: var(--accent);
    opacity: 0.8;
}

.lang-code::before { content: '['; opacity: 0.5; }
.lang-code::after  { content: ']'; opacity: 0.5; }

/* ── Print button (screen only) ── */
.print-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 3px;
    padding: 8px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    z-index: 999;
}

.print-btn:hover { background: #33ffaa; }

@media print {
    .print-btn { display: none; }
    /* Firefox: auto margins and an exact 297mm min-height cause the first
       page to shift/overflow onto a second page due to rounding — pin the
       body to the page box instead */
    body {
        padding: 12mm 14mm;
        margin: 0;
        min-height: auto;
    }
}
