/*/////////////// MAIN.CSS ////////////////*/

:root {
    /* --mainTextColor: #111111; */
    --mainTextColor: rgba(0,0,0,0.8);
    --linkTextColor: #2563EB;
    --highlight: #111111;
    --mainBackground: #ffffff;

    --primaryFont: 'Instrument Sans', sans-serif;

}

* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

::selection {
    background-color: var(--highlight);
    color: #ffffff;
}

html {
    font-size: 62.5%;
    color: var(--mainTextColor);
    background-color: var(--mainBackground);
}

html, body {
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

body {
    font-family: var(--primaryFont);
    font-style: normal;
    font-weight: 400;
    color: var(--mainTextColor);
}

h1 {
    font-size: 1.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

h2 {
    font-size: 1.4rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
}
h3 {
    font-size: 1.4rem;
    font-weight: 700;
    text-transform: uppercase;
}

p, span, a, li, h3 {
    font-size: 1.4rem;
    line-height: 1.4;
}

a {
    color: var(--mainTextColor);
    text-decoration: underline;
}

a:hover, a:visited:hover {
    color: var(--linkTextColor);
    text-decoration: underline;
}

a:visited{
    color: var(--mainTextColor);
}

.bold { font-weight: 700; }
.italics { font-style: italic; }

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}
.page-header-line {
    flex: 1;
    height: 1.5px;
    background-color: var(--mainTextColor);
    /* margin-left: 20px; */
}

/*////////// LAYOUT ///////////*/

.site-layout {
    display: grid;
    align-items: start;
    align-content: start;
    grid-template-columns: 160px 1fr;
    padding: 50px 50px 150px 50px;
    min-height: 100vh;
    max-width: 1000px;
    margin: 0 auto;
}

.page-content {
    min-width: 0;
}

.site-nav {
    position: sticky;
    top: 50px; /* must be same as padding in site-layout */
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.nav-logo {
    max-width: 100px;
}
.nav-logo a {
    font-size: 1.8rem;
    letter-spacing: 0.03em;
    line-height: 1.2;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--mainTextColor);
    text-decoration: none;
}


.nav-menu {
    display: flex;
    flex-direction: column;
    list-style: none;
}

.nav-menu a {
    font-weight: 400;
    color: var(--mainTextColor);
    text-decoration: underline;
}

.nav-logo a:visited {
    color: var(--mainTextColor);
}

.nav-menu a.active-page {
    font-weight: 700;
}

.nav-toggle { display: none; }

/*////////// HOME PAGE ///////////*/
.home-page > div:first-of-type {
    margin-bottom: 40px;
}

/* .hero-image {
    width: 100%;
    overflow: hidden;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
} */

.home-columns {
    display: flex;
    gap: 50px;
}

.home-about {
    flex: 1;
}

.home-clients {
    width:225px;
}

.home-page p:not(:last-of-type) {
    margin-bottom: 1.1rem;
}

.home-clients ul {
    list-style: none;
    padding: 0;
}
.email-container {
    margin-top:3rem;
}
.email  {
    margin-left: 6px; 
    text-decoration: underline;
    user-select: all;
    cursor: pointer;
}

/*////////// PORTFOLIO ///////////*/
.portfolio-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.portfolio-project-container {
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.portfolio-project-container.full { grid-column: span 2; }
.portfolio-project-container.half { grid-column: span 1; }

.portfolio-project-img-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
}

.portfolio-project-container.half .portfolio-project-img-container {
    aspect-ratio: 1 / 1;
}

.portfolio-project-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.portfolio-project-title {
    font-size: 2.0rem;
    text-transform: none;

    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: 200px 15px 15px;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,1));
    color: #ffffff;
    text-align: left;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.portfolio-project-description {
    font-size: 1.5rem;

    position: absolute;
    inset: 0;
    color: #ffffff;
    display: flex;
    align-items: flex-end;
    padding: 15px 15px 47px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.portfolio-project-container:hover .portfolio-project-description,
.portfolio-project-container:hover .portfolio-project-title {
    opacity: 1;
}

.portfolio-page a:hover,
.portfolio-page a:visited:hover {
    color: var(--mainTextColor);
    text-decoration: none;
}

/*////////// PASSWORD POPUP ///////////*/

/* Lock icon — rides on the title, so it reveals on hover with everything else */
.locked .portfolio-project-title::before {
    content: "";
    display: inline-block;
    width: 2.2rem;
    height: 2.2rem;
    margin-right: 0.5rem;
    vertical-align: -0.25rem;
    background-repeat: no-repeat;
    background-size: contain;
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%3E%3Crect%20x='5'%20y='11'%20width='14'%20height='9'%20rx='1.5'/%3E%3Cpath%20d='M8%2011V8a4%204%200%200%201%208%200v3'/%3E%3C/svg%3E");
}

.pw-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.pw-overlay.active { display: flex; }

.pw-box {
    position: relative;
    background-color: var(--mainBackground);
    width: 90%;
    max-width: 340px;
    padding: 30px;
}

.pw-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 2.2rem;
    line-height: 1;
    color: var(--mainTextColor);
    cursor: pointer;
}

.pw-prompt { margin-bottom: 16px; }

/* Form controls don't inherit font — set it explicitly */
.pw-input {
    width: 100%;
    padding: 10px;
    margin-bottom: 12px;
    border: 1px solid var(--mainTextColor);
    font-family: inherit;
    font-size: 1.4rem;
}

.pw-submit {
    width: 100%;
    padding: 10px;
    border: none;
    background-color: var(--highlight);
    color: #ffffff;
    font-family: inherit;
    font-size: 1.4rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
}

.pw-error {
    margin-top: 12px;
    color: rgb(246, 77, 77);
}

.pw-contact { margin-top: 16px; }

/*///////////// PROJECT PAGE ///////////////*/

.project-header {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 50px;
    
    margin-bottom: 2rem;
}

.project-header-row {
    margin-bottom: 2rem;
}
.project-header-row li {
    list-style: none;
}
.project-header-row > p:not(:last-of-type) {
    margin-bottom: 1.1rem; /* match home page */
}

.project-highlights {
    flex-direction: column;
}

.project-section-row {
    display: flex;
    gap: 25px;
    margin-bottom: 30px;
    align-items: flex-start;
}

.project-section-row > * {
    flex: 1;
    min-width: 0;
}
.project-section-row > p {
    flex: 1;
}

.project-section-row > *.half {
    flex: 0 0 calc(50% - 12.5px);
}

.project-section-row img {
    flex: 2;
    width: 100%;
    height: auto;
    display: block;
}

.wip-project {
    color: rgba(255, 58, 58, 0.8);
}

/* LIGHTBOX */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    cursor: default;
}

/* CV */


.last-updated {
    color: #ff4d4d;
    font-size: 1.2rem;
    font-style: italic;
    white-space: nowrap;
}
.cv-section p,
.cv-section a,
.cv-section li {
    font-size: 1.4rem;
}

ul.cv-entry-description {
    list-style: disc;
    padding-left: 1.4rem;
    margin: 0;
}

.cv-section-header h2 {
    font-size: 1.6rem;
}

.cv-section-header {
    margin-bottom: 20px;
}

.cv-row-group {
    display: flex;
    margin-bottom: 50px;
    align-items: flex-start;
}

.cv-col-left {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: 50px; /* match site-layout padding */
    z-index: 40;
    align-self: flex-start;
    margin-right: 25px;
}

.cv-company {
    font-weight: 700;
}

.cv-title {
    font-style: italic;
}

p.cv-date {
    color: #999999;
    font-size: 1.2rem;
}

.cv-col-right {
    flex: 1;
}

.cv-entry {
    display: flex;
    width: 100%;
    padding-bottom: 35px;
    align-items: flex-start;
}

.cv-entry-name {
    width: 150px;
    flex-shrink: 0;
    margin-right: 15px;
}

.cv-entry-description {
    flex: 1;
}
.cv-entry-description li {
    margin-bottom: 0.7rem;
}

.cv-entry-activity {
    flex: 1;
}


/*////////// MOBILE ///////////*/

@media screen and (max-width: 768px) {
    html {
        font-size: 70%;
    }
    .site-layout {
        grid-template-columns: 1fr;
        padding: 25px 25px 100px 25px;
    }

    /* NAV */
    .site-nav {
        position: static;
        top: auto;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0;
        margin-bottom: 50px;
    }

    .nav-logo { 
        max-width: none; 
    }
    .nav-logo a {
        font-size: 2.4rem;
    }

    .nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 30px;
        height: 30px;
        padding: 0;
        border: none;
        background: none;
        cursor: pointer;
        z-index: 1200;
    }

    .nav-bar-line {
        display: block;
        width: 24px;
        height: 2px;
        background-color: var(--mainTextColor);
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .nav-toggle.active .nav-bar-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle.active .nav-bar-line:nth-child(2) { opacity: 0; }
    .nav-toggle.active .nav-bar-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .nav-menu {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 1100;
        background-color: var(--mainBackground);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
    }

    .nav-menu.active { display: flex; }
    .nav-menu a { 
        font-size: 2.4rem; 
        text-decoration: none;
    }

    body.nav-open { overflow: hidden; }

    .page-header h1 {
        font-size: 2.4rem;
    }
    .page-header-line { background-color:var(--mainBackground)}

    /* HOME */
    .home-columns {
        flex-direction: column;
        gap: 40px;
    }
    .home-clients { width: 100%; }

    /* PORTFOLIO */
 
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .portfolio-project-container.full,
    .portfolio-project-container.half { grid-column: span 1; }

    .portfolio-project-container.half .portfolio-project-img-container {
        aspect-ratio: 4 / 3;
    }

    .portfolio-project-title,
    .portfolio-project-description {
        position: static;
        opacity: 1;
        padding: 0;
        background: none;
        color: var(--mainTextColor);
        display: block;
    }

    .portfolio-project-title {
        font-size: 1.8rem;
        margin-top: 10px;
    }

    .portfolio-project-description {
        margin-top: 4px;
    }

    /* Lock icon is stroked white for the overlay — needs to be dark here */
    .locked .portfolio-project-title::before {
        width: 1.8rem;
        height: 1.8rem;
        vertical-align: -0.2rem;
        background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23111'%20stroke-width='2'%3E%3Crect%20x='5'%20y='11'%20width='14'%20height='9'%20rx='1.5'/%3E%3Cpath%20d='M8%2011V8a4%204%200%200%201%208%200v3'/%3E%3C/svg%3E");
    }

    /* PROJECT PAGES */
    .project-header {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .project-section-row {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 20px;
    }
    .project-section-row > *.half { flex: 1 1 auto; }

    /* CV */
    .cv-row-group {
        flex-direction: column;
        margin-bottom: 40px;
    }

    .cv-col-left {
        position: static;
        top: auto;
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
    }

    .cv-entry {
        flex-direction: column;
        padding-bottom: 20px;
    }

    .cv-entry-name {
        width: auto;
        margin-right: 0;
        margin-bottom: 5px;
    }
}