:root {
    --primary: #b91c1c;
    --text-main: #374151;
    --text-muted: #6b7280;
    --bg-body: #f3f4f6;
    --bg-paper: #ffffff;
    --bg-offset: #f9fafb;
    --bg-title: #f7f8fa;
    --border: #e5e7eb;
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --primary: #ef4444;
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --bg-body: #111827;
    --bg-paper: #1f2937;
    --bg-offset: #374151;
    --bg-title: #263241;
    --border: #4b5563;
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 40px 20px;
    color: var(--text-main);
    background: var(--bg-body);
    font-family: "Roboto", Arial, sans-serif;
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

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

a:hover,
a:focus-visible {
    color: var(--primary);
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.resume-paper {
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
    background: var(--bg-paper);
    border-top: 8px solid var(--primary);
    box-shadow: var(--shadow);
    transition: background-color 0.3s;
}

.action-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    padding: 15px 40px;
    background: var(--bg-offset);
    border-bottom: 1px solid var(--border);
}

.btn-dl {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 16px;
    color: var(--text-main);
    background: var(--bg-paper);
    border: 1px solid var(--border);
    border-radius: 4px;
    font: 700 0.85rem/1 "Roboto", Arial, sans-serif;
    text-transform: uppercase;
    cursor: pointer;
}

.btn-dl:hover,
.btn-dl:focus-visible {
    color: var(--primary);
    border-color: var(--primary);
    outline: none;
}

.icon-btn {
    min-width: 40px;
    justify-content: center;
    padding: 8px;
}

.resume-header {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 50px 60px 40px;
    border-bottom: 2px solid var(--border);
}

.profile-img {
    width: 150px;
    height: 150px;
    flex: 0 0 auto;
    object-fit: cover;
    padding: 4px;
    background: var(--bg-paper);
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-content h1 {
    margin: 0 0 5px;
    color: var(--text-main);
    font-family: "Oswald", Arial, sans-serif;
    font-size: 3rem;
    line-height: 1.1;
    text-transform: uppercase;
}

.role {
    margin: 0 0 20px;
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.availability {
    margin: -8px 0 20px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.contact-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px 25px;
    margin: 0;
    color: var(--text-main);
    font-size: 0.9rem;
    font-style: normal;
    font-weight: 500;
}

.contact-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.contact-item i {
    color: var(--primary);
    font-size: 1rem;
}

.secure-link {
    padding: 0;
    color: inherit;
    background: none;
    border: 0;
    border-bottom: 1px dotted var(--text-muted);
    font: inherit;
    cursor: pointer;
}

.secure-link:hover,
.secure-link:focus-visible {
    color: var(--primary);
    border-bottom-color: var(--primary);
    outline: none;
}

.content-body {
    padding: 50px 60px;
}

.section {
    margin-bottom: 50px;
}

.compact-section {
    margin-bottom: 42px;
}

.final-section {
    margin-bottom: 0;
}

.section-title {
    display: flex;
    align-items: center;
    margin: 0 0 28px;
    padding: 10px 16px;
    color: var(--text-main);
    background: linear-gradient(90deg, var(--bg-title), transparent);
    border-left: 5px solid var(--primary);
    border-radius: 4px;
    font-family: "Oswald", Arial, sans-serif;
    font-size: 1.5rem;
    text-transform: uppercase;
}

.profile-text {
    margin: 0 0 15px;
    padding-left: 20px;
    color: var(--text-main);
    font-size: 1.1rem;
}

.strength-cloud {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 7px;
    margin: 18px 0 2px 20px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.strength-cloud span {
    display: inline-flex;
    align-items: center;
    min-height: 0;
    padding: 2px 7px;
    color: var(--text-main);
    background: color-mix(in srgb, var(--primary) 7%, var(--bg-paper));
    border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.15;
}

.strength-cloud .weight-2 {
    min-height: 0;
    padding: 2px 8px;
    font-size: 0.75rem;
}

.strength-cloud .weight-3 {
    min-height: 0;
    padding: 3px 9px;
    color: #ffffff;
    background: var(--primary);
    border-color: var(--primary);
    font-size: 0.8rem;
}

.job-item {
    position: relative;
    margin-bottom: 35px;
    padding-left: 28px;
}

.job-item::before {
    position: absolute;
    top: 8px;
    bottom: -26px;
    left: 6px;
    width: 1px;
    background: var(--border);
    content: "";
}

.job-item::after {
    position: absolute;
    top: 8px;
    left: 2px;
    width: 9px;
    height: 9px;
    background: var(--primary);
    border: 2px solid var(--bg-paper);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--primary);
    content: "";
}

.job-item:last-child::before {
    display: none;
}

.job-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 5px;
}

.job-title {
    margin: 0;
    color: var(--text-main);
    font-size: 1.25rem;
    font-weight: 700;
}

.job-meta {
    margin: 0;
    color: var(--primary);
    font-family: "Oswald", Arial, sans-serif;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.job-sub {
    margin: 0 0 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.job-desc {
    margin: 0;
    padding: 0;
    list-style: none;
}

.job-desc li {
    position: relative;
    margin-bottom: 8px;
    padding-left: 20px;
    color: var(--text-main);
    font-size: 1rem;
}

.job-desc li::before {
    position: absolute;
    left: 0;
    color: var(--primary);
    content: "\2022";
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.4;
}

.edu-box {
    margin-left: 20px;
    padding: 30px;
    background: var(--bg-offset);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.edu-title {
    margin: 0 0 5px;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 700;
}

.edu-sub {
    margin: 0 0 15px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

.edu-text {
    margin: 0 0 15px;
    color: var(--text-main);
}

.edu-text:last-child {
    margin-bottom: 0;
}

footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 18px;
    padding: 30px;
    color: #9ca3af;
    background: #111827;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-align: center;
    text-transform: uppercase;
}

@media (max-width: 800px) {
    body {
        padding: 0;
    }

    .resume-paper {
        margin: 0;
        border-top: 0;
        box-shadow: none;
    }

    .action-bar {
        flex-wrap: wrap;
        justify-content: center;
        padding: 15px 20px;
    }

    .resume-header {
        flex-direction: column;
        gap: 24px;
        padding: 40px 20px;
        text-align: center;
    }

    .header-content h1 {
        font-size: 2.25rem;
    }

    .contact-grid {
        justify-content: center;
    }

    .content-body {
        padding: 40px 20px;
    }

    .job-head {
        flex-direction: column;
        gap: 5px;
    }

    .profile-text,
    .job-item,
    .edu-box,
    .strength-cloud {
        margin-left: 0;
        padding-left: 0;
    }

    .job-item {
        padding-left: 22px;
    }

    .job-item::before {
        left: 3px;
    }

    .job-item::after {
        left: -1px;
    }
}

@media print {
    @page {
        size: letter;
        margin: 0.45in;
    }

    :root {
        --primary: #b91c1c;
        --text-main: #000000;
        --text-muted: #444444;
        --bg-paper: #ffffff;
        --bg-offset: #ffffff;
        --border: #cccccc;
    }

    body {
        padding: 0;
        color: black;
        background: white;
        font-size: 9pt;
        line-height: 1.35;
    }

    .resume-paper {
        max-width: 100%;
        overflow: visible;
        border: 0;
        border-top: 5px solid #b91c1c;
        box-shadow: none;
    }

    .action-bar {
        display: none;
    }

    .resume-header,
    .content-body {
        padding: 0;
    }

    .resume-header {
        gap: 18px;
        padding-bottom: 12px;
    }

    .profile-img {
        width: 88px;
        height: 88px;
    }

    .header-content h1 {
        margin-bottom: 2px;
        font-size: 24pt;
    }

    .role {
        margin-bottom: 6px;
        font-size: 10pt;
    }

    .availability {
        margin-bottom: 7px;
        color: #444444;
        font-size: 8.4pt;
    }

    .contact-grid {
        gap: 4px 14px;
        font-size: 7.8pt;
    }

    .content-body {
        padding-top: 12px;
    }

    .section,
    .compact-section {
        margin-bottom: 14px;
    }

    .section-title {
        margin-bottom: 7px;
        padding: 4px 8px;
        background: #f7f7f7;
        border-left-color: black;
        border-radius: 0;
        font-size: 10.5pt;
    }

    .profile-text {
        margin-bottom: 6px;
        padding-left: 10px;
        font-size: 9pt;
    }

    .strength-cloud {
        gap: 3px 5px;
        margin: 8px 0 0 10px;
        padding-top: 6px;
    }

    .strength-cloud span,
    .strength-cloud .weight-2,
    .strength-cloud .weight-3 {
        padding: 1px 5px;
        color: black;
        background: white;
        border-color: #cccccc;
        font-size: 7.5pt;
    }

    .job-item {
        margin-bottom: 10px;
        padding-left: 18px;
        break-inside: avoid;
    }

    .job-item::before {
        bottom: -8px;
        left: 3px;
    }

    .job-item::after {
        left: -1px;
        background: #b91c1c;
        border-color: white;
    }

    .job-head {
        margin-bottom: 1px;
    }

    .job-title {
        font-size: 9.7pt;
    }

    .job-meta,
    .job-sub {
        font-size: 8.2pt;
    }

    .job-desc li {
        margin-bottom: 2px;
        padding-left: 14px;
        font-size: 8.7pt;
    }

    .job-desc li::before {
        font-size: 9pt;
        line-height: 1.25;
    }

    .edu-box {
        margin-left: 10px;
        padding: 10px;
        background: white;
    }

    .edu-title {
        font-size: 9.2pt;
    }

    .edu-sub,
    .edu-text {
        font-size: 8.7pt;
    }

    .strength-cloud {
        break-inside: avoid;
    }

    a {
        color: black;
        text-decoration: none;
    }

    .job-meta {
        color: black;
    }

    .secure-link {
        color: black;
        border: 0;
    }
}
