/* =====================================================================
 * MarpaMail landing homepage -- styles for this page variant.
 *
 * Loaded by homepage.tpl beside this file, so these rules only ever apply to
 * the homepage. Nothing here belongs in css/custom.css.
 *
 * Built only from PHOX's own custom properties (--brand-primary, --block-bg,
 * --radius, --spacing-Nx, --text-heading-color, ...), so the brand colour and
 * html.wdes-dark-mode are inherited without a second set of rules.
 *
 * Sections stay inside the .container that header.tpl wraps main-body in.
 * A full-bleed hero would need a 50vw break-out, and vw includes the
 * scrollbar on Windows, which yields a horizontal scrollbar on the whole
 * page. The rounded hero panel avoids that class of bug entirely.
 *
 * color-mix() is written directly in each declaration rather than behind a
 * custom property: through a var() indirection an unsupported color-mix makes
 * the declaration invalid at computed-value time (resolving to `unset`)
 * instead of falling back to the plain-colour declaration above it.
 * ===================================================================== */

.mm-landing {
    --mm-gap: var(--spacing-3x);
    --mm-section-gap: var(--spacing-10x);
}

/* ---------- shared pieces ---------- */

.mm-section {
    margin-bottom: var(--mm-section-gap);
}

.mm-section__head {
    text-align: center;
    margin-bottom: var(--spacing-6x);
}

.mm-section__head h2 {
    margin: 0;
    color: var(--text-heading-color);
    font-size: var(--font-size-h2);
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
}

.mm-section__head p {
    margin: var(--spacing-2x) auto 0;
    max-width: 60ch;
    color: var(--text-body-color);
    font-size: var(--font-size-lg);
}

/* next.png is 50x45 and grey. Held small so it reads as a chevron affordance
 * rather than artwork; --invert flips it to white for dark backgrounds. */
.mm-chevron {
    width: 9px;
    height: auto;
    margin-left: 6px;
    vertical-align: baseline;
    opacity: 0.65;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.mm-chevron--invert {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

a:hover > .mm-chevron,
a:hover .mm-chevron {
    transform: translateX(3px);
    opacity: 1;
}

.mm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2x) var(--spacing-4x);
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: var(--font-size-semi-md);
    font-weight: var(--font-weight-semi-bold);
    line-height: 1.4;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mm-btn:hover,
.mm-btn:focus {
    text-decoration: none;
}

.mm-btn--primary {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: var(--text-white-color);
}

.mm-btn--primary:hover,
.mm-btn--primary:focus {
    background-color: var(--brand-primary);
    color: var(--text-white-color);
    filter: brightness(0.92);
}

.mm-btn--ghost {
    background-color: var(--block-bg);
    border-color: var(--gray-lighter-4);
    color: var(--text-heading-color);
}

.mm-btn--ghost:hover,
.mm-btn--ghost:focus {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.mm-eyebrow {
    display: inline-block;
    margin-bottom: var(--spacing-2x);
    padding: 4px var(--spacing-2x);
    background-color: var(--gray-faded);
    background-color: color-mix(in srgb, var(--brand-primary) 12%, var(--block-bg));
    border-radius: 999px;
    color: var(--brand-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semi-bold);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* ---------- hero ---------- */

.mm-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: center;
    gap: var(--spacing-6x);
    margin-bottom: var(--mm-section-gap);
    padding: var(--spacing-9x) var(--spacing-7x);
    background-color: var(--gray-faded);
    background-color: color-mix(in srgb, var(--brand-primary) 8%, var(--block-bg));
    border-radius: calc(var(--radius) * 3);
}

.mm-hero__title {
    margin: 0;
    color: var(--text-heading-color);
    font-size: clamp(30px, 4.2vw, 52px);
    font-weight: var(--font-weight-bold);
    line-height: 1.12;
}

.mm-hero__lead {
    margin: var(--spacing-3x) 0 0;
    max-width: 52ch;
    color: var(--text-body-color);
    font-size: var(--font-size-lg);
    line-height: 1.65;
}

.mm-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-2x);
    margin-top: var(--spacing-5x);
}

.mm-hero__chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-2x) var(--spacing-4x);
    margin: var(--spacing-5x) 0 0;
    padding: 0;
    list-style: none;
}

.mm-hero__chips li {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-body-color);
    font-size: var(--font-size-base);
}

.mm-hero__chips i {
    color: var(--brand-primary);
}

.mm-hero__art {
    display: flex;
    justify-content: center;
}

.mm-art {
    width: 100%;
    max-width: 460px;
    height: auto;
}

.mm-art__blob {
    fill: var(--brand-primary);
    opacity: 0.07;
}

.mm-art__pill {
    fill: var(--brand-primary);
    opacity: 0.28;
}

.mm-art__pill--faint {
    opacity: 0.14;
}

.mm-art__envelope {
    fill: var(--block-bg);
    stroke: var(--brand-primary);
    stroke-width: 4;
}

.mm-art__flap {
    stroke: var(--brand-primary);
}

.mm-art__shield {
    fill: var(--brand-primary);
}

.mm-art__check {
    stroke: #fff;
}

.mm-art__dot {
    fill: var(--brand-primary);
    opacity: 0.5;
}

.mm-art__dot--faint {
    opacity: 0.25;
}

/* ---------- card grids ---------- */

.mm-grid {
    display: grid;
    gap: var(--mm-gap);
    margin: 0;
    padding: 0;
    list-style: none;
}

.mm-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mm-card {
    display: flex;
    flex-direction: column;
    padding: var(--spacing-5x) var(--spacing-4x);
    background-color: var(--block-bg);
    border: var(--block-border);
    border-radius: var(--radius);
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.mm-card:hover {
    border-color: var(--brand-primary);
    transform: translateY(-2px);
}

.mm-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: var(--spacing-3x);
    background-color: var(--gray-faded);
    background-color: color-mix(in srgb, var(--brand-primary) 12%, var(--block-bg));
    border-radius: var(--radius);
    color: var(--brand-primary);
    font-size: var(--font-size-xlg);
}

.mm-card h3 {
    margin: 0 0 var(--spacing-1x);
    color: var(--text-heading-color);
    font-size: var(--font-size-h6);
    font-weight: var(--font-weight-semi-bold);
}

.mm-card p {
    margin: 0;
    color: var(--text-body-color);
    font-size: var(--font-size-base);
    line-height: 1.6;
}

/* Pushed to the bottom so links align across cards of unequal copy length. */
.mm-card__link {
    margin-top: auto;
    padding-top: var(--spacing-3x);
    color: var(--brand-primary);
    text-decoration: none;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semi-bold);
}

.mm-card__link:hover {
    color: var(--brand-primary);
    text-decoration: none;
}

/* ---------- stats strip ---------- */

.mm-stats {
    margin-bottom: var(--mm-section-gap);
    padding: var(--spacing-5x) var(--spacing-4x);
    background-color: var(--gray-faded);
    background-color: color-mix(in srgb, var(--brand-primary) 8%, var(--block-bg));
    border-radius: calc(var(--radius) * 2);
}

.mm-stats ul {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--spacing-3x);
    margin: 0;
    padding: 0;
    list-style: none;
}

.mm-stats li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.mm-stats strong {
    color: var(--brand-primary);
    font-size: var(--font-size-h3);
    font-weight: var(--font-weight-bold);
    line-height: 1.1;
}

.mm-stats span {
    color: var(--text-body-color);
    font-size: var(--font-size-base);
}

/* ---------- quick actions ---------- */

/* The stock .home-shortcuts sets its own bottom margin; the section wrapper
 * owns spacing here so the rhythm matches the other landing sections. */
.mm-quick .mm-shortcuts {
    margin-bottom: 0;
}

/* ---------- closing CTA ---------- */

.mm-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-4x);
    margin-bottom: var(--mm-section-gap);
    padding: var(--spacing-7x);
    background-color: var(--brand-primary);
    border-radius: calc(var(--radius) * 3);
}

.mm-cta__copy h2 {
    margin: 0;
    color: var(--text-white-color);
    font-size: var(--font-size-h3);
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
}

.mm-cta__copy p {
    margin: var(--spacing-1x) 0 0;
    max-width: 56ch;
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--font-size-md);
}

.mm-cta__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-2x);
}

.mm-btn--light {
    background-color: #fff;
    border-color: #fff;
    color: var(--brand-primary);
}

.mm-btn--light:hover,
.mm-btn--light:focus {
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--brand-primary);
}

.mm-btn--outline-light {
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.mm-btn--outline-light:hover,
.mm-btn--outline-light:focus {
    border-color: #fff;
    background-color: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* ---------- responsive ---------- */

@media screen and (max-width: 991px) {
    .mm-hero {
        grid-template-columns: minmax(0, 1fr);
        padding: var(--spacing-7x) var(--spacing-4x);
        text-align: center;
    }

    .mm-hero__lead {
        margin-left: auto;
        margin-right: auto;
    }

    .mm-hero__actions,
    .mm-hero__chips {
        justify-content: center;
    }

    /* Art first would push the copy below the fold on a tablet. */
    .mm-hero__art {
        order: 2;
        margin-top: var(--spacing-4x);
    }

    .mm-grid--3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 767px) {
    .mm-landing {
        --mm-section-gap: var(--spacing-7x);
    }

    .mm-grid--3 {
        grid-template-columns: minmax(0, 1fr);
    }

    .mm-stats ul {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mm-cta {
        padding: var(--spacing-5x) var(--spacing-4x);
    }

    .mm-cta__actions {
        width: 100%;
    }

    .mm-cta__actions .mm-btn {
        flex: 1 1 auto;
    }
}

/* ---------- dark mode ---------- */

/* PHOX's dark mode redefines the neutrals but leaves --brand-primary at its
 * light-mode value, which is too dark to read as *text* on a near-black panel.
 * Lighten it only where the brand colour is used for type or glyphs; brand
 * filled surfaces (.mm-btn--primary, .mm-cta) keep the true brand colour. */
.wdes-dark-mode .mm-eyebrow,
.wdes-dark-mode .mm-card__link,
.wdes-dark-mode .mm-card__icon,
.wdes-dark-mode .mm-stats strong,
.wdes-dark-mode .mm-hero__chips i {
    color: color-mix(in srgb, var(--brand-primary) 55%, #fff);
}

/* The envelope is stroked, not filled, so it needs the same lift to stay
 * legible against the dark hero panel. */
.wdes-dark-mode .mm-art__envelope,
.wdes-dark-mode .mm-art__flap {
    stroke: color-mix(in srgb, var(--brand-primary) 55%, #fff);
}
