:root {
    /* Fluid type scale. Token = size in vw at desktop. Floor keeps 390px phones as designed; no ceiling, so text stays proportional to the vw-based layout at every width. */
    --fs-0_7vw: max(0.171rem, 0.7vw);
    --fs-0_8vw: max(0.195rem, 0.8vw);
    --fs-0_85vw: max(0.207rem, 0.85vw);
    --fs-0_9vw: max(0.219rem, 0.9vw);
    --fs-0_96vw: max(0.234rem, 0.96vw);
    --fs-1vw: max(0.244rem, 1vw);
    --fs-1_1vw: max(0.268rem, 1.1vw);
    --fs-1_12vw: max(0.273rem, 1.12vw);
    --fs-1_5vw: max(0.366rem, 1.5vw);
    --fs-1_68vw: max(0.409rem, 1.68vw);
    --fs-1_7vw: max(0.414rem, 1.7vw);
    --fs-2vw: max(0.487rem, 2vw);
    --fs-3vw: max(0.731rem, 3vw);
    --fs-3_2vw: max(0.78rem, 3.2vw);
    --fs-3_36vw: max(0.819rem, 3.36vw);
    --fs-3_5vw: max(0.853rem, 3.5vw);
    --fs-5_04vw: max(1.228rem, 5.04vw);
    --fs-6vw: max(1.462rem, 6vw);
    --fs-7vw: max(1.706rem, 7vw);
    --fs-10vw: max(2.438rem, 10vw);
    --fs-14vw: max(3.413rem, 14vw);
}

@font-face {
    font-family: 'title';
    src: url("../Fonts/CraftworkGrotesk-Heavy.woff2");
}

@font-face {
    font-family: 'para';
    src: url("../Fonts/Space/SpaceGrotesk-Regular.woff2");
}

@font-face {
    font-family: 'para-semibold';
    src: url("../Fonts/Space/SpaceGrotesk-SemiBold.woff2");
}

@font-face {
    font-family: 'para-bold';
    src: url("../Fonts/Space/SpaceGrotesk-Bold.woff2");
}

@font-face {
    font-family: 'fa';
    src: url("../Fonts/fa-solid-900.woff2");
}

html,
body {
    margin: 0;
    overflow-x: hidden;
}

html {
    background-color: #fff;
}

b.para {
    font-family: 'para-bold';
    color: #333333;
}

@media not all and (min-resolution:.001dpcm) {
    @supports (-webkit-appearance:none) {
        b.para {
            text-rendering: optimizeLegibility;
            -webkit-font-smoothing: antialiased;
        }
    }
}

::-webkit-scrollbar {
    width: 5px;
    background-color: black;
}

::-webkit-scrollbar-track {
    opacity: 0;
    display: none;
}

::-webkit-scrollbar-thumb {
    background: #f8f8f8;
}

::-webkit-scrollbar-thumb:hover {
    background: #6e6e6e;
}

a:link {
    text-decoration: none;
}

::-moz-selection {
    color: #333333;
    background: #00FF47;
}

::selection {
    color: #333333;
    background: #00FF47;
}

/* ---------- Navigation ---------- */

.fixed-nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000000;
    width: 100%;
}

.fixed-nav-bar ul {
    opacity: 0;
    visibility: hidden;
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0);
    transition: background-color 700ms linear, opacity .70s ease-in-out;
}

.fixed-nav-bar ul.scrolled {
    visibility: visible;
    opacity: 1;
    /* glass effect: no tint, so it stays clear over dark sections and reads white over white ones */
    -webkit-backdrop-filter: blur(3.3px) saturate(1.8);
    backdrop-filter: blur(3.3px) saturate(1.8);
}

.fixed-nav-bar li {
    float: right;
}

.fixed-nav-bar li.amitsharma {
    float: left;
}

.fixed-nav-bar li.amitsharma .nav-logo {
    height: 2.4em;
    width: 2.4em;
    margin: 0 0.5em 0 0;
}

.fixed-nav-bar li.amitsharma a {
    font-family: 'para-semibold', 'para';
    font-style: italic;
}

.nav-name {
    display: inline-block;
    vertical-align: middle;
    line-height: 1.1;
    text-align: left;
}

.nav-logo {
    height: 1.4em;
    width: 1.4em;
    vertical-align: middle;
    margin: -0.25em 0.4em 0 0;
}

/* Paused (first frame) by default; the GIF plays only while hovered */
.fixed-nav-bar li.amitsharma a:hover .nav-logo {
    content: url("../nav-logo.gif");
}

.fixed-nav-bar a:hover .nav-contact {
    content: url("../nav-contact.gif");
}

.nav-contact {
    height: 1.7em;
    width: 1.7em;
    margin: -0.4em 0.3em 0 0;
}

.fixed-nav-bar a:hover .nav-resume {
    content: url("../nav-resume.gif");
}

.fixed-nav-bar li a {
    display: inline-block;
    text-align: center;
    padding: 1vw 3vw;
    text-decoration: none;
    white-space: pre;
    font-family: 'para';
    font-size: var(--fs-0_85vw);
    color: #222222;
}

.fixed-nav-bar li a:hover {
    color: #332cce;
}

.fixed-nav-bar ul.on-dark.scrolled {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background-color: transparent;
}

.fixed-nav-bar ul.on-dark li a {
    color: #ffffff;
    transition: color .3s ease;
}

.fixed-nav-bar ul.on-dark li a:hover {
    color: #b9b5ff;
}

/* ---------- Page fade-in ---------- */

#fadein {
    animation: fadein 2s;
}

@keyframes fadein {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Menu button is injected by js/nav-contrast.js and only shown on mobile */
.fixed-nav-bar li.nav-menu {
    display: none;
}

@media (max-width: 820px) {
    .fixed-nav-bar li a {
        font-size: 12px;
        padding: 12px 3vw;
    }

    .fixed-nav-bar ul {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        padding: 0 4vw;
    }

    .fixed-nav-bar li,
    .fixed-nav-bar li.amitsharma {
        float: none;
    }

    .fixed-nav-bar li.amitsharma {
        order: 1;
    }

    .fixed-nav-bar li.amitsharma a {
        padding-left: 0;
    }

    .fixed-nav-bar li.nav-menu {
        display: block;
        order: 2;
        margin-left: auto;
    }

    /* zero-height line break so the menu card always sits on its own row */
    .fixed-nav-bar ul::before {
        content: "";
        order: 3;
        flex: 0 0 100%;
        height: 0;
    }

    .fixed-nav-bar li.nav-item {
        display: none;
        order: 4;
        flex: 0 0 100%;
        margin-bottom: 12px;
    }

    .fixed-nav-bar ul.menu-open li.nav-item {
        display: block;
    }

    /* Same look as the "Explore case study" button */
    .nav-menu-btn,
    .fixed-nav-bar li.nav-item a,
    .fixed-nav-bar ul.on-dark li.nav-item a {
        box-sizing: border-box;
        display: flex;
        align-items: center;
        font-family: 'para', monospace;
        font-size: 14px;
        font-weight: bold;
        line-height: 1;
        color: #000;
        background-color: #fff;
        border: 1.75px solid #000;
        border-radius: 11px;
        padding: 14px 16px 11px;
        box-shadow: 0 5px 0 0 #000;
        cursor: pointer;
    }

    /* Contact and Resume share one card, split by a divider */
    .fixed-nav-bar li.nav-item {
        flex: 0 0 100%;
        margin: 0;
    }

    .fixed-nav-bar li.nav-item a,
    .fixed-nav-bar ul.on-dark li.nav-item a {
        width: 170px;
        margin-left: auto;
        justify-content: flex-start;
        box-shadow: none;
    }

    .fixed-nav-bar li.nav-item:nth-of-type(2) a,
    .fixed-nav-bar ul.on-dark li.nav-item:nth-of-type(2) a {
        border-radius: 11px 11px 0 0;
    }

    .fixed-nav-bar li.nav-item:nth-of-type(1) a,
    .fixed-nav-bar ul.on-dark li.nav-item:nth-of-type(1) a {
        border-top: 0;
        border-radius: 0 0 11px 11px;
    }

    .fixed-nav-bar li.nav-item:nth-of-type(1) {
        margin-bottom: 17px;
        position: relative;
    }

    .fixed-nav-bar li.nav-item:nth-of-type(1)::after {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        right: 0;
        width: 170px;
        border-radius: 0 0 11px 11px;
        box-shadow: 0 5px 0 0 #000;
        z-index: -1;
        pointer-events: none;
    }

    .fixed-nav-bar li.nav-item:nth-of-type(2) {
        margin-bottom: 0;
    }

    /* Source order is Resume, Contact; show Contact first */
    .fixed-nav-bar li.nav-item:nth-of-type(2) {
        order: 4;
    }

    .fixed-nav-bar li.nav-item:nth-of-type(1) {
        order: 5;
    }

    .nav-menu-btn {
        justify-content: center;
        width: 34.5px;
        height: 34.5px;
        padding: 0;
        border-radius: 50%;
        box-shadow: 0 4px 0 0 #000;
    }

    .nav-menu-btn svg {
        width: 15px;
        height: 10.5px;
    }

    .nav-menu-btn:active,
    .fixed-nav-bar li.nav-item a:active {
        transform: translateY(5px);
        box-shadow: none;
    }

    .nav-menu-btn:hover,
    .fixed-nav-bar li.nav-item a:hover,
    .fixed-nav-bar ul.on-dark li.nav-item a:hover {
        background-color: #332cce;
        color: #fff;
        border-color: #000;
        box-shadow: none;
    }

    .nav-menu-btn:hover {
        border-color: #332cce;
        box-shadow: 0 4px 0 0 #2923a5;
    }
}
