/* ==========================================================================
   Inventio — theme2 / contact
   ========================================================================== */

.contact {
    overflow: clip;
    padding-bottom: clamp(64px, 8vw, 128px);
}

.contact__glow {
    right: -18%;
    top: 4%;
    background: radial-gradient(circle, rgba(10, 132, 255, 0.2), rgba(10, 132, 255, 0) 62%);
}

.contact__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    gap: clamp(36px, 5vw, 96px);
    align-items: start;
}

.contact__intro {
    position: sticky;
    top: calc(var(--header-h) + 8px);
    display: grid;
    gap: clamp(20px, 2.2vw, 32px);
    justify-items: start;
}

.contact__intro nav {
    margin-bottom: clamp(16px, 3vw, 40px);
}

.contact__intro .h-hero {
    font-size: clamp(2.7rem, 1rem + 4.6vw, 5.2rem);
}

.contact__intro .lead {
    max-width: 32em;
}

.channels {
    display: grid;
    gap: 12px;
    width: 100%;
    max-width: 440px;
    margin-top: clamp(8px, 1.4vw, 20px);
}

.channel {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 16px;
    padding: 16px 20px 16px 16px;
    border-radius: var(--r-lg);
    background: var(--card);
    border: 1px solid var(--line);
}

.channel .mono {
    display: block;
    margin-bottom: 4px;
    color: var(--ink-mute);
}

.channel__value {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.channel__icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--grad);
    color: var(--white);
}

.channel__icon svg {
    width: 22px;
    height: 22px;
}

/* panel */
.contact__panel {
    position: relative;
    border-radius: var(--r-xl);
    background: var(--white);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.contact__panel::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: var(--grad);
}

.form {
    display: grid;
    gap: clamp(22px, 2.4vw, 32px);
    padding: clamp(24px, 3.2vw, 52px);
}

.form[hidden],
.form-done[hidden] {
    display: none;
}

.form__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
    color: var(--ink-mute);
}

.form__head .mono:first-child {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
}

.form__head i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--signal);
    box-shadow: 0 0 0 4px rgba(31, 201, 122, 0.18);
    animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
    50% {
        box-shadow: 0 0 0 8px rgba(31, 201, 122, 0);
    }
}

/* topics */
.topics {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.topics legend {
    padding: 0;
    margin-bottom: 12px;
    color: var(--ink-mute);
}

.topics__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.topics__chip {
    padding: 10px 16px;
    border-radius: var(--r-pill);
    border: 1px solid var(--line-strong);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s, transform 0.3s var(--ease-out);
}

.topics__chip:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.topics__chip:active {
    transform: scale(0.96);
}

.topics__chip[aria-pressed='true'] {
    background: var(--blue);
    border-color: var(--blue);
    color: var(--white);
}

/* fields */
.form__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.field {
    position: relative;
    min-width: 0;
}

.field--wide {
    grid-column: 1 / -1;
}

.field__input {
    display: block;
    width: 100%;
    padding: 26px 18px 10px;
    border-radius: var(--r-md);
    border: 1px solid transparent;
    background: var(--paper);
    font-size: 1rem;
    line-height: 1.4;
    color: var(--ink);
    outline: none;
    transition: border-color 0.3s, background-color 0.3s, box-shadow 0.3s;
    -webkit-appearance: none;
    appearance: none;
}

.field__input--area {
    min-height: 168px;
    resize: vertical;
}

.field__input:hover {
    border-color: var(--line-strong);
}

.field__input:focus {
    background: var(--white);
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(10, 98, 255, 0.12);
}

.field__label {
    position: absolute;
    top: 18px;
    left: 19px;
    color: var(--ink-mute);
    line-height: 1.4;
    pointer-events: none;
    transform-origin: 0 0;
    transition: transform 0.35s var(--ease-out), color 0.3s;
}

.field__input:focus + .field__label,
.field__input:not(:placeholder-shown) + .field__label {
    transform: translateY(-11px) scale(0.72);
    letter-spacing: 0.02em;
}

.field__input:focus + .field__label {
    color: var(--blue);
}

.field__error {
    min-height: 0;
    padding: 0 4px;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: #d92d20;
}

.field__error:not(:empty) {
    padding-top: 6px;
}

.field.has-error .field__input {
    border-color: #d92d20;
    background: #fff6f5;
}

.field.has-error .field__input:focus {
    box-shadow: 0 0 0 4px rgba(217, 45, 32, 0.12);
}

.field.has-error .field__label {
    color: #d92d20;
}

/* feedback */
.form__alert {
    padding: 14px 18px;
    border-radius: var(--r-md);
    background: #fff6f5;
    border: 1px solid rgba(217, 45, 32, 0.3);
    color: #b42318;
    font-size: var(--fs-small);
    line-height: 1.45;
}

.form__alert[hidden] {
    display: none;
}

.form__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px 28px;
}

.form__legal {
    flex: 1 1 240px;
    max-width: 380px;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--ink-mute);
}

.form__legal a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.form__legal a:hover {
    color: var(--blue);
}

.form.is-busy .btn__dot svg {
    animation: send 0.9s var(--ease-in-out) infinite;
}

@keyframes send {
    0% {
        transform: translate(0, 0);
        opacity: 1;
    }
    50% {
        transform: translate(10px, -10px);
        opacity: 0;
    }
    51% {
        transform: translate(-10px, 10px);
        opacity: 0;
    }
    100% {
        transform: translate(0, 0);
        opacity: 1;
    }
}

/* success */
.form-done {
    display: grid;
    gap: 18px;
    justify-items: start;
    align-content: center;
    min-height: 520px;
    padding: clamp(28px, 4vw, 64px);
}

.form-done .mono {
    color: var(--blue);
}

.form-done h2 {
    max-width: 18ch;
    outline: none;
}

.form-done__icon {
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: var(--grad);
    color: var(--white);
    box-shadow: 0 0 0 12px rgba(10, 132, 255, 0.12);
    animation: pop 0.7s var(--ease-spring) both;
}

.form-done__icon svg {
    width: 40px;
    height: 40px;
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: check 0.6s var(--ease-out) 0.35s forwards;
}

@keyframes pop {
    from {
        transform: scale(0.4);
        opacity: 0;
    }
}

@keyframes check {
    to {
        stroke-dashoffset: 0;
    }
}

@media (max-width: 980px) {
    .contact__grid {
        grid-template-columns: 1fr;
    }

    .contact__intro {
        position: static;
    }
}

@media (max-width: 560px) {
    .form__grid {
        grid-template-columns: 1fr;
    }

    .contact__panel {
        border-radius: var(--r-lg);
    }

    .form__foot .btn {
        width: 100%;
        justify-content: space-between;
    }

    .form__head .mono:last-child {
        display: none;
    }
}
