:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    /* Use a responsive padding variable to maintain alignment */
    --padding-x: max(5vw, 2rem);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'IBM Plex Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 16px;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

.custom-cursor {
    width: 10px;
    height: 10px;
    /* White background with difference blend mode creates a black square over white backgrounds, and a white square over black backgrounds! */
    background-color: white;
    mix-blend-mode: difference;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1000;
    transform: translate(-100px, -100px);
    /* Start offscreen */
    /* Remove center offsets here, JS handles it relative to top-left */
    margin-top: -5px;
    margin-left: -5px;
}

@keyframes slideDown {
    0% {
        transform: translateY(-30px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(2rem, 2vw, 3rem) var(--padding-x);
    opacity: 0;
    animation: slideDown 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-size: 0.95rem;
    cursor: default;
}

.logo-mark {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.connect-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding-bottom: 2px;
    display: inline-block;
    overflow: hidden;
}

.connect-link span {
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.connect-link::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.connect-link:hover span {
    transform: translateY(100%);
}

.connect-link:hover::after {
    transform: translateY(0);
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 var(--padding-x);
}

.hero {
    position: relative;
    margin-top: clamp(1rem, 3vw, 2.5rem);
    margin-bottom: clamp(2rem, 4vw, 6rem);
}

.hero-heading {
    position: relative;
    z-index: 2;
    /* Responsive font size that looks good on both mobile and desktop */
    font-size: clamp(2rem, 4.8vw, 4.5rem);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--text-color);
    cursor: default;
    max-width: 1500px;
    text-wrap: balance;
}

@keyframes bisonWave {
    0% {
        transform: translateY(110%) rotateX(-25deg);
    }

    100% {
        transform: translateY(0) rotateX(0deg);
    }
}

.portrait-wrapper {
    position: relative;
    z-index: 1;
    /* Reduced negative margin to prevent too much overlap with text */
    margin-top: -1.5rem;
    width: 28%;
    min-width: 260px;
    max-width: 350px;
    overflow: hidden;
    /* This masks the image while it scales down */
    cursor: none;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        max-width 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        margin-top 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cinematicScaleDown {
    0% {
        transform: scale(1.25);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 0.7;
        /* User previously requested portrait opacity to be 0.7 */
    }
}

.portrait {
    width: 100%;
    height: auto;
    display: block;
    filter: grayscale(100%);
    object-fit: cover;
    /* Blend mode helps the black text pop against light grays in the portrait */
    mix-blend-mode: multiply;
    opacity: 0;
    /* Extremely smooth exponental out easing, delayed slightly to let text start */
    animation: cinematicScaleDown 1.8s cubic-bezier(0.19, 1, 0.22, 1) 0.6s forwards;
}

@keyframes cinematicScaleDownColored {
    0% {
        transform: scale(1.25);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
        /* Opaque since it isn't multiplied */
    }
}

.portrait.portrait-color {
    position: absolute;
    top: 0;
    left: 0;

    /* Remove the grayscale filters and blends so it is fully bright */
    filter: none;
    mix-blend-mode: normal;

    /* Run the exact same animation as its sibling, except targeting opacity: 1 */
    animation: cinematicScaleDownColored 1.8s cubic-bezier(0.19, 1, 0.22, 1) 0.6s forwards;

    /* JavaScript will dynamically apply duplicate mask layers for the 
       hover drag/trail effect */


    pointer-events: none;
    /* Crucial so mouse events continue triggering on the wrapper! */
}

.links-section {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: auto;
    /* pushes links to bottom of the main content area */
    padding-bottom: 3rem;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Force 2x2 grid if they start to wrap on medium screens */
@media (max-width: 1080px) and (min-width: 769px) {
    .links-section {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@keyframes fadeUp {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.links-section a {
    color: var(--text-color);
    text-decoration: none;
    position: relative;
    opacity: 0;
    animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    display: inline-block;
    overflow: hidden;
    padding: 0 5px;
    /* Added some padding so letter-descenders don't get chopped off */
    vertical-align: top;
}

/* Base span configuration */
.links-section a span {
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Pseudo element that starts above */
.links-section a::after {
    content: attr(data-text);
    position: absolute;
    left: 5px;
    /* Offset padding */
    top: 0;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Hover triggering both text pieces */
.links-section a:hover span {
    transform: translateY(100%);
}

.links-section a:hover::after {
    transform: translateY(0);
}

.links-section a:nth-child(1) {
    animation-delay: 1.3s;
}

.links-section a:nth-child(2) {
    animation-delay: 1.4s;
}

.links-section a:nth-child(3) {
    animation-delay: 1.5s;
}

.links-section a:nth-child(4) {
    animation-delay: 1.6s;
}

.text-footer {
    width: 100%;
    padding: 0;
    overflow: hidden;
    position: relative;
    /* Cursor needs to be able to overlap the bottom bound */
    padding-bottom: 0;
}

@keyframes slideUp {
    0% {
        transform: translateY(150%);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.massive-text {
    font-weight: 700;
    line-height: 0.8;
    text-transform: uppercase;
    text-align: center;
    /* Fallback in case JS doesn't run */
    font-size: 14vw;
    margin-bottom: -0.08em;
    /* Pulls the bottom edge up, effectively cutting off the text due to overflow: hidden on the footer */
    transform: translateY(150%);
    opacity: 0;
    animation: slideUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) 1.2s forwards;
}

/* Specific Text Utilities */
.desktop-break {
    display: none;
}

@media (max-width: 1200px) {
    .portrait-wrapper {
        margin-top: -1.5vw;
    }
}

@media (min-width: 769px) {
    .desktop-break {
        display: block;
    }
}

@media (max-width: 768px) {
    .hero-heading {
        line-height: 1.3;
    }

    .portrait-wrapper {
        margin-top: -1rem;
        width: 60%;
    }

    .links-section {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    :root {
        --padding-x: 1.5rem;
    }

    header {
        padding: 1rem var(--padding-x);
    }

    .hero {
        margin-top: 1rem;
        margin-bottom: 2rem;
    }

    .hero-heading {
        font-size: clamp(1.75rem, 4.8vw, 5.5rem);
    }

    .portrait-wrapper {
        width: 50%;
        min-width: 230px;
    }

    .links-section {
        margin-top: 0;
    }

    .logo-mark {
        height: 26px;
    }

    .logo-container {
        font-size: 0.825rem;
        gap: 0.5rem;
    }

    .connect-link {
        font-size: 0.85rem;
    }

    .text-footer {
        padding-bottom: 0;
    }
}

@media (min-width: 1600px) {
    .portrait-wrapper {
        width: 32%;
        max-width: 480px;
        /* Keep it consistent with the desktop layout to avoid too much overlap */
        margin-top: -1.5rem;
    }
}