body {
    background: #e0dfda;
    margin: 0;
}

.header.solid {
    background: #e0dfda;
}

.cv-layout {
    display: grid;
    grid-template-columns: 38% 62%;
    margin-top: 80px;
}


/* =========================
LEFT: portrait + intro
========================= */

.cv-left {
    position: sticky;
    top: 80px;
    align-self: start;
    padding: 5vh 4vw 4vh 6vw;
}

/* cut-out photo (no background) sits straight on the page, fading out at the bottom */
.cv-portrait {
    width: 100%;
    max-width: 200px;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    margin-bottom: 1.8rem;
    -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
}

.cv-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 15%;
    filter: grayscale(100%) contrast(1.05);
    transition: filter 0.35s ease;
}

/* colour comes in when the mouse is anywhere on the left panel */
.cv-left:hover .cv-portrait img {
    filter: grayscale(0%);
}

/* phones and tablets have no hover: show the photo in colour */
@media (hover: none) {
    .cv-portrait img {
        filter: none;
    }
}

.cv-eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.25rem;
    text-transform: uppercase;
    opacity: 0.55;
    margin-bottom: 0.8rem;
}

.cv-left h1 {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.6rem, 2.4vw, 2.4rem);
    letter-spacing: 0.25rem;
    line-height: 1.2;
}

.cv-subtitle {
    margin-top: 0.8rem;
    font-family: 'Fraunces', serif;
    font-style: italic;
}

.cv-bio {
    margin-top: 1.3rem;
    max-width: 26rem;
    font-size: 0.92rem;
    line-height: 1.75;
    opacity: 0.8;
}

.cv-facts {
    margin-top: 1.6rem;
    max-width: 26rem;
    border-top: 1px solid rgba(17, 17, 17, 0.2);
}

.cv-facts div {
    display: grid;
    grid-template-columns: 5.5rem 1fr;
    padding: 0.7rem 0;
    border-bottom: 1px solid rgba(17, 17, 17, 0.12);
    font-size: 0.85rem;
}

.cv-facts dt {
    font-size: 0.68rem;
    letter-spacing: 0.15rem;
    text-transform: uppercase;
    opacity: 0.5;
    padding-top: 0.15rem;
}

.cv-facts a {
    color: #111;
    text-decoration: none;
    border-bottom: 1px solid rgba(17, 17, 17, 0.3);
}

.cv-facts a:hover {
    border-color: #111;
}


/* =========================
RIGHT
========================= */

.cv-right {
    padding: 8vh 7vw 14vh 3vw;
}

.cv-section {
    margin-bottom: 6rem;
}

.cv-section h2 {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.25rem;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #111;
}


/* highlights strip */

.cv-highlights {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: rgba(17, 17, 17, 0.2);
    border: 1px solid rgba(17, 17, 17, 0.2);
    margin-bottom: 6rem;
}

.highlight {
    background: #e0dfda;
    padding: 1.6rem 1.4rem;
}

.highlight-year {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.15rem;
    opacity: 0.5;
    margin-bottom: 0.8rem;
}

.highlight strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.03rem;
}

.highlight p {
    margin-top: 0.3rem;
    font-size: 0.85rem;
    opacity: 0.7;
}


/* timeline items: date on the left, details on the right */

.cv-item {
    display: grid;
    grid-template-columns: 10rem 1fr;
    gap: 2rem;
    padding: 1.4rem 0;
    border-bottom: 1px solid rgba(17, 17, 17, 0.1);
}

.cv-item:last-child {
    border-bottom: none;
}

.cv-when {
    font-size: 0.75rem;
    letter-spacing: 0.08rem;
    opacity: 0.55;
    padding-top: 0.2rem;
}

.cv-item h3,
.cred-text h3 {
    font-size: 1.05rem;
    font-weight: 500;
}

.cv-where {
    margin-top: 0.2rem;
    font-size: 0.9rem;
    opacity: 0.75;
}

.cv-note {
    margin-top: 0.4rem;
    font-size: 0.82rem;
    opacity: 0.6;
}

.cv-item ul {
    margin-top: 0.8rem;
    padding-left: 1rem;
    font-size: 0.9rem;
    line-height: 1.7;
    opacity: 0.8;
}


/* certificates: thumbnail on the left, details on the right */

.cred {
    display: grid;
    grid-template-columns: 10rem 1fr;
    gap: 2rem;
    align-items: start;
    padding: 1.6rem 0;
    border-bottom: 1px solid rgba(17, 17, 17, 0.1);
}

.cred:last-child {
    border-bottom: none;
}

.cred-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    padding: 0;
    border: 1px solid rgba(17, 17, 17, 0.15);
    background: #ecebe7;
    overflow: hidden;
    cursor: zoom-in;
}

.cred-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.4s ease;
}

.cred-thumb:hover img {
    transform: scale(1.05);
}

.cred-thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    border-style: dashed;
    background: transparent;
    cursor: default;
}

.cred-thumb--empty span {
    font-size: 0.65rem;
    letter-spacing: 0.15rem;
    text-transform: uppercase;
    opacity: 0.45;
}

.cred-text .cv-when {
    display: block;
    margin-bottom: 0.4rem;
}

.cred-text p {
    margin-top: 0.3rem;
    font-size: 0.88rem;
    line-height: 1.65;
    opacity: 0.75;
}

.cred-link {
    display: inline-block;
    margin-top: 0.8rem;
    font-size: 0.72rem;
    letter-spacing: 0.12rem;
    text-transform: uppercase;
    color: #111;
    text-decoration: none;
    border-bottom: 1px solid rgba(17, 17, 17, 0.35);
    opacity: 0.7;
}

.cred-link:hover {
    opacity: 1;
}

.cred--pending .cred-text {
    opacity: 0.7;
}


/* skills */

.skill-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.skill-block h4 {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.15rem;
    text-transform: uppercase;
    opacity: 0.55;
    margin-bottom: 0.5rem;
}

.skill-block p {
    font-size: 1rem;
}

.skill-tools {
    display: block;
    margin-top: 0.6rem;
    font-size: 0.78rem;
    opacity: 0.55;
}

.skill-tools a {
    color: #111;
    text-decoration: none;
    border-bottom: 1px solid rgba(17, 17, 17, 0.35);
}


/* =========================
CERTIFICATE VIEWER
========================= */

.cert-viewer {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5vh 5vw;
    background: rgba(17, 17, 17, 0.88);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    cursor: zoom-out;
}

.cert-viewer.open {
    opacity: 1;
    pointer-events: auto;
}

.cert-viewer img {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.cert-close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    background: none;
    border: none;
    color: #e0dfda;
    font-size: 2.2rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}


/* =========================
SMALLER SCREENS
========================= */

@media (max-width: 1000px) {

    .cv-layout {
        grid-template-columns: 1fr;
    }

    .cv-left {
        position: relative;
        top: 0;
        padding: 6vh 6vw 2vh;
    }

    .cv-right {
        padding: 4vh 6vw 10vh;
    }
}

@media (max-width: 600px) {

    .cv-highlights {
        grid-template-columns: 1fr;
    }

    .cv-item,
    .cred {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .cred-thumb {
        max-width: 14rem;
    }

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