/* Shared styles for every page: tokens, base elements, layout shell, header and footer. */

/* Tokens */

:root {
    --ink: #191919;
    --muted: #606060;
    --paper: #f1f1f1;
    --line: #cfcfcf;
    --display: 'Google Sans Flex', sans-serif;
    --mono: 'DM Mono', monospace;
    --grid-columns: repeat(12, minmax(0, 1fr));
    --grid-margin: 80px;
    --grid-gutter: 20px;
    --link-height: 60px;
    --link-min-width: 140px;
    --link-padding-inline: 20px;
    --link-gap: 12px;
    --brand-linkedin: #0a66c2;
    --brand-behance: #1769ff;
}

/* Base */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: var(--display);
    font-size: 14px;
    line-height: 1.35;
}

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

a:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 4px;
}

/* Links: shared pill button. Variants: --nav (internal page, sliding dot),
   --social (brand color, logo prefix), --resume (icon prefix). */

.site-link {
    --link-border: var(--ink);
    --link-hover-fg: var(--paper);
    --link-hover-bg: var(--ink);

    display: inline-flex;
    width: max-content;
    min-width: var(--link-min-width);
    height: var(--link-height);
    align-items: center;
    justify-content: center;
    gap: var(--link-gap);
    padding: 0 var(--link-padding-inline);
    border: 1px solid var(--link-border);
    border-radius: 999px;
    font-size: 18px;
    font-weight: 400;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.site-link:hover,
.site-link:focus-visible {
    border-color: var(--link-hover-bg);
    color: var(--link-hover-fg);
    background-color: var(--link-hover-bg);
}

.site-link--nav span {
    margin-left: 5px;
    transition: margin-left 180ms ease;
}

.site-link--nav:hover span,
.site-link--nav:focus-visible span {
    margin-left: 20px;
}

.site-link--social,
.site-link--resume {
    --link-min-width: 180px;
    --link-gap: 10px;
}

.site-link--social img,
.site-link--resume img {
    width: 0;
    height: 18px;
    opacity: 0;
    transition: width 180ms ease, opacity 180ms ease, filter 180ms ease;
}

.site-link--social:hover img,
.site-link--social:focus-visible img,
.site-link--resume:hover img,
.site-link--resume:focus-visible img {
    width: 18px;
    opacity: 1;
}

.site-link--social {
    --link-hover-fg: #fff;
}

.site-link--social:hover img,
.site-link--social:focus-visible img {
    filter: brightness(0) invert(1);
}

.site-link--linkedin {
    --link-hover-bg: var(--brand-linkedin);
}

.site-link--behance {
    --link-hover-bg: var(--brand-behance);
}

/* Layout */

.section-shell {
    width: calc(100% - (var(--grid-margin) * 2));
    margin-inline: auto;
}

/* Header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    width: 100%;
    margin: 0 auto;
    padding: 25px var(--grid-margin) 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--paper);
    transition: transform 220ms ease;
}

.site-header.is-hidden {
    transform: translateY(-100%);
}

.wordmark {
    font-size: 16px;
    font-weight: 500;
}

.site-nav {
    display: flex;
    gap: 72px;
    font-size: 16px;
}

.site-nav a,
.footer-nav a {
    transition: opacity 180ms ease;
}

.site-nav a:hover,
.footer-nav a:hover {
    opacity: .55;
}

.menu-toggle {
    display: none;
    position: relative;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    color: inherit;
    background: none;
    cursor: pointer;
}

.menu-toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

.menu-toggle__bar {
    position: absolute;
    left: 4px;
    width: 24px;
    height: 1.5px;
    background: currentColor;
    transition: transform 220ms ease;
}

.menu-toggle__bar:first-child {
    transform: translateY(-4px);
}

.menu-toggle__bar:last-child {
    transform: translateY(4px);
}

.site-header.is-menu-open .menu-toggle__bar:first-child {
    transform: rotate(45deg);
}

.site-header.is-menu-open .menu-toggle__bar:last-child {
    transform: rotate(-45deg);
}

/* Footer */

.site-footer {
    position: relative;
    min-height: 560px;
    padding: 0 0 28px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: 1fr auto;
    align-items: center;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    align-items: flex-start;
    gap: 18px;
    padding-top: 30px;
}

.footer-brand strong {
    max-width: 100%;
    font-size: clamp(5rem, 7vw, 8.8rem);
    font-weight: 600;
    line-height: .9;
    white-space: nowrap;
}

.footer-brand span {
    padding-bottom: 5px;
    font-size: 24px;
    font-weight: 300;
    line-height: 1.1;
    text-align: start;
}

.footer-nav {
    justify-self: end;
    align-items: end;
    display: grid;
    gap: 12px;
    font-size: 24px;
    font-weight: 500;
}

.footer-nav>a {
    position: relative;
    justify-self: end;
    text-align: end;
}

.footer-nav>a::after {
    position: absolute;
    right: 0;
    bottom: -5px;
    left: 0;
    height: 1px;
    background: currentColor;
    content: '';
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 180ms ease;
}

.footer-nav>a:hover::after {
    transform: scaleX(1);
}

.footer-bottom {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 300;
}

/* Responsive */

@media (max-width: 700px) {
    :root {
        --grid-margin: 20px;
        --grid-gutter: 20px;
    }

    .site-header {
        padding-top: 15px;
    }

    .menu-toggle {
        display: block;
    }

    .site-nav {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        flex-direction: column;
        gap: 24px;
        padding: 10px 0 36px;
        background: inherit;
        font-size: 24px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 220ms ease, transform 220ms ease, visibility 0s linear 220ms;
    }

    .site-header.is-menu-open .site-nav {
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: opacity 220ms ease, transform 220ms ease;
    }

    .site-footer {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .footer-brand {
        display: block;
    }

    .footer-brand strong {
        display: block;
        font-size: 16vw;
    }

    .footer-brand span {
        display: block;
        margin-top: 10px;
        text-align: left;
    }

    .footer-nav {
        align-self: center;
        justify-self: center;
        justify-items: center;
        gap: 24px;
        font-size: 24px;
        text-align: center;
    }

    .footer-nav>a {
        justify-self: center;
        text-align: center;
    }

    .footer-bottom {
        gap: 12px;
        font-size: 14px;
        font-weight: 300;
    }
}

/* Motion */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}