@font-face {
    font-family: "EncodeSansSemi";
    src: url("/fonts/Encode_Sans_Semi_Condensed/EncodeSansSemiCondensed-ExtraLight.ttf") format("truetype");
    font-weight: 100;
}

@font-face {
    font-family: "EncodeSansSemiBold";
    src: url("/fonts/Encode_Sans_Semi_Condensed/EncodeSansSemiCondensed-Medium.ttf") format("truetype");
    font-weight: 500;
}

@font-face {
    font-family: "CormorantGaramond";
    src: url("/fonts/Cormorant_Garamond/CormorantGaramond-VariableFont_wght.ttf") format("truetype");
    font-weight: 500;
}

/* --------------------------------------------------
Modal container
-------------------------------------------------- */

.contact-modal {
position: fixed;
inset: 0;
z-index: 10000;

display: none;

align-items: center;
justify-content: center;

padding: 2rem;

font-family: "EncodeSansSemi", sans-serif;
color: #f3f3f3;
}

/*
The modal is hidden until JavaScript changes
aria-hidden to false.
*/

.contact-modal[aria-hidden="false"] {
display: flex;
}

/* --------------------------------------------------
Backdrop
-------------------------------------------------- */

.contact-modal-backdrop {
position: absolute;
inset: 0;

background: rgba(0, 0, 0, 0.82);

cursor: pointer;
}

/* --------------------------------------------------
Modal panel
-------------------------------------------------- */

.contact-modal-panel {
position: relative;
z-index: 1;

width: 100%;
max-width: 760px;
max-height: calc(100vh - 4rem);

overflow-y: auto;

padding: 3.5rem 4rem;

background: #0b0b0b;
border: 1px solid rgba(255, 255, 255, 0.16);

box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, 0.6);

scrollbar-width: thin;
}


/* --------------------------------------------------
Close button
-------------------------------------------------- */

.contact-modal-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;

    width: 2.5rem;
    height: 2.5rem;

    padding: 0;

    border: 0;
    background: transparent;

    color: rgba(255, 255, 255, 0.7);

    font-family: Arial, sans-serif;
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;

    cursor: pointer;

    transition: color 0.2s ease, opacity 0.2s ease;
}

.contact-modal-close:hover {
    color: #fff;
}

/* --------------------------------------------------
Modal states
-------------------------------------------------- */

.contact-state {
    width: 100%;
}

.contact-state[hidden] {
    display: none;
}

/* --------------------------------------------------
Header
-------------------------------------------------- */

.contact-header {
    text-align: center;
    margin-bottom: 2.75rem;
}

.subtitle {
    margin-bottom: 0.8rem;

    text-transform: uppercase;
    letter-spacing: 0.25rem;

    opacity: 0.7;

    font-size: 0.85rem;
}

.contact-header h2 {
    margin-bottom: 1rem;

    font-family: "CormorantGaramond", serif;
    font-size: clamp(2.75rem, 7vw, 4.75rem);
    font-weight: 500;
    line-height: 1;
}

.description {
    max-width: 600px;
    margin: auto;

    opacity: 0.75;

    line-height: 1.6;
}

/* --------------------------------------------------
Form
-------------------------------------------------- */

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.field,
.human-test {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.contact-modal label,
.contact-modal legend {
    font-family: "EncodeSansSemiBold", sans-serif;
    font-size: 0.82rem;
    letter-spacing: 0.12rem;
    text-transform: uppercase;
}

/* --------------------------------------------------
Inputs
-------------------------------------------------- */

.contact-modal input,
.contact-modal textarea {
    width: 100%;

    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 0;

    outline: none;

    background: #111;
    color: #f3f3f3;

    font-family: "EncodeSansSemi", sans-serif;
    font-size: 1rem;
    line-height: 1.6;

    padding: 0.85rem 1rem;

    transition:
        border-color 0.25s ease,
        background 0.25s ease;
}

.contact-modal input:focus,
.contact-modal textarea:focus {
    border-color: rgba(255, 255, 255, 0.75);
    background: #151515;
}

.contact-modal textarea {
    min-height: 220px;
    resize: vertical;
}

.message-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.field-help,
.challenge-question {
    font-size: 0.84rem;
    opacity: 0.55;
}

.counter {
    white-space: nowrap;

    font-size: 0.78rem;
    opacity: 0.45;
}

/* --------------------------------------------------
Human verification
-------------------------------------------------- */

.human-test {
    border: 1px solid rgba(255, 255, 255, 0.12);

    padding: 1.25rem;
}

.human-test legend {
    padding: 0 0.5rem;
}

.challenge-question {
    margin-bottom: 0.75rem;

    font-size: 0.95rem;
    opacity: 0.8;
}

/* --------------------------------------------------
Form actions
-------------------------------------------------- */

.form-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    gap: 1rem;

    margin-top: 0.25rem;
}

.button {
    display: inline-block;

    padding: 1rem 2rem;

    border: 1px solid rgba(255, 255, 255, 0.3);

    background: transparent;
    color: white;

    font-family: "EncodeSansSemi", sans-serif;
    font-size: 0.95rem;

    cursor: pointer;

    transition:
        background 0.3s ease,
        color 0.3s ease,
        opacity 0.3s ease;
}

.button:hover:not(:disabled) {
    background: white;
    color: black;
}

.button:disabled {
    cursor: wait;
    opacity: 0.45;
}

.button.secondary {
    opacity: 0.7;
}

.button.secondary:hover:not(:disabled) {
    opacity: 1;
}

/* --------------------------------------------------
Status messages
-------------------------------------------------- */

.form-status {
    min-height: 1.5em;

    font-size: 0.9rem;
    opacity: 0.8;
}

.form-status.success {
    opacity: 1;
}

.form-status.error {
    color: #e8b7b7;
    opacity: 1;
}

/* --------------------------------------------------
Success / failure states
-------------------------------------------------- */

.contact-result {
    min-height: 20rem;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;

    padding: 2rem 0;
}

.contact-result .subtitle {
    margin-bottom: 1rem;
}

.contact-result h2 {
    margin-bottom: 1.25rem;

    font-family: "CormorantGaramond", serif;
    font-size: clamp(2.75rem, 7vw, 4.75rem);
    font-weight: 500;
    line-height: 1;
}

.contact-result p:not(.subtitle) {
    max-width: 500px;
    margin-bottom: 2rem;

    opacity: 0.75;
    line-height: 1.7;
}

/* --------------------------------------------------
Prevent page scrolling while modal is open
-------------------------------------------------- */

body.contact-modal-open {
    overflow: hidden;
}

/* --------------------------------------------------
Mobile
-------------------------------------------------- */

@media (max-width: 700px) {

    .contact-modal {
        align-items: flex-start;


        padding: 1rem;


    }

    .contact-modal-panel {
        max-height: calc(100vh - 2rem);


        padding: 3rem 1.5rem 2rem;


    }

    .contact-modal-close {
        top: 0.75rem;
        right: 0.75rem;
    }

    .contact-header {
        margin-bottom: 2.25rem;
    }

    .contact-header h2 {
        font-size: clamp(2.75rem, 14vw, 4rem);
    }

    .contact-form {
        gap: 1.3rem;
    }

    .human-test {
        padding: 1rem;
    }

    .message-meta {
        flex-direction: column;
        gap: 0.25rem;
    }

    .contact-modal textarea {
        min-height: 200px;
    }

    .contact-result {
        min-height: 16rem;
    }

}

/* --------------------------------------------------
Very small screens
-------------------------------------------------- */

@media (max-width: 420px) {

    .contact-modal {
        padding: 0;
    }

    .contact-modal-panel {
        width: 100%;
        max-height: 100vh;
        min-height: 100vh;


        border-left: 0;
        border-right: 0;

        padding: 3rem 1.25rem 2rem;


    }

}