/* ============================================================
   EDIT VISUAL STYLE HERE
============================================================ */

:root {
    --bg: #ffffff;
    --text: #0033ff;

    --font-main: "IBM Plex Mono", monospace;

    --font-size-main: 12pt;
    --font-weight-light: 300;
    --font-weight-regular: 300;
    --font-weight-semibold: 600;

    --page-padding: 10px;
    --header-padding: 6px 10px;
}

/* ============================================================
   EDIT LAYOUT HERE
============================================================ */

:root {
    --projects-top-margin: 72px;
    --projects-bottom-margin: 1vh;
    --projects-width: 60%;
    --projects-left-margin: 0px;
    --project-bottom-space: 6px;

    --popup-max-width: 40vw;
    --popup-max-height: calc(100vh - var(--projects-top-margin) - 20px);
    --popup-right-margin: 10px;

    --about-popup-width: 38vw;
    --about-popup-height: 65vh;

    --mobile-projects-top-extra: 36px;
    --mobile-popup-max-width: 90vw;
    --mobile-popup-max-height: 60vh;
}

/* ============================================================
   GLOBAL
============================================================ */

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-main);
    font-size: var(--font-size-main);
    font-weight: var(--font-weight-regular);
}

body {
    padding: var(--page-padding);
}

/* HEADER */

.header {
    position: fixed;
    top: var(--page-padding);
    left: var(--page-padding);
    right: var(--page-padding);
    background: var(--text);
    color: var(--bg);
    padding: var(--header-padding);
    z-index: 100;
    line-height: 1.25;
}

.brand,
.filter {
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    cursor: pointer;
    padding: 0 2px;
}

.brand:hover,
.filter:hover,
.brand.is-selected,
.filter.is-selected {
    background: var(--bg);
    color: var(--text);
}

/* MAIN */

.main {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--page-padding);
    right: var(--page-padding);
    overflow-y: auto;
    padding-top: var(--projects-top-margin);
    padding-bottom: var(--projects-bottom-margin);
}

/* PROJECT LIST */

.projects {
    width: var(--projects-width);
    margin-left: var(--projects-left-margin);
}

.project {
    margin-bottom: var(--project-bottom-space);
    line-height: 1.2;
}

.project-title {
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    cursor: pointer;
    padding: 0 2px;
}

.project-title:hover,
.project-title.is-selected {
    background: var(--text);
    color: var(--bg);
}

.project-title:focus {
    outline: none;
    background: var(--text);
    color: var(--bg);
}

.project-description {
    display: none;
    margin: 4px 0 10px 0;
    font-weight: var(--font-weight-light);
    line-height: 1.35;
}

.project-description.active {
    display: block;
}

.institution a {
    color: inherit;
    text-decoration: underline;
}

/* POPUP */

.popup {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 200;
}

.popup.active {
    display: block;
}

.popup-inner {
    position: absolute;
    top: 50%;
    right: var(--popup-right-margin);
    transform: translateY(-50%);
    width: auto;
    height: auto;
    max-width: var(--popup-max-width);
    max-height: var(--popup-max-height);
}

/* MEDIA */

.popup-media-wrap {
    width: auto;
    height: auto;
    max-width: var(--popup-max-width);
    max-height: var(--popup-max-height);
    cursor: pointer;
}

.popup-media {
    display: block;
    width: auto;
    height: auto;
    max-width: var(--popup-max-width);
    max-height: var(--popup-max-height);
    object-fit: contain;
}

.popup-iframe,
.popup-video {
    display: block;
    width: var(--popup-max-width);
    height: var(--popup-max-height);
    border: none;
}

.popup-video {
    object-fit: contain;
    cursor: default;
}

/* ABOUT POPUP */

.popup-text {
    width: var(--about-popup-width);
    height: var(--about-popup-height);
    background: var(--text);
    color: var(--bg);
    padding: 14px;
    overflow-y: auto;
    line-height: 1.45;
}

.popup-text a {
    color: inherit;
    text-decoration: none;
}

/* MOBILE INLINE MEDIA */

.mobile-popup-slot {
    display: none;
}

/* TYPO */

.light { font-weight: var(--font-weight-light); }
.semibold { font-weight: var(--font-weight-semibold); }

/* ============================================================
   RESPONSIVE / MOBILE

   If you change 700px here, also change MOBILE_BREAKPOINT
   in script.js.
============================================================ */

@media (max-width: 700px) {

    .main {
        padding-top: calc(var(--projects-top-margin) + var(--mobile-projects-top-extra));
    }

    .projects {
        width: 100%;
        margin-left: 0;
    }

    .project {
        margin-bottom: calc(var(--project-bottom-space) + 2px);
    }

    .popup.project-popup {
        display: none !important;
    }

    .popup.about-popup {
        display: block;
        z-index: 300;
    }

    .popup.about-popup .popup-inner {
        position: absolute;
        top: 50%;
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%);
        max-width: var(--mobile-popup-max-width);
        max-height: var(--mobile-popup-max-height);
    }

    .mobile-popup-slot {
        display: flex;
        justify-content: center;
        width: 100%;
        margin: 10px 0 14px 0;
        position: relative;
        z-index: 150;
    }

    .mobile-popup-slot .popup-inner {
        position: static;
        transform: none;
        max-width: var(--mobile-popup-max-width);
        max-height: var(--mobile-popup-max-height);
    }

    .mobile-popup-slot .popup-media-wrap,
    .mobile-popup-slot .popup-media {
        max-width: var(--mobile-popup-max-width);
        max-height: var(--mobile-popup-max-height);
    }

    .mobile-popup-slot .popup-iframe,
    .mobile-popup-slot .popup-video {
        width: var(--mobile-popup-max-width);
        height: var(--mobile-popup-max-height);
    }

    .popup-text {
        width: var(--mobile-popup-max-width);
        height: var(--mobile-popup-max-height);
    }
}