/* ============================================================
   Base Reset & Page
============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --navy: #0f172a;
    --blue: #1e3a8a;
    --blue-mid: #1e40af;
    --blue-light: #3b82f6;
    --gray-dark: #334155;
    --gray-mid: #64748b;
    --gray-light: #94a3b8;
    --border: #e2e8f0;
    --chip-bg: #eff6ff;
    --bg: #ffffff;
}

html { font-size: 10pt; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.55;
    color: var(--navy);
    background: #f1f5f9;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Screen Controls (hidden on print)
============================================================ */
.controls {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--navy);
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.controls-brand {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.8;
}

.controls-actions { display: flex; gap: 0.75rem; align-items: center; }

.btn-ctrl {
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-download {
    background: var(--blue-light);
    color: white;
}
.btn-download:hover { background: #2563eb; transform: translateY(-1px); }
.btn-download:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-close {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}
.btn-close:hover { background: rgba(255,255,255,0.25); }

.controls-hint {
    color: rgba(255,255,255,0.55);
    font-size: 0.75rem;
}

/* ============================================================
   CV Paper
============================================================ */
.cv-wrapper {
    padding: 3.5rem 2rem 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cv-paper {
    background: var(--bg);
    width: 100%;
    max-width: 800px;
    box-shadow: 0 4px 40px rgba(0,0,0,0.15);
    overflow: hidden;
}

.cv-body {
    padding: 2rem 2.75rem 2.5rem;
}

/* ============================================================
   Header — modern banner
============================================================ */
.cv-header {
    background: linear-gradient(135deg, var(--blue) 0%, var(--navy) 100%);
    color: white;
    padding: 2.25rem 2.75rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.cv-avatar {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20pt;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.cv-name {
    font-size: 22pt;
    font-weight: 800;
    letter-spacing: -0.3px;
    line-height: 1.1;
    margin-bottom: 0.3rem;
}

.cv-title {
    font-size: 11pt;
    font-weight: 400;
    color: #bfdbfe;
    margin-bottom: 0.7rem;
    letter-spacing: 0.01em;
}

.cv-contact {
    font-size: 8pt;
    color: rgba(255,255,255,0.85);
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
}

.cv-contact a { color: white; text-decoration: none; }
.cv-contact a:hover { text-decoration: underline; }
.cv-contact span { display: flex; align-items: center; gap: 0.3rem; }
.cv-contact .dot { opacity: 0.5; }

/* ============================================================
   Sections
============================================================ */
.cv-section { margin: 1.35rem 0; }
.cv-section:first-child { margin-top: 0; }

.cv-section-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 9.5pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--blue);
    margin-bottom: 0.75rem;
}

.cv-section-title::before {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 2px;
    background: var(--blue-light);
    flex-shrink: 0;
}

.cv-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ============================================================
   Competencies — chip style
============================================================ */
.competencies-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.comp-chip {
    background: var(--chip-bg);
    border: 1px solid #dbeafe;
    border-radius: 999px;
    padding: 0.3rem 0.8rem;
    font-size: 8.5pt;
    color: var(--gray-dark);
    display: inline-flex;
    gap: 0.35rem;
}

.comp-chip strong { color: var(--blue); font-weight: 700; }

/* ============================================================
   Experience Entries — timeline style
============================================================ */
.exp-entry {
    position: relative;
    padding-left: 1rem;
    border-left: 2px solid var(--border);
    margin-bottom: 1.1rem;
}
.exp-entry:last-child { margin-bottom: 0; }

.exp-entry::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--blue-light);
    border: 2px solid white;
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.exp-title {
    font-size: 10pt;
    font-weight: 700;
    color: var(--navy);
}

.exp-meta {
    text-align: right;
    flex-shrink: 0;
}

.exp-date {
    font-size: 8.5pt;
    color: var(--gray-dark);
    font-weight: 600;
}

.exp-location {
    font-size: 8pt;
    color: var(--gray-mid);
}

.exp-company {
    font-size: 9pt;
    color: var(--blue-mid);
    font-style: italic;
    font-weight: 500;
    margin: 1px 0 4px;
}

.exp-bullets {
    padding-left: 1rem;
    margin-top: 3px;
}

.exp-bullets li {
    font-size: 9pt;
    color: var(--gray-dark);
    margin-bottom: 2px;
    line-height: 1.5;
}

/* ============================================================
   Project links
============================================================ */
.edu-note {
    font-size: 8.5pt;
    color: var(--gray-mid);
    margin-top: 2px;
}

.project-links {
    display: inline-flex;
    gap: 0.5rem;
    font-size: 8pt;
    font-style: normal;
    margin-bottom: 3px;
}

.project-links a {
    color: var(--blue-mid);
    text-decoration: none;
    font-weight: 600;
}
.project-links a:hover { text-decoration: underline; }

/* ============================================================
   Certifications / Conferences — single-column rows
============================================================ */
.cert-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    font-size: 9pt;
    color: var(--gray-dark);
    padding: 4px 0;
}

.cert-row:not(:last-child) {
    border-bottom: 1px dashed var(--border);
}

.cert-row .cert-date {
    flex-shrink: 0;
    color: var(--gray-mid);
    white-space: nowrap;
    font-size: 8pt;
    padding-left: 1rem;
}

.cert-row a { color: var(--blue-mid); text-decoration: none; font-size: 8pt; }

/* ============================================================
   Awards list
============================================================ */
.award-item {
    display: flex;
    gap: 0.6rem;
    font-size: 9pt;
    color: var(--gray-dark);
    margin-bottom: 5px;
    line-height: 1.5;
}

.award-item .award-dot {
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--blue-light);
    margin-top: 6px;
}

/* ============================================================
   Inline lists
============================================================ */
.inline-list {
    font-size: 9pt;
    color: var(--gray-dark);
}

/* ============================================================
   References
============================================================ */
.ref-item {
    font-size: 8.5pt;
    color: var(--gray-dark);
    line-height: 1.6;
    border-left: 3px solid var(--blue-light);
    padding-left: 0.6rem;
    margin-bottom: 0.6rem;
}
.ref-item:last-child { margin-bottom: 0; }
.ref-name { font-weight: 700; color: var(--navy); }
.ref-item a { color: var(--blue-mid); text-decoration: none; }

/* ============================================================
   Footer
============================================================ */
.cv-footer {
    margin-top: 1.5rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 7.5pt;
    color: var(--gray-light);
}

/* ============================================================
   Tailor form (tailor.html only)
============================================================ */
.tailor-form {
    background: var(--bg);
    border-radius: 10px;
    box-shadow: 0 4px 40px rgba(0,0,0,0.15);
    padding: 2rem 2.25rem;
    width: 100%;
    max-width: 640px;
}

.tailor-form h1 {
    font-size: 1.3rem;
    color: var(--navy);
    margin-bottom: 0.3rem;
}

.tailor-form p.tailor-hint {
    font-size: 0.85rem;
    color: var(--gray-mid);
    margin-bottom: 1.25rem;
}

.tailor-field { margin-bottom: 1rem; }

.tailor-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-dark);
    margin-bottom: 0.4rem;
}

.tailor-field input,
.tailor-field textarea {
    width: 100%;
    font-family: inherit;
    font-size: 0.9rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--navy);
    resize: vertical;
}

.tailor-field textarea { min-height: 220px; }

.tailor-field input:focus,
.tailor-field textarea:focus {
    outline: none;
    border-color: var(--blue-light);
    box-shadow: 0 0 0 3px var(--chip-bg);
}

.tailor-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.tailor-submit {
    background: var(--blue);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.65rem 1.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}
.tailor-submit:hover { background: var(--blue-mid); }
.tailor-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* ============================================================
   PRINT
============================================================ */
@media print {
    html { font-size: 9.5pt; }

    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        color-adjust: exact;
    }

    body { background: white; }

    .controls { display: none !important; }

    .cv-wrapper {
        padding: 0;
        background: white;
    }

    .cv-paper {
        box-shadow: none;
        max-width: 100%;
    }

    @page {
        size: A4;
        margin: 1.2cm 1.6cm;
    }

    .cv-header { padding: 1.4rem 0; margin: 0 -1.6cm 1rem; padding-left: 1.6cm; padding-right: 1.6cm; }
    .cv-body { padding: 0; }
    .cv-section { page-break-inside: avoid; }
    .exp-entry { page-break-inside: avoid; }
    a { color: var(--blue-mid) !important; }
}
