:root {
    --paper: #f8f5ef;
    --paper-solid: #fffdf9;
    --ink: #142630;
    --muted: #4b5a62;
    --sidebar: #153949;
    --sidebar-ink: #e8f0f3;
    --accent: #c96d2c;
    --line: #d8d4cb;
    --shadow: rgba(10, 25, 34, 0.14);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Work Sans", "Segoe UI", sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at 15% 5%, #faf6ee 0%, #ece6dc 100%);
    line-height: 1.35;
}

h1,
h2,
h3,
h4,
p,
ul {
    margin: 0;
}

ul {
    padding-left: 1.1rem;
}

.studio-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2.5rem 1rem;
}

.studio-main {
    width: min(980px, 100%);
    background: var(--paper-solid);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 14px 40px var(--shadow);
    padding: 2.2rem;
}

.studio-header {
    margin-bottom: 1.6rem;
}

.eyebrow {
    font-size: 0.76rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.65rem;
}

.studio-header h1 {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(2rem, 4.8vw, 3.1rem);
    font-weight: 700;
    letter-spacing: 0.01em;
    margin-bottom: 0.45rem;
}

.intro {
    max-width: 65ch;
    color: var(--muted);
}

.cv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.cv-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1.15rem;
    background: linear-gradient(145deg, #fffefa, #f4f0e8);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    height: 100%;
}

.cv-card h2 {
    font-size: 1.08rem;
    line-height: 1.22;
}

.cv-card p {
    font-size: 0.94rem;
    color: var(--muted);
    flex: 1;
}

.card-link {
    margin-top: auto;
    align-self: flex-start;
    text-decoration: none;
    color: var(--paper-solid);
    background: var(--sidebar);
    border-radius: 999px;
    padding: 0.48rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.cv-card-placeholder {
    border-style: dashed;
}

.studio-footer {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-start;
}

.studio-footer .toolbar-link {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
}

.cv-page-body {
    min-height: 100vh;
    padding: 1rem;
}

.cv-preview {
    width: 100%;
    overflow-x: auto;
    padding: 24px;
    display: flex;
    justify-content: center;
}

.screen-toolbar {
    width: min(210mm, 100%);
    margin: 0 auto 0.6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.toolbar-link {
    text-decoration: none;
    color: var(--sidebar);
    font-weight: 600;
    font-size: 0.9rem;
}

.web-only {
    display: inline-flex;
}

.print-btn {
    border: none;
    background: var(--accent);
    color: #fff;
    padding: 0.62rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.88rem;
}

.print-btn:hover {
    filter: brightness(0.95);
}

.a4-sheet {
    width: 210mm;
    height: 297mm;
    margin: 0 auto;
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 34% 66%;
    background: var(--paper-solid);
    box-shadow: 0 8px 30px var(--shadow);
    overflow: hidden;
}

.cv-sheet {
    width: 210mm;
    height: 297mm;
}

.cv-sidebar {
    background: linear-gradient(180deg, #113444 0%, #173f50 100%);
    color: var(--sidebar-ink);
    padding: 15mm 7mm 14mm;
    display: flex;
    flex-direction: column;
    gap: 4mm;
}

.portrait-wrap,
.cv-photo-frame {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    border-radius: 50%;
    overflow: hidden;
    border: 6px solid #f47a20;
    background: #f7f4ef;
    position: relative;
}

.portrait-wrap.portrait-fallback::before {
    content: "HR";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #f5f8f9;
}

.portrait-image,
.cv-photo,
.cv-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 18%;
    transform: scale(1);
    transform-origin: center 18%;
}

.sidebar-block {
    display: grid;
    gap: 2.2mm;
}

.sidebar-identity {
    text-align: center;
    display: grid;
    gap: 1.2mm;
}

.sidebar-identity h1 {
    font-size: 1.3rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #ffffff;
}

.sidebar-identity h2 {
    font-size: 0.76rem;
    line-height: 1.35;
    color: #f6d9c6;
    font-weight: 600;
}

.sidebar-identity p {
    font-size: 0.7rem;
    line-height: 1.3;
    color: #d9e8ee;
}

.sidebar-block h3 {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #ffd6bd;
}

.meta-list,
.chip-list,
.plain-list {
    list-style: none;
    padding-left: 0;
    display: grid;
    gap: 1.8mm;
}

.meta-list li,
.chip-list li,
.plain-list li {
    font-size: 0.69rem;
    line-height: 1.32;
}

.meta-list span {
    font-weight: 600;
}

.cv-highlight {
    color: #102733;
    font-weight: 700;
}

.svg-icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 1.8mm;
}

.section-icon {
    width: 3.2mm;
    height: 3.2mm;
    flex: 0 0 3.2mm;
    color: var(--accent);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.main-block .section-heading span,
.cv-lower-card .section-heading span {
    display: inline;
    color: inherit;
}

.cv-product-designer .meta-list li {
    display: grid;
    grid-template-columns: 3.2mm auto 1fr;
    align-items: start;
    column-gap: 1.5mm;
}

.cv-product-designer .contact-icon {
    width: 3mm;
    height: 3mm;
    margin-top: 0.2mm;
    color: #f2b78e;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cv-product-designer .contact-label {
    font-weight: 600;
}

.cv-product-designer .contact-value {
    font-weight: 400;
    color: #deeaee;
    word-break: break-word;
}

.cv-product-designer .tools-list {
    gap: 1.5mm;
}

.cv-product-designer .tools-list li {
    display: grid;
    grid-template-columns: 2.8mm 1fr;
    align-items: center;
    column-gap: 1.2mm;
}

.cv-product-designer .tool-icon {
    width: 2.3mm;
    height: 2.3mm;
    color: #f2b78e;
    fill: currentColor;
    stroke: none;
}

.cv-product-designer .product-project-grid li {
    grid-template-columns: 3.2mm 1fr;
    grid-template-areas:
        "icon title"
        "icon meta";
    column-gap: 1.2mm;
    row-gap: 0.55mm;
    padding-left: 0;
    border-left: none;
}

.cv-product-designer .project-icon {
    grid-area: icon;
    width: 2.8mm;
    height: 2.8mm;
    margin-top: 0.1mm;
    color: var(--accent);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cv-product-designer .product-project-grid strong {
    grid-area: title;
}

.cv-product-designer .product-project-grid span {
    grid-area: meta;
}

.cv-main {
    display: flex;
    flex-direction: column;
    padding: 12mm 10mm 10mm;
    gap: 3.4mm;
}

.main-block {
    display: grid;
    gap: 1.5mm;
}

.main-block h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.8mm;
}

.main-block p,
.main-block li {
    font-size: 0.71rem;
    line-height: 1.32;
}

.experience-item {
    display: grid;
    gap: 1.2mm;
}

.role-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.55rem;
}

.role-row h4 {
    font-size: 0.74rem;
    line-height: 1.2;
}

.role-row p {
    white-space: nowrap;
    color: #4f626b;
    font-size: 0.67rem;
    font-weight: 600;
}

.experience-item ul,
.compact-block ul {
    margin: 0;
}

.project-grid {
    list-style: none;
    padding-left: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.8mm 2.8mm;
}

.project-grid li {
    display: grid;
    gap: 0.6mm;
    padding-left: 1.8mm;
    border-left: 1px solid #e5d8c9;
}

.project-grid strong {
    font-size: 0.69rem;
    line-height: 1.25;
    color: #25343b;
}

.project-grid span {
    font-size: 0.66rem;
    line-height: 1.28;
    color: #516069;
}

.cv-lower-section {
    margin-top: 5mm;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10mm;
    align-items: start;
}

.cv-lower-card h2 {
    margin: 0 0 3mm;
    padding-bottom: 3mm;
    border-bottom: 1px solid rgba(31, 41, 55, 0.18);
    font-size: 11px;
    line-height: 1;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #c7652a;
}

.cv-lower-card ul {
    margin: 0;
    padding-left: 14px;
}

.cv-lower-card li,
.cv-lower-card p {
    margin: 0 0 2.4mm;
    font-size: 9.2px;
    line-height: 1.32;
    color: #1f2937;
}

.cv-lower-card strong {
    display: block;
    font-weight: 700;
    color: #111827;
}

.cv-lower-card span {
    display: block;
    color: #1f2937;
}

.cv-cert-text {
    margin-bottom: 0;
}

.cv-date-signature {
    margin-top: 5mm;
    padding-top: 3mm;
    border-top: 1px solid rgba(31, 41, 55, 0.14);
    display: grid;
    grid-template-columns: 22mm 32mm;
    justify-content: end;
    align-items: start;
    column-gap: 8mm;
    width: 100%;
}

.cv-date-accent {
    color: var(--accent, #c96d2c);
    font-weight: 700;
}

.cv-date-block,
.cv-signature-block {
    display: grid;
    grid-template-rows: auto 1fr;
    align-items: start;
    justify-items: end;
    text-align: right;
}

.cv-small-label {
    margin: 0 0 1.5mm;
    font-size: 7.4px;
    line-height: 1;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(31, 41, 55, 0.48);
}

#cvPrintDate {
    font-size: 9.2px;
    line-height: 1.2;
    color: rgba(31, 41, 55, 0.72);
    font-style: normal;
    white-space: nowrap;
}

.cv-signature {
    display: block;
    width: 28mm;
    max-width: 28mm;
    height: auto;
    max-height: 11mm;
    object-fit: contain;
    object-position: center;
    opacity: 1;
    visibility: visible;
    filter: brightness(0) saturate(100%) invert(18%) sepia(27%) saturate(1184%) hue-rotate(150deg) brightness(90%) contrast(92%);
}

.placeholder-main {
    justify-content: center;
}

@media (max-width: 920px) {
    .cv-page-body {
        padding: 0.5rem;
    }

    .cv-preview {
        padding: 8px;
        justify-content: flex-start;
    }

    .a4-sheet {
        width: 100%;
        min-height: unset;
        max-height: none;
        grid-template-columns: 1fr;
    }

    .cv-sidebar {
        padding: 8mm 6mm;
        gap: 4mm;
    }

    .cv-main {
        padding: 8mm 6mm 9mm;
    }

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

    .cv-lower-section {
        grid-template-columns: 1fr;
        gap: 5mm;
    }

    .cv-date-signature {
        margin-top: 4mm;
        column-gap: 6mm;
    }
}

/* Strong override: date / period accent color */
.role-row p.cv-date-accent,
.cv-lower-card span.cv-date-accent,
.cv-cert-text span.cv-date-accent {
    color: var(--accent, #c96d2c);
    font-weight: 700;
}

@media screen and (max-width: 980px) {
    .cv-page-body {
        min-height: 100%;
        height: auto;
        overflow-x: hidden;
        overflow-y: auto;
        padding: 0.75rem;
    }

    .cv-preview {
        width: 100%;
        padding: 0;
        overflow-x: hidden;
        overflow-y: visible;
        display: block;
    }

    .screen-toolbar {
        width: 100%;
        max-width: none;
        flex-wrap: wrap;
        justify-content: stretch;
        gap: 0.5rem;
    }

    .screen-toolbar .toolbar-link,
    .screen-toolbar .print-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .a4-sheet {
        width: 100%;
        max-width: 100%;
        min-height: auto;
        height: auto;
        max-height: none;
        overflow: visible;
        grid-template-columns: 1fr;
        border-radius: 14px;
        box-shadow: 0 8px 24px var(--shadow);
    }

    .cv-sidebar,
    .cv-main,
    .cv-content {
        width: 100%;
        max-width: 100%;
        overflow: visible;
    }

    .cv-sidebar {
        padding: 18px;
        gap: 12px;
    }

    .cv-main {
        padding: 18px;
        gap: 12px;
    }

    .project-grid,
    .cv-lower-section {
        grid-template-columns: 1fr;
    }

    .project-grid li,
    .cv-product-designer .product-project-grid li {
        border-left: none;
        padding-left: 0;
    }

    .role-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .role-row p,
    .cv-date-accent {
        white-space: normal;
    }

    .meta-list li,
    .plain-list li,
    .chip-list li,
    .project-grid span,
    .main-block p,
    .main-block li,
    .cv-lower-card li,
    .cv-lower-card p,
    .contact-value {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .cv-product-designer .meta-list li {
        grid-template-columns: 3.2mm auto 1fr;
    }

    .cv-product-designer .tools-list li {
        grid-template-columns: 2.8mm 1fr;
    }

    .cv-product-designer .product-project-grid li {
        grid-template-columns: 3.2mm 1fr;
        row-gap: 0.55mm;
    }

    .cv-date-signature {
        margin-top: 4mm;
        column-gap: 6mm;
    }

    .cv-signature {
        width: 24mm;
        max-width: 24mm;
        max-height: 9mm;
    }
}

@media screen and (max-width: 480px) {
    .cv-page-body {
        padding: 0.5rem;
    }

    .cv-sidebar,
    .cv-main {
        padding: 14px;
    }

    .sidebar-identity h1 {
        font-size: 1.1rem;
    }

    .sidebar-identity h2 {
        font-size: 0.71rem;
    }

    .sidebar-identity p,
    .sidebar-block h3,
    .main-block h3,
    .cv-lower-card h2,
    .meta-list li,
    .chip-list li,
    .plain-list li,
    .main-block p,
    .main-block li,
    .project-grid strong,
    .project-grid span,
    .role-row h4,
    .role-row p,
    .cv-date-block,
    .cv-signature-block {
        font-size: 0.68rem;
    }

    .screen-toolbar {
        gap: 0.4rem;
    }

    .screen-toolbar .toolbar-link,
    .screen-toolbar .print-btn {
        font-size: 0.82rem;
        padding: 0.55rem 0.8rem;
    }

    .cv-date-signature {
        column-gap: 5mm;
    }

    .cv-signature {
        width: 22mm;
        max-width: 22mm;
        max-height: 8.5mm;
    }
}

.mobile-pdf-help-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 28, 34, 0.56);
    backdrop-filter: blur(3px);
}

.mobile-pdf-help-backdrop[hidden] {
    display: none !important;
}

.mobile-pdf-help {
    width: min(100%, 38rem);
    max-height: min(90vh, 46rem);
    overflow: auto;
    border: 1px solid rgba(20, 38, 48, 0.14);
    border-radius: 18px;
    padding: 1.05rem;
    background: linear-gradient(180deg, #fffdf8 0%, #f2ece2 100%);
    color: var(--ink);
    box-shadow: 0 24px 70px rgba(8, 20, 26, 0.28);
}

.mobile-pdf-help-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.mobile-pdf-help-eyebrow {
    margin-bottom: 0.15rem;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}

.mobile-pdf-help h2 {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(1.4rem, 4vw, 2rem);
    line-height: 1.1;
}

.mobile-pdf-help-close,
.mobile-pdf-help-primary,
.mobile-pdf-help-secondary {
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.mobile-pdf-help-close {
    flex: none;
    padding: 0.55rem 0.9rem;
    background: #e7dfd2;
    color: var(--ink);
}

.mobile-pdf-help-intro {
    color: var(--muted);
    margin-bottom: 1rem;
}

.mobile-pdf-help-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.mobile-pdf-help-block {
    padding: 0.85rem;
    border-radius: 14px;
    border: 1px solid rgba(20, 38, 48, 0.09);
    background: rgba(255, 255, 255, 0.52);
}

.mobile-pdf-help-block h3 {
    margin-bottom: 0.55rem;
    font-size: 0.94rem;
}

.mobile-pdf-help-block ol {
    margin: 0;
    padding-left: 1.15rem;
    color: var(--muted);
}

.mobile-pdf-help-block li+li {
    margin-top: 0.35rem;
}

.mobile-pdf-help-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1rem;
}

.mobile-pdf-help-primary,
.mobile-pdf-help-secondary {
    padding: 0.75rem 1rem;
}

.mobile-pdf-help-primary {
    background: var(--accent);
    color: #fffaf4;
}

.mobile-pdf-help-secondary {
    background: var(--sidebar);
    color: var(--sidebar-ink);
}

.mobile-pdf-help-primary:focus-visible,
.mobile-pdf-help-secondary:focus-visible,
.mobile-pdf-help-close:focus-visible {
    outline: 2px solid rgba(201, 109, 44, 0.55);
    outline-offset: 2px;
}

@media (max-width: 680px) {
    .mobile-pdf-help {
        padding: 0.95rem;
    }

    .mobile-pdf-help-header {
        flex-direction: column;
    }

    .mobile-pdf-help-grid {
        grid-template-columns: 1fr;
    }

    .mobile-pdf-help-actions {
        flex-direction: column;
    }

    .mobile-pdf-help-primary,
    .mobile-pdf-help-secondary,
    .mobile-pdf-help-close {
        width: 100%;
        justify-content: center;
    }
}