:root {
    --page-bg: #000000;
    --sidebar-bg: #000000;
    --sidebar-fg: #f5f5f5;
    --sidebar-muted: #9a9a9a;
    --main-bg: #000000;
    --main-fg: #f5f5f5;
    --main-muted: #b0b0b0;
    --rule: #2a2a2a;
    --rule-dark: #333333;
    --cv-max-width: 90rem;
}

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

html {
    font-size: 15px;
    scroll-behavior: smooth;
    background: var(--page-bg);
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--page-bg);
    color: var(--main-fg);
    font-family: "Playfair Display", Georgia, "Times New Roman", serif;
    font-weight: 400;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: #fff;
    color: #050505;
}

::-moz-selection {
    background: #fff;
    color: #050505;
}

.cv-toolbar {
    width: 100%;
    max-width: var(--cv-max-width);
    margin: 0 auto;
    padding: 1.25rem clamp(1rem, 4vw, 2.75rem) 0.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1.25rem;
}

.cv-export-btn {
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 0.65rem 1.15rem;
    border: 1px solid #fff;
    background: transparent;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.cv-export-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.cv-export-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.cv-toolbar-hint {
    font-size: 0.72rem;
    color: var(--sidebar-muted);
    margin: 0;
    letter-spacing: 0.02em;
}

a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:hover {
    opacity: 0.75;
}

.cv-page {
    width: 100%;
    max-width: var(--cv-max-width);
    margin: 0 auto;
    padding: 0.5rem clamp(1rem, 4vw, 2.75rem) 3rem;
    background: var(--page-bg);
}

.cv-sheet {
    background: var(--main-bg);
    display: grid;
    grid-template-columns: minmax(0, 11fr) minmax(0, 19fr);
    min-height: 70vh;
}

@media (max-width: 768px) {
    .cv-sheet {
        grid-template-columns: 1fr;
        min-height: unset;
    }
}

/* —— Sidebar —— */
.cv-sidebar {
    background: var(--sidebar-bg);
    color: var(--sidebar-fg);
    padding: 2.25rem clamp(1.25rem, 3vw, 2.25rem) 2.5rem;
}

.cv-photo-wrap {
    text-align: left;
    margin-bottom: 1.75rem;
}

.cv-photo-frame {
    position: relative;
    display: block;
    width: 9.5rem;
    height: 9.5rem;
    margin: 0;
}

.cv-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    border: none;
    display: block;
    background: #111;
}

.cv-photo.is-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--sidebar-muted);
}

.cv-photo-nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.65rem;
    margin-top: 0.85rem;
}

.cv-photo-nav[hidden] {
    display: none !important;
}

.cv-photo-btn {
    border: none;
    background: none;
    color: var(--sidebar-fg);
    cursor: pointer;
    font-family: inherit;
    font-size: 1.35rem;
    font-weight: 400;
    line-height: 1;
    padding: 0.15rem 0.35rem;
    opacity: 0.85;
}

.cv-photo-btn:hover {
    opacity: 1;
}

.cv-photo-btn:focus-visible {
    outline: 1px solid var(--sidebar-muted);
    outline-offset: 2px;
}

.cv-sidebar-name {
    font-size: 1.65rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin: 0 0 0.35rem;
    text-align: left;
    line-height: 1.2;
}

.cv-side-h {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin: 0 0 0.85rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--rule-dark);
}

.cv-side-block {
    margin-bottom: 1.65rem;
}

.cv-side-block:last-child {
    margin-bottom: 0;
}

.cv-contact-line {
    font-size: 0.88rem;
    margin: 0 0 0.45rem;
    word-break: break-word;
}

.cv-contact-line:last-child {
    margin-bottom: 0;
}

.cv-skill-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cv-skill-list li {
    position: relative;
    padding-left: 1.1rem;
    margin-bottom: 0.4rem;
    font-size: 0.88rem;
}

.cv-skill-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45em;
    width: 5px;
    height: 5px;
    border: 1px solid var(--sidebar-fg);
    border-radius: 50%;
    opacity: 0.85;
}

.cv-lang-table {
    width: 100%;
    font-size: 0.88rem;
    border-collapse: collapse;
}

.cv-lang-table td {
    padding: 0.2rem 0;
    vertical-align: baseline;
}

.cv-lang-table td:last-child {
    text-align: right;
    color: var(--sidebar-muted);
    padding-left: 0.5rem;
}

.cv-hobby-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cv-hobby-list li {
    position: relative;
    padding-left: 1rem;
    margin-bottom: 0.35rem;
    font-size: 0.88rem;
}

.cv-hobby-list li::before {
    content: "·";
    position: absolute;
    left: 0;
    opacity: 0.7;
}

.cv-side-edu {
    margin-bottom: 1.1rem;
}

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

.cv-side-edu-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 0.2rem;
    line-height: 1.3;
}

.cv-side-edu-period {
    margin: 0 0 0.2rem;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sidebar-muted);
    line-height: 1.35;
}

.cv-side-edu-school {
    margin: 0 0 0.35rem;
    font-size: 0.82rem;
    font-style: italic;
    color: var(--sidebar-muted);
    line-height: 1.35;
}

.cv-side-edu-bullets {
    margin: 0.35rem 0 0;
    padding-left: 1rem;
    font-size: 0.82rem;
    color: var(--sidebar-muted);
    line-height: 1.45;
}

.cv-side-edu-bullets li {
    margin-bottom: 0.25rem;
}

.cv-side-edu-bullets li:last-child {
    margin-bottom: 0;
}

/* —— Main column —— */
.cv-main {
    padding: 2.25rem clamp(1.25rem, 3vw, 2.75rem) 2.5rem;
    background: var(--main-bg);
    color: var(--main-fg);
}

@media (max-width: 768px) {
    .cv-main {
        padding: 1.75rem clamp(1rem, 4vw, 2.75rem) 2rem;
    }
}

.cv-main-h {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin: 0 0 0.85rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid var(--main-fg);
}

.cv-main-block {
    margin-bottom: 1.85rem;
}

.cv-main-block:last-child {
    margin-bottom: 0;
}

.cv-profile-text {
    margin: 0;
    font-size: 0.95rem;
    color: var(--main-muted);
    line-height: 1.65;
}

.cv-filter-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1.5rem;
}

.cv-filter-btn {
    font-family: inherit;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--main-fg);
    background: var(--main-bg);
    color: var(--main-fg);
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.cv-filter-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.cv-filter-btn[aria-pressed="true"] {
    background: #fff;
    color: #000;
}

.cv-exp {
    margin-bottom: 1.35rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--rule);
}

.cv-exp:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.cv-exp.is-hidden,
.cv-side-edu.is-hidden,
.cv-skill-list li.is-hidden,
.cv-hobby-list li.is-hidden {
    display: none;
}

.cv-exp--collapsible .cv-exp-head {
    margin-bottom: 0;
}

.cv-exp:not(.cv-exp--collapsible) .cv-exp-head {
    margin-bottom: 0.5rem;
}

.cv-exp-trigger {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    color: inherit;
    font: inherit;
    text-align: inherit;
    cursor: pointer;
    border-radius: 0;
}

.cv-exp-trigger:focus-visible {
    outline: 1px solid var(--main-muted);
    outline-offset: 3px;
}

.cv-exp-head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem 1.25rem;
    align-items: start;
}

@media (max-width: 520px) {
    .cv-exp-head {
        grid-template-columns: 1fr;
    }

    .cv-exp-meta {
        text-align: left;
    }
}

.cv-exp-role {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 0.2rem;
    line-height: 1.25;
}

.cv-exp-org {
    margin: 0;
    font-size: 0.88rem;
    color: var(--main-muted);
}

.cv-exp-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    text-align: right;
    max-width: 18rem;
}

.cv-exp-meta-line {
    display: block;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--main-muted);
    line-height: 1.4;
}

.cv-exp--collapsible .cv-exp-details {
    margin-top: 0.65rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--rule);
}

.cv-exp--collapsible .cv-bullets {
    margin-top: 0;
}

.cv-bullets {
    margin: 0.5rem 0 0;
    padding-left: 1.15rem;
    font-size: 0.9rem;
    color: var(--main-muted);
}

.cv-bullets li {
    margin-bottom: 0.35rem;
}

.cv-bullets li:last-child {
    margin-bottom: 0;
}

@page {
    margin: 14mm;
    size: A4;
}

@media print {
    .no-print {
        display: none !important;
    }

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

    html {
        font-size: 11pt;
        background: #fff !important;
    }

    body {
        background: #fff !important;
        color: #111 !important;
    }

    .cv-toolbar {
        display: none !important;
    }

    .cv-page {
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
        background: #fff !important;
    }

    .cv-sheet {
        display: grid !important;
        grid-template-columns: 11fr 19fr !important;
        min-height: auto !important;
        border: none !important;
        box-shadow: none !important;
        background: #fff !important;
    }

    .cv-sidebar {
        background: #0a0a0a !important;
        color: #fafafa !important;
        border-right: none !important;
        padding: 1.5rem 1.35rem 1.75rem !important;
    }

    .cv-photo {
        border: none !important;
        border-radius: 0 !important;
        background: #1a1a1a !important;
    }

    .cv-photo.is-placeholder {
        color: #888 !important;
    }

    .cv-side-h {
        border-bottom-color: #333 !important;
    }

    .cv-lang-table td:last-child {
        color: #b0b0b0 !important;
    }

    .cv-skill-list li::before {
        border-color: #fafafa !important;
    }

    .cv-main {
        background: #fff !important;
        color: #111 !important;
        padding: 1.5rem 1.5rem 1.75rem !important;
    }

    .cv-main-h {
        color: #111 !important;
        border-bottom-color: #111 !important;
    }

    .cv-profile-text,
    .cv-bullets,
    .cv-bullets li {
        color: #333 !important;
    }

    .cv-exp-org,
    .cv-exp-meta-line {
        color: #555 !important;
    }

    .cv-exp-role {
        color: #111 !important;
    }

    .cv-exp {
        border-bottom-color: #ddd !important;
    }

    .cv-exp-details[hidden] {
        display: block !important;
    }

    .cv-exp-trigger {
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    .cv-exp--collapsible .cv-exp-details {
        border-top-color: #ddd !important;
    }

    .cv-side-edu-title {
        color: #fafafa !important;
    }

    .cv-side-edu-period,
    .cv-side-edu-school,
    .cv-side-edu-bullets,
    .cv-side-edu-bullets li {
        color: #b0b0b0 !important;
    }

    .cv-exp.is-hidden,
    .cv-side-edu.is-hidden,
    .cv-skill-list li.is-hidden {
        display: block !important;
    }

    a {
        text-decoration: none !important;
        color: inherit !important;
    }

    .cv-sidebar a {
        color: #fafafa !important;
    }

    .cv-main a {
        color: #111 !important;
    }
}
