/* Mango early-access landing page. One screen, no scrolling: everything lives
   in the hero. Tokens (colors, fonts) come from styles.css. */

html,
body.landing {
    height: 100%;
    overflow: hidden;
}

body.landing {
    min-height: 0;
}

.lp-icon {
    display: block;
    flex: none;
    width: 20px;
    height: 20px;
}

.lp {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100vh;
    height: 100dvh;
    padding: env(safe-area-inset-top) var(--gutter) env(safe-area-inset-bottom);
}

.lp__rainbow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: clamp(44px, 9vh, 84px);
    object-fit: cover;
    object-position: 50% 0;
    pointer-events: none;
}

/* ---------- Top bar ---------- */

.lp__bar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding-top: clamp(10px, 2.6vh, 24px);
}

.lp__brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--brown-900);
    text-decoration: none;
}

.lp__brand img {
    width: 30px;
    height: 30px;
}

.lp__bar-link {
    padding: 7px 14px;
    border: var(--border);
    border-radius: 999px;
    background: var(--card-bg);
    font-size: var(--text-small);
    font-weight: 600;
    color: var(--brown-900);
    text-decoration: none;
}

.lp__bar-link:hover {
    background: #fffaf0;
}

/* ---------- Hero ---------- */

.lp__hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    justify-items: center;
    width: 100%;
    max-width: 1280px;
    min-height: 0;
    margin: 0 auto;
}

.lp__copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 600px;
    text-align: center;
}

.lp__eyebrow {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border: 1.5px solid var(--badge-border);
    border-radius: 999px;
    background: var(--badge-bg);
    font-size: var(--text-small);
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--olive-900);
}

.lp__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--olive-600);
    box-shadow: 0 0 0 3px rgb(80 120 18 / 0.2);
}

.lp__title {
    margin-top: clamp(10px, 2.4vh, 22px);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2rem, min(7.4vw, 8.2vh), 3.875rem);
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: var(--brown-900);
    text-wrap: balance;
}

.lp__lede {
    margin-top: clamp(10px, 2.2vh, 20px);
    max-width: 30em;
    font-size: clamp(0.9375rem, 2.1vh, 1.125rem);
    line-height: 1.5;
    color: var(--brown-700);
    text-wrap: pretty;
}

/* The "coming soon" badge draws the eye with a soft, steady pulse: a glow that
   expands out from the pill, and a dot that pulses with it. No movement. */
@keyframes pill-pulse {
    0% { box-shadow: 0 0 0 0 rgb(80 120 18 / 0.4); }
    70%, 100% { box-shadow: 0 0 0 10px rgb(80 120 18 / 0); }
}

@keyframes dot-pulse {
    0% { box-shadow: 0 0 0 0 rgb(80 120 18 / 0.55); }
    70%, 100% { box-shadow: 0 0 0 7px rgb(80 120 18 / 0); }
}

@media (prefers-reduced-motion: no-preference) {
    .lp__eyebrow {
        animation: pill-pulse 2s ease-out infinite;
    }

    .lp__dot {
        animation: dot-pulse 2s ease-out infinite;
    }
}

/* ---------- Email form ---------- */

.lp-form {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 480px;
    margin-top: clamp(14px, 3.4vh, 30px);
    padding: 6px;
    border: var(--border);
    border-radius: 999px;
    background: var(--card-bg);
    box-shadow: 0 var(--ledge) 0 var(--brown-900);
}

/* No focus rings on the landing pages. Focus on the field shows as a darker
   border instead. */
.lp a,
.lp button,
.lp input,
.lp-done {
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.lp-form:focus-within {
    border-color: var(--olive-900);
}

.lp-form[data-invalid] {
    border-color: var(--chip-today);
    box-shadow: 0 var(--ledge) 0 var(--chip-today);
}

.lp-form__input {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0 8px 0 16px;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 1rem; /* 16px keeps iOS Safari from zooming on focus */
    color: var(--brown-900);
}

.lp-form__input::placeholder {
    color: var(--brown-500);
}

.lp-form__button {
    flex: none;
    height: 44px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: var(--olive-900);
    font-size: var(--text-button);
    font-weight: 600;
    color: var(--on-dark);
    white-space: nowrap;
    cursor: pointer;
}

.lp-form__button:hover {
    background: #2a3402;
}

.lp-form__button:active {
    transform: translateY(1px);
}

.lp-perk {
    margin-top: clamp(14px, 3.4vh, 30px);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--brown-900);
    text-wrap: balance;
}

.lp-perk + .lp-form {
    margin-top: 10px;
}

.lp-note {
    max-width: 34em;
    margin-top: 12px;
    min-height: 1.3em;
    font-size: var(--text-small);
    line-height: 1.35;
    color: var(--brown-500);
    text-wrap: balance;
}

.lp-note[data-error] {
    font-weight: 600;
    color: #c42b2c;
}

/* Success state replaces the form. */
.lp-done {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: 480px;
    margin-top: clamp(14px, 3.4vh, 30px);
    padding: 14px 18px;
    border: var(--border);
    border-radius: var(--radius-card);
    background: var(--card-added-bg);
    box-shadow: 0 var(--ledge) 0 var(--olive-600);
    text-align: left;
    color: var(--olive-600);
}

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

/* Focused by script when it appears, so no ring. */
.lp-done:focus {
    outline: none;
}

.lp-done .lp-icon {
    width: 28px;
    height: 28px;
}

.lp-done__title {
    font-family: var(--font-display);
    font-size: 1.1875rem;
    font-weight: 700;
    color: var(--olive-900);
}

.lp-done__text {
    font-size: var(--text-body);
    color: var(--brown-700);
}

.lp--joined .lp-perk,
.lp--joined .lp-form,
.lp--joined .lp-note {
    display: none;
}

/* ---------- Floating event cards (decor) ---------- */

.lp__decor {
    display: none;
}

.lp-card {
    width: 250px;
    padding: 14px 14px 12px;
    border: var(--border);
    border-radius: var(--radius-card);
    background: var(--card-bg);
    text-align: left;
}

.lp-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.lp-card__title {
    font-family: var(--font-display);
    font-size: 1.1875rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--brown-900);
}

.lp-card__time {
    margin-top: 6px;
    font-size: var(--text-small);
    font-weight: 500;
    color: var(--brown-700);
}

.lp-badge {
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: center;
    min-width: 44px;
    padding: 4px 6px 5px;
    border: 1.5px solid var(--badge-border);
    border-radius: var(--radius-badge);
    background: linear-gradient(var(--badge-bg), var(--badge-bg)), var(--card-bg);
    font-family: var(--font-display);
    line-height: 1;
}

.lp-badge__month {
    font-size: 0.8125rem;
    color: var(--badge-month);
}

.lp-badge__day {
    margin-top: 2px;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--olive-900);
}

.lp-card__add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    height: 38px;
    border-radius: var(--radius-button);
    background: var(--olive-900);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--on-dark);
}

.lp-card__add .lp-icon {
    width: 18px;
    height: 18px;
}

.lp-card__add--done {
    background: var(--card-added-bg);
    border: 1.5px solid var(--card-added-divider);
    color: var(--olive-600);
}

@media (min-width: 1180px) and (min-height: 640px) {
    .lp__hero {
        grid-template-columns: 250px minmax(0, 1fr) 250px;
        gap: 40px;
    }

    .lp__decor {
        display: flex;
        flex-direction: column;
        gap: 26px;
    }

    .lp__decor--left {
        justify-self: start;
        align-items: flex-start;
    }

    .lp__decor--right {
        justify-self: end;
        align-items: flex-end;
    }

    .lp-card--a {
        transform: rotate(-4deg);
    }

    .lp-card--b {
        transform: rotate(3deg) translateX(24px);
    }

    .lp-card--c {
        transform: rotate(4deg);
    }

    .lp-card--d {
        transform: rotate(-3deg) translateX(-24px);
    }
}

/* ---------- How it works ---------- */

.lp__steps {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    padding: 0 0 clamp(12px, 3vh, 28px);
    list-style: none;
}

.lp-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1.5px solid var(--band-border);
    border-radius: var(--radius-card);
    background: rgb(255 246 230 / 0.7);
}

.lp-step__icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--badge-bg);
    border: 1.5px solid var(--badge-border);
    color: var(--olive-900);
}

.lp-step__title {
    font-size: var(--text-button);
    font-weight: 600;
    color: var(--brown-900);
}

.lp-step__text {
    font-size: var(--text-small);
    line-height: 1.3;
    color: var(--brown-700);
}

.lp-step__soon {
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--chip-tomorrow);
    font-size: 0.6875rem;
    font-weight: 600;
    vertical-align: 2px;
    color: var(--brown-900);
}

/* ---------- Small screens ---------- */

@media (max-width: 720px) {
    .lp__steps {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .lp-step {
        padding: 8px 12px;
    }

    .lp-step__icon {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 440px) {
    .lp-form {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .lp-form:focus-within {
        border-color: transparent;
    }

    .lp-form[data-invalid] {
        box-shadow: none;
    }

    .lp-form__input {
        flex: none; /* in a column, flex: 1 would ignore the height */
        height: 54px;
        padding: 0 16px;
        border: 1.5px solid var(--brown-900);
        border-radius: 14px;
        background: #ffffff;
        text-align: left;
    }

    .lp-form__input:focus {
        border-color: var(--olive-900);
        border-width: 2px;
        padding: 0 15.5px;
    }

    .lp-form[data-invalid] .lp-form__input {
        border-color: var(--chip-today);
    }

    .lp-form__button {
        width: 100%;
        height: 54px;
        border-radius: 14px;
    }
}

/* Short desktop windows: drop the supporting detail first. Phones and tablets
   scroll instead (see the end of this file), so nothing is hidden there. */
@media (min-width: 900px) and (max-height: 600px) {
    .lp__steps {
        display: none;
    }
}

@media (min-width: 900px) and (max-height: 520px) {
    .lp__eyebrow {
        display: none;
    }
}

/* The form is already on screen at phone sizes. */
@media (max-width: 600px) {
    .lp__bar-link {
        display: none;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .lp-form__button,
    .lp-form {
        transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
    }
}

/* ---------- Phones and tablets: the page may scroll ---------- */

@media (max-width: 899px) {
    html,
    body.landing {
        height: auto;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .lp {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        grid-template-rows: auto minmax(min-content, 1fr) auto;
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }

    .lp__hero {
        padding: 16px 0 24px;
    }
}
