:root {
    --accent: #1abc9c;
    --accent-dark: #006b58;
    --accent-print: #0d9488;
    --bg-light: #f8fafc;
    --border: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --skill-bg: #f1f5f9;
    --dot-gray: #cbd5e1;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-full: 9999px;
    --transition: all 0.2s ease;
}

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

body {
    background: var(--bg-light);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
}

.a4-page {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background: #ffffff;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border-radius: 4px;
}

.cv-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 2rem 2rem 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    background: #ffffff;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.avatar img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: block;
}

.avatar-relative {
    position: relative;
}

.cv-section-mb {
    margin-bottom: 1.75rem;
}

.text-cv-accent {
    color: #0f766e;
}

.avatar-badge {
    position: absolute;
    bottom: -8px;
    right: -8px;
    background: var(--accent);
    width: 28px;
    height: 28px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.7rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.title h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.title p {
    color: #0f766e;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 0.5rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.contact-grid i {
    color: var(--accent);
    width: 1rem;
    text-align: center;
}

.contact-grid .col-span-2 {
    grid-column: span 2;
}

.contact-grid a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.contact-grid a:hover {
    color: var(--accent);
}

.cv-body {
    display: flex;
    flex-wrap: wrap;
}

.main-col {
    flex: 2;
    min-width: 0;
    padding: 2rem 2rem 2rem 2rem;
    border-right: 1px solid var(--border);
    background: #ffffff;
}

.sidebar-col {
    flex: 1;
    min-width: 280px;
    background: var(--bg-light);
    padding: 2rem 1.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #1e293b;
    white-space: nowrap;
}

.section-header::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.timeline-border > .relative {
    padding-left: 2rem;
    border-left: 2px solid var(--border);
    margin-bottom: 1.75rem;
    position: relative;
}

.timeline-border > .relative:last-child {
    border-left-color: transparent;
    margin-bottom: 0;
}

.experience-dot {
    position: absolute;
    left: -0.3125rem;
    top: 0.3rem;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 1px var(--accent);
    z-index: 2;
}

.experience-dot-gray {
    background: var(--dot-gray) !important;
    box-shadow: 0 0 0 1px var(--dot-gray) !important;
}

.skill-tag {
    background: var(--skill-bg);
    border: 1px solid var(--border);
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #1e293b;
    white-space: nowrap;
}

.skill-tag i {
    font-size: 0.65rem;
    color: var(--accent);
}

.bento-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.bento-card h3 {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.bento-card h3 .badge {
    font-size: 0.65rem;
    background: #f1f5f9;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    color: #0f766e;
    font-weight: 600;
}

.bento-card p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    flex: 1;
}

.bento-card p.text-cv-accent {
    color: #0f766e;
}

.bento-card .card-link {
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: var(--accent-dark);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.sidebar-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #64748b;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-section-title i {
    color: var(--accent);
    font-size: 0.8rem;
}

.floating-buttons {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-print, .btn-pdf, .btn-ats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.1rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.8rem;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    box-shadow: var(--shadow-md);
    border: none;
    font-family: inherit;
}

.btn-print {
    background: #1e293b;
    color: white;
}

.btn-pdf {
    background: #0f766e;
    color: white;
}

.btn-ats {
    background: #ffffff;
    color: #0f766e;
    border: 2px solid #0f766e;
    padding: 0.5rem 1rem;
}

.text-sm {
    font-size: 0.8rem;
}

.text-xs {
    font-size: 0.7rem;
}

.text-slate-600 {
    color: #475569;
}

.text-slate-500 {
    color: #64748b;
}

.text-slate-400, .text-slate-300 { color: #64748b; }

.font-bold {
    font-weight: 700;
}

.leading-relaxed {
    line-height: 1.7;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.gap-2 {
    gap: 0.5rem;
}

.space-y-4 > * + * {
    margin-top: 1rem;
}

@media screen and (max-width: 768px) {
    body {
        padding: 0.5rem;
    }

    .cv-header {
        flex-direction: column;
        padding: 1.5rem;
    }

    .title h1 {
        font-size: 1.4rem;
    }

    .cv-body {
        flex-direction: column;
    }

    .main-col {
        border-right: none;
        padding: 1.5rem;
    }

    .sidebar-col {
        padding: 1.5rem;
        min-width: auto;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .floating-buttons {
        bottom: 1rem;
        right: 1rem;
    }

    .btn-print, .btn-pdf, .btn-ats {
        padding: 0.5rem 0.9rem;
        font-size: 0.7rem;
    }
}

@media screen and (max-width: 480px) {
    .avatar img {
        width: 70px;
        height: 70px;
    }

    .title h1 {
        font-size: 1.2rem;
    }

    .projects-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid .col-span-2 {
        grid-column: span 1;
    }
}

@media print {
    @page {
        size: A4;
        margin: 8mm 8mm 8mm 8mm;
    }

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

    html, body {
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
        font-size: 12px !important;
        line-height: 1.5 !important;
        width: 100% !important;
    }

    .a4-page {
        box-shadow: none !important;
        margin: 0 auto !important;
        max-width: 100% !important;
        border-radius: 0 !important;
    }

    .floating-buttons, .no-print {
        display: none !important;
    }

    .cv-body {
        display: grid !important;
        grid-template-columns: 2fr 1fr !important;
        grid-auto-rows: auto !important;
        gap: 0 !important;
    }

    .main-col {
        display: contents !important;
        padding: 0 !important;
        border: none !important;
    }

    .sidebar-col {
        grid-column: 2 !important;
        grid-row: 1 / 3 !important;
        padding: 1rem 1rem 1rem 1.2rem !important;
        background: #f9fafb !important;
        margin: 0 !important;
    }

    .main-col > section:nth-child(1) {
        grid-column: 1 !important;
        grid-row: 1 !important;
        padding: 1rem 1.2rem 0.5rem 1.2rem !important;
        margin: 0 !important;
    }

    .main-col > section:nth-child(2) {
        grid-column: 1 !important;
        grid-row: 2 !important;
        padding: 0.5rem 1.2rem 1rem 1.2rem !important;
        margin: 0 !important;
    }

    .studies-section {
        grid-column: 1 / -1 !important;
        grid-row: 3 !important;
        padding: 1rem 1.2rem !important;
        margin: 0 !important;
        background: white !important;
    }

    .projects-section {
        grid-column: 1 / -1 !important;
        grid-row: 4 !important;
        padding: 0.5rem 1.2rem 1rem 1.2rem !important;
        margin: 0 !important;
        background: white !important;
    }

    .cv-header {
        padding: 1rem 1.2rem 0.8rem 1.2rem !important;
        gap: 1rem !important;
    }

    .avatar img {
        width: 75px !important;
        height: 75px !important;
        border-radius: 0.5rem !important;
    }

    .avatar-badge {
        width: 22px !important;
        height: 22px !important;
        bottom: -5px !important;
        right: -5px !important;
        font-size: 0.6rem !important;
        background: var(--accent-print) !important;
    }

    .title h1 {
        font-size: 1.8rem !important;
    }

    .title p {
        font-size: 0.8rem !important;
    }

    .contact-grid {
        grid-template-columns: repeat(2, auto) !important;
        gap: 0.35rem 0.8rem !important;
        font-size: 0.75rem !important;
    }

    .section-header {
        margin-bottom: 0.8rem !important;
        gap: 0.75rem !important;
    }

    .section-header h2 {
        font-size: 0.75rem !important;
        letter-spacing: 0.1em !important;
        color: #374151 !important;
    }

    .timeline-border > .relative {
        padding-left: 1.5rem !important;
        margin-bottom: 1rem !important;
        border-left: 2px solid #d1d5db !important;
    }

    .experience-dot {
        left: -0.28rem !important;
        top: 0.35rem !important;
        width: 9px !important;
        height: 9px !important;
        background: var(--accent-print) !important;
    }

    .experience-dot-gray {
        background: #cbd5e1 !important;
    }

    .timeline-border h3 {
        font-size: 0.9rem !important;
    }

    .timeline-border p {
        font-size: 0.75rem !important;
    }

    .timeline-border li {
        font-size: 0.7rem !important;
    }

    .studies-section .space-y-4 {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 1rem !important;
        margin-top: 0 !important;
    }

    .studies-section .space-y-4 > * {
        margin-top: 0 !important;
    }

    .projects-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.6rem !important;
    }

    .bento-card {
        padding: 0.7rem !important;
        border: 1px solid #d1d5db !important;
        border-radius: 0.6rem !important;
        background: white !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    .bento-card h3 {
        font-size: 0.85rem !important;
    }

.bento-card h3 .badge {
        font-size: 0.65rem !important;
        background: #f1f5f9 !important;
        color: var(--accent-print) !important;
    }

    .bento-card p {
        font-size: 0.7rem !important;
    }

    .bento-card .card-link {
        font-size: 0.65rem !important;
        color: #0d9488 !important;
    }

    .skill-tag {
        font-size: 0.65rem !important;
        padding: 0.25rem 0.6rem !important;
        border: 1px solid #d1d5db !important;
    }

    .sidebar-section-title {
        font-size: 0.7rem !important;
    }

    .bento-card, .skill-tag, .section-header, .cv-header {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    .timeline-border > .relative {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    .title p, .contact-grid i, .skill-tag i, .sidebar-section-title i, .bento-card h3 .badge {
        color: var(--accent-print) !important;
    }

    .avatar-badge, .experience-dot:not(.experience-dot-gray) {
        background-color: var(--accent-print) !important;
    }

    a {
        color: #0d9488 !important;
        text-decoration: underline !important;
    }
}

@-moz-document url-prefix() {
    @media print {
        body {
            font-size: 11.5px !important;
        }
    }
}
    