:root {
    --page-bg: #e7e4dc;
    --paper: #fbf8f1;
    --ink: #22303f;
    --ink-strong: #16243b;
    --ink-soft: #46535f;
    --muted: #7b8696;
    --warm-muted: #8c8470;
    --rule: #d8d2c4;
    --rule-soft: #ede7da;
    --chip-border: #cbd2de;
    --chrome-border: #d2cdc0;
    --chrome-pill: #dad5c7;
    --shadow: 0 4px 24px rgba(28, 46, 71, 0.12);
    --font-body: "Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-display: "Spectral", Georgia, "Times New Roman", serif;
}

@font-face {
    font-family: "Libre Franklin";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: local("Libre Franklin");
}

@font-face {
    font-family: "Spectral";
    font-style: normal;
    font-weight: 600 700;
    font-display: swap;
    src: local("Spectral");
}

* {
    box-sizing: border-box;
}

html {
    background: var(--page-bg);
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    margin: 0;
    background: var(--page-bg);
    color: var(--ink);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

a {
    color: inherit;
}

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

a:focus-visible,
input:focus-visible,
button:focus-visible {
    outline: 2px solid var(--ink-strong);
    outline-offset: 3px;
}

.cv-shell {
    min-height: 100vh;
    padding-bottom: 64px;
}

.cv-chrome {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(231, 228, 220, 0.86);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--chrome-border);
}

.chrome-inner {
    max-width: 860px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.chrome-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.chrome-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.chrome-name {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--ink-strong);
}

.chrome-label {
    font-size: 12px;
    color: #7a7565;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.language-switch {
    display: flex;
    gap: 2px;
    background: var(--chrome-pill);
    padding: 3px;
    border-radius: 999px;
}

.language-switch button {
    border: 0;
    cursor: pointer;
    font: 600 12px/1 var(--font-body);
    padding: 7px 13px;
    border-radius: 999px;
    background: transparent;
    color: #5c5848;
}

.language-switch button.active {
    background: var(--ink-strong);
    color: #ffffff;
}

.cv-stage {
    max-width: 860px;
    margin: 0 auto;
    padding: 36px 24px 0;
}

.cv-page {
    background: var(--paper);
    border-radius: 5px;
    box-shadow: var(--shadow);
    padding: 50px 60px;
}

.letterhead {
    text-align: center;
    border-bottom: 2px solid #1c2e47;
    padding-bottom: 22px;
}

.profile-image {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 12%;
    border: 1.5px solid #c9cfd9;
    margin: 0 auto 16px;
    display: block;
}

h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 40px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--ink-strong);
    line-height: 1.04;
}

.role-text {
    margin: 9px 0 0;
    font-size: 14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #5e6b7c;
}

.tagline-text {
    margin: 9px 0 0;
    font-size: 12.5px;
    color: var(--muted);
}

.contact-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 16px;
    margin-top: 16px;
}

.contact-row a {
    font-size: 12px;
    color: #52606d;
    text-decoration: none;
    border-bottom: 1px solid rgba(82, 96, 109, 0.35);
}

.contact-row a:hover {
    color: var(--ink-strong);
    border-bottom-color: var(--ink-strong);
}

.phone-gate {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 20px;
}

.phone-gate input {
    width: 54px;
    height: 22px;
    border: 1px solid rgba(82, 96, 109, 0.28);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.45);
    color: var(--ink-strong);
    font: 600 11px/1 var(--font-body);
    padding: 0 7px;
}

.phone-gate input::placeholder {
    color: #8c95a1;
}

.phone-gate button {
    border: 0;
    border-bottom: 1px solid rgba(82, 96, 109, 0.35);
    background: transparent;
    color: #52606d;
    cursor: pointer;
    font: 600 12px/1 var(--font-body);
    padding: 2px 0 1px;
}

.phone-gate button:hover {
    color: var(--ink-strong);
    border-bottom-color: var(--ink-strong);
}

.phone-status {
    min-width: 0;
    font-size: 11px;
    color: var(--warm-muted);
}

.phone-gate.unlocked input,
.phone-gate.unlocked button,
.phone-gate.unlocked .phone-status {
    display: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.profile-text {
    max-width: 640px;
    margin: 24px auto 4px;
    font-family: var(--font-display);
    font-size: 16.5px;
    line-height: 1.6;
    color: #33414f;
    text-align: center;
    font-style: italic;
}

.chips {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    margin-top: 18px;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}

.credential-item {
    min-height: 58px;
    padding: 10px 12px;
    border-right: 1px solid var(--rule-soft);
    text-align: left;
}

.credential-item:last-child {
    border-right: 0;
}

.credential-label {
    display: block;
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 700;
    color: var(--warm-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.credential-value {
    display: block;
    font-size: 11.5px;
    line-height: 1.35;
    color: #344457;
    font-weight: 600;
}

.cv-section {
    margin-top: 34px;
}

.cv-section h2 {
    margin: 0 0 4px;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--ink-strong);
    border-bottom: 1px solid var(--rule);
    padding-bottom: 7px;
}

.experience-item {
    display: grid;
    grid-template-columns: 138px 1fr;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid var(--rule-soft);
}

.experience-period {
    font-size: 11px;
    letter-spacing: 0.03em;
    color: var(--warm-muted);
    font-weight: 600;
    text-transform: uppercase;
    padding-top: 2px;
}

.experience-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--ink-strong);
}

.experience-place {
    font-size: 12.5px;
    color: var(--muted);
    font-style: italic;
    margin: 2px 0 6px;
}

.experience-detail {
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--ink-soft);
}

.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    margin-top: 32px;
}

.compact-section {
    margin-top: 0;
}

.compact-section h2 {
    font-size: 16px;
    padding-bottom: 6px;
    margin-bottom: 9px;
}

.nested-title {
    margin-top: 18px !important;
}

.line-item,
.earlier-item,
.small-line {
    font-size: 12.5px;
    color: #3e4c59;
    line-height: 1.5;
    padding: 3px 0;
}

.small-line {
    margin: 0;
}

.earlier-section {
    margin-top: 30px;
}

.earlier-list {
    display: grid;
    gap: 7px;
    padding-top: 7px;
}

.earlier-item {
    position: relative;
    padding-left: 14px;
    color: #5d6a72;
}

.earlier-item::before {
    content: "·";
    position: absolute;
    left: 0;
    top: 3px;
    color: var(--warm-muted);
}

.cv-footer {
    margin-top: 28px;
    padding-top: 15px;
    border-top: 2px solid #1c2e47;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 11.5px;
}

.cv-footer span:first-child {
    color: var(--warm-muted);
    font-style: italic;
}

.cv-footer span:last-child {
    color: #a39b86;
}

@media (max-width: 760px) {
    .cv-stage {
        padding: 22px 12px 0;
    }

    .cv-page {
        padding: 34px 22px;
    }

    h1 {
        font-size: 33px;
    }

    .bottom-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

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

    .credential-item {
        border-right: 0;
        border-bottom: 1px solid var(--rule-soft);
        text-align: center;
    }

    .credential-item:last-child {
        border-bottom: 0;
    }

    .experience-item {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .experience-period {
        padding-top: 0;
    }
}

@media (max-width: 460px) {
    .chrome-inner {
        padding: 12px;
    }

    .chrome-title {
        width: 100%;
        justify-content: space-between;
    }

    .language-switch {
        flex: 1 1 auto;
    }

    .language-switch button {
        flex: 1;
    }

    .chrome-actions {
        width: 100%;
    }

    h1 {
        font-size: 29px;
    }

    .role-text {
        font-size: 12px;
    }

    .contact-row {
        gap: 8px 12px;
    }

    .phone-gate {
        order: -1;
    }
}

@media print {
    body {
        background: #ffffff;
    }

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

    .cv-shell {
        padding-bottom: 0;
    }

    .cv-stage {
        max-width: none;
        padding: 0 !important;
    }

    .cv-page {
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 36px 44px !important;
    }

    @page {
        margin: 14mm;
    }
}
