* {
    box-sizing: border-box;
}

html {
    background: #f8f6f1;
    color: #171717;

    font-family:
        Helvetica,
        "Helvetica Neue",
        Arial,
        sans-serif;
}

body {
    margin: 0;
}

/* Header */

header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;

    max-width: 1420px;

    margin: 0 auto;
    padding: 42px 34px 58px;
}

h1 {
    margin: 0;

    font-size: 1.05rem;
    font-weight: 400;

    letter-spacing: 0.025em;
}

nav {
    display: flex;
    gap: 26px;

    font-size: 0.82rem;
    font-weight: 400;

    letter-spacing: 0.025em;
}

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

nav a {
    color: #85827d;

    transition: color 0.15s ease;
}

nav a:hover,
nav a.active {
    color: #171717;
}

/* Main gallery */

main {
    max-width: 1420px;

    margin: 0 auto;
    padding: 0 34px;
}

.gallery {
    display: grid;

    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 32px;

    align-items: start;
}

.gallery a {
    position: relative;

    display: block;

    overflow: hidden;

    background: #eeece7;
}

.gallery img {
    display: block;

    width: 100%;
    height: auto;

    transition:
        opacity 0.2s ease,
        transform 0.25s ease;
}

.gallery .caption {
    position: absolute;

    left: 15px;
    bottom: 13px;

    z-index: 1;

    color: #ffffff;

    font-size: 0.76rem;
    font-weight: 400;

    letter-spacing: 0.025em;

    opacity: 0;

    transition: opacity 0.2s ease;
}

.gallery a::after {
    content: "";

    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            to top,
            rgba(0, 0, 0, 0.30) 0%,
            rgba(0, 0, 0, 0.00) 30%
        );

    opacity: 0;

    transition: opacity 0.2s ease;
}

.gallery a:hover img {
    transform: scale(1.004);
}

.gallery a:hover::after,
.gallery a:hover .caption {
    opacity: 1;
}

/* Footer */

footer {
    max-width: 1420px;

    margin: 82px auto 0;
    padding: 0 34px 38px;

    color: #96928c;

    font-size: 0.74rem;
    font-weight: 400;

    letter-spacing: 0.02em;
}

/* Lightbox */

.lightbox {
    position: fixed;
    inset: 0;

    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 48px;

    background: rgba(17, 17, 17, 0.96);

    visibility: hidden;
    opacity: 0;

    transition:
        opacity 0.18s ease,
        visibility 0.18s ease;
}

.lightbox.open {
    visibility: visible;
    opacity: 1;
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;

    max-width: 100%;
    max-height: 100%;

    margin: 0;
}

.lightbox-content img {
    display: block;

    max-width: min(92vw, 1800px);
    max-height: 86vh;

    width: auto;
    height: auto;

    object-fit: contain;
}

.lightbox-content figcaption {
    margin-top: 15px;

    color: #d6d3cd;

    font-size: 0.78rem;
    font-weight: 400;

    letter-spacing: 0.025em;
}

.lightbox-close {
    position: fixed;

    top: 24px;
    right: 28px;

    z-index: 1001;

    padding: 0;

    border: 0;
    background: none;

    color: #d6d3cd;

    font-family:
        Helvetica,
        "Helvetica Neue",
        Arial,
        sans-serif;

    font-size: 2rem;
    font-weight: 200;
    line-height: 1;

    cursor: pointer;

    opacity: 0.8;

    transition: opacity 0.15s ease;
}

.lightbox-close:hover {
    opacity: 1;
}

body.lightbox-open {
    overflow: hidden;
}

/* Research */

.research-main {
    max-width: 960px;

    padding-bottom: 10px;
}

.research-intro {
    max-width: 800px;

    margin-bottom: 54px;
}

.research-kicker {
    margin: 0 0 22px;

    color: #8a867f;

    font-size: 0.78rem;
    font-weight: 400;

    letter-spacing: 0.035em;
}

.research-intro h2 {
    max-width: 760px;

    margin: 0 0 36px;

    font-size: clamp(2rem, 4vw, 3.35rem);
    font-weight: 400;
    line-height: 1.08;

    letter-spacing: -0.025em;
}

.research-bio {
    max-width: 700px;

    margin: 0 0 18px;

    color: #504e49;

    font-size: 1rem;
    font-weight: 400;
    line-height: 1.65;
}

.research-section {
    margin: 0 0 58px;
}

.research-section h3 {
    margin: 0 0 30px;

    padding-bottom: 12px;

    border-bottom: 1px solid #d9d6cf;

    color: #85817a;

    font-size: 0.75rem;
    font-weight: 400;

    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.research-item {
    margin: 0;
    padding: 28px 0;

    border-bottom: 1px solid #e0ddd6;
}

.research-item:first-of-type {
    padding-top: 0;
}

.research-item-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;

    gap: 24px;
}

.research-item h4 {
    margin: 0;

    font-size: 1.08rem;
    font-weight: 400;

    letter-spacing: -0.01em;
}

.research-item-heading > span,
.text-link {
    flex-shrink: 0;

    color: #8a867f;

    font-size: 0.76rem;
    font-weight: 400;

    letter-spacing: 0.02em;
}

.text-link {
    transition: color 0.15s ease;
}

.text-link:hover {
    color: #171717;
}

.research-item p {
    max-width: 700px;

    margin: 13px 0 0;

    color: #56534e;

    font-size: 0.92rem;
    line-height: 1.62;
}

.research-item .research-detail {
    color: #918d86;

    font-size: 0.76rem;

    letter-spacing: 0.015em;
}

/* CV */

.cv-list {
    border-top: 1px solid #d9d6cf;
}

.cv-link {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;

    padding: 23px 0;

    border-bottom: 1px solid #d9d6cf;

    transition: opacity 0.15s ease;
}

.cv-link:hover {
    opacity: 0.58;
}

.cv-link > span:first-child {
    display: flex;
    flex-direction: column;

    gap: 6px;
}

.cv-link strong {
    font-size: 0.95rem;
    font-weight: 400;
}

.cv-link small {
    color: #85817a;

    font-size: 0.77rem;
    font-weight: 400;
}

.cv-arrow {
    flex-shrink: 0;

    color: #85817a;

    font-size: 0.75rem;
}

.research-footer {
    max-width: 960px;
}

/* Tablet */

@media (max-width: 1000px) {
    header {
        padding: 34px 26px 44px;
    }

    main {
        padding: 0 26px;
    }

    .gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));

        gap: 26px;
    }

    footer {
        padding-right: 26px;
        padding-left: 26px;
    }

    .research-intro {
        margin-bottom: 46px;
    }

    .research-section {
        margin-bottom: 52px;
    }
}

/* Mobile */

@media (max-width: 600px) {
    header {
        align-items: flex-start;

        padding: 26px 18px 34px;
    }

    h1 {
        font-size: 0.98rem;
    }

    nav {
        gap: 14px;

        font-size: 0.76rem;
    }

    main {
        padding: 0 18px;
    }

    .gallery {
        grid-template-columns: 1fr;

        gap: 20px;
    }

    .gallery .caption {
        opacity: 1;
    }

    .gallery a::after {
        opacity: 1;
    }

    footer {
        margin-top: 54px;

        padding:
            0
            18px
            24px;
    }

    .lightbox {
        padding: 22px;
    }

    .lightbox-content img {
        max-width: 100%;
        max-height: 82vh;
    }

    .lightbox-close {
        top: 16px;
        right: 18px;
    }

    .research-intro {
        margin-bottom: 40px;
    }

    .research-intro h2 {
        margin-bottom: 30px;

        font-size: 2.2rem;
    }

    .research-bio {
        font-size: 0.94rem;
    }

    .research-section {
        margin-bottom: 46px;
    }

    .research-item-heading {
        display: block;
    }

    .research-item-heading > span,
    .research-item-heading .text-link {
        display: inline-block;

        margin-top: 7px;
    }

    .cv-link {
        align-items: flex-start;
    }

    .cv-link small {
        max-width: 230px;

        line-height: 1.4;
    }
}
