/* Contact page (contact.html), after design-refs/contact.png:
   the form on the left and a slate panel on the right from 1024px; stacked below.
   The form's submission (id, field names, endpoint, redirect) lives in contact.html and is unchanged. */

:root {
    --contact-field-h: 3.25rem;            /* 52px on phones, 56px from 768px */
    --contact-row-gap: 2rem;               /* leaves room for an error line under a field */
    --contact-col-gap: 1.25rem;
    --contact-radius: 0.5rem;
    --contact-border: #d4d6db;
    --contact-placeholder: #8a8f98;
    --contact-error: #c81e1e;
    --contact-panel-bg: #8b9cb2;           /* the reference's slate */
    --contact-panel-ink: #14181f;
    --contact-panel-muted: #283140;        /* 4.5:1 on the slate */
    --contact-panel-line: rgba(20, 24, 31, 0.22);
}

/* From 768px everything but the Submit button fits on one screen under the header, as in the
   reference: field height, gaps and type scale with the space left (--contact-avail). */
@media (min-width: 768px) {
    :root {
        --contact-avail: calc(100svh - var(--header-height));
        --contact-field-h: clamp(2.75rem, var(--contact-avail) * 0.066, 3.75rem);
        --contact-row-gap: clamp(1.25rem, var(--contact-avail) * 0.031, 2.25rem);
    }
}

.contact {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    row-gap: 3rem;
    padding: 2.5rem var(--gutter) 4rem;
    font-family: "Geist", sans-serif;
    letter-spacing: 0;
}

@media (min-width: 768px) {
    .contact {
        row-gap: 4rem;
        padding-top: clamp(1rem, var(--contact-avail) * 0.04, 3.5rem);
        padding-bottom: 5rem;
    }
}

/* Side by side from 1024px: the form a little wider than the panel, the panel's top
   just above the heading, as in the reference */
@media (min-width: 1024px) {
    .contact {
        grid-template-columns: minmax(0, 1.17fr) minmax(0, 1fr);
        column-gap: clamp(1.5rem, 2.5vw, 2.5rem);
        align-items: start;
        padding-top: clamp(1rem, var(--contact-avail) * 0.028, 1.5rem);
        padding-bottom: 6rem;
    }

    .contact__main {
        padding-top: clamp(0.75rem, var(--contact-avail) * 0.03, 2rem);
    }
}

/* ---------- Heading ---------- */
.contact__title {
    margin: 0;
    font-size: var(--section-title);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: #0a0a0a;
    text-wrap: balance;
}

@media (min-width: 768px) {
    .contact__title {
        font-size: min(var(--section-title), var(--contact-avail) * 0.068);
    }
}

.contact__lede {
    margin: 1rem 0 0;
    max-width: 40rem;
    font-size: clamp(1rem, 0.9rem + 0.35vw, 1.25rem);
}

@media (min-width: 768px) {
    .contact__lede {
        margin-top: clamp(0.5rem, var(--contact-avail) * 0.016, 1rem);
        max-width: none;
        font-size: clamp(1rem, var(--contact-avail) * 0.022, 1.25rem);
    }
    line-height: 1.5;
    color: #575757;
}

/* ---------- Form ---------- */
.contact__form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--contact-row-gap) var(--contact-col-gap);
    margin-top: 2.5rem;
}

@media (min-width: 640px) {
    .contact__form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact__item--full,
    .contact__privacy,
    .contact__actions {
        grid-column: 1 / -1;
    }
}

@media (min-width: 768px) {
    .contact__form {
        margin-top: clamp(1.25rem, var(--contact-avail) * 0.045, 3.25rem);
    }
}

.contact__item {
    position: relative;
}

.contact-field {
    display: block;
    width: 100%;
    height: var(--contact-field-h);
    margin: 0;
    padding: 0 1.125rem;
    background-color: #ffffff;
    border: 1px solid var(--contact-border);
    border-radius: var(--contact-radius);
    font: inherit;
    font-size: 0.875rem;  /* 14px (the founder's choice) */
    color: #0a0a0a;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 768px) {
    .contact-field {
        padding: 0 1.25rem;
    }
}

.contact-field::placeholder {
    color: var(--contact-placeholder);
    opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
    .contact-field:hover {
        border-color: #b4b8c0;
    }
}

.contact-field:focus {
    outline: none;
    border-color: #0a0a0a;
    box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.06);
}

.contact-field.is-invalid {
    border-color: var(--contact-error);
}

.contact-field.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(200, 30, 30, 0.1);
}

/* Dropdowns: black text and a solid triangle on the right, as in the reference */
.contact-field--select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 3rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M0 0h14L7 9z' fill='%230a0a0a'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.25rem center;
    background-size: 0.625rem auto;  /* 10px wide: a little smaller than the reference's */
    text-overflow: ellipsis;
}



/* Error line: sits in the gap under its field, so the rows never move */
.contact__error {
    position: absolute;
    top: 100%;
    left: 0;
    margin: 0.3125rem 0 0;
    font-size: 0.875rem;
    line-height: 1.2;
    color: var(--contact-error);
}

.contact__error:empty {
    display: none;
}

@media (min-width: 768px) {
    .contact__error {
        margin-top: 0.1875rem;
    }
}

.contact__privacy {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #575757;
}


.contact__privacy a {
    color: #0a0a0a;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.contact__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

/* Submit: the same size and look as the header's black Get Started button (40px tall, 15px text,
   4px corners, the softer-black fill rising on hover); the click area stays 44px */
.contact__submit {
    --btn-fill: var(--header-btn-solid-bg-hover);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: clamp(7rem, 30vw, 9.5rem);  /* below 1024px: the header's Get Started size */
    height: 2.25rem;
    padding: 0.25rem 0.25rem 0.25rem 1rem;
    border: 0;
    border-radius: var(--header-radius);
    background-color: #000000;
    background-image: linear-gradient(var(--btn-fill), var(--btn-fill));
    background-repeat: no-repeat;
    background-position: bottom;
    background-size: 100% 0;
    color: #ffffff;
    font: inherit;
    font-size: 0.875rem;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-size 0.35s var(--header-ease), transform 0.1s ease-out;
}

@media (min-width: 1024px) {
    .contact__submit {
        min-width: 7.0625rem;               /* 113px, as wide as the header's Get Started */
        height: var(--header-btn-height);   /* 40px */
        font-size: 0.9375rem;
    }
}

/* Small white square with a black arrow at the right end, as on the hero's Get Started */
.contact__submit-icon {
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.1875rem;
    background: #ffffff;
    color: #000000;
}

.contact__submit-icon svg {
    transition: transform 0.2s ease;
}

@media (min-width: 1024px) {
    .contact__submit-icon {
        width: 2rem;
        height: 2rem;
    }
}

.contact__submit::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -0.25rem;   /* keeps the tap area at least 44px tall */
    bottom: -0.25rem;
}

@media (hover: hover) and (pointer: fine) {
    .contact__submit:not(:disabled):hover {
        background-size: 100% 100%;
    }

    .contact__submit:not(:disabled):hover .contact__submit-icon svg {
        transform: translateX(2px);
    }
}

@media (hover: none) {
    .contact__submit:not(:disabled):active {
        background-color: var(--header-btn-solid-bg-hover);
        transform: scale(0.97);
    }
}

.contact__submit:focus-visible {
    background-size: 100% 100%;
    outline: 2px solid #000000;
    outline-offset: 3px;
}

.contact__submit:disabled {
    cursor: default;
}

.contact__status {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.4;
}

/* ---------- Panel ---------- */
.contact__panel {
    border-radius: 1.25rem;
    padding: 2rem 1.5rem 2.25rem;
    background: var(--contact-panel-bg);
    color: var(--contact-panel-ink);
}

@media (min-width: 768px) {
    .contact__panel {
        border-radius: 1.5rem;
        padding: 3rem;
    }
}

@media (min-width: 1024px) {
    .contact__panel {
        padding: clamp(2rem, var(--contact-avail) * 0.06, 3.5rem) 3rem clamp(2rem, var(--contact-avail) * 0.065, 4rem) clamp(3rem, 3.5vw, 3.5rem);
    }
}

.contact__note {
    margin: 0;
}

.contact__quote {
    margin: 0;
}

/* Small quote marks: the opening one hangs to the left of the text, as in the reference */
.contact__quote p {
    position: relative;
    margin: 0;
    font-size: clamp(1.375rem, 1.1rem + 0.75vw, 1.875rem);
}

@media (min-width: 1024px) {
    .contact__quote p {
        font-size: clamp(1.25rem, min(1.1rem + 0.75vw, var(--contact-avail) * 0.036), 1.875rem);
    }
    line-height: 1.45;
    letter-spacing: -0.01em;
    text-wrap: pretty;
}

.contact__quote p::before,
.contact__quote p::after {
    font-size: 0.6em;
    line-height: 1;
    color: rgba(255, 255, 255, 0.6);
}

.contact__quote p::before {
    content: "\201C";
    position: absolute;
    top: 0.2em;
    left: -0.75em;
}

.contact__quote p::after {
    content: "\201D";
    position: relative;
    top: -0.55em;
    margin-left: 0.1em;
}

.contact__cite {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-top: 1.75rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

@media (min-width: 768px) {
    .contact__cite {
        margin-top: clamp(1.25rem, var(--contact-avail) * 0.04, 2.5rem);
    }
}

.contact__cite-role {
    color: var(--contact-panel-muted);
}

/* A line separates the founders' note from the steps, as in the reference */
.contact__next {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--contact-panel-line);
}

@media (min-width: 768px) {
    .contact__next {
        margin-top: clamp(1.5rem, var(--contact-avail) * 0.045, 3rem);
        padding-top: clamp(1.5rem, var(--contact-avail) * 0.045, 3rem);
    }
}

.contact__next-title {
    margin: 0;
    font-family: "Geist", sans-serif;
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--contact-panel-muted);
}

@media (min-width: 768px) {
    .contact__next-title {
        font-size: 0.9375rem;
    }
}

.contact__steps {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.625rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 640px) {
    .contact__steps {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.625rem;
        margin-top: clamp(0.875rem, var(--contact-avail) * 0.02, 1.25rem);
    }
}

/* Each step is a soft, lighter tile (no lines) */
.contact__step {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 1rem 1.125rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.16);
}

@media (min-width: 768px) {
    .contact__step {
        padding: clamp(0.75rem, var(--contact-avail) * 0.02, 1rem) 1rem clamp(0.875rem, var(--contact-avail) * 0.022, 1.125rem);
    }
}

.contact__step-num {
    font-family: "Geist", sans-serif;
    font-size: 0.75rem;
    color: var(--contact-panel-muted);
}

.contact__step-name {
    margin-top: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.contact__step-text {
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--contact-panel-muted);
    text-wrap: pretty;
}

/* Beside the form the panel is narrow until 1280px: the steps stack there as compact rows
   (number and name on one line, no description), so the panel still fits on one screen */
@media (min-width: 1024px) and (max-width: 1279.98px) {
    .contact__steps {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.5rem;
    }

    .contact__step {
        flex-direction: row;
        align-items: baseline;
        gap: 0.75rem;
        padding: 0.625rem 1rem;
        border-radius: 0.5rem;
    }

    .contact__step-name {
        margin-top: 0;
    }

    .contact__step-text {
        display: none;
    }

    .contact__quote p {
        font-size: clamp(1.125rem, var(--contact-avail) * 0.03, 1.5rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .contact-field,
    .contact__submit,
    .contact__submit-icon svg {
        transition: none;
    }
}
