/* --------------------------------------------------
   BASIC SETUP
-------------------------------------------------- */

:root {
    --page-padding: 5vw;
    --text-offset: 80px;
    --text-width: 680px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #f8f8f5;
    color: #222;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.6;
    overflow-x: hidden;
}


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


/* --------------------------------------------------
   HEADER
-------------------------------------------------- */

.site-header {
    width: 100%;
    padding: 28px 5vw;

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

    border-bottom: 1px solid #d8d8d3;
}

.site-name {
    color: #222;
    text-decoration: none;

    font-size: 1.15rem;
    font-weight: normal;
}

nav {
    display: flex;
    gap: 28px;
}

nav a {
    color: #555;
    text-decoration: none;

    font-family: Arial, sans-serif;
    font-size: 0.8rem;
}

nav a:hover {
    color: #222;
}


/* --------------------------------------------------
   GENERAL LAYOUT
-------------------------------------------------- */

main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 5vw 100px;
}


/* --------------------------------------------------
   EXPERIMENT HEADER
-------------------------------------------------- */

.experiment-header {
    max-width: 850px;
    padding: 150px 0 50px;
}

.eyebrow {
    margin: 0 0 18px;

    color: #6d7d78;

    font-family: Arial, sans-serif;
    font-size: 0.72rem;
    font-weight: normal;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.experiment-header h1 {
    margin: 0;

    font-size: clamp(3rem, 7vw, 6.5rem);
    font-weight: normal;
    line-height: 0.98;
    letter-spacing: -0.04em;
}

.subtitle {
    max-width: 600px;
    margin-top: 45px;

    color: #555;
    font-size: 1.25rem;
    line-height: 1.6;
}

.experiment-meta {
    display: flex;
    gap: 24px;

    margin-top: 30px;

    color: #777;

    font-family: Arial, sans-serif;
    font-size: 0.72rem;
}


/* --------------------------------------------------
   ESSAY
-------------------------------------------------- */

.essay {
    max-width: var(--text-width);
    margin: 20px 0 0 var(--text-offset);
}

.essay p {
    margin: 0 0 28px;

    font-size: 1.1rem;
}

.essay .lead {
    margin-bottom: 42px;

    font-size: 1.35rem;
    line-height: 1.6;
}

.essay h2 {
    margin: 80px 0 25px;

    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: normal;
    line-height: 1;
    letter-spacing: -0.03em;
}


/* --------------------------------------------------
   VISUALISATIONS
-------------------------------------------------- */

.visualisation {
    width: 100vw;

    margin-top: 70px;
    margin-bottom: 70px;

    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.visualisation > div {
    width: 100%;
    min-height: 500px;
}

.visualisation figcaption {
    max-width: var(--text-width);
    margin: 18px 0 0
        calc(50vw - (var(--text-width) / 2));
    padding: 0;
    color: #777;
    font-family: Arial, sans-serif;
    font-size: 0.72rem;
    line-height: 1.5;
}


/* --------------------------------------------------
   TECHNICAL NOTES
-------------------------------------------------- */

.technical {
    max-width: var(--text-width);

    margin: 80px 0 0 var(--text-offset);

    padding-top: 45px;

    border-top: 1px solid #d8d8d3;
}

.technical h2,
.sources h2 {
    margin: 0 0 25px;

    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: normal;
    line-height: 1;
    letter-spacing: -0.03em;
}

.technical p:not(.eyebrow) {
    font-size: 1rem;
}

.technical-details {
    margin: 40px 0 0;
}

.technical-details div {
    display: grid;
    grid-template-columns: 140px 1fr;

    padding: 12px 0;

    border-top: 1px solid #deded9;
}

.technical-details div:last-child {
    border-bottom: 1px solid #deded9;
}

.technical-details dt {
    color: #777;

    font-family: Arial, sans-serif;
    font-size: 0.72rem;
}

.technical-details dd {
    margin: 0;

    font-family: Arial, sans-serif;
    font-size: 0.8rem;
}


/* --------------------------------------------------
   SOURCES
-------------------------------------------------- */

.sources {
    max-width: var(--text-width);

    margin: 80px 0 0 var(--text-offset);
}

.sources ul {
    margin: 0;
    padding-left: 20px;

    font-size: 1rem;
}

.sources li {
    margin-bottom: 10px;
}


/* --------------------------------------------------
   FOOTER
-------------------------------------------------- */

.site-footer {
    width: 100%;
    padding: 50px 5vw;

    color: #777;

    font-family: Arial, sans-serif;
    font-size: 0.7rem;

    border-top: 1px solid #d8d8d3;
}


/* --------------------------------------------------

   MOBILE

-------------------------------------------------- */

@media screen and (max-width: 700px) {

    html,

    body {

        width: 100%;

        max-width: 100%;

        overflow-x: hidden;

    }

    :root {

        --page-padding: 6vw;

        --text-offset: 0;

        --text-width: 100%;

    }

    /* HEADER */

    .site-header {

        width: 100%;

        padding: 22px 6vw;

        display: flex;

        justify-content: space-between;

        align-items: baseline;

        gap: 20px;

    }

    .site-name {

        flex-shrink: 0;

        font-size: 1.05rem;

    }

    nav {

        display: flex;

        gap: 12px;

        flex-wrap: wrap;

        justify-content: flex-end;

    }

    nav a {

        font-size: 0.65rem;

    }

    /* MAIN */

    main {

        width: 100%;

        max-width: 100%;

        margin: 0;

        padding: 0 6vw 70px;

    }

    /* EXPERIMENT HEADER */

    .experiment-header {

        width: 100%;

        max-width: 100%;

        padding: 100px 0 50px;

    }

    .experiment-header h1 {

        font-size: clamp(3rem, 14vw, 5rem);

    }

    .subtitle {

        width: 100%;

        max-width: 100%;

        margin-top: 35px;

        font-size: 1.1rem;

    }

    .experiment-meta {

        flex-direction: column;

        gap: 6px;

    }

    /* ESSAY */

    .essay {

        width: 100%;

        max-width: 100%;

        margin: 0;

    }

    .essay p {

        font-size: 1.05rem;

    }

    .essay .lead {

        font-size: 1.25rem;

    }

    .essay h2 {

        margin-top: 60px;

    }

    /* VISUALISATIONS */

    .visualisation {

        width: 100%;

        max-width: 100%;

        margin-top: 50px;

        margin-bottom: 50px;

        margin-left: 0;

        margin-right: 0;

    }

    .visualisation > div {

        width: 100%;

        min-height: 400px;

    }

    .visualisation figcaption {

        width: 100%;

        max-width: 100%;

        margin: 18px 0 0;

        padding: 0;

    }

    /* TECHNICAL NOTES */

    .technical {

        width: 100%;

        max-width: 100%;

        margin: 80px 0 0;

    }

    .technical-details div {

        grid-template-columns: 110px 1fr;

    }

    /* SOURCES */

    .sources {

        width: 100%;

        max-width: 100%;

        margin: 80px 0 0;

    }

    /* FOOTER */

    .site-footer {

        width: 100%;

        padding: 40px 6vw;

    }

}

/* --------------------------------------------------
   VERY NARROW PHONES
-------------------------------------------------- */

@media screen and (max-width: 380px) {

    .site-header {
        padding-left: 5vw;
        padding-right: 5vw;
        gap: 10px;
    }

    .site-name {
        font-size: 0.95rem;
    }

    nav {
        gap: 9px;
        flex-wrap: nowrap;
    }

    nav a {
        font-size: 0.6rem;
    }
}