:root {
    --baby-pink: #e5b5c4;
    --text-color: #171717;
    --button-fill: #ffe6f0;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "aktiv-grotesk-extended", sans-serif;
    background: var(--baby-pink);
    color: var(--text-color);
    letter-spacing: 0.08em;
}

body.no-scroll {
    overflow: hidden;
}

.site-chrome {
    position: fixed;
    top: 1.5rem;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: baseline;
    padding: 0 1.5rem;
    z-index: 10;
}

.page-title,
.footer-title {
    font-size: 24px;
    font-weight: 500;
    letter-spacing: -1.5px;
    text-transform: lowercase;
}

.page-title {
    text-align: center;
    justify-self: center;
    grid-column: 2;
    color: var(--text-color);
    text-decoration: none;
}

.page-title:hover,
.page-title:focus-visible {
    text-decoration: underline;
}

.pill-group {
    display: inline-flex;
    gap: 0.65rem;
    align-items: center;
    justify-self: end;
    grid-column: 3;
}

.pill-button {
    border: 1.5px solid var(--text-color);
    background: var(--baby-pink);
    border-radius: 999px;
    padding: 0.4rem 1.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: none;
    text-decoration: none;
    color: var(--text-color);
    letter-spacing: 0.03em;
    outline: none;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.pill-button--dark {
    background: var(--text-color);
    color: var(--baby-pink);
}

.pill-button:hover,
.pill-button:focus-visible {
    background: var(--text-color);
    color: var(--button-fill);
    box-shadow: 0 4px 10px rgba(23, 23, 23, 0.15);
    transform: translateY(1px);
}

.pill-button:focus-visible {
    outline: 2px solid var(--button-fill);
    outline-offset: 3px;
}

.form-submit {
    border: 1.5px solid var(--text-color);
    background: var(--text-color);
    color: var(--button-fill);
    border-radius: 999px;
    padding: 15px;
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.03em;
    outline: none;
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.form-submit:hover,
.form-submit:focus-visible {
    background: var(--text-color);
    color: var(--button-fill);
    box-shadow: 0 4px 10px rgba(23, 23, 23, 0.15);
    transform: translateY(1px);
}

.form-submit:focus-visible {
    outline: 2px solid var(--button-fill);
    outline-offset: 3px;
}

.rsvp-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.rsvp-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.rsvp-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(23, 23, 23, 0.45);
    backdrop-filter: blur(3px);
}

.rsvp-modal {
    position: relative;
    width: min(460px, 100%);
    background: var(--baby-pink);
    border: 1.5px solid var(--text-color);
    border-radius: 28px;
    padding: 2rem;
    box-shadow: 0 25px 50px rgba(23, 23, 23, 0.35);
    z-index: 1;
}

.rsvp-modal__title {
    margin: 0;
    font-size: 1.4rem;
    text-transform: lowercase;
    letter-spacing: -1.5px;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--text-color);
    color: var(--baby-pink);
    font-size: 1rem;
    font-weight: 600;
    text-transform: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rsvp-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cf-turnstile {
    align-self: center;
    margin-bottom: 0.5rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.85rem;
    letter-spacing: -1.2px;
    text-transform: lowercase;
}

.form-field input,
.form-field select {
    border: 1.5px solid var(--text-color);
    border-radius: 999px;
    padding: 0.75rem 1.2rem;
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--button-fill);
    color: var(--text-color);
    outline: none;
    transition: border 0.2s ease;
    width: 100%;
}

.form-field select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.8rem;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23171717' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    cursor: pointer;
}

.form-field input:focus,
.form-field select:focus {
    border-color: var(--text-color);
    box-shadow: 0 0 0 2px rgba(23, 23, 23, 0.15);
}

.form-submit {
    position: relative;
}

.form-submit::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 1.1rem;
    height: 1.1rem;
    margin: auto;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: button-spin 0.75s linear infinite;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.2s ease;
}

.form-submit.is-loading {
    color: transparent;
    pointer-events: none;
}

.form-submit.is-loading::after {
    opacity: 1;
}

.form-status {
    font-size: 0.8rem;
    text-align: center;
    text-transform: none;
    letter-spacing: 0;
    margin-top: -0.5rem;
}

.form-status[data-status="info"] {
    color: var(--text-color);
}

.form-status[data-status="success"] {
    color: #1f7a1f;
}

.form-status[data-status="error"] {
    color: #9b1c1c;
}

@keyframes button-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.site-footer {
    position: fixed;
    bottom: 1.5rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 0 1.5rem;
    z-index: 10;
}

.footer-title {
    text-align: center;
}

@media (max-width: 600px) {
    .site-chrome {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 0.65rem;
    }

    .page-title,
    .pill-group {
        grid-column: auto;
        justify-self: center;
    }

    .pill-group {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.2rem;
    }

    .pill-button {
        padding: 0.25rem 0.9rem;
        font-size: 0.78rem;
        letter-spacing: 0.008em;
    }

    .site-footer {
        bottom: 1rem;
    }
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6.5rem 0 7rem;
    width: 100%;
}

.marquee-stack {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.marquee {
    overflow: hidden;
    border-radius: 0;
    /* Promote to its own layer to avoid jank on some GPUs */
    transform: translateZ(0);
}

.marquee__inner {
    display: inline-flex;
    gap: 1.5rem;
    padding: 0 1rem;
    font-size: clamp(2.8rem, 6vw, 5.8rem);
    font-weight: 600;
    text-transform: uppercase;
    animation: scroll var(--marquee-duration, 30s) linear infinite;
    white-space: nowrap;
    /* Use relative tracking so spacing scales with font-size */
    letter-spacing: -0.05em;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* Pause by default; JS will enable once markup is duplicated and fonts are ready */
    animation-play-state: paused;
}

.marquee__inner > span {
    flex: 0 0 auto;
}

/* Consistent spacing around divider glyphs used within marquee phrases */
.marquee__inner .glyph {
    display: inline-block;
    /* ch varies by font; em gives steadier visual spacing across devices */
    margin: 0 0.35em;
    letter-spacing: 0; /* cancel inherited tracking around the symbol */
    font-style: normal; /* avoid inheriting italics from surrounding text */
}

/* When a glyph is its own marquee item, rely solely on the track gap */
.marquee__inner > .glyph {
    margin: 0;
}

.marquee--reverse .marquee__inner {
    /* Use dedicated reverse keyframes to avoid start-at-100% hitch */
    animation-name: scroll-reverse;
    animation-direction: normal;
}

.marquee-divider {
    width: min(95%, 1100px);
    height: 2px;
    background: var(--text-color);
    align-self: center;
}

/* Make horizontal dividers shorter on small screens */
@media (max-width: 600px) {
    .marquee-divider {
        width: 85%;
    }
}

/* Start animation only when JS marks the track ready */
.marquee__inner.is-ready {
    animation-play-state: running;
}

@keyframes scroll {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

@keyframes scroll-reverse {
    0% {
        transform: translate3d(-50%, 0, 0);
    }
    100% {
        transform: translate3d(0, 0, 0);
    }
}
