.main {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4%;
    padding: 4%;
    margin-top: 0;
    width: 100%;
    animation: smooth_appear 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 1025px) {
    #index.main {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: center;
        justify-items: center;
        gap: clamp(2rem, 6vw, 6rem);
        padding: clamp(3rem, 7vh, 6rem) clamp(4rem, 9vw, 10rem);
    }

    #index .home-portrait,
    #index .welcome {
        width: 100%;
    }

    #index .welcome {
        max-width: 42rem;
        padding: 2rem;
    }

    #index #welcome_animation {
        max-width: clamp(20rem, 26vw, 22rem);
        font-size: clamp(1.75rem, 3vw, 2.5rem);
        line-height: 1.3;
        text-wrap: balance;
    }
}

main > .main[hidden] {
    display: none;
}

main > #index.main[hidden] {
    display: none;
}

#it_stuff .project-card {
    scroll-margin-top: 8rem;
}

@media (min-width: 1025px) {
    #it_stuff {
        flex-direction: column;
        align-items: center;
        gap: 2.5rem;
    }
}

#it_stuff .project-details {
    --project-preview-height: 352px;
    position: relative;
    max-height: var(--project-preview-height);
    overflow: hidden;
    overflow-anchor: none;
    transition: max-height 850ms cubic-bezier(0.22, 1, 0.36, 1);
}

#it_stuff .project-details::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 6rem;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.95));
    content: "";
    opacity: 1;
    pointer-events: none;
    transition: opacity 350ms ease-out;
}

#it_stuff .project-card.is-expanded .project-details {
    max-height: none;
}

#it_stuff .project-card.is-expanded .project-details::after {
    opacity: 0;
}

.project-content {
    padding-bottom: 1rem;
}

.twingate-logo-link {
    display: block !important;
    width: 55%;
    margin: 1rem auto;
}

.twingate-logo {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto !important;
    filter: invert(100%);
    background-color: white;
}

.project-read-more {
    --project-arrow-stroke: 6px;
    --project-circle-stroke: 3.5px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin: 0 auto;
    border: var(--project-circle-stroke) solid var(--accent-cyan);
    border-radius: 50%;
    background: var(--nav-bg);
    color: var(--accent-cyan);
    font: inherit;
    cursor: pointer;
    transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.project-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2rem;
    height: 1.25rem;
    transform: translate(-50%, calc(-50% + 2px));
    transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.project-arrow::before,
.project-arrow::after {
    position: absolute;
    top: 50%;
    width: 1.25rem;
    height: var(--project-arrow-stroke);
    border-radius: 999px;
    background: currentColor;
    content: "";
}

.project-arrow::before {
    right: calc(50% - 3px);
    transform: rotate(32deg);
    transform-origin: right center;
}

.project-arrow::after {
    left: calc(50% - 3px);
    transform: rotate(-32deg);
    transform-origin: left center;
}

#it_stuff .project-card.is-expanded .project-arrow {
    transform: translate(-50%, calc(-50% - 2px)) rotate(180deg);
}

#it_stuff .project-card:not(.is-expanded) .project-read-more {
    z-index: 1;
    margin-top: -3.5rem;
    margin-bottom: 0.5rem;
}

.project-read-more:hover,
.project-read-more:focus-visible {
    background: var(--accent-cyan);
    color: var(--button-text-on-accent);
    transform: translateY(2px);
}

.project-read-more:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    #it_stuff .project-details,
    #it_stuff .project-details::after,
    .project-read-more,
    .project-arrow,
    .home-continue-entry,
    .home-continue,
    .home-continue-arrow {
        transition: none;
        animation: none;
    }
}

@media (max-width: 480px) {
    .project-read-more {
        --project-arrow-stroke: 4.5px;
        --project-circle-stroke: 2.625px;
        width: 2.75rem;
        height: 2.75rem;
    }

    .project-arrow {
        width: 1.5rem;
        height: 0.9375rem;
        transform: translate(-50%, calc(-50% + 1.5px));
    }

    .project-arrow::before,
    .project-arrow::after {
        width: 0.9375rem;
    }

    .project-arrow::before {
        right: calc(50% - 2.25px);
    }

    .project-arrow::after {
        left: calc(50% - 2.25px);
    }

    #it_stuff .project-card.is-expanded .project-arrow {
        transform: translate(-50%, calc(-50% - 1.5px)) rotate(180deg);
    }

    #it_stuff .project-card:not(.is-expanded) .project-read-more {
        margin-top: -2.75rem;
    }
}

.welcome {
    padding: 3%;
    border-radius: 2%;
    text-align: center;
    width: 60%;
    max-width: 900px;
    font-size: 1.8rem;
    line-height: 1.6;
    color: var(--text-p);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: smooth_appear 650ms ease-out;
}

#welcome_animation {
    animation: smooth_appear 650ms ease-out;
}

.d1, .d2 {
    position: relative;
    background: var(--bg-panel);
    padding: 3%;
    text-align: center;
    border: 2px solid #000;
    border-radius: 15px;
    -moz-border-radius: 15px;
    box-shadow: 0px 0px 5% var(--shadow-glow);
    width: 45%;
    font-size: 1.2rem;
    line-height: 1.6;
    animation: smooth_appear 650ms ease-out;
    color: var(--text-p);
    display: flex;
    justify-content: center;
    align-items: center;
}

.d2 {
    width: 100%;
    padding: 2%;
}

.home-portrait {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    width: 26%;
    max-width: 300px;
}

.home-portrait > .d2 {
    background: transparent;
    border: 0;
    box-shadow: none;
}

.d2 img {
    width: 100%;
    max-width: 400px;
    height: auto;
    border: 3px solid var(--accent-cyan-opaque);
    border-radius: 12px;
    padding: 0;
}

.portrait-flip {
    position: relative;
    display: block;
    width: 100%;
    max-width: 300px;
    padding: 0;
    border: 0;
    background: transparent;
    perspective: 1000px;
    cursor: pointer;
}

.portrait-fireworks {
    position: absolute;
    z-index: 1;
    inset: 0;
    overflow: visible;
    pointer-events: none;
}

.portrait-firework-burst {
    position: absolute;
    width: 1px;
    height: 1px;
}

.portrait-firework-spark {
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 13px;
    border-radius: 50%;
    animation: portrait-firework 850ms ease-out forwards;
}

.portrait-firework-spark.is-blue {
    background: #168bff;
    box-shadow: 0 0 8px #168bff;
}

.portrait-firework-spark.is-red {
    background: #ff3c54;
    box-shadow: 0 0 8px #ff3c54;
}

.portrait-firework-spark.is-white {
    background: #fff;
    box-shadow: 0 0 8px #fff;
}

@keyframes portrait-firework {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(var(--angle)) translateY(0) scaleY(0.45);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(-1 * var(--distance))) scaleY(0);
    }
}

.portrait-flip-inner {
    position: relative;
    display: block;
    width: 100%;
    transform-style: preserve-3d;
    transition: transform 0.7s ease;
}

.portrait-flip.is-flipped .portrait-flip-inner {
    transform: rotateY(180deg);
}

.d2 .portrait-flip-face {
    width: 100%;
    max-width: none;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.d2 .portrait-flip-face--back {
    position: absolute;
    inset: 0;
    height: 100%;
    object-fit: cover;
    transform: rotateY(180deg);
}

.portrait-flip:focus-visible {
    outline: 3px solid var(--accent-cyan-opaque);
    outline-offset: 5px;
    border-radius: 12px;
}

@media (prefers-reduced-motion: reduce) {
    .main,
    .welcome,
    #welcome_animation,
    .d1,
    .d2,
    .d3,
    .d4,
    body.home-entrance #index #image_animation,
    body.home-entrance #index .socials,
    body.home-entrance #index .home-continue-entry,
    body.home-entrance #index .home-continue {
        animation: none;
    }
    .portrait-flip-inner {
        transition: none;
    }

    .portrait-fireworks {
        display: none;
    }
}

.d3, .d4 {
    background: var(--bg-panel);
    padding: 5%;
    text-align: center;
    border: 2px solid #000;
    border-radius: 15px;
    -moz-border-radius: 15px;
    box-shadow: 0px 0px 5% var(--shadow-glow);
    width: 90%;
    font-size: clamp(1rem, calc(0.8rem + 0.9vw), 1.5rem);
    line-height: 1.8;
    animation: smooth_appear 650ms ease-out;
    color: var(--text-p);
}

.d3 h1 {
    font-size: clamp(1.4rem, calc(1.1rem + 1.4vw), 2rem);
    text-align: center;
    margin-bottom: 1rem;
    text-wrap: balance;
}

.d3 h2 {
    font-size: clamp(1.2rem, calc(1rem + 1vw), 1.5rem);
    text-wrap: balance;
}

.d3 > img,
.d3 > a > img {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    height: auto;
}

.d3 img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem auto;
}

.d3 .img_left,
.d3 .img_right {
    width: 42%;
    max-width: 420px;
    min-width: 180px;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    margin: 15px;
    border: 3px solid var(--accent-cyan-opaque);
}

.d3 .img_left { float: left; }
.d3 .img_right { float: right; }

.d3::after {
    content: "";
    display: table;
    clear: both;
}