/* Messenger replication case — signal / high-load */

.case-mx-page {
    --mx-bg: #06080b;
    --mx-ink: #e8eef2;
    --mx-mute: rgba(232, 238, 242, 0.58);
    --mx-line: rgba(232, 238, 242, 0.14);
    --mx-accent: #5eead4;
    --mx-glow: #0e7490;
    background: var(--mx-bg);
    color: var(--mx-ink);
}

.case-mx-page .site-header {
    --header-fg: var(--mx-ink);
}

.mx-case {
    overflow: clip;
}

/* —— Hero —— */
.mx-hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 120px var(--pad) 48px;
    isolation: isolate;
}

.mx-hero-atmosphere {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background:
        radial-gradient(ellipse 60% 50% at 85% 20%, rgba(14, 116, 144, 0.45), transparent 58%),
        radial-gradient(ellipse 50% 40% at 12% 80%, rgba(94, 234, 212, 0.12), transparent 55%),
        linear-gradient(180deg, #06080b 0%, #0a1218 55%, #06080b 100%);
}

.mx-hero-grid {
    position: absolute;
    inset: 0;
    opacity: 0.2;
    background-image:
        linear-gradient(rgba(232, 238, 242, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(232, 238, 242, 0.07) 1px, transparent 1px);
    background-size: 8.333vw 8.333vw;
    mask-image: linear-gradient(to bottom, #000 18%, transparent 88%);
}

.mx-hero-beam {
    position: absolute;
    border-radius: 50%;
    filter: blur(64px);
    pointer-events: none;
}

.mx-hero-beam--a {
    top: -12%;
    right: -6%;
    width: 48vw;
    height: 48vw;
    background: rgba(14, 116, 144, 0.5);
    animation: mx-drift 16s ease-in-out infinite alternate;
}

.mx-hero-beam--b {
    bottom: 0;
    left: -10%;
    width: 36vw;
    height: 36vw;
    background: rgba(94, 234, 212, 0.16);
    animation: mx-drift 20s ease-in-out infinite alternate-reverse;
}

.mx-hero-routes {
    position: absolute;
    inset: 18% 8% 22% 42%;
    opacity: 0.55;
    background:
        linear-gradient(115deg, transparent 0%, transparent 46%, rgba(94, 234, 212, 0.35) 47%, transparent 48%),
        linear-gradient(155deg, transparent 0%, transparent 52%, rgba(14, 116, 144, 0.55) 53%, transparent 54%),
        linear-gradient(95deg, transparent 0%, transparent 62%, rgba(94, 234, 212, 0.22) 63%, transparent 64%);
    mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 20%, transparent 75%);
    animation: mx-pulse 5.5s ease-in-out infinite alternate;
}

@keyframes mx-drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(-3%, 5%, 0) scale(1.07); }
}

@keyframes mx-pulse {
    from { opacity: 0.35; }
    to { opacity: 0.7; }
}

.mx-hero-meta {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: auto;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mx-mute);
}

.mx-hero-copy {
    max-width: min(36rem, 100%);
    padding-bottom: 28px;
}

.mx-brand {
    margin: 0 0 12px;
    font-size: clamp(14px, 1.6vw, 18px);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--mx-accent);
}

.mx-hero h1 {
    margin: 0;
    font-size: clamp(52px, 11vw, 148px);
    font-weight: 400;
    letter-spacing: -0.06em;
    line-height: 0.88;
    animation: mx-rise 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.mx-lede {
    margin: 22px 0 0;
    max-width: 30ch;
    font-size: clamp(16px, 1.7vw, 20px);
    line-height: 1.45;
    color: var(--mx-mute);
    text-wrap: pretty;
    animation: mx-rise 1s 0.12s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.mx-scope {
    margin: 18px 0 0;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(242, 241, 236, 0.4);
    animation: mx-rise 1s 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes mx-rise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
}

.mx-scroll {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 36px;
    font-size: 13px;
    color: var(--mx-ink);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.mx-scroll:hover {
    color: var(--mx-accent);
    border-bottom-color: var(--mx-accent);
}

.mx-scroll i {
    font-style: normal;
}

/* —— Story —— */
.mx-story {
    background: var(--mx-ink);
    color: var(--mx-bg);
}

.mx-flow,
.mx-body {
    padding: 88px var(--pad);
}

.mx-section-head {
    max-width: 34em;
    margin-bottom: 56px;
}

.mx-eyebrow {
    display: block;
    margin-bottom: 14px;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(10, 10, 10, 0.45);
}

.mx-section-head h2,
.mx-block h2 {
    margin: 0 0 16px;
    font-size: clamp(28px, 4.2vw, 48px);
    font-weight: 400;
    letter-spacing: -0.04em;
    line-height: 1.05;
}

.mx-section-head p {
    margin: 0;
    font-size: 17px;
    line-height: 1.5;
    color: rgba(10, 10, 10, 0.62);
}

.mx-flow-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid rgba(10, 10, 10, 0.16);
}

.mx-flow-steps li {
    padding: 32px 28px 40px;
    border-right: 1px solid rgba(10, 10, 10, 0.12);
}

.mx-flow-steps li:first-child {
    padding-left: 0;
}

.mx-flow-steps li:last-child {
    border-right: 0;
    padding-right: 0;
}

.mx-flow-steps span {
    display: block;
    margin-bottom: 18px;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: rgba(10, 10, 10, 0.4);
}

.mx-flow-steps strong {
    display: block;
    margin-bottom: 10px;
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.03em;
}

.mx-flow-steps p {
    margin: 0;
    font-size: 15px;
    line-height: 1.45;
    color: rgba(10, 10, 10, 0.62);
}

.mx-body {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(220px, 0.55fr);
    gap: 64px;
    border-top: 1px solid rgba(10, 10, 10, 0.12);
}

.mx-block + .mx-block {
    margin-top: 56px;
    padding-top: 56px;
    border-top: 1px solid rgba(10, 10, 10, 0.1);
}

.mx-block p {
    margin: 0 0 14px;
    font-size: 17px;
    line-height: 1.55;
    color: rgba(10, 10, 10, 0.78);
}

.mx-block ul {
    margin: 8px 0 18px;
    padding-left: 1.15em;
}

.mx-block li {
    margin-bottom: 8px;
    font-size: 16px;
    line-height: 1.45;
    color: rgba(10, 10, 10, 0.78);
}

.mx-aside {
    position: sticky;
    top: 108px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding-top: 4px;
}

.mx-aside h3 {
    margin: 0 0 8px;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(10, 10, 10, 0.4);
}

.mx-aside p {
    margin: 0;
    font-size: 15px;
    line-height: 1.45;
}

.mx-aside a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid rgba(10, 10, 10, 0.25);
}

.mx-aside a:hover {
    border-bottom-color: #0e7490;
    color: #0e7490;
}

.mx-aside i {
    font-style: normal;
}

.mx-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.mx-tags span {
    font-size: 13px;
    color: rgba(10, 10, 10, 0.7);
}

.mx-contact {
    position: relative;
    min-height: unset;
    padding: clamp(96px, 12vw, 168px) var(--pad) clamp(88px, 10vw, 140px);
    color: var(--mx-ink);
    background: var(--mx-bg);
    overflow: hidden;
    isolation: isolate;
}

.mx-contact .eyebrow,
.mx-contact h2 {
    color: var(--mx-ink);
}

.mx-contact h2 {
    max-width: 14ch;
    margin: clamp(22px, 3vh, 36px) 0 clamp(40px, 7vh, 88px);
    font-size: clamp(42px, 7.2vw, 120px);
    font-weight: 400;
    letter-spacing: -0.055em;
    line-height: 0.92;
}

.case-mx-page .site-footer {
    padding-top: clamp(56px, 7vw, 88px);
    padding-bottom: clamp(40px, 5vw, 64px);
}

@media (max-width: 960px) {
    .mx-flow-steps {
        grid-template-columns: 1fr 1fr;
    }

    .mx-flow-steps li:nth-child(2) {
        border-right: 0;
        padding-right: 0;
    }

    .mx-flow-steps li:nth-child(1),
    .mx-flow-steps li:nth-child(2) {
        border-bottom: 1px solid rgba(10, 10, 10, 0.12);
        padding-bottom: 24px;
    }

    .mx-body {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .mx-aside {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
}

@media (max-width: 640px) {
    .mx-hero {
        padding-top: 108px;
        padding-bottom: 36px;
    }

    .mx-flow,
    .mx-body {
        padding: 56px var(--pad);
    }

    .mx-flow-steps {
        grid-template-columns: 1fr;
    }

    .mx-flow-steps li {
        border-right: 0;
        border-bottom: 1px solid rgba(10, 10, 10, 0.12);
        padding: 22px 0;
    }

    .mx-flow-steps li:last-child {
        border-bottom: 0;
    }

    .mx-aside {
        grid-template-columns: 1fr;
    }
}
@media (prefers-reduced-motion: reduce) {
    .mx-hero-beam--a,
    .mx-hero-beam--b,
    .mx-hero-routes,
    .mx-hero h1,
    .mx-lede,
    .mx-scope {
        animation: none;
    }
}
