/* ==========================================================
   Contact Section - Structure
   1) Local Tokens
   2) Main Section
   3) Panel + Typography
   4) Actions + Link
   5) Responsive
   ========================================================== */

/* ==========================================================
   Local Tokens
   ========================================================== */
#contact {
    /* Section spacing */
    --contact-padding-top: 20px;

    /* Reveal animation values */
    --contact-enter-y: 0px;
    --contact-enter-blur: 4px;
    --contact-enter-scale-start: 0.985;
}

/* ==========================================================
   Main Section
   ========================================================== */
/* Removes site-main bottom padding when contact is the last section. */
.site-main:has(#contact:last-child) {
    padding-bottom: 0;
}

#contact {
    background-color: var(--bg-dark);
    color: var(--text-on-dark);
    margin-top: 0;
    padding-top: var(--contact-padding-top);
    overflow: visible;
}

#contact .page-shell {
    width: min(100%, var(--page-max-width));
    margin-inline: auto;
}

/* ==========================================================
   Panel + Typography
   ========================================================== */
.contact-panel {
    max-width: 1200px;
    margin-inline: auto;
    text-align: center;
    padding: 50px;
    border-radius: 16px;
    opacity: 1;
    transform: none;
    filter: none;
    will-change: transform, opacity, filter;
    transition: none;
}

.contact-panel[data-animate] {
    --contact-panel-progress: 0;
    opacity: var(--contact-panel-progress);
    transform: translate3d(0, calc(var(--contact-enter-y) * (1 - var(--contact-panel-progress))), 0)
        scale(calc(var(--contact-enter-scale-start) + ((1 - var(--contact-enter-scale-start)) * var(--contact-panel-progress))));
    filter: blur(calc(var(--contact-enter-blur) * (1 - var(--contact-panel-progress))));
}

.contact-title {
    margin: 0 0 var(--title-subtext-space) 0;
    font-size: var(--title-size);
    line-height: 0.95;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--text-on-dark);
}

.contact-subtitle {
    margin: 0 0 35px 0;
    font-size: var(--body-size);
    line-height: var(--body-leading);
    font-weight: 400;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-grey);
    opacity: 1;
}

/* ==========================================================
   Actions + Link
   ========================================================== */
.contact-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.contact-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 42px;
    border: none;
    border-radius: 50px;
    background-color: var(--text-on-dark);
    color: var(--text-on-light);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0em;
    cursor: pointer;
    transition: all 300ms ease-out;
    font-family: "Poppins", sans-serif;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    max-width: 100%;
    opacity: 1;
}

.contact-button:hover {
    background-color: var(--grey);
    opacity: 1;
}

.contact-button:active {
    transform: scale(0.98);
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-grey);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 300;
    opacity: 1;
    transition: color 200ms ease-out, opacity 200ms ease-out;
}

.contact-link:hover {
    color: var(--text-on-dark);
    opacity: 1;
}

.contact-link-icon::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: var(--text-grey);
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.447 20.452h-3.554v-5.569c0-1.328-.475-2.236-1.986-2.236-1.081 0-1.722.728-2.004 1.431-.103.25-.129.599-.129.948v5.426h-3.554s.047-8.8 0-9.714h3.554v1.375c.427-.659 1.191-1.592 2.897-1.592 2.117 0 3.704 1.385 3.704 4.362v5.569zM5.337 8.855c-1.144 0-1.915-.759-1.915-1.71 0-.955.771-1.71 1.958-1.71 1.187 0 1.915.755 1.94 1.71 0 .951-.753 1.71-1.983 1.71zm1.581 11.597H3.754V9.738h3.164v10.714zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.225 0z"/></svg>');
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.447 20.452h-3.554v-5.569c0-1.328-.475-2.236-1.986-2.236-1.081 0-1.722.728-2.004 1.431-.103.25-.129.599-.129.948v5.426h-3.554s.047-8.8 0-9.714h3.554v1.375c.427-.659 1.191-1.592 2.897-1.592 2.117 0 3.704 1.385 3.704 4.362v5.569zM5.337 8.855c-1.144 0-1.915-.759-1.915-1.71 0-.955.771-1.71 1.958-1.71 1.187 0 1.915.755 1.94 1.71 0 .951-.753 1.71-1.983 1.71zm1.581 11.597H3.754V9.738h3.164v10.714zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.225 0z"/></svg>');
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-position: center;
    transition: background-color 200ms ease-out;
}

.contact-link:hover .contact-link-icon::before {
    background-color: var(--text-on-dark);
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1024px) {
    .contact-panel {
        padding: clamp(50px, 6vw, 80px) 0;
    }

    .contact-subtitle {
        margin-bottom: 40px;
        font-size: clamp(0.95rem, 1.1vw, 1.2rem);
    }
}

@media (max-width: 640px) {
    #contact {
        color: var(--text-on-dark);
    }

    .contact-panel {
        padding: clamp(40px, 5vw, 60px) clamp(20px, 4vw, 32px);
    }

    .contact-title {
        margin-bottom: 16px;
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }

    .contact-subtitle {
        margin-bottom: 32px;
        font-size: 18px;
    }

    .contact-actions {
        gap: 20px;
    }

    .contact-button {
        width: fit-content;
        padding: 14px clamp(18px, 6vw, 36px);
        font-size: clamp(1rem, 5.2vw, 24px);
        white-space: nowrap;
    }

    .contact-panel[data-animate] {
        opacity: 1;
        transform: translateY(0);
        filter: none;
    }
}
