/* Brand tokens */
:root {
    --sw-blue: #122a3c;
    --sw-sage: #f2ede0;
    --sw-black: #04141e;
    --sw-orange: #d36820;
    --sw-orange-text: #a84f12;
    --sw-orange-light: #e98b4b;
    --sw-border: #c9c4b8;
    --sw-error: #b42318;

    --font-serif: "EB Garamond", Georgia, serif;
    --font-sans: "Poppins", system-ui, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html:has(dialog[open]) {
    overflow: hidden;
}

body {
    margin: 0;
    background: var(--sw-sage);
    color: var(--sw-black);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--sw-blue);
    text-underline-offset: 4px;
}

a:hover {
    color: var(--sw-orange-text);
}

:focus-visible {
    outline: 3px solid var(--sw-orange);
    outline-offset: 3px;
}

/* Layout */
.page {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100svh;
}

.page__content {
    display: flex;
    flex-direction: column;
    padding: 48px clamp(32px, 5vw, 72px) 40px;
}

.brand img {
    display: block;
    width: 140px;
    height: auto;
}

.intro {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 560px;
    padding: 64px 0;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--sw-orange-text);
}

.eyebrow__rule {
    display: block;
    width: 40px;
    height: 1px;
    background: var(--sw-orange);
}

.eyebrow--small {
    gap: 12px;
    font-size: 12px;
}

.eyebrow--small .eyebrow__rule {
    width: 32px;
}

.headline {
    margin: 24px 0 0;
    font-family: var(--font-serif);
    font-size: clamp(40px, 5.2vw, 76px);
    font-weight: 500;
    line-height: 1.02;
    color: var(--sw-blue);
}

.headline em {
    font-style: italic;
    color: var(--sw-orange-text);
}

.mark {
    color: var(--sw-orange);
}

.lead {
    margin: 28px 0 0;
    font-size: 16px;
    line-height: 1.75;
    color: rgb(4 20 30 / 0.8);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
    margin-top: 40px;
}

.actions__alt {
    margin: 0;
    font-size: 13px;
    color: rgb(4 20 30 / 0.72);
}

.footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 32px;
    padding-top: 20px;
    border-top: 1px solid rgb(18 42 60 / 0.15);
    font-size: 12px;
    line-height: 1.6;
    color: rgb(4 20 30 / 0.7);
}

/* Arched image */
.arch {
    position: relative;
    margin: 32px 32px 32px 0;
    min-height: 560px;
    overflow: hidden;
    border-radius: 360px 360px 16px 16px;
    background: var(--sw-blue);
}

.arch__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 45% center;
    transform-origin: 45% 62%;
    animation: sw-zoom 40s ease-in-out infinite alternate;
}

.arch::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 45%;
    background: linear-gradient(0deg, rgb(4 20 30 / 0.75), rgb(4 20 30 / 0));
}

.arch__caption {
    position: absolute;
    z-index: 1;
    left: 32px;
    right: 32px;
    bottom: 32px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.arch__caption p {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 26px;
    line-height: 1.25;
    color: var(--sw-sage);
}

.arch__caption span {
    font-size: 11px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    white-space: nowrap;
    color: rgb(255 255 255 / 0.85);
}

@keyframes sw-zoom {
    from {
        transform: scale(1.04);
    }
    to {
        transform: scale(1.28);
    }
}

@media (prefers-reduced-motion: reduce) {
    .arch__image {
        animation: none;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 52px;
    padding: 0 28px;
    border-radius: 3px;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.btn--primary {
    border: 0;
    background: var(--sw-blue);
    color: #ffffff;
}

.btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgb(18 42 60 / 0.25);
}

.btn--primary:disabled {
    opacity: 0.6;
    pointer-events: none;
}

.btn--outline {
    border: 1px solid var(--sw-blue);
    background: transparent;
    color: var(--sw-blue);
}

.btn--outline:hover {
    background: var(--sw-blue);
    color: #ffffff;
}

.btn--block {
    width: 100%;
}

.btn__icon {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--sw-orange-light);
    stroke-width: 2;
}

/* Signup modal */
.signup {
    width: min(520px, calc(100% - 48px));
    max-height: calc(100% - 48px);
    padding: 44px 40px 36px;
    border: 0;
    border-radius: 12px;
    background: #ffffff;
    color: var(--sw-black);
    box-shadow: 0 24px 60px rgb(4 20 30 / 0.3);
}

.signup::backdrop {
    background: rgb(4 20 30 / 0.62);
    backdrop-filter: blur(4px);
}

.signup[open] {
    animation: sw-dialog-in 220ms ease-out;
}

@keyframes sw-dialog-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.signup__close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--sw-blue);
    cursor: pointer;
}

.signup__close:hover {
    background: var(--sw-sage);
}

.signup__close svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.signup__title {
    margin: 16px 0 0;
    font-family: var(--font-serif);
    font-size: 40px;
    font-weight: 500;
    line-height: 1.08;
    color: var(--sw-blue);
}

.signup__text {
    margin: 14px 0 0;
    font-size: 14px;
    line-height: 1.7;
    color: rgb(4 20 30 / 0.78);
}

.signup__success {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0 8px;
    text-align: center;
}

.signup__success[hidden] {
    display: none;
}

.signup__success .btn {
    margin-top: 28px;
}

.signup__tick {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--sw-sage);
}

.signup__tick svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: var(--sw-orange-text);
    stroke-width: 1.8;
}

/* Form */
.form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 28px;
}

.form__honeypot {
    position: absolute;
    left: -9999px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field__label {
    font-size: 12px;
    color: var(--sw-black);
}

.required {
    color: var(--sw-orange-text);
}

.field__input {
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid var(--sw-border);
    border-radius: 4px;
    background: #ffffff;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--sw-black);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field__input:focus {
    outline: none;
    border-color: var(--sw-orange);
    box-shadow: 0 0 0 4px rgb(211 104 32 / 0.15);
}

.field__input[aria-invalid="true"] {
    border-color: var(--sw-error);
}

.field__error,
.form__status {
    margin: 0;
    font-size: 12px;
    color: var(--sw-error);
}

.consent {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 12px;
    line-height: 1.6;
    color: rgb(4 20 30 / 0.78);
    cursor: pointer;
}

.consent input {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--sw-blue);
}

/* Tablet and mobile */
@media (max-width: 1023px) {
    .page {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "brand"
            "arch"
            "intro"
            "footer";
        padding: 24px 20px 20px;
    }

    .page__content {
        display: contents;
    }

    .brand {
        grid-area: brand;
    }

    .brand img {
        width: 112px;
    }

    .arch {
        grid-area: arch;
        margin: 20px 0 0;
        min-height: 0;
        height: clamp(300px, 60vw, 460px);
        border-radius: 180px 180px 12px 12px;
    }

    .arch__caption {
        left: 20px;
        right: 20px;
        bottom: 18px;
    }

    .arch__caption p {
        font-size: 19px;
    }

    .arch__caption span {
        display: none;
    }

    .intro {
        grid-area: intro;
        max-width: none;
        padding: 28px 4px 32px;
    }

    .lead {
        margin-top: 14px;
        font-size: 14px;
    }

    .actions {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        margin-top: 24px;
    }

    .footer {
        grid-area: footer;
        flex-direction: column;
        gap: 4px;
        padding: 14px 4px 0;
        font-size: 11px;
    }

    /* Modal becomes a bottom sheet */
    .signup {
        width: 100%;
        max-width: 100%;
        max-height: calc(100% - 24px);
        margin: auto 0 0;
        padding: 36px 24px 28px;
        border-radius: 16px 16px 0 0;
        overflow-y: auto;
    }

    .signup[open] {
        animation: sw-sheet-in 260ms ease-out;
    }

    .signup__title {
        font-size: 32px;
    }
}

@keyframes sw-sheet-in {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}