@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700&family=Manrope:wght@400;500;600&display=swap");

:root {
    --dark: #171715;
    --dark-text: #F4F4F0;
    --dark-muted: #A8A8A1;

    --light: #F4F4F0;
    --light-text: #171715;
    --light-muted: #70706A;
    --light-line: #D8D8D2;

    --page-width: 1100px;
    --side-padding: clamp(24px, 5vw, 72px);
}


/* --------------------------------
   Base
-------------------------------- */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    background: var(--dark);
    color: var(--dark-text);

    font-family:
        "Manrope",
        sans-serif;

    font-size: 16px;
    line-height: 1.5;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
}


/* --------------------------------
   Initial page reveal
-------------------------------- */

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;

    background: var(--dark);

    opacity: 1;
    visibility: visible;
    pointer-events: all;

    transition:
        opacity 1800ms cubic-bezier(0.22, 1, 0.36, 1),
        visibility 1800ms ease;
}

.page-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-dots {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    display: flex;
    align-items: center;

    font-family: inherit;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;

    color: var(--dark-text);

    letter-spacing: 0.08em;

    opacity: 1;
}

.loading-dots span {
    display: inline-block;
    animation: loadingDot 1.2s infinite ease-in-out;
}

.loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes loadingDot {
    0%,
    60%,
    100% {
        opacity: 0.25;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-5px);
    }
}

.page-loader.is-hidden .loading-dots {
    opacity: 0;
    transition: opacity 0.8s ease;
}


/* --------------------------------
   Opening
-------------------------------- */

.intro {
    position: relative;
    isolation: isolate;
    overflow: hidden;

    min-height: 100svh;

    padding: var(--side-padding);

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

    background: var(--dark);
    color: var(--dark-text);
}


/* --------------------------------
   Intro background image
-------------------------------- */

.intro::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;

    background-image: url("images/background.png");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;

    filter: blur(4px);
    transform: scale(1.02);
}


/* Dark translucent layer over image */

.intro::after {
    content: "";

    position: absolute;
    inset: 0;

    z-index: -1;

    background: rgba(23, 23, 21, 0.68);

    pointer-events: none;
}


/* Keep actual content above the background */

.intro-inner {
    position: relative;
    z-index: 1;
}

.intro-inner {
    width: min(100%, var(--page-width));

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

    margin: 0 auto;
}

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

.intro-name h1 {
    margin: 0;

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

    font-size: clamp(2.25rem, 6vw, 5.5rem);
    font-weight: 400;

    letter-spacing: -0.045em;
    line-height: 1;
}

.intro-name h4 {
    margin: 0;

    transform: translateX(2.5px);

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

    font-size: clamp(1.125rem, 3vw, 2.75rem);
    font-weight: 400;

    letter-spacing: -0.045em;
    line-height: 1;
}


/* --------------------------------
   Intro photo
-------------------------------- */

.intro-photo {
    width: min(42%, 440px);

    aspect-ratio: 5 / 4;

    flex: 0 0 auto;

    overflow: hidden;

    border-radius: 16px;
}

.intro-photo img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}


/* --------------------------------
   Social links
-------------------------------- */

.intro-content .social-links {
    display: flex;
    flex-direction: column;

    align-items: flex-start;

    gap: 18px;

    margin-top: 26px;
}

.social-link {
    display: flex;
    align-items: center;

    color: inherit;
    text-decoration: none;
}

.social-link-icon {
    width: 22px;
    height: 22px;

    flex: 0 0 22px;

    display: block;

    object-fit: contain;
}

.social-link-handle {
    margin-left: 14px;

    color: var(--light);

    font-family:
        "Manrope",
        sans-serif;

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

    letter-spacing: -0.012em;
    line-height: 1.2;
}


/* --------------------------------
   Resume area
-------------------------------- */

.information {
    width: 100%;

    margin: 0;

    padding:
        5vh 0
        7vh;

    background: var(--light);
    color: var(--light-text);

    /*
        The background belongs to this element,
        so it always reaches both edges of the screen.
    */
}


/*
    All resume sections share one intrinsic width.

    max-content makes the grid wide enough for
    its longest content. The grid itself is then
    centered within the full-width white area.
*/
.information {
    display: grid;

    grid-template-columns: min(
        max-content,
        calc(100% - (2 * var(--side-padding)))
    );

    justify-content: center;
}


/*
    Every section occupies the same grid column,
    so the section headings and entries line up
    regardless of how much content each section has.
*/
.resume-section {
    grid-column: 1;

    width: 100%;

    margin: 0;

    display: block;

    padding:
        42px 0;

    text-align: left;

    opacity: 0;
    transform: translateY(18px);

    transition:
        opacity 900ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

.resume-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.resume-section + .resume-section {
    border-top: 1px solid var(--light-line);
}


/* --------------------------------
   Section headings
-------------------------------- */

.resume-section h2 {
    margin: 0 0 30px;

    font-family:
        "Barlow Condensed",
        sans-serif;

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

    letter-spacing: 0.08em;
    line-height: 1;

    text-transform: uppercase;
}


/* --------------------------------
   Entries
-------------------------------- */

.entries {
    min-width: 0;
}

.entry {
    display: grid;

    grid-template-columns:
        56px
        minmax(0, 1fr);

    column-gap: 24px;

    align-items: center;

    opacity: 0;
    transform: translateY(12px);

    transition:
        opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.resume-section.is-visible .entry {
    opacity: 1;
    transform: translateY(0);
}

.resume-section.is-visible .entry:nth-child(1) {
    transition-delay: 80ms;
}

.resume-section.is-visible .entry:nth-child(2) {
    transition-delay: 150ms;
}

.resume-section.is-visible .entry:nth-child(3) {
    transition-delay: 220ms;
}

.resume-section.is-visible .entry:nth-child(4) {
    transition-delay: 290ms;
}

.resume-section.is-visible .entry:nth-child(5) {
    transition-delay: 360ms;
}

.entry + .entry {
    margin-top: 32px;
}


/* --------------------------------
   Logos
-------------------------------- */

.entry-logo {
    width: 48px;
    height: 48px;

    display: block;

    object-fit: contain;
    object-position: center;

    border-radius: 7px;
}


/* --------------------------------
   Entry typography
-------------------------------- */

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

.entry-primary {
    margin: 0;

    color: var(--light-text);

    font-family:
        "Manrope",
        sans-serif;

    font-size: 1rem;
    font-weight: 600;

    letter-spacing: -0.025em;
    line-height: 1.25;
}

.entry-secondary {
    margin: 2px 0 0;

    color: var(--light-text);

    font-family:
        "Manrope",
        sans-serif;

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

    letter-spacing: -0.018em;
    line-height: 1.25;
}

.entry-date {
    margin: 4px 0 0;

    color: var(--light-muted);

    font-family:
        "Manrope",
        sans-serif;

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

    letter-spacing: -0.012em;
    line-height: 1.2;
}


/* --------------------------------
   Footer
-------------------------------- */

.contact {
    width: 100%;

    background: var(--dark);
    color: var(--dark-text);
}

.contact-inner {
    width: min(100%, var(--page-width));

    margin: 0 auto;

    padding:
        28px var(--side-padding);
}

.copyright {
    margin: 0;

    text-align: center;

    color: var(--dark-muted);

    font-family:
        "Manrope",
        sans-serif;

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

    letter-spacing: -0.01em;
    line-height: 1.4;
}


/* --------------------------------
   Mobile
-------------------------------- */

@media (max-width: 700px) {

    .intro {
        justify-content: center;
        align-items: center;

        padding: var(--side-padding);
    }

    .intro-inner {
        width: 100%;

        display: flex;
        flex-direction: column;

        align-items: stretch;
        justify-content: center;
    }

    .intro-photo {
        width: min(100%, 360px);

        aspect-ratio: 5 / 4;

        order: 1;

        align-self: center;

        margin-bottom: 32px;
    }

    .intro-content {
        order: 2;

        width: 100%;
    }

    .intro-name h1 {
        font-size: clamp(2.4rem, 12vw, 4rem);
    }

    .intro-name h4 {
        font-size: clamp(1.125rem, 6vw, 2rem);
    }

    .intro-content .social-links {
        margin-top: 26px;

        gap: 18px;
    }


    /*
        On mobile the intrinsic resume width is
        constrained by the screen padding.
    */
    .information {
        grid-template-columns:
            min(
                max-content,
                calc(100% - (2 * var(--side-padding)))
            );

        padding:
            3vh 0
            5vh;
    }

    .resume-section {
        padding:
            36px 0;
    }

    .resume-section h2 {
        margin-bottom: 28px;
    }

    .entry {
        grid-template-columns:
            44px
            minmax(0, 1fr);

        column-gap: 18px;
    }

    .entry-logo {
        width: 40px;
        height: 40px;

        border-radius: 6px;
    }

    .entry-primary {
        font-size: 0.98rem;
    }

    .entry-secondary {
        font-size: 0.92rem;
    }

    .entry-date {
        font-size: 0.82rem;
    }

    .entry + .entry {
        margin-top: 30px;
    }

    .contact-inner {
        padding:
            24px var(--side-padding);
    }
}


/* --------------------------------
   Reduced motion
-------------------------------- */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    .scroll-arrow {
        animation: none;
    }

    .scroll-cue,
    .resume-section,
    .entry {
        transition: none;
    }

    .resume-section,
    .entry {
        opacity: 1;
        transform: none;
    }
}


/* --------------------------------
   Minimal scrollbar
-------------------------------- */

html {
    scrollbar-width: thin;
    scrollbar-color: #70706A transparent;
}

html::-webkit-scrollbar {
    width: 3px;
}

html::-webkit-scrollbar-track {
    background: transparent;
}

html::-webkit-scrollbar-thumb {
    background: #70706A;
    border-radius: 999px;
}

html::-webkit-scrollbar-thumb:hover {
    background: #8A8A83;
}

::selection {
    background: rgba(0, 0, 0, 0.10);
    color: inherit;
}

::-moz-selection {
    background: rgba(0, 0, 0, 0.10);
    color: inherit;
}
