/* =========================================================================
   Magma Solutions — "Deep Space + Code" design system
   Background #07040F → #120A24 · violet #6D28D9 / #8B5CF6 · orange #FF7A18 / #FFA53C
   Glass surfaces on a fixed animated canvas (see index.html) · no white sections
   ========================================================================= */

:root {
    /* colour */
    --mg-bg-0: #07040F;
    --mg-bg-1: #120A24;
    --mg-violet: #6D28D9;
    --mg-violet-2: #8B5CF6;
    --mg-violet-tint: rgba(139, 92, 246, .14);
    --mg-violet-line: rgba(139, 92, 246, .30);
    --mg-orange: #FF7A18;
    --mg-amber: #FFA53C;
    --mg-head: #FFFFFF;
    --mg-text: #C9C3DC;
    --mg-muted: #9C93B8;
    --mg-soft-violet: #D8C7FF;

    /* surfaces */
    --mg-glass: rgba(255, 255, 255, .045);
    --mg-glass-2: rgba(255, 255, 255, .07);
    --mg-line: rgba(255, 255, 255, .09);
    --mg-line-strong: rgba(255, 255, 255, .16);

    /* geometry */
    --mg-radius: 18px;
    --mg-radius-sm: 8px;
    --mg-radius-btn: 12px;
    --mg-max: 1200px;
    --mg-max-wide: 1560px;
    --mg-gap: 24px;
    --mg-pad-y: 64px;
    --mg-card-pad: 28px;

    /* elevation */
    --mg-shadow: 0 18px 48px rgba(0, 0, 0, .42);
    --mg-shadow-lg: 0 30px 80px rgba(0, 0, 0, .55);
    --mg-glow-violet: 0 18px 50px rgba(109, 40, 217, .32);
    --mg-glow-orange: 0 14px 34px rgba(255, 122, 24, .30);

    /* motion */
    --mg-ease: cubic-bezier(.4, 0, .2, 1);
    --mg-t: .2s var(--mg-ease);

    /* type */
    --mg-arabic: "Cairo", "Noto Kufi Arabic", Tahoma, Arial, sans-serif;
    --mg-display: "Montserrat", "Open Sans", "Cairo", "Noto Kufi Arabic", Tahoma, Arial, sans-serif;
    --mg-body: "Open Sans", "Cairo", "Noto Kufi Arabic", Tahoma, Arial, sans-serif;
    --mg-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

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

html {
    background: var(--mg-bg-0);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--mg-body);
    font-size: 17px;
    line-height: 1.7;
    color: var(--mg-text);
    background: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body,
.mg-container,
.mg-card,
.mg-slide {
    overflow-wrap: break-word;
}

main {
    display: block;
}

img {
    max-width: 100%;
}

h1,
h2,
h3,
h4 {
    font-family: var(--mg-display);
    color: var(--mg-head);
    margin: 0;
    font-weight: 700;
    letter-spacing: -.01em;
}

a {
    color: var(--mg-soft-violet);
}

::selection {
    background: rgba(255, 122, 24, .28);
    color: #FFFFFF;
}

:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--mg-orange);
    outline-offset: 3px;
}

.mg-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ======================================================= animated backdrop */

.mg-space {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
    background:
        radial-gradient(120% 80% at 50% -20%, #1A0F33 0%, rgba(18, 10, 36, 0) 60%),
        linear-gradient(180deg, #07040F 0%, #120A24 52%, #07040F 100%);
}

.mg-space canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.mg-nebula {
    position: absolute;
    inset: -10%;
}

.mg-nebula span {
    position: absolute;
    display: block;
    border-radius: 50%;
    opacity: .16;
    will-change: transform;
}

.mg-nebula span:nth-child(1) {
    width: 60vw;
    height: 60vw;
    min-width: 460px;
    min-height: 460px;
    left: -14vw;
    top: -16vh;
    background: radial-gradient(circle at 50% 50%, rgba(109, 40, 217, .95) 0%, rgba(109, 40, 217, .35) 42%, rgba(109, 40, 217, 0) 72%);
    animation: mgNebA 72s linear infinite alternate;
}

.mg-nebula span:nth-child(2) {
    width: 46vw;
    height: 46vw;
    min-width: 360px;
    min-height: 360px;
    right: -12vw;
    top: 22vh;
    background: radial-gradient(circle at 50% 50%, rgba(255, 122, 24, .85) 0%, rgba(255, 122, 24, .28) 44%, rgba(255, 122, 24, 0) 72%);
    opacity: .12;
    animation: mgNebB 88s linear infinite alternate;
}

.mg-nebula span:nth-child(3) {
    width: 54vw;
    height: 54vw;
    min-width: 400px;
    min-height: 400px;
    left: 18vw;
    bottom: -28vh;
    background: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, .85) 0%, rgba(139, 92, 246, .26) 46%, rgba(139, 92, 246, 0) 74%);
    opacity: .14;
    animation: mgNebC 64s linear infinite alternate;
}

@keyframes mgNebA {
    from {
        transform: translate3d(0, 0, 0) scale(1);
    }

    to {
        transform: translate3d(6vw, 5vh, 0) scale(1.14);
    }
}

@keyframes mgNebB {
    from {
        transform: translate3d(0, 0, 0) scale(1.08);
    }

    to {
        transform: translate3d(-7vw, -6vh, 0) scale(.94);
    }
}

@keyframes mgNebC {
    from {
        transform: translate3d(0, 0, 0) scale(.96);
    }

    to {
        transform: translate3d(-5vw, -9vh, 0) scale(1.12);
    }
}

/* -------------------------------------------- tech motifs (same palette) */

/* purely decorative: hidden from assistive tech and crawlers (the wrapper and
   each motif carry aria-hidden), not clickable, never selectable text */
.mg-tech-grid,
.mg-tech-circuit,
.mg-tech-code {
    position: absolute;
    inset: 0;
    display: block;
    pointer-events: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* very faint blueprint grid, faded out towards the bottom */
.mg-tech-grid {
    background-image:
        linear-gradient(rgba(139, 92, 246, .10) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, .10) 1px, transparent 1px);
    background-size: 72px 72px;
    opacity: .5;
    -webkit-mask-image: radial-gradient(130% 100% at 50% 0%, #000 0%, rgba(0, 0, 0, .4) 58%, transparent 94%);
    mask-image: radial-gradient(130% 100% at 50% 0%, #000 0%, rgba(0, 0, 0, .4) 58%, transparent 94%);
}

/* thin circuit traces with connected nodes and a slow drifting glow */
.mg-tech-circuit {
    width: 100%;
    height: 100%;
    opacity: .85;
}

.mg-tech-circuit .mg-trace {
    fill: none;
    stroke-width: 1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mg-tech-circuit .mg-trace--v {
    stroke: rgba(139, 92, 246, .22);
}

.mg-tech-circuit .mg-trace--o {
    stroke: rgba(255, 122, 24, .16);
}

.mg-tech-circuit .mg-flow {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 26 420;
}

.mg-tech-circuit .mg-flow--v {
    stroke: rgba(196, 181, 253, .55);
    animation: mgTraceFlow 26s linear infinite;
}

.mg-tech-circuit .mg-flow--o {
    stroke: rgba(255, 165, 60, .5);
    animation: mgTraceFlow 34s linear infinite reverse;
}

.mg-tech-circuit .mg-node {
    fill: rgba(139, 92, 246, .38);
    transform-box: fill-box;
    transform-origin: center;
    animation: mgNodePulse 9s ease-in-out infinite;
}

.mg-tech-circuit .mg-node--o {
    fill: rgba(255, 122, 24, .42);
    animation-duration: 12s;
    animation-delay: -3s;
}

.mg-tech-circuit .mg-node:nth-of-type(2n) {
    animation-delay: -5s;
}

.mg-tech-circuit .mg-node:nth-of-type(3n) {
    animation-delay: -8s;
}

@keyframes mgTraceFlow {
    from {
        stroke-dashoffset: 446;
    }

    to {
        stroke-dashoffset: 0;
    }
}

@keyframes mgNodePulse {

    0%,
    100% {
        opacity: .45;
        transform: scale(.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.15);
    }
}

/* faint binary columns, drifting slowly */
.mg-tech-code {
    overflow: hidden;
}

.mg-tech-code span {
    position: absolute;
    top: -22%;
    display: block;
    writing-mode: vertical-rl;
    font-family: var(--mg-mono);
    font-size: 12px;
    line-height: 1;
    letter-spacing: .46em;
    color: rgba(139, 92, 246, .26);
    will-change: transform;
    animation: mgCodeDrift 38s ease-in-out infinite alternate;
}

.mg-tech-code span:nth-child(2n) {
    color: rgba(255, 122, 24, .18);
    animation-duration: 52s;
}

.mg-tech-code span:nth-child(1) {
    left: 5%;
    animation-delay: -6s;
}

.mg-tech-code span:nth-child(2) {
    left: 13%;
    top: 8%;
    font-size: 11px;
    animation-delay: -18s;
}

.mg-tech-code span:nth-child(3) {
    left: 23%;
    top: -6%;
    font-size: 10px;
    opacity: .7;
    animation-delay: -27s;
}

.mg-tech-code span:nth-child(4) {
    left: 78%;
    top: 4%;
    animation-delay: -12s;
}

.mg-tech-code span:nth-child(5) {
    left: 88%;
    top: -10%;
    font-size: 11px;
    animation-delay: -22s;
}

.mg-tech-code span:nth-child(6) {
    left: 94%;
    top: 14%;
    font-size: 10px;
    opacity: .65;
}

/* the digits are generated here, so they are never document text */
.mg-tech-code span:nth-child(1)::before {
    content: "01001101";
}

.mg-tech-code span:nth-child(2)::before {
    content: "101100101";
}

.mg-tech-code span:nth-child(3)::before {
    content: "0110100";
}

.mg-tech-code span:nth-child(4)::before {
    content: "11001010";
}

.mg-tech-code span:nth-child(5)::before {
    content: "01011001";
}

.mg-tech-code span:nth-child(6)::before {
    content: "1010010";
}

@keyframes mgCodeDrift {
    from {
        transform: translate3d(0, 0, 0);
    }

    to {
        transform: translate3d(0, 18vh, 0);
    }
}

/* ================================================================ layout */

.mg-container {
    width: 100%;
    max-width: var(--mg-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* wide container for the header bar and the footer row */
.mg-container--wide {
    max-width: var(--mg-max-wide);
    padding-left: clamp(20px, 3.4vw, 56px);
    padding-right: clamp(20px, 3.4vw, 56px);
}

.mg-section {
    position: relative;
    padding: var(--mg-pad-y) 0;
}

.mg-section--tight {
    padding: 48px 0 var(--mg-pad-y);
}

.mg-section--band {
    border-top: 1px solid var(--mg-line);
    border-bottom: 1px solid var(--mg-line);
    background: linear-gradient(180deg, rgba(139, 92, 246, .05) 0%, rgba(139, 92, 246, 0) 60%);
}

/* ============================================================ typography */

.mg-kicker,
.mg-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mg-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--mg-orange);
    margin: 0;
}

.mg-kicker::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--mg-orange);
    box-shadow: 0 0 10px rgba(255, 122, 24, .8);
}

.mg-h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.02em;
    color: var(--mg-head);
}

.mg-h2 {
    font-size: clamp(1.6rem, 2.8vw, 2.3rem);
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -.015em;
    color: var(--mg-head);
}

.mg-h3 {
    font-size: clamp(1.15rem, 1.6vw, 1.35rem);
    font-weight: 700;
    line-height: 1.3;
    color: var(--mg-head);
}

.mg-lead {
    margin: 16px 0 0;
    font-size: 17px;
    line-height: 1.7;
    color: var(--mg-text);
    max-width: 62ch;
}

.mg-rule {
    display: block;
    width: 84px;
    height: 2px;
    margin: 20px 0 0;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--mg-orange) 0%, rgba(139, 92, 246, .85) 55%, rgba(139, 92, 246, 0) 100%);
}

.mg-rule--center {
    margin-left: auto;
    margin-right: auto;
}

/* =========================================================== section head */

.mg-sec-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.mg-sec-head-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.mg-sec-head-main .mg-h2 {
    margin-top: 12px;
}

.mg-see-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font-size: 13px;
    font-weight: 700;
    color: var(--mg-soft-violet);
    text-decoration: none;
    letter-spacing: .01em;
    border-bottom: 1px solid var(--mg-violet-line);
    padding: 4px 2px;
    transition: color var(--mg-t), border-color var(--mg-t);
}

.mg-see-all:hover {
    color: var(--mg-orange);
    border-bottom-color: rgba(255, 122, 24, .6);
}

.mg-see-all .mg-arr {
    transition: transform var(--mg-t);
}

.mg-see-all:hover .mg-arr {
    transform: translateX(4px);
}

/* ================================================================ buttons */

.mg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 46px;
    padding: 13px 24px;
    border: 1px solid transparent;
    border-radius: var(--mg-radius-btn);
    font-family: var(--mg-body);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .01em;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--mg-t), box-shadow var(--mg-t), background var(--mg-t), border-color var(--mg-t), color var(--mg-t);
}

.mg-btn--primary,
.mg-btn--orange {
    background-color: #FF7A18;
    background-image: linear-gradient(135deg, #FF7A18 0%, #FFA53C 100%);
    color: #180A2B;
    box-shadow: var(--mg-glow-orange);
}

.mg-btn--primary:hover,
.mg-btn--orange:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 44px rgba(255, 122, 24, .42);
    color: #180A2B;
}

.mg-btn--purple {
    background: linear-gradient(135deg, var(--mg-violet) 0%, var(--mg-violet-2) 100%);
    color: #FFFFFF;
    box-shadow: var(--mg-glow-violet);
}

.mg-btn--purple:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 50px rgba(109, 40, 217, .45);
    color: #FFFFFF;
}

/* secondary buttons (ghost, and actions that are not open yet): one readable
   treatment — light-violet label, visible 1px violet border, violet fill and
   an orange accent on hover/active. Every state stays well above 4.5:1. */
.mg-btn--ghost,
.mg-btn--off {
    background: rgba(255, 255, 255, .03);
    border-color: rgba(139, 92, 246, .45);
    color: var(--mg-soft-violet);
}

.mg-btn--ghost:hover,
.mg-btn--ghost:active,
.mg-btn--off:hover,
.mg-btn--off:active {
    background: rgba(109, 40, 217, .26);
    border-color: rgba(255, 122, 24, .55);
    color: var(--mg-amber);
}

.mg-btn--ghost:hover,
.mg-btn--ghost:active {
    transform: translateY(-2px);
}

.mg-btn--lg {
    min-height: 54px;
    padding: 16px 32px;
    font-size: 15px;
}

.mg-btn--sm {
    min-height: 42px;
    padding: 10px 18px;
    font-size: 13px;
}

.mg-btn--off {
    cursor: default;
    box-shadow: none;
}

.mg-btn--off:hover,
.mg-btn--off:active {
    transform: none;
}

/* ================================================================= header */

nav {
    position: sticky;
    top: 0;
    z-index: 90;
    display: block;
}

.mg-header {
    background: rgba(7, 4, 15, .58);
    border-bottom: 1px solid var(--mg-line);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    backdrop-filter: blur(10px) saturate(120%);
    transition: background var(--mg-t), box-shadow var(--mg-t), border-color var(--mg-t);
}

.mg-scrolled .mg-header {
    background: rgba(7, 4, 15, .92);
    border-bottom-color: rgba(255, 255, 255, .12);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .5);
}

/* compact bar: the height is the bar's only vertical measure, so it carries the
   "less padding" of the client's request (80 / 72 -> 66 / 60, about 17% less).
   The logo file keeps its own 44px height and stays vertically centred here. */
.mg-header-in {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 26px;
    height: 66px;
    transition: height var(--mg-t);
}

.mg-scrolled .mg-header-in {
    height: 60px;
}

.mg-brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 44px;
    text-decoration: none;
    color: #FFFFFF;
}

/* brand lockup straight on the dark bar: white / transparent, no plate,
   no box, no shadow behind it */
.mg-logo {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    line-height: 1;
    font-family: var(--mg-display);
    white-space: nowrap;
    text-shadow: none;
}

.mg-logo-word {
    color: #FFFFFF;
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .05em;
}

.mg-logo-sub {
    margin-top: 6px;
    color: var(--mg-orange);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .3em;
}

/* logo files (original in the header / drawer / code panel, white in the
   footer) drop straight onto the dark surface: no white plate, no padding,
   no box, no shadow behind them */
.mg-logo-img {
    display: block;
    height: 44px;
    width: auto;
    max-width: 100%;
    background: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    object-fit: contain;
}

.mg-logo-img--head {
    height: 44px;
}

.mg-logo-img--drawer {
    height: 34px;
}

.mg-logo--drawer .mg-logo-word {
    font-size: 21px;
}

.mg-logo--drawer .mg-logo-sub {
    font-size: 9px;
    margin-top: 5px;
}

.mg-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-width: 0;
    gap: clamp(24px, 2.5vw, 35px);
}

.mg-nav-item {
    display: inline-flex;
    align-items: center;
}

.mg-navlink {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 2px;
    font-family: var(--mg-body);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--mg-text);
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--mg-t);
}

.mg-navlink:hover,
.mg-navlink.on,
.mg-navlink.active {
    color: #FFFFFF;
}

.mg-navlink.on::after,
.mg-navlink.active::after {
    content: "";
    position: absolute;
    left: 2px;
    right: 2px;
    bottom: 7px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--mg-orange), var(--mg-amber));
    box-shadow: 0 0 12px rgba(255, 122, 24, .7);
}

.mg-header-end {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 12px;
}

.mg-cta-pill {
    margin-left: 4px;
}

/* the orange pill in the bar only, a touch smaller than .mg-btn--sm;
   the footer's small button keeps its own size */
.mg-header-cta {
    min-height: 38px;
    padding: 8px 15px;
    font-size: 12px;
}

.mg-burger {
    display: none;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    padding: 0;
    border: 1px solid var(--mg-line-strong);
    border-radius: 12px;
    background: rgba(255, 255, 255, .05);
    color: #FFFFFF;
    cursor: pointer;
    place-items: center;
}

.mg-burger-lines {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.mg-burger-lines i {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

.mg-burger-x {
    font-size: 21px;
    line-height: 1;
    font-weight: 600;
}

.mg-scrim {
    position: fixed;
    inset: 0;
    background: rgba(7, 4, 15, .7);
    opacity: 0;
    pointer-events: none;
    transition: opacity .24s var(--mg-ease);
    z-index: 105;
}

.mg-scrim.open {
    opacity: 1;
    pointer-events: auto;
}

.mg-drawer {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: flex;
    flex-direction: column;
    padding: 16px 22px 40px;
    background:
        radial-gradient(120% 60% at 100% 0%, rgba(109, 40, 217, .38), rgba(7, 4, 15, 0) 60%),
        linear-gradient(180deg, #0B0618 0%, var(--mg-bg-1) 100%);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .24s var(--mg-ease), transform .24s var(--mg-ease), visibility .24s;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mg-drawer.open {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.mg-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--mg-line);
}

.mg-drawer-x {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: grid;
    place-items: center;
    border: 1px solid var(--mg-line-strong);
    border-radius: 12px;
    background: rgba(255, 255, 255, .05);
    color: #FFFFFF;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.mg-drawer-links {
    display: flex;
    flex-direction: column;
    padding: 12px 0 0;
}

.mg-drawer-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 46px;
    padding: 10px 2px;
    font-family: var(--mg-display);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--mg-text);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    transition: color var(--mg-t), padding-left var(--mg-t);
}

.mg-drawer-link.on,
.mg-drawer-link:hover {
    color: #FFFFFF;
    padding-left: 8px;
}

.mg-drawer-link.on {
    border-bottom-color: rgba(255, 122, 24, .45);
}

.mg-drawer-link.on::after {
    content: "→";
    color: var(--mg-orange);
    font-size: 16px;
}

.mg-drawer-cta {
    margin-top: 26px;
    width: 100%;
}

html.mg-menu-open,
html.mg-menu-open body {
    overflow: hidden;
}

/* ============================================================== page hero */

.mg-pagehead {
    position: relative;
    overflow: hidden;
    padding: 40px 0 36px;
    border-bottom: 1px solid var(--mg-line);
    background:
        radial-gradient(85% 130% at 12% -30%, rgba(109, 40, 217, .34), rgba(109, 40, 217, 0) 62%),
        radial-gradient(60% 120% at 92% -40%, rgba(255, 122, 24, .16), rgba(255, 122, 24, 0) 60%);
}

.mg-phero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
}

.mg-phero-main {
    min-width: 0;
}

.mg-phero-main .mg-h1 {
    margin-top: 14px;
}

.mg-phero-aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    flex: 0 0 auto;
    max-width: min(420px, 45%);
    padding-bottom: 4px;
    text-align: right;
}

.mg-count {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--mg-soft-violet);
    background: var(--mg-violet-tint);
    border: 1px solid var(--mg-violet-line);
    border-radius: var(--mg-radius-sm);
    padding: 8px 12px;
}

.mg-crumb {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 100%;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--mg-muted);
}

.mg-crumb .mg-crumb-here {
    display: inline-block;
    max-width: 26ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mg-crumb a {
    color: var(--mg-text);
    text-decoration: none;
    transition: color var(--mg-t);
}

.mg-crumb a:hover {
    color: var(--mg-orange);
}

.mg-crumb .mg-crumb-sep {
    color: rgba(156, 147, 184, .6);
}

.mg-crumb .mg-crumb-here {
    color: var(--mg-soft-violet);
}

/* =================================================================== hero */

.mg-hero {
    position: relative;
    overflow: hidden;
    padding: 52px 0 56px;
    border-bottom: 1px solid var(--mg-line);
}

/* thin glowing grid "horizon" along the top of the hero */
.mg-hero::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    width: min(1400px, 130vw);
    height: 340px;
    transform: translateX(-50%);
    background-image:
        linear-gradient(rgba(139, 92, 246, .16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, .16) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(80% 100% at 50% 0%, #000 0%, rgba(0, 0, 0, .35) 55%, transparent 100%);
    mask-image: radial-gradient(80% 100% at 50% 0%, #000 0%, rgba(0, 0, 0, .35) 55%, transparent 100%);
    pointer-events: none;
}

.mg-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 122, 24, 0) 0%, rgba(255, 122, 24, .55) 22%, rgba(139, 92, 246, .75) 55%, rgba(255, 122, 24, 0) 100%);
    box-shadow: 0 0 26px rgba(139, 92, 246, .55);
    pointer-events: none;
}

.mg-hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
    gap: 56px;
    align-items: center;
}

.mg-hero-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    min-width: 0;
}

.mg-hero-title {
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: -.025em;
    color: var(--mg-head);
    margin: 22px 0 0;
    max-width: 18ch;
}

/* one word of the hero heading in the site's orange accent: inline, so the
   heading keeps its font, size, weight, letter-spacing and line breaks */
.mg-hero-accent {
    color: var(--mg-orange);
}

.mg-hero-body {
    margin: 22px 0 0;
    font-size: 17px;
    line-height: 1.7;
    color: var(--mg-text);
    max-width: 56ch;
}

.mg-hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.mg-hero-marks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
    width: 100%;
    max-width: 100%;
}

.mg-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 7px 11px;
    border-radius: var(--mg-radius-sm);
    border: 1px solid var(--mg-violet-line);
    background: var(--mg-violet-tint);
    color: var(--mg-soft-violet);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    line-height: 1.2;
    white-space: nowrap;
}

/* ------------------------------------------------------ glass code window */

.mg-hero-panel {
    position: relative;
    min-width: 0;
}

.mg-hero-panel::before {
    content: "";
    position: absolute;
    inset: -18% -14% -28% -14%;
    background: radial-gradient(50% 50% at 50% 50%, rgba(139, 92, 246, .38), rgba(139, 92, 246, 0) 70%);
    filter: blur(6px);
    pointer-events: none;
}

/* The card's base. It is opaque, in the one colour the four sides of the box
   paint as well, so the frame at rest, the turning box and the sides that close
   it are all the same dark material. It no longer clips: the turn is clipped by
   the stage inside it, a little wider than the card, and the faces carry the
   card's own rounded corners. */
.mg-code.mg-show {
    background-color: #0B0816;
    background-image:
        radial-gradient(78% 120% at 50% 30%, rgba(139, 92, 246, .26), rgba(139, 92, 246, 0) 72%),
        linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, 0) 45%);
    /* nothing to blur any more, and a backdrop filter would flatten the box */
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    overflow: visible;
}

.mg-code {
    position: relative;
    border-radius: var(--mg-radius);
    border: 1px solid var(--mg-line);
    background: rgba(255, 255, 255, .045);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    backdrop-filter: blur(14px) saturate(120%);
    box-shadow: var(--mg-shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .07);
    overflow: hidden;
}

.mg-code-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--mg-line);
    background: rgba(255, 255, 255, .025);
}

.mg-code-dots {
    display: inline-flex;
    gap: 6px;
    flex: 0 0 auto;
}

.mg-code-dots i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
}

.mg-code-dots i:nth-child(1) {
    background: var(--mg-orange);
}

.mg-code-dots i:nth-child(2) {
    background: var(--mg-amber);
}

.mg-code-dots i:nth-child(3) {
    background: var(--mg-violet-2);
}

.mg-code-title {
    position: relative;
    font-family: var(--mg-mono);
    font-size: 11.5px;
    letter-spacing: .02em;
    color: var(--mg-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mg-code-lines {
    padding: 20px 18px;
    font-family: var(--mg-mono);
    font-size: clamp(11px, 2.4vw, 13px);
    line-height: 1.95;
    color: var(--mg-text);
    overflow: hidden;
}

.mg-code-line {
    display: flex;
    gap: 12px;
    white-space: pre-wrap;
    min-width: 0;
}

.mg-code-line > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.mg-code-n {
    flex: 0 0 2ch;
    color: rgba(156, 147, 184, .5);
    -webkit-user-select: none;
    user-select: none;
}

.mg-code-k {
    color: var(--mg-violet-2);
}

.mg-code-v {
    color: #C4B5FD;
}

.mg-code-o {
    color: var(--mg-amber);
}

.mg-code-s {
    color: #E9DDFF;
}

.mg-code-p {
    color: rgba(201, 195, 220, .72);
}

.mg-code-f {
    color: var(--mg-orange);
}

/* ------------------------------------------------- the code writes itself */

/* Every character keeps its own span from the first frame: hidden with
   visibility (not display), so the card is already as tall as the finished
   code and nothing jumps, reflows or resizes while it types. Line numbers wait
   for the first character of their line. */
.mg-code-typing .mg-code-line > span,
.mg-code-typing .mg-ch {
    position: relative;
}

.mg-code-typing .mg-ch {
    visibility: hidden;
}

.mg-code-typing .mg-ch.is-on {
    visibility: visible;
}

.mg-code-typing .mg-code-n {
    visibility: hidden;
}

.mg-code-typing .mg-code-n.is-on {
    visibility: visible;
}

/* the caret is a thin accent bar (never a real text cursor); it sits inside the
   character it follows, so it costs no layout and moves with the typing */
.mg-code-caret {
    position: absolute;
    left: 100%;
    top: .06em;
    width: 2px;
    height: 1.1em;
    margin-left: 1px;
    border-radius: 1px;
    background: var(--mg-orange);
    -webkit-box-shadow: 0 0 6px rgba(255, 122, 26, .55);
    box-shadow: 0 0 6px rgba(255, 122, 26, .55);
    pointer-events: none;
    -webkit-animation: mgCodeCaretBlink 1.06s steps(1, end) infinite;
    animation: mgCodeCaretBlink 1.06s steps(1, end) infinite;
}

.mg-code-caret--start {
    left: 0;
    margin-left: 0;
}

@-webkit-keyframes mgCodeCaretBlink {

    0%,
    45% {
        opacity: 1;
    }

    46%,
    100% {
        opacity: 0;
    }
}

@keyframes mgCodeCaretBlink {

    0%,
    45% {
        opacity: 1;
    }

    46%,
    100% {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {

    .mg-code-caret {
        display: none;
        -webkit-animation: none;
        animation: none;
    }
}

.mg-code-mark {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 18px;
    border-top: 1px solid var(--mg-line);
    background: rgba(255, 255, 255, .03);
}

.mg-code-wordmark {
    display: flex;
    flex-direction: column;
    line-height: 1;
    font-family: var(--mg-display);
    font-weight: 800;
    font-size: 17px;
    letter-spacing: .04em;
    color: var(--mg-head);
}

.mg-code-wordmark span {
    font-size: 9px;
    letter-spacing: .3em;
    color: var(--mg-orange);
    margin-top: 5px;
}

.mg-code-badge {
    font-family: var(--mg-mono);
    font-size: 11px;
    color: var(--mg-muted);
    border: 1px solid var(--mg-line);
    border-radius: var(--mg-radius-sm);
    padding: 4px 8px;
    white-space: nowrap;
}

/* ================================================ hero showcase (3D box turn)
   The card is a closed box seen through its front. Each side is a whole card —
   the title bar with its three dots and its own file name, the screen, and the
   bottom bar with the MAGMA logo and the two dots and chevrons — painted on its
   own OPAQUE dark base, and the box is closed by two plain dark sides, so its
   interior is never seen and no face is ever faded or switched off.

   The box is a four-sided prism about the vertical axis: four sides 90deg apart
   at radius R = half the card's measured width (set from the page), so each
   side is exactly as wide as the card and they meet at the corners. The box is
   pushed back by R with translateZ(-R), so the side on show — which stands R in
   front of the axis — lands exactly in the card's plane: at rest the card is the
   same size, in the same place, with no scale at all.

   A step turns the whole box 90deg about its own centre (not about an edge),
   so the card is seen going away in perspective, its far edge shrinking, while
   the next side comes round from the far side and lands flat: the near corner
   passes toward the viewer, and the 1500px perspective keeps that swell gentle.
   The sides are all opaque with their backs hidden, so at every angle of the
   turn exactly the sides facing the viewer are drawn.

   Side 1 is in the flow and sets the one height the card has at every width;
   the other three sides cover exactly that same box, so the hero is as tall on
   either side and nothing below it can move — at rest or during a turn. */

.mg-show-stage {
    position: relative;
    -webkit-perspective: 1500px;
    perspective: 1500px;
    -webkit-perspective-origin: 50% 50%;
    perspective-origin: 50% 50%;
    /* The one cut in the turn, and it is deliberately wider than the card: the
       negative margins, cancelled by the same padding, push the clip 18px past
       the card on every side, so the box keeps its swell and neither its near
       corner nor its sides are sliced flat against the card's frame, while the
       turn still cannot reach the hero copy around it or add a sideways scroll
       on a phone. */
    margin: -18px;
    padding: 18px;
    overflow: hidden;
}

/* The turning box: a four-sided prism about the vertical axis, its four sides
   90deg apart at radius --mg-show-r (half the card's measured width, set from
   the page), so each side is exactly as wide as the card and they meet at the
   corners. translateZ(-r) — written before the turn, so it is applied after it,
   as the box's own push-back — puts the box back by its radius: the side on show
   stands one radius in front of the axis, so it lands exactly in the card's
   plane, same size, same place, no scale. Nothing is hinged on an edge: the
   whole box turns about its centre. */
.mg-show-cube {
    position: relative;
    height: 100%;
    --mg-show-r: 180px;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    -webkit-transform: translateZ(calc(-1 * var(--mg-show-r))) rotateY(0deg);
    transform: translateZ(calc(-1 * var(--mg-show-r))) rotateY(0deg);
    -webkit-transition: -webkit-transform 780ms cubic-bezier(.65, .02, .25, 1);
    transition: transform 780ms cubic-bezier(.65, .02, .25, 1);
}

/* One side of the box, and on the two content sides a whole card: the title bar
   with its three dots and this side's file name, the screen, and the bottom bar
   with the logo and the dots and chevrons — all painted on an OPAQUE dark base,
   so nothing of another side can ever be seen through it. --mg-show-a is the
   side's angle round the box (0 = facing the viewer, then 90, 180, 270). Every
   side hides its back: at every angle of the turn exactly the sides that face
   the viewer are drawn. */
.mg-show-face {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: calc(var(--mg-radius) - 1px);
    overflow: hidden;
    background-color: #0B0816;
    background-image:
        radial-gradient(78% 120% at 50% 30%, rgba(139, 92, 246, .26), rgba(139, 92, 246, 0) 72%),
        linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, 0) 45%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: rotateY(var(--mg-show-a, 0deg)) translateZ(var(--mg-show-r));
    transform: rotateY(var(--mg-show-a, 0deg)) translateZ(var(--mg-show-r));
}

/* side 1 is the side in the flow, so it alone decides how tall the card is on
   every width; the other three cover exactly that same box */
.mg-show-face--campaign,
.mg-show-face--back,
.mg-show-face--left {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

/* the two plain dark sides that close the box, so its hollow interior is never
   seen — no figures, no chrome, just the card's own colour */
.mg-show-face--back,
.mg-show-face--left {
    background-image: none;
}

/* where each side waits round the box (the page re-assigns all four angles on
   every change; these are the resting angles, so nothing stacks at the front
   before the page has painted) */
.mg-show-face--campaign {
    --mg-show-a: 90deg;
}

.mg-show-face--back {
    --mg-show-a: 180deg;
}

.mg-show-face--left {
    --mg-show-a: 270deg;
}

/* the screen area of a face: the code block sits in it, the console fills it
   (the console is that same element, so its own height is the flexed one) */
.mg-show-face .mg-show-screen {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    overflow: hidden;
}

/* a forward step turns the box -90deg about its centre, so the side standing on
   its right comes round to the front; a step back turns it the other way */
.mg-show-cube.flip-next {
    -webkit-transform: translateZ(calc(-1 * var(--mg-show-r))) rotateY(-90deg);
    transform: translateZ(calc(-1 * var(--mg-show-r))) rotateY(-90deg);
}

.mg-show-cube.flip-prev {
    -webkit-transform: translateZ(calc(-1 * var(--mg-show-r))) rotateY(90deg);
    transform: translateZ(calc(-1 * var(--mg-show-r))) rotateY(90deg);
}

/* the moment the turn ends: the box goes back to 0 and the four sides take
   their new angles in the same frame — is-snap stops that swap from animating,
   so the landing is exactly flat and the resting state never depends on where
   the turn was */
.mg-show-cube.is-snap {
    -webkit-transition: none !important;
    transition: none !important;
}

/* ------------------------------------------------------------- the control */

.mg-code-brand {
    display: flex;
    align-items: center;
    min-width: 0;
}

/* two dots and two chevrons in one small control: nothing else round in it, so
   it always reads as two illustrations */
.mg-show-ctrl {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 8px;
    border: 1px solid var(--mg-line);
    border-radius: var(--mg-radius-sm);
    background: rgba(255, 255, 255, .03);
}

.mg-show-dot {
    -webkit-appearance: none;
    appearance: none;
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(156, 147, 184, .34);
    cursor: pointer;
    transition: background .3s ease, box-shadow .3s ease;
}

.mg-show-dot:hover {
    background: rgba(201, 195, 220, .7);
}

.mg-show-dot.is-on {
    background: var(--mg-orange);
    box-shadow: 0 0 8px rgba(255, 122, 26, .7);
}

.mg-show-nav {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: none;
    color: var(--mg-muted);
    line-height: 0;
    cursor: pointer;
    transition: color .25s ease, background .25s ease;
}

.mg-show-nav svg {
    display: block;
}

.mg-show-nav:hover {
    color: var(--mg-orange);
    background: rgba(255, 255, 255, .06);
}

.mg-show-dot:focus-visible,
.mg-show-nav:focus-visible {
    outline: 1px solid var(--mg-orange);
    outline-offset: 2px;
}

/* ------------------------------------------------- slide 2: the console */

.mg-camp {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    min-height: 0;
    padding: 20px 18px;
    font-family: var(--mg-mono);
}

.mg-camp-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    flex: 0 0 auto;
    font-size: 9.5px;
    line-height: 1.2;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--mg-muted);
}

.mg-camp-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.mg-camp-legend i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--mg-orange);
    box-shadow: 0 0 8px rgba(255, 122, 26, .6);
}

.mg-camp-legend span:nth-child(2) i {
    background: var(--mg-violet-2);
    box-shadow: 0 0 8px rgba(139, 92, 246, .6);
}

.mg-camp-legend span:nth-child(3) i {
    background: var(--mg-amber);
    box-shadow: 0 0 8px rgba(255, 165, 60, .55);
}

.mg-camp-plot {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.mg-camp-chart {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.mg-camp-grid line {
    stroke: rgba(255, 255, 255, .07);
    stroke-width: 1;
}

/* the trend line: drawn left to right, then held, then redrawn after a short
   fade (6.6s). Without the animation (reduced motion) it is simply drawn. */
.mg-camp-line {
    stroke-dasharray: 100;
    stroke-dashoffset: 0;
    -webkit-filter: drop-shadow(0 0 5px rgba(255, 122, 26, .5));
    filter: drop-shadow(0 0 5px rgba(255, 122, 26, .5));
    -webkit-animation: mgCampDraw 6.6s cubic-bezier(.4, 0, .2, 1) infinite both;
    animation: mgCampDraw 6.6s cubic-bezier(.4, 0, .2, 1) infinite both;
}

.mg-camp-area {
    opacity: .9;
    -webkit-animation: mgCampArea 6.6s cubic-bezier(.4, 0, .2, 1) infinite both;
    animation: mgCampArea 6.6s cubic-bezier(.4, 0, .2, 1) infinite both;
}

@-webkit-keyframes mgCampDraw {
    0% {
        stroke-dashoffset: 100;
        opacity: 0;
    }

    6% {
        opacity: 1;
    }

    40% {
        stroke-dashoffset: 0;
        opacity: 1;
    }

    84% {
        stroke-dashoffset: 0;
        opacity: 1;
    }

    93% {
        stroke-dashoffset: 0;
        opacity: 0;
    }

    94% {
        stroke-dashoffset: 100;
        opacity: 0;
    }

    100% {
        stroke-dashoffset: 100;
        opacity: 0;
    }
}

@keyframes mgCampDraw {
    0% {
        stroke-dashoffset: 100;
        opacity: 0;
    }

    6% {
        opacity: 1;
    }

    40% {
        stroke-dashoffset: 0;
        opacity: 1;
    }

    84% {
        stroke-dashoffset: 0;
        opacity: 1;
    }

    93% {
        stroke-dashoffset: 0;
        opacity: 0;
    }

    94% {
        stroke-dashoffset: 100;
        opacity: 0;
    }

    100% {
        stroke-dashoffset: 100;
        opacity: 0;
    }
}

@-webkit-keyframes mgCampArea {
    0% {
        opacity: 0;
    }

    34% {
        opacity: .9;
    }

    84% {
        opacity: .9;
    }

    93% {
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}

@keyframes mgCampArea {
    0% {
        opacity: 0;
    }

    34% {
        opacity: .9;
    }

    84% {
        opacity: .9;
    }

    93% {
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}

/* small campaign tags: they come in one after another and drift */
.mg-camp-chip {
    position: absolute;
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 122, 26, .3);
    background: rgba(18, 10, 32, .78);
    color: var(--mg-text);
    font-size: 9px;
    line-height: 1.35;
    letter-spacing: .02em;
    white-space: nowrap;
    opacity: .9;
    -webkit-animation: mgCampFloat 6.6s ease-in-out infinite both;
    animation: mgCampFloat 6.6s ease-in-out infinite both;
}

.mg-camp-chip--a {
    top: 0;
    left: 0;
    -webkit-animation-delay: .1s;
    animation-delay: .1s;
}

.mg-camp-chip--b {
    top: 0;
    right: 0;
    -webkit-animation-delay: .95s;
    animation-delay: .95s;
}

.mg-camp-chip--c {
    bottom: 0;
    left: 4%;
    -webkit-animation-delay: 1.8s;
    animation-delay: 1.8s;
}

.mg-camp-chip--d {
    bottom: 0;
    right: 3%;
    -webkit-animation-delay: 2.65s;
    animation-delay: 2.65s;
}

@-webkit-keyframes mgCampFloat {
    0% {
        opacity: 0;
        -webkit-transform: translateY(7px);
        transform: translateY(7px);
    }

    10% {
        opacity: .92;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }

    55% {
        opacity: .92;
        -webkit-transform: translateY(-4px);
        transform: translateY(-4px);
    }

    90% {
        opacity: .9;
        -webkit-transform: translateY(2px);
        transform: translateY(2px);
    }

    100% {
        opacity: 0;
        -webkit-transform: translateY(7px);
        transform: translateY(7px);
    }
}

@keyframes mgCampFloat {
    0% {
        opacity: 0;
        transform: translateY(7px);
    }

    10% {
        opacity: .92;
        transform: translateY(0);
    }

    55% {
        opacity: .92;
        transform: translateY(-4px);
    }

    90% {
        opacity: .9;
        transform: translateY(2px);
    }

    100% {
        opacity: 0;
        transform: translateY(7px);
    }
}

/* small engagement badges, low opacity, popping in and out */
.mg-camp-badge {
    position: absolute;
    display: -webkit-inline-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(255, 122, 26, .34);
    background: rgba(255, 122, 26, .12);
    color: var(--mg-orange);
    opacity: .5;
    pointer-events: none;
    -webkit-animation: mgCampPop 4.4s ease-in-out infinite both;
    animation: mgCampPop 4.4s ease-in-out infinite both;
}

.mg-camp-badge--a {
    top: 26%;
    left: 46%;
    -webkit-animation-delay: .8s;
    animation-delay: .8s;
}

.mg-camp-badge--b {
    top: 60%;
    left: 22%;
    -webkit-animation-delay: 2.4s;
    animation-delay: 2.4s;
}

@-webkit-keyframes mgCampPop {
    0% {
        opacity: 0;
        -webkit-transform: scale(.55);
        transform: scale(.55);
    }

    16% {
        opacity: .5;
        -webkit-transform: scale(1);
        transform: scale(1);
    }

    70% {
        opacity: .4;
        -webkit-transform: scale(1);
        transform: scale(1);
    }

    100% {
        opacity: 0;
        -webkit-transform: scale(.55);
        transform: scale(.55);
    }
}

@keyframes mgCampPop {
    0% {
        opacity: 0;
        transform: scale(.55);
    }

    16% {
        opacity: .5;
        transform: scale(1);
    }

    70% {
        opacity: .4;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(.55);
    }
}

/* the four bars grow one after another, then hold */
.mg-camp-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    flex: 0 0 auto;
    height: clamp(30px, 8vw, 40px);
}

.mg-camp-bar {
    flex: 1 1 0;
    min-width: 0;
    border-radius: 3px 3px 2px 2px;
    background: linear-gradient(180deg, rgba(255, 122, 26, .95), rgba(139, 92, 246, .35));
    transform-origin: 50% 100%;
    -webkit-transform: scaleY(1);
    transform: scaleY(1);
    -webkit-animation: mgCampBar .9s cubic-bezier(.2, .7, .3, 1) both;
    animation: mgCampBar .9s cubic-bezier(.2, .7, .3, 1) both;
}

.mg-camp-bar--1 {
    height: 42%;
    -webkit-animation-delay: .05s;
    animation-delay: .05s;
}

.mg-camp-bar--2 {
    height: 60%;
    -webkit-animation-delay: .22s;
    animation-delay: .22s;
}

.mg-camp-bar--3 {
    height: 78%;
    -webkit-animation-delay: .39s;
    animation-delay: .39s;
}

.mg-camp-bar--4 {
    height: 96%;
    -webkit-animation-delay: .56s;
    animation-delay: .56s;
}

@-webkit-keyframes mgCampBar {
    from {
        -webkit-transform: scaleY(0);
        transform: scaleY(0);
    }

    to {
        -webkit-transform: scaleY(1);
        transform: scaleY(1);
    }
}

@keyframes mgCampBar {
    from {
        transform: scaleY(0);
    }

    to {
        transform: scaleY(1);
    }
}

/* nothing moves while the side is not showing or the hero is off screen */
.mg-show-face:not(.is-active) .mg-anim,
.mg-show.is-idle .mg-anim {
    -webkit-animation-play-state: paused;
    animation-play-state: paused;
}

@media (max-width: 620px) {

    /* a little less room around the turn, so the box never reaches the edge of
       a narrow screen */
    .mg-show-stage {
        margin: -12px;
        padding: 12px;
    }

    .mg-camp {
        gap: 8px;
        padding: 16px 14px;
    }

    .mg-camp-legend {
        gap: 4px 10px;
        font-size: 9px;
    }

    .mg-camp-chip {
        padding: 2px 6px;
        font-size: 8.5px;
    }

    .mg-camp-bars {
        gap: 5px;
    }
}

/* the showcase under "prefers-reduced-motion": no box and no turn — the sides
   simply swap in place (here, and only here, the sides that are not showing are
   hidden, because without the turn the opaque sides would lie on top of one
   another), and nothing loops */
@media (prefers-reduced-motion: reduce) {

    .mg-show-stage {
        margin: 0;
        padding: 0;
        -webkit-perspective: none;
        perspective: none;
    }

    .mg-show-cube,
    .mg-show-cube.flip-next,
    .mg-show-cube.flip-prev {
        -webkit-transform: none !important;
        transform: none !important;
        -webkit-transition: none !important;
        transition: none !important;
    }

    .mg-show-face {
        -webkit-transform: none !important;
        transform: none !important;
        opacity: 0;
        visibility: hidden;
        transition: none;
    }

    .mg-show-face.is-active {
        opacity: 1;
        visibility: visible;
    }

    .mg-anim,
    .mg-show-dot,
    .mg-show-nav {
        -webkit-animation: none !important;
        animation: none !important;
        transition: none;
    }
}

/* ================================================================= grids */

.mg-grid {
    display: grid;
    gap: var(--mg-gap);
    align-items: stretch;
}

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

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

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

/* ================================================================= cards */

.mg-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    border-radius: var(--mg-radius);
    border: 1px solid var(--mg-line);
    background: var(--mg-glass);
    color: inherit;
    text-decoration: none;
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    backdrop-filter: blur(10px) saturate(120%);
    overflow: hidden;
    transition: transform var(--mg-t), border-color var(--mg-t), box-shadow var(--mg-t), background var(--mg-t);
}

.mg-card:hover,
.mg-card:focus-within {
    transform: translateY(-4px);
    border-color: rgba(139, 92, 246, .55);
    box-shadow: 0 22px 60px rgba(0, 0, 0, .48), 0 0 0 1px rgba(139, 92, 246, .18);
}

.mg-card-media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(109, 40, 217, .3), rgba(255, 122, 24, .16));
}

.mg-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--mg-t);
}

.mg-card:hover .mg-card-media img,
.mg-card:focus-within .mg-card-media img {
    transform: scale(1.03);
}

.mg-card-corner {
    position: absolute;
    left: 12px;
    top: 12px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: var(--mg-radius-sm);
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(7, 4, 15, .62);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    font-family: var(--mg-display);
    font-weight: 800;
    font-size: 14px;
    color: var(--mg-amber);
    z-index: 2;
}

.mg-card-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: var(--mg-card-pad);
    flex: 1 1 auto;
}

.mg-card-title {
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.32;
    letter-spacing: -.01em;
    color: var(--mg-head);
    margin: 0;
}

.mg-card-text {
    margin: 0;
    font-size: 15.5px;
    line-height: 1.65;
    color: var(--mg-text);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1 1 auto;
}

.mg-badge,
.mg-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: var(--mg-radius-sm);
    border: 1px solid var(--mg-violet-line);
    background: var(--mg-violet-tint);
    color: var(--mg-soft-violet);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    line-height: 1.35;
}

.mg-date {
    display: inline-flex;
    align-items: center;
    font-family: var(--mg-mono);
    font-size: 11.5px;
    letter-spacing: .04em;
    color: var(--mg-amber);
}

.mg-link-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    min-height: 44px;
    font-size: 13px;
    font-weight: 700;
    color: var(--mg-soft-violet);
    text-decoration: none;
    transition: color var(--mg-t);
}

.mg-link-more .mg-arr {
    transition: transform var(--mg-t);
}

.mg-link-more:hover {
    color: var(--mg-orange);
}

.mg-link-more:hover .mg-arr {
    transform: translateX(4px);
}

.mg-link-more--off {
    color: var(--mg-muted);
    cursor: default;
}

.mg-link-more--off:hover {
    color: var(--mg-muted);
}

.mg-link-more--off:hover .mg-arr {
    transform: none;
}

.mg-arr {
    display: inline-block;
    transition: transform var(--mg-t);
}

.mg-card-body .mg-btn {
    margin-top: 14px;
}

/* ================================================= image / letter placeholders */

.mg-ph {
    width: 100%;
    height: 100%;
    min-height: 100%;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, .92);
    font-family: var(--mg-display);
    font-weight: 800;
    font-size: 42px;
    letter-spacing: .02em;
}

/* service cards: line-art mark on the coloured panel (the letter lives in
   the corner badge only, so it is never printed twice) */
.mg-svc-art {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 100%;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.mg-svc-art::before {
    content: "";
    position: absolute;
    width: 74%;
    max-width: 200px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 122, 24, .30) 0%, rgba(139, 92, 246, .24) 46%, rgba(139, 92, 246, 0) 72%);
    pointer-events: none;
}

.mg-svc-svg {
    position: relative;
    width: 42%;
    min-width: 64px;
    max-width: 112px;
    height: auto;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .38));
    transition: transform var(--mg-t);
}

.mg-card:hover .mg-svc-svg,
.mg-card:focus-within .mg-svc-svg {
    transform: scale(1.04);
}

.mg-ph-0 {
    background: linear-gradient(135deg, #6D28D9, #2A0B52);
}

.mg-ph-1 {
    background: linear-gradient(135deg, #FF7A18, #6D28D9);
}

.mg-ph-2 {
    background: linear-gradient(135deg, #8B5CF6, #241046);
}

.mg-ph-3 {
    background: linear-gradient(135deg, #3B1D74, #120A24);
}

/* ============================================================== skeletons */

.mg-skel {
    border-radius: var(--mg-radius);
    border: 1px solid var(--mg-line);
    background: linear-gradient(90deg, rgba(255, 255, 255, .04) 25%, rgba(255, 255, 255, .09) 37%, rgba(255, 255, 255, .04) 63%);
    background-size: 400% 100%;
    animation: mgShimmer 1.6s ease-in-out infinite;
}

@keyframes mgShimmer {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0 50%;
    }
}

.mg-skel-card {
    height: 360px;
}

.mg-skel-logo {
    height: 170px;
}

.mg-skel-person {
    height: 320px;
}

.mg-skel-value {
    height: 150px;
}

.mg-skel-slide {
    height: 380px;
}

.mg-skel-title {
    height: 46px;
    width: 78%;
    margin-bottom: 18px;
    border-radius: 10px;
}

.mg-skel-line {
    height: 14px;
    width: 92%;
    margin-bottom: 12px;
    border-radius: var(--mg-radius-sm);
}

.mg-skel-line--short {
    width: 58%;
}

/* ========================================================= empty / alerts */

.mg-empty {
    border: 1px dashed rgba(139, 92, 246, .35);
    border-radius: var(--mg-radius);
    background: rgba(255, 255, 255, .03);
    padding: 56px 26px;
    text-align: center;
}

.mg-empty-mark {
    font-family: var(--mg-mono);
    font-weight: 700;
    font-size: 22px;
    color: var(--mg-orange);
    letter-spacing: .1em;
    margin-bottom: 14px;
}

.mg-empty h2,
.mg-empty h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--mg-head);
}

.mg-empty p {
    margin: 0 auto 22px;
    max-width: 50ch;
    color: var(--mg-text);
    font-size: 15.5px;
    line-height: 1.7;
}

/* Empty states with no "< / >" mark and no action button under the text (the
   home Clients and Team grids): the block keeps an even top/bottom rhythm
   instead of carrying the mark's height above and a button's margin below. */
.mg-empty--plain {
    padding: 44px 26px;
}

.mg-empty--plain p {
    margin-bottom: 0;
}

.mg-alert {
    border-radius: var(--mg-radius-btn);
    padding: 15px 18px;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.6;
    margin-top: 16px;
}

.mg-alert--ok {
    background: rgba(34, 197, 94, .12);
    border: 1px solid rgba(34, 197, 94, .35);
    color: #A7F3C4;
}

.mg-alert--err {
    background: rgba(248, 113, 113, .12);
    border: 1px solid rgba(248, 113, 113, .35);
    color: #FCA5A5;
}

/* ================================================================ slider */

.mg-slider {
    position: relative;
}

.mg-slide-viewport {
    overflow: hidden;
    border-radius: var(--mg-radius);
}

.mg-slide-track {
    display: flex;
    transition: transform .55s var(--mg-ease);
    will-change: transform;
}

.mg-slide {
    position: relative;
    flex: 0 0 100%;
    min-width: 100%;
}

.mg-slide-inner {
    display: grid;
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
    gap: 48px;
    align-items: center;
    padding: var(--mg-card-pad);
    border-radius: var(--mg-radius);
    border: 1px solid var(--mg-line);
    background: rgba(255, 255, 255, .045);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    backdrop-filter: blur(10px) saturate(120%);
}

/* the product mock-up sits straight on the slide: the SVG is transparent, so
   there is no frame, no plate and no colour block behind the device */
.mg-slide-art {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
}

.mg-art-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.mg-slide-copy {
    min-width: 0;
}

/* A product's own brand mark (Clinics Pro): a small transparent crest sitting
   immediately above the product name, flush with its left edge and at the
   weight of the "Solution n / n" eyebrow above it. Only the cards that carry
   a mark render it, so the other slides keep their exact copy rhythm. */
.mg-slide-mark {
    display: block;
    width: auto;
    height: clamp(22px, 2vw, 26px);
    margin: 12px 0 0;
    object-fit: contain;
}

.mg-slide-title {
    font-size: clamp(1.5rem, 2.6vw, 2.1rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.015em;
    color: var(--mg-head);
    margin: 12px 0 14px;
}

.mg-slide-desc {
    margin: 0;
    font-size: 16px;
    line-height: 1.7;
    color: var(--mg-text);
    max-width: 58ch;
}

/* the card's one action: the same small orange button as elsewhere on the site,
   directly under the description where the domain line used to sit */
.mg-slide-more {
    margin-top: 18px;
}

.mg-slide-more .mg-arr {
    transition: transform var(--mg-t);
}

.mg-slide-more:hover .mg-arr {
    transform: translateX(3px);
}

/* the slider's two manual controls: one round orange arrow on each side of the
   card ("Previous" left, "Next" right), half over the card's edge and vertically
   centred on it. Both sit inside the card's own padding, so they never cover the
   copy or the "Learn More" button. */
.mg-slide-stage {
    position: relative;
}

.mg-slide-next,
.mg-slide-prev {
    position: absolute;
    top: 50%;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid rgba(255, 165, 60, .55);
    border-radius: 50%;
    background-color: var(--mg-orange);
    background-image: linear-gradient(135deg, #FF7A18 0%, #FFA53C 100%);
    color: #FFFFFF;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .45), 0 8px 20px rgba(255, 122, 24, .38);
    transform: translateY(-50%);
    transition: transform var(--mg-t), background-color var(--mg-t), border-color var(--mg-t), box-shadow var(--mg-t);
}

/* the only difference between the two: which edge they hang on */
.mg-slide-next {
    right: -22px;
}

.mg-slide-prev {
    left: -22px;
}

.mg-slide-next:hover,
.mg-slide-prev:hover {
    background-color: #E86A0C;
    background-image: linear-gradient(135deg, #E86A0C 0%, #F0902B 100%);
    border-color: rgba(255, 197, 138, .75);
    transform: translateY(-50%) scale(1.03);
    box-shadow: 0 16px 34px rgba(0, 0, 0, .5), 0 10px 24px rgba(232, 106, 12, .5);
}

.mg-slide-next:active,
.mg-slide-prev:active {
    transform: translateY(-50%) scale(.97);
}

.mg-slide-next:focus-visible,
.mg-slide-prev:focus-visible {
    outline: 2px solid #FFFFFF;
    outline-offset: 3px;
}

.mg-slide-next-ico,
.mg-slide-prev-ico {
    display: block;
    width: 22px;
    height: 22px;
}

/* ================================================================ values */

.mg-values {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--mg-gap);
}

.mg-value-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    padding: var(--mg-card-pad);
    border-radius: var(--mg-radius);
    border: 1px solid var(--mg-line);
    background: var(--mg-glass);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: transform var(--mg-t), border-color var(--mg-t), box-shadow var(--mg-t);
}

.mg-value-item:hover {
    transform: translateY(-4px);
    border-color: rgba(139, 92, 246, .55);
    box-shadow: 0 22px 60px rgba(0, 0, 0, .45);
}

.mg-value-num {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: var(--mg-radius-sm);
    border: 1px solid var(--mg-violet-line);
    background: linear-gradient(135deg, rgba(109, 40, 217, .55), rgba(255, 122, 24, .22));
    color: #FFFFFF;
    font-family: var(--mg-mono);
    font-weight: 700;
    font-size: 14px;
}

.mg-value-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.32;
    color: var(--mg-head);
    margin: 0;
}

.mg-value-text {
    margin: 0;
    font-size: 15.5px;
    line-height: 1.65;
    color: var(--mg-text);
}

/* =============================================================== clients */

.mg-client {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 100%;
    min-height: 170px;
    padding: 26px 20px;
    text-align: center;
    border-radius: var(--mg-radius);
    border: 1px solid var(--mg-line);
    background: var(--mg-glass);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: transform var(--mg-t), border-color var(--mg-t), box-shadow var(--mg-t);
}

.mg-client:hover,
.mg-client:focus-within {
    transform: translateY(-4px);
    border-color: rgba(139, 92, 246, .55);
    box-shadow: 0 22px 60px rgba(0, 0, 0, .45);
}

.mg-client-logo {
    max-width: 130px;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
    background: rgba(255, 255, 255, .92);
    padding: 8px 12px;
    border-radius: var(--mg-radius-sm);
}

.mg-client-mark {
    width: 58px;
    height: 58px;
    border-radius: var(--mg-radius-sm);
    display: grid;
    place-items: center;
    color: #FFFFFF;
    font-family: var(--mg-display);
    font-weight: 800;
    font-size: 22px;
}

.mg-client-name {
    font-family: var(--mg-display);
    font-size: 14.5px;
    font-weight: 700;
    color: var(--mg-head);
    line-height: 1.3;
}

.mg-client-sector {
    font-size: 12.5px;
    color: var(--mg-muted);
}

.mg-client-cover {
    position: absolute;
    inset: 0;
    border-radius: var(--mg-radius);
    z-index: 2;
}

/* ================================================================== team */

.mg-person {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: var(--mg-radius);
    border: 1px solid var(--mg-line);
    background: var(--mg-glass);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    overflow: hidden;
    transition: transform var(--mg-t), border-color var(--mg-t), box-shadow var(--mg-t);
}

.mg-person:hover {
    transform: translateY(-4px);
    border-color: rgba(139, 92, 246, .55);
    box-shadow: 0 22px 60px rgba(0, 0, 0, .45);
}

.mg-person-media {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(109, 40, 217, .3), rgba(255, 122, 24, .16));
}

.mg-person-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--mg-t);
}

.mg-person:hover .mg-person-media img {
    transform: scale(1.03);
}

.mg-person-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 22px 24px 26px;
    flex: 1 1 auto;
}

.mg-person-name {
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--mg-head);
    margin: 0;
}

.mg-person-role {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--mg-orange);
}

.mg-person-bio {
    margin: 4px 0 0;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--mg-text);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================== webinars */

.mg-webinar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    height: 100%;
    padding: var(--mg-card-pad);
    border-radius: var(--mg-radius);
    border: 1px solid var(--mg-line);
    background: var(--mg-glass);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: transform var(--mg-t), border-color var(--mg-t), box-shadow var(--mg-t);
}

.mg-webinar:hover {
    transform: translateY(-4px);
    border-color: rgba(139, 92, 246, .55);
    box-shadow: 0 22px 60px rgba(0, 0, 0, .45);
}

.mg-webinar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
}

.mg-webinar-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.01em;
    color: var(--mg-head);
    margin: 0;
}

.mg-webinar-text {
    margin: 0;
    font-size: 15.5px;
    line-height: 1.7;
    color: var(--mg-text);
    flex: 1 1 auto;
}

.mg-webinar .mg-btn {
    margin-top: 8px;
}

/* ============================================================== articles */

.mg-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--mg-soft-violet);
    text-decoration: none;
    transition: color var(--mg-t);
}

.mg-back:hover {
    color: var(--mg-orange);
}

.mg-back--bottom {
    margin: 36px 0 0;
}

.mg-article-wrap {
    max-width: 820px;
}

.mg-article-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.mg-article-body {
    font-size: 17px;
    line-height: 1.8;
    color: var(--mg-text);
    overflow-wrap: break-word;
}

.mg-article-body p {
    margin: 0 0 20px;
}

.mg-article-body h1,
.mg-article-body h2,
.mg-article-body h3 {
    margin: 32px 0 14px;
    font-size: 1.35rem;
    color: var(--mg-head);
}

.mg-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--mg-radius);
}

.mg-article-body a {
    color: var(--mg-amber);
}

.mg-article-body ul,
.mg-article-body ol {
    margin: 0 0 20px;
    padding-left: 22px;
}

.mg-article-body li {
    margin-bottom: 8px;
}

.mg-article-body blockquote {
    margin: 24px 0;
    padding: 16px 20px;
    border-left: 2px solid var(--mg-orange);
    border-radius: var(--mg-radius-sm);
    background: rgba(255, 255, 255, .04);
    color: var(--mg-head);
}

/* Arabic / right-to-left copy: right-to-left flow, Arabic-first fallback and
   a little more leading than the Latin faces need */
.mg-rtl,
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

.mg-rtl ul,
.mg-rtl ol,
[dir="rtl"] ul,
[dir="rtl"] ol {
    padding-left: 0;
    padding-right: 22px;
}

.mg-article-body.mg-rtl,
[dir="rtl"] .mg-article-body {
    line-height: 1.9;
}

.mg-article-body.mg-rtl blockquote,
[dir="rtl"] .mg-article-body blockquote {
    border-left: 0;
    border-right: 2px solid var(--mg-orange);
}

/* ========================================================= service detail */

.mg-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
    gap: 40px;
    align-items: start;
}

.mg-detail-main {
    min-width: 0;
}

.mg-detail-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-self: start;
    position: sticky;
    top: 96px;
    min-width: 0;
}

.mg-detail-title {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--mg-head);
}

.mg-detail-card .mg-link-more {
    margin-top: 0;
}

.mg-detail-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: var(--mg-card-pad);
    border-radius: var(--mg-radius);
    border: 1px solid var(--mg-line);
    background: var(--mg-glass);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.mg-detail-card .mg-btn {
    margin-top: 6px;
    width: 100%;
}

.mg-detail-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mg-detail-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font-size: 14.5px;
    color: var(--mg-text);
    text-decoration: none;
    transition: color var(--mg-t);
}

.mg-detail-list a:hover {
    color: var(--mg-orange);
}

/* =============================================================== contact */

.mg-contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr);
    gap: 40px;
    align-items: start;
}

.mg-contact-formbox {
    padding: var(--mg-card-pad);
    border-radius: var(--mg-radius);
    border: 1px solid var(--mg-line);
    background: var(--mg-glass);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.mg-contact-formbox h2 {
    margin-bottom: 22px;
}

.mg-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
}

.mg-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.mg-field--full {
    grid-column: 1 / -1;
}

.mg-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--mg-muted);
}

.mg-input {
    width: 100%;
    min-height: 48px;
    padding: 13px 16px;
    border: 1px solid var(--mg-line-strong);
    border-radius: var(--mg-radius-btn);
    background: rgba(255, 255, 255, .04);
    font-family: var(--mg-body);
    font-size: 15.5px;
    line-height: 1.5;
    color: #FFFFFF;
    outline: none;
    transition: border-color var(--mg-t), box-shadow var(--mg-t), background var(--mg-t);
}

.mg-input::placeholder {
    color: #857D9E;
}

.mg-input:focus {
    border-color: var(--mg-orange);
    background: rgba(255, 255, 255, .06);
    box-shadow: 0 0 0 4px rgba(255, 122, 24, .16);
}

.mg-textarea {
    min-height: 156px;
    resize: vertical;
}

.mg-contact-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mg-contact-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px;
    border-radius: var(--mg-radius);
    border: 1px solid var(--mg-line);
    background: var(--mg-glass);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.mg-contact-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--mg-orange);
}

.mg-contact-value {
    font-size: 15.5px;
    font-weight: 600;
    color: var(--mg-head);
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: color var(--mg-t);
}

.mg-contact-value:hover {
    color: var(--mg-amber);
}

.mg-contact-missing {
    color: var(--mg-muted);
    font-weight: 500;
    font-size: 14.5px;
    font-style: italic;
}

/* ================================================================ footer */

/* compact centred stack: the white logo alone on its line, the newsletter
   under it, then the muted link row and copyright under a hairline divider.
   On desktop (900px+) this becomes two columns: the brand block on the left,
   everything else stacked in the right column. */
.mg-footer {
    margin-top: 0;
    border-top: 1px solid var(--mg-line);
    background: linear-gradient(180deg, rgba(18, 10, 36, .72) 0%, rgba(7, 4, 15, .96) 100%);
    color: var(--mg-text);
    padding: 15px 0;
}

.mg-footer-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

/* the right column on desktop; on narrow screens it is just the stack that
   follows the logo, filling the centred column */
.mg-foot-rest {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-width: 0;
}

/* the mark, then its small social row 8px under it: one block, centred as a
   whole, so the footer balances against the newsletter without growing */
.mg-foot-ident {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    min-width: 0;
}

.mg-foot-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    text-decoration: none;
    color: #FFFFFF;
}

/* three 14px white glyphs in 22px round hit areas, 6px apart: the row is about
   78px wide, so it never sticks out past the 82px logo above it */
.mg-foot-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    line-height: 0;
}

.mg-social-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
}

.mg-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: #FFFFFF;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: color 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.mg-social-ico {
    display: block;
    width: 14px;
    height: 14px;
}

a.mg-social:hover,
a.mg-social:focus-visible {
    color: var(--mg-orange);
    transform: scale(1.05);
}

a.mg-social:focus-visible {
    outline: 2px solid var(--mg-orange);
    outline-offset: 2px;
}

/* a link the client has not filled in yet: same glyph, not clickable */
.mg-social--off {
    cursor: default;
}

/* text fallback lockup, kept in proportion with the small image mark */
.mg-logo--foot .mg-logo-word {
    font-size: 26px;
    letter-spacing: .04em;
}

.mg-logo--foot .mg-logo-sub {
    margin-top: 5px;
    font-size: 8px;
    letter-spacing: .32em;
}

.mg-foot-brand .mg-logo-img {
    height: auto;
    width: 82px;
    max-width: 60vw;
    max-height: 56px;
    object-fit: contain;
}

/* small version inside the hero's decorative code window */
.mg-code-logo-img {
    display: block;
    height: 22px;
    width: auto;
    max-width: 100%;
    background: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    object-fit: contain;
}

/* newsletter: the label on its own line centred over the box, then the email
   box and Submit side by side (wrapping to two centred lines when narrow) */
.mg-foot-news {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-width: 0;
    margin-bottom: 14px;
    text-align: center;
}

/* the block is as wide as its widest line, so the label can start at the very
   left of the box below it and be centred over that box */
.mg-news-form {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: auto;
    max-width: 100%;
}

.mg-news-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: auto;
    max-width: 100%;
    min-width: 0;
}

.mg-news-label {
    align-self: flex-start;
    width: 260px;
    max-width: 100%;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--mg-orange);
    white-space: nowrap;
}

.mg-news-input {
    width: 260px;
    max-width: 100%;
    flex: 0 1 260px;
    min-width: 0;
    min-height: 38px;
    padding: 8px 12px;
    font-size: 14px;
}

.mg-news-form .mg-input {
    background: rgba(255, 255, 255, .04);
    border-color: var(--mg-line-strong);
    color: #FFFFFF;
}

.mg-news-form .mg-input::placeholder {
    color: #857D9E;
}

.mg-news-form .mg-input:focus {
    border-color: var(--mg-orange);
    box-shadow: 0 0 0 4px rgba(255, 122, 24, .16);
}

.mg-news-form .mg-btn {
    width: auto;
    min-height: 38px;
    padding: 8px 16px;
    font-size: 13px;
}

.mg-foot-news .mg-alert {
    margin-top: 0;
    padding: 9px 13px;
    font-size: 13px;
}

/* one muted copyright line, centred, under a hairline divider */
.mg-foot-copy {
    margin-top: 11px;
    padding-top: 9px;
    border-top: 1px solid var(--mg-line);
    text-align: center;
    font-size: 11.5px;
    line-height: 1.5;
    color: #9C93B8;
}

/* ========================================================= whatsapp float */

.mg-wa {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 80;
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #25D366 0%, #1FA855 100%);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
    text-decoration: none;
    transition: transform var(--mg-t), box-shadow var(--mg-t);
}

.mg-wa:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 44px rgba(37, 211, 102, .35);
}

.mg-wa svg {
    display: block;
    width: 28px;
    height: 28px;
    fill: #FFFFFF;
}

/* ============================================ reveal (IntersectionObserver) */

.mg-anim .mg-reveal {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .4s var(--mg-ease), transform .4s var(--mg-ease);
    will-change: opacity, transform;
}

.mg-anim .mg-reveal.rv-in {
    opacity: 1;
    transform: none;
    will-change: auto;
}

/* backdrop-filter fallback: keep glass readable where blur is unsupported */
@supports not ((-webkit-backdrop-filter: blur(4px)) or (backdrop-filter: blur(4px))) {

    .mg-card,
    .mg-value-item,
    .mg-client,
    .mg-person,
    .mg-webinar,
    .mg-contact-card,
    .mg-contact-formbox,
    .mg-code,
    .mg-slide-inner,
    .mg-detail-card {
        background: rgba(18, 10, 36, .88);
    }

    .mg-header {
        background: rgba(7, 4, 15, .96);
    }
}

/* ============================================================ responsive */

@media (max-width: 1120px) {
    .mg-nav,
    .mg-header-cta {
        display: none;
    }

    .mg-burger {
        display: grid;
    }

    .mg-header-in,
    .mg-scrolled .mg-header-in {
        height: 56px;
    }

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

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

    .mg-detail-side {
        position: static;
    }
}

@media (max-width: 900px) {
    :root {
        --mg-pad-y: 44px;
        --mg-card-pad: 24px;
        --mg-gap: 20px;
    }

    .mg-hero {
        padding: 34px 0 38px;
    }

    .mg-hero-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 36px;
    }

    .mg-hero-title {
        max-width: 24ch;
    }

    .mg-pagehead {
        padding: 30px 0 28px;
    }

    .mg-phero {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
    }

    .mg-phero-aside {
        align-items: flex-start;
        text-align: left;
        padding-bottom: 0;
        max-width: 100%;
    }

    .mg-slide-inner {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    .mg-slide-art {
        max-width: 320px;
    }

    /* the two arrows shrink with the card and keep to its padding edges */
    .mg-slide-next,
    .mg-slide-prev {
        width: 40px;
        height: 40px;
    }

    .mg-slide-next {
        right: -19px;
    }

    .mg-slide-prev {
        left: -19px;
    }

    .mg-slide-next-ico,
    .mg-slide-prev-ico {
        width: 20px;
        height: 20px;
    }

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

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

    .mg-contact-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }

    .mg-sec-head {
        margin-bottom: 26px;
    }

    .mg-section--tight {
        padding-top: 34px;
    }

    /* footer: smaller mark and tighter gaps in the centred stack */
    .mg-footer-row {
        gap: 12px;
    }

    .mg-foot-brand .mg-logo-img {
        width: 82px;
    }

    /* keep the backdrop cheap on phones: the pulse stops, the motifs stay */
    .mg-tech-circuit .mg-flow {
        animation: none;
        opacity: .5;
    }
}

@media (max-width: 620px) {
    .mg-container {
        padding: 0 18px;
    }

    .mg-container--wide {
        padding-left: 18px;
        padding-right: 18px;
    }

    body {
        font-size: 16px;
    }

    .mg-logo-word {
        font-size: 24px;
    }

    .mg-logo-sub {
        font-size: 9px;
        letter-spacing: .28em;
        margin-top: 5px;
    }

    .mg-logo-img--head {
        height: 38px;
    }

    .mg-foot-brand .mg-logo-img {
        width: 82px;
        max-width: 46vw;
    }

    .mg-grid--2,
    .mg-grid--3,
    .mg-grid--4,
    .mg-values {
        grid-template-columns: minmax(0, 1fr);
    }

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

    .mg-footer {
        padding: 15px 0;
    }

    .mg-footer-row {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .mg-foot-news {
        align-items: center;
        width: 100%;
    }

    .mg-news-row {
        flex-wrap: nowrap;
        width: auto;
    }

    .mg-foot-copy {
        margin-top: 11px;
        padding-top: 9px;
    }

    .mg-logo--foot .mg-logo-word {
        font-size: 22px;
    }

    .mg-logo--foot .mg-logo-sub {
        font-size: 8px;
        margin-top: 6px;
    }

    .mg-hero-marks {
        margin-top: 24px;
    }

    .mg-hero-cta .mg-btn {
        width: 100%;
    }

    .mg-wa {
        right: 16px;
        bottom: 16px;
        width: 50px;
        height: 50px;
    }

    .mg-code-lines {
        padding: 16px 14px;
    }

    .mg-slide-inner {
        padding: 20px;
    }

    .mg-slide-next,
    .mg-slide-prev {
        width: 36px;
        height: 36px;
    }

    .mg-slide-next {
        right: -18px;
    }

    .mg-slide-prev {
        left: -18px;
    }

    .mg-slide-next-ico,
    .mg-slide-prev-ico {
        width: 18px;
        height: 18px;
    }

    .mg-empty {
        padding: 40px 18px;
    }

    /* lighter backdrop on small screens: fewer binary columns, softer traces */
    .mg-tech-grid {
        background-size: 56px 56px;
        opacity: .4;
    }

    .mg-tech-circuit {
        opacity: .6;
    }

    .mg-tech-code span:nth-child(3),
    .mg-tech-code span:nth-child(6) {
        display: none;
    }
}

@media (max-width: 400px) {
    .mg-hero-marks {
        gap: 6px;
    }

    .mg-chip {
        font-size: 10px;
        padding: 6px 9px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .mg-nebula span {
        animation: none !important;
    }

    /* the tech motifs stay, but completely still */
    .mg-tech-code span,
    .mg-tech-circuit .mg-flow,
    .mg-tech-circuit .mg-node {
        animation: none !important;
    }

    .mg-tech-circuit .mg-flow {
        opacity: .55;
    }

    .mg-tech-circuit .mg-node {
        opacity: .7;
    }

    .mg-skel,
    .mg-card,
    .mg-value-item,
    .mg-client,
    .mg-person,
    .mg-webinar,
    .mg-btn,
    .mg-slide-track,
    .mg-slide-next,
    .mg-slide-prev,
    .mg-drawer,
    .mg-scrim,
    .mg-wa,
    .mg-card-media img,
    .mg-person-media img {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }

    .mg-anim .mg-reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* ===================================================== site control layer
   The "turned off" screen, the footer link line, the Brain session cards and
   the two Brain dialogs. Everything here is built from the existing palette,
   radii and glass treatment, so it reads as part of the same system. */

.mg-hide {
    display: none !important;
}

/* a little more air between the nav labels than the old nine-item row had;
   at mid widths the gap eases off so the row never crowds the header button */
@media (max-width: 1320px) {
    .mg-nav {
        gap: clamp(16px, 1.75vw, 24px);
    }

    .mg-navlink {
        font-size: 11.5px;
    }
}

/* a page whose switch is off: centred glass card, header and footer kept */
.mg-off-wrap {
    min-height: 58vh;
    display: flex;
    align-items: center;
}

.mg-off {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
    padding: 46px 30px;
    text-align: center;
    border-radius: var(--mg-radius);
    border: 1px solid var(--mg-line);
    background: linear-gradient(180deg, rgba(21, 12, 43, .92) 0%, rgba(11, 6, 24, .92) 100%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    backdrop-filter: blur(10px) saturate(120%);
    box-shadow: var(--mg-shadow);
}

.mg-off-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1px solid var(--mg-violet-line);
    background: var(--mg-violet-tint);
    color: var(--mg-amber);
}

.mg-off-icon svg {
    display: block;
    width: 26px;
    height: 26px;
}

.mg-off-title {
    margin: 0;
    font-size: clamp(1.45rem, 2.6vw, 1.95rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.015em;
    color: var(--mg-head);
}

.mg-off-text {
    margin: 0;
    max-width: 44ch;
    font-size: 16px;
    line-height: 1.7;
    color: var(--mg-text);
}

.mg-off-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}

/* footer: the page links in Base order, one quiet line above the copyright */
.mg-foot-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 2px 16px;
    margin-top: 13px;
    padding-top: 4px;
}

.mg-foot-links a {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .01em;
    color: var(--mg-muted);
    text-decoration: none;
    transition: color var(--mg-t);
}

.mg-foot-links a:hover {
    color: var(--mg-orange);
}

/* ============================================================ brain page */

.mg-session .mg-card-body {
    gap: 12px;
}

.mg-session-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.mg-session-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
    margin: 0;
    padding: 0 0 2px;
}

.mg-session-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--mg-text);
}

.mg-session-mk {
    flex: 0 0 auto;
    min-width: 66px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--mg-muted);
}

.mg-session-mv {
    min-width: 0;
    color: var(--mg-head);
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* the description of a session is the reason to read the card: no clamp */
.mg-session .mg-card-text {
    display: block;
    overflow: visible;
    -webkit-line-clamp: none;
    flex: 0 1 auto;
}

.mg-session-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 18px;
    width: 100%;
    margin-top: auto;
    padding-top: 14px;
}

.mg-session-actions .mg-btn {
    margin-top: 0;
}

.mg-session-actions .mg-link-more {
    margin-top: 0;
    padding-top: 0;
}

/* =========================================================================
   BRAIN · the session cards: the grid and the phone's flat cube turn
   Same cards, same copy, same links — only where they sit and how they change.
   Phones (<=639px): one card at a time; every face sits in the same grid cell,
   so the section is as tall as the tallest card for the whole loop and the page
   never jumps. The shown card turns away to the edge on its own vertical axis
   while the next card opens from the opposite edge, both with a slight flat
   shading — a graphic 2D cube face, no perspective, no depth, no tilt. Tablet
   portrait (640-991px): two cards per row. From 992px: three cards in one row,
   compact. Nothing below adds perspective or preserve-3d anywhere: the turn is
   a plain orthographic squash, so it can never become a 3D cube.
   ========================================================================= */

.mg-sessions {
    position: relative;
    min-width: 0;
}

.mg-sessions-viewport {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--mg-gap);
    align-items: stretch;
}

.mg-sess-face {
    grid-area: 1 / 1;
    min-width: 0;
    visibility: hidden;
    transform-origin: 50% 50%;
    will-change: transform;
}

.mg-sess-face.is-on {
    visibility: visible;
    z-index: 2;
}

/* both halves of a turn stay visible while they are being animated */
.mg-sess-face.flip-out,
.mg-sess-face.flip-in {
    visibility: visible;
    z-index: 3;
}

/* the leaving face: flat turn away to the edge (~90deg = zero width) */
.mg-sess-face.flip-out {
    animation: mgSessFaceOut 380ms cubic-bezier(.45, .05, .55, .95) both;
}

/* the arriving face: opens from the opposite edge once the other has left */
.mg-sess-face.flip-in {
    animation: mgSessFaceIn 380ms cubic-bezier(.45, .05, .55, .95) 380ms both;
}

/* a step backwards turns the cube the other way round */
.mg-sessions[data-dir="prev"] .mg-sess-face.flip-out {
    animation-name: mgSessFaceOutPrev;
}

.mg-sessions[data-dir="prev"] .mg-sess-face.flip-in {
    animation-name: mgSessFaceInPrev;
}

@keyframes mgSessFaceOut {
    from {
        transform: rotateY(0deg);
    }

    to {
        transform: rotateY(90deg);
    }
}

@keyframes mgSessFaceIn {
    from {
        transform: rotateY(-90deg);
    }

    to {
        transform: rotateY(0deg);
    }
}

@keyframes mgSessFaceOutPrev {
    from {
        transform: rotateY(0deg);
    }

    to {
        transform: rotateY(-90deg);
    }
}

@keyframes mgSessFaceInPrev {
    from {
        transform: rotateY(90deg);
    }

    to {
        transform: rotateY(0deg);
    }
}

/* the flat shading: the half of the turn that faces away from the light is
   darkened a little, on the card itself, so both faces read as two sides of
   one cube. It never takes a click (pointer-events: none). */
.mg-sess-face::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 6;
    border-radius: inherit;
    background: #07040F;
    opacity: 0;
    pointer-events: none;
}

.mg-sess-face.flip-out::after {
    animation: mgSessShadeUp 380ms linear both;
}

.mg-sess-face.flip-in::after {
    animation: mgSessShadeDown 380ms linear 380ms both;
}

@keyframes mgSessShadeUp {
    from {
        opacity: 0;
    }

    to {
        opacity: .34;
    }
}

@keyframes mgSessShadeDown {
    from {
        opacity: .34;
    }

    to {
        opacity: 0;
    }
}

/* the dots: which card of the loop is on show (phones only) */
.mg-sess-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
}

.mg-sess-dot {
    position: relative;
    width: 9px;
    height: 9px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .24);
    cursor: pointer;
    transition: width var(--mg-t), background var(--mg-t);
    -webkit-tap-highlight-color: transparent;
}

/* a 30px touch target around a 9px dot */
.mg-sess-dot::after {
    content: "";
    position: absolute;
    inset: -11px;
    border-radius: 999px;
}

.mg-sess-dot.is-on {
    width: 24px;
    background: linear-gradient(135deg, #FF7A18 0%, #FFA53C 100%);
}

.mg-sess-dot:focus-visible {
    outline: 2px solid var(--mg-amber);
    outline-offset: 3px;
}

/* on a phone a tap can leave :hover behind, so the shown face stays a flat
   graphic card: no lift of the whole card, and never a tilt */
@media (max-width: 639.98px) {

    .mg-session.mg-sess-face:hover,
    .mg-session.mg-sess-face:focus-within {
        transform: none;
    }
}

/* tablet portrait: two cards per row, every card flat and visible */
@media (min-width: 640px) {
    .mg-sessions-viewport {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mg-sess-dots {
        display: none;
    }

    .mg-sess-face {
        grid-area: auto;
        visibility: visible;
        will-change: auto;
    }

    .mg-sess-face.flip-out,
    .mg-sess-face.flip-in {
        animation: none;
    }

    .mg-sess-face.flip-out::after,
    .mg-sess-face.flip-in::after {
        animation: none;
        opacity: 0;
    }
}

/* desktop and tablet landscape: three cards in one row, compact.
   Everything on the card is a size down and the picture is capped, so the row
   is short and tidy; no text is clamped or hidden and the Register button
   stays inside every card. */
@media (min-width: 992px) {
    .mg-sessions-viewport {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }

    .mg-session.mg-sess-face .mg-card-media {
        aspect-ratio: 16 / 7;
        max-height: 104px;
    }

    .mg-session.mg-sess-face .mg-ph {
        font-size: 26px;
    }

    .mg-session.mg-sess-face .mg-card-body {
        gap: 8px;
        padding: 16px 18px 18px;
    }

    .mg-session.mg-sess-face .mg-session-head {
        gap: 6px 8px;
    }

    .mg-session.mg-sess-face .mg-badge {
        padding: 3px 7px;
        font-size: 9.5px;
        letter-spacing: .08em;
    }

    .mg-session.mg-sess-face .mg-date {
        font-size: 10.5px;
    }

    .mg-session.mg-sess-face .mg-card-title {
        font-size: .95rem;
        line-height: 1.28;
    }

    .mg-session.mg-sess-face .mg-session-meta {
        gap: 3px;
    }

    .mg-session.mg-sess-face .mg-session-row {
        gap: 8px;
        font-size: 12.5px;
        line-height: 1.45;
    }

    .mg-session.mg-sess-face .mg-session-mk {
        min-width: 52px;
        font-size: 9px;
        letter-spacing: .12em;
    }

    .mg-session.mg-sess-face .mg-card-text {
        max-width: 42ch;
        font-size: 13.5px;
        line-height: 1.55;
    }

    .mg-session.mg-sess-face .mg-session-actions {
        gap: 8px 12px;
        padding-top: 10px;
    }

    .mg-session.mg-sess-face .mg-session-actions .mg-btn {
        min-height: 38px;
        padding: 9px 16px;
        border-radius: 10px;
        font-size: 12.5px;
    }

    .mg-session.mg-sess-face .mg-session-actions .mg-link-more {
        min-height: 0;
        font-size: 12px;
    }
}

/* motion turned down: the cards swap instantly (the script does the same) */
@media (prefers-reduced-motion: reduce) {

    .mg-sess-face,
    .mg-sess-face.flip-out,
    .mg-sess-face.flip-in,
    .mg-sess-face.flip-out::after,
    .mg-sess-face.flip-in::after {
        animation: none !important;
        transform: none !important;
    }

    .mg-sess-face::after {
        opacity: 0 !important;
    }

    .mg-sess-dot {
        transition: none !important;
    }
}

.mg-volunteer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 22px 32px;
    padding: var(--mg-card-pad);
    border-radius: var(--mg-radius);
    border: 1px solid var(--mg-line);
    background: var(--mg-glass);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    backdrop-filter: blur(10px) saturate(120%);
}

.mg-volunteer-main {
    min-width: 0;
    max-width: 62ch;
}

.mg-volunteer h2 {
    margin: 10px 0 8px;
    font-size: clamp(1.25rem, 2.2vw, 1.7rem);
    font-weight: 800;
    letter-spacing: -.015em;
    color: var(--mg-head);
}

.mg-volunteer p {
    margin: 0;
    font-size: 15.5px;
    line-height: 1.7;
    color: var(--mg-text);
}

/* ================================================================ dialogs */

.mg-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(4, 2, 10, .8);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    overflow-y: auto;
}

.mg-modal.open {
    display: flex;
}

.mg-modal-card {
    position: relative;
    width: 100%;
    max-width: 580px;
    max-height: calc(100vh - 44px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 26px 28px 28px;
    border-radius: var(--mg-radius);
    border: 1px solid var(--mg-line-strong);
    background: linear-gradient(180deg, #150C2B 0%, #0B0618 100%);
    box-shadow: var(--mg-shadow-lg);
}

.mg-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.mg-modal-title {
    margin: 0;
    font-size: 1.22rem;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -.01em;
    color: var(--mg-head);
}

.mg-modal-x {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: -8px -8px 0 0;
    border: 1px solid transparent;
    border-radius: var(--mg-radius-sm);
    background: transparent;
    font-size: 22px;
    line-height: 1;
    color: var(--mg-text);
    cursor: pointer;
    transition: color var(--mg-t), background var(--mg-t), border-color var(--mg-t);
}

.mg-modal-x:hover {
    color: var(--mg-head);
    background: rgba(255, 255, 255, .06);
    border-color: var(--mg-line);
}

.mg-modal-sub {
    margin: 10px 0 20px;
    font-size: 15px;
    line-height: 1.65;
    color: var(--mg-text);
}

.mg-modal-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mg-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
}

.mg-modal-done {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
}

.mg-req {
    color: var(--mg-amber);
}

.mg-field-error {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.45;
    color: #FF9B85;
}

.mg-textarea--short {
    min-height: 96px;
}

@media (max-width: 620px) {
    .mg-off {
        padding: 34px 20px;
    }

    .mg-off-actions {
        width: 100%;
        flex-direction: column;
    }

    .mg-off-actions .mg-btn {
        width: 100%;
    }

    .mg-volunteer {
        align-items: flex-start;
    }

    .mg-volunteer .mg-btn {
        width: 100%;
    }

    .mg-modal {
        align-items: flex-start;
        padding: 12px;
    }

    .mg-modal-card {
        max-height: calc(100vh - 24px);
        padding: 20px;
    }

    .mg-modal-actions {
        flex-direction: column;
    }

    .mg-modal-actions .mg-btn {
        width: 100%;
    }

    .mg-foot-links {
        gap: 2px 16px;
    }
}

/* =========================================================================
   FINAL READABILITY GUARANTEE — secondary / not-yet-open actions
   Declared last, with literal colours and !important so no other rule, no
   missing variable and no platform "disabled" styling can turn these into
   grey-on-grey: light label (#E9E2FF), visible 1px violet border, a surface
   slightly lighter than the card, orange accent on hover/active.
   ========================================================================= */

.mg-btn.mg-btn--off,
.mg-btn.mg-btn--ghost,
.mg-btn[disabled],
.mg-btn:disabled,
.mg-btn[aria-disabled="true"] {
    color: #E9E2FF !important;
    -webkit-text-fill-color: #E9E2FF !important;
    background-color: rgba(139, 92, 246, .16) !important;
    background-image: none !important;
    border: 1px solid rgba(139, 92, 246, .55) !important;
    box-shadow: none !important;
    opacity: 1 !important;
    cursor: default;
}

.mg-btn.mg-btn--ghost {
    cursor: pointer;
}

.mg-btn.mg-btn--off:hover,
.mg-btn.mg-btn--off:active,
.mg-btn.mg-btn--ghost:hover,
.mg-btn.mg-btn--ghost:active,
.mg-btn[disabled]:hover,
.mg-btn:disabled:hover,
.mg-btn[aria-disabled="true"]:hover {
    color: #FFA53C !important;
    -webkit-text-fill-color: #FFA53C !important;
    background-color: rgba(109, 40, 217, .34) !important;
    border-color: rgba(255, 122, 24, .60) !important;
}

.mg-btn.mg-btn--off:hover,
.mg-btn.mg-btn--off:active,
.mg-btn[disabled]:hover,
.mg-btn:disabled:hover,
.mg-btn[aria-disabled="true"]:hover {
    transform: none !important;
}

/* =========================================================================
   HOME · "OUR SERVICES" — one compact card per slide
   Same palette, font family, radius, hover accent and A/B/C corner badge as
   the rest of the card system, only smaller; the cards sit in a fixed-height
   stack, so the section never jumps as slides change. The switch between them
   is the cube turn at the end of this file (the fade below is the reduced-motion
   and no-cube fallback).
   Scoped to .mg-svcs / .mg-section--svc so every other card grid on the site
   keeps its current size.
   ========================================================================= */

/* no controls under the card, so the section closes with its own padding
   instead of reserving room for an arrow/dot row */
.mg-section--svc {
    padding: 64px 0 52px;
}

/* tighter between the heading and the cards */
.mg-section--svc .mg-sec-head {
    margin-bottom: 20px;
}

.mg-svcs {
    position: relative;
    width: 100%;
}

/* every slide sits in the same grid cell: the row is as tall as the tallest
   card, so the section height is fixed for the whole loop */
.mg-svcs-viewport {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    width: 100%;
}

.mg-svcs-slide {
    grid-area: 1 / 1;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .45s var(--mg-ease), transform .45s var(--mg-ease), visibility 0s linear .45s;
}

.mg-svcs-slide.on {
    opacity: 1;
    visibility: visible;
    transform: none;
    z-index: 2;
    transition: opacity .45s var(--mg-ease), transform .45s var(--mg-ease), visibility 0s;
}

/* --- the compact card: same shape and colours, less of everything -------- */

.mg-svcs .mg-card {
    min-height: 0;
}

.mg-svcs .mg-card-media {
    aspect-ratio: auto;
    height: 148px;
    flex: 0 0 auto;
}

.mg-svcs .mg-svc-art::before {
    width: 58%;
    max-width: 118px;
}

.mg-svcs .mg-svc-svg {
    width: 32%;
    min-width: 44px;
    max-width: 72px;
}

.mg-svcs .mg-card-corner {
    left: 10px;
    top: 10px;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    font-size: 11.5px;
}

.mg-svcs .mg-card-body {
    gap: 7px;
    padding: 15px 18px 16px;
}

.mg-svcs .mg-badge {
    gap: 5px;
    padding: 4px 7px;
    font-size: 9.5px;
    letter-spacing: .09em;
}

.mg-svcs .mg-card-title {
    font-size: 18px;
    line-height: 1.28;
}

.mg-svcs .mg-card-text {
    font-size: 14px;
    line-height: 1.55;
    -webkit-line-clamp: 3;
}

.mg-svcs .mg-link-more {
    gap: 6px;
    padding-top: 5px;
    min-height: 34px;
    font-size: 12.5px;
}

/* loading placeholder matches the compact card, so nothing jumps on arrival */
.mg-skel-svc {
    max-width: 480px;
    height: 352px;
    margin: 0 auto;
    border-radius: var(--mg-radius);
}

@media (max-width: 900px) {
    .mg-section--svc {
        padding: 48px 0 40px;
    }

    .mg-section--svc .mg-sec-head {
        margin-bottom: 18px;
    }

    .mg-svcs-slide,
    .mg-skel-svc {
        max-width: 440px;
    }

    .mg-svcs .mg-card-media {
        height: 138px;
    }

    .mg-svcs .mg-card-body {
        padding: 14px 16px 15px;
    }

    .mg-svcs .mg-card-title {
        font-size: 17px;
    }

    .mg-skel-svc {
        height: 332px;
    }
}

@media (max-width: 620px) {
    .mg-section--svc {
        padding: 36px 0 30px;
    }

    .mg-section--svc .mg-sec-head {
        margin-bottom: 16px;
    }

    .mg-svcs-slide,
    .mg-skel-svc {
        max-width: none;
    }

    .mg-svcs .mg-card-media {
        height: 118px;
    }

    .mg-svcs .mg-svc-svg {
        min-width: 38px;
        max-width: 62px;
    }

    .mg-svcs .mg-card-corner {
        left: 8px;
        top: 8px;
        width: 24px;
        height: 24px;
        font-size: 11px;
    }

    .mg-svcs .mg-card-body {
        gap: 6px;
        padding: 13px 15px 14px;
    }

    .mg-svcs .mg-card-title {
        font-size: 16.5px;
    }

    .mg-svcs .mg-card-text {
        font-size: 13.5px;
        line-height: 1.5;
    }

    .mg-svcs .mg-link-more {
        min-height: 32px;
        font-size: 12px;
    }

    .mg-skel-svc {
        height: 304px;
    }
}

/* Home · "Our solutions": the slider has no arrow/dot row under it any more,
   so the band closes with exactly the bottom spacing of "Our services" above
   it (52 / 40 / 30 at the same breakpoints) instead of the taller default. */
.mg-section--solutions {
    padding-bottom: 52px;
}

@media (max-width: 900px) {
    .mg-section--solutions {
        padding-bottom: 40px;
    }
}

@media (max-width: 620px) {
    .mg-section--solutions {
        padding-bottom: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {

    /* no auto-advance in the view script; a manual step changes instantly */
    .mg-svcs-slide,
    .mg-svcs-slide.on {
        transition: none !important;
    }
}

/* =========================================================================
   HOME · "OUR VALUES" and "FROM OUR JOURNAL" — one card per slide
   The same behaviour and the same card system as the "Our services" slider
   above: the cards sit in one stack, so only a single centred card is ever
   visible, and the stack is as tall as the tallest card, which keeps the
   section from jumping as the slides change. "Our values" switches with the
   cube turn defined at the end of this file; "From our journal" keeps the
   cross-fade below (the fade is also the reduced-motion fallback for both).
   There are no arrows and no dots under either slider, so both sections close
   with the same bottom spacing (52 / 40 / 30) as the sliders above them.
   Scoped to .mg-section--vals / .mg-section--arts: the /our-values and
   /articles pages keep their own grids.
   ========================================================================= */

.mg-section--vals,
.mg-section--arts {
    padding-bottom: 52px;
}

/* tighter between the heading and the card */
.mg-section--vals .mg-sec-head,
.mg-section--arts .mg-sec-head {
    margin-bottom: 20px;
}

.mg-vals,
.mg-arts {
    position: relative;
    width: 100%;
}

/* one column, and every card stacked in that one cell: the stack height is
   the tallest card, so no slide is ever a different height than the section */
.mg-vals-viewport,
.mg-arts-viewport {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    width: 100%;
}

.mg-vals-slide,
.mg-arts-slide {
    grid-area: 1 / 1;
    width: 100%;
    margin: 0 auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .45s var(--mg-ease), transform .45s var(--mg-ease), visibility 0s linear .45s;
}

.mg-vals-slide.on,
.mg-arts-slide.on {
    opacity: 1;
    visibility: visible;
    transform: none;
    z-index: 2;
    transition: opacity .45s var(--mg-ease), transform .45s var(--mg-ease), visibility 0s;
}

/* one card at a time: a readable width on a desktop screen, the full
   container width on a phone */
.mg-vals-slide {
    max-width: 520px;
}

.mg-arts-slide {
    max-width: 560px;
}

/* the one-card slide is wide enough to carry the whole excerpt, and the stack
   height is set by the tallest card, so nothing moves when it changes */
.mg-arts .mg-card-text {
    display: block;
    -webkit-line-clamp: none;
    overflow: visible;
}

@media (max-width: 900px) {

    .mg-section--vals,
    .mg-section--arts {
        padding-bottom: 40px;
    }

    .mg-section--vals .mg-sec-head,
    .mg-section--arts .mg-sec-head {
        margin-bottom: 18px;
    }

    .mg-vals-slide {
        max-width: 480px;
    }

    .mg-arts-slide {
        max-width: 520px;
    }
}

@media (max-width: 620px) {

    .mg-section--vals,
    .mg-section--arts {
        padding-bottom: 30px;
    }

    .mg-section--vals .mg-sec-head,
    .mg-section--arts .mg-sec-head {
        margin-bottom: 16px;
    }

    .mg-vals-slide,
    .mg-arts-slide {
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {

    /* no auto-advance in the view script; a manual step changes instantly */
    .mg-vals-slide,
    .mg-vals-slide.on,
    .mg-arts-slide,
    .mg-arts-slide.on {
        transition: none !important;
    }
}

/* =========================================================================
   HOME · "OUR SERVICES" and "OUR VALUES" — the cards turn like cube faces
   Only the switch between two cards changes here: the card design, its size,
   its content, its links, the section spacing and the Base-driven loading and
   empty states all stay exactly as they were. Each card is one face of a cube
   inside a perspective stage; all faces sit in the same grid cell, so the stage
   keeps the tallest card's height and the section never jumps. Going forward
   the shown face turns away to -90deg while the next face arrives from +90deg
   (a backward step mirrors both), so one face rotates out while the next
   rotates in. Only the shown face is ever visible — the others are
   visibility:hidden — so two faces can never show through each other. The
   "From our journal" slider keeps its own fade.
   ========================================================================= */

/* direction of the last step: forward by default, mirrored for a step back */
.mg-cube {
    --mg-cube-from: 90deg;
    --mg-cube-to: -90deg;
}

.mg-cube[data-dir="prev"] {
    --mg-cube-from: -90deg;
    --mg-cube-to: 90deg;
}

/* the stage: the 3D view plus the mask that keeps the turn inside the section.
   The negative vertical insets leave room for the card's hover lift and its
   shadow; the sideways cut is the only hard edge, so nothing can spill into
   the neighbouring columns on any width. */
.mg-cube-stage {
    perspective: 1200px;
    perspective-origin: 50% 50%;
    -webkit-clip-path: inset(-40px 0 -40px 0);
    clip-path: inset(-40px 0 -40px 0);
}

/* a face that is off the stage waits where a leaving face ends up (the arriving
   face starts on the opposite side, see the keyframes below) */
.mg-cube .mg-cube-face {
    transform-origin: 50% 50%;
    transform-style: preserve-3d;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    opacity: 0;
    visibility: hidden;
    transform: rotateY(var(--mg-cube-to)) scale(.94);
    transition:
        transform 650ms cubic-bezier(.22, .61, .36, 1),
        opacity 650ms cubic-bezier(.22, .61, .36, 1),
        visibility 0s linear 650ms;
}

/* the shown face: it turns in from the far side, then rests flat — no 3D
   transform at rest, so the card keeps its glass treatment and hover state */
.mg-cube .mg-cube-face.on {
    opacity: 1;
    visibility: visible;
    z-index: 2;
    transform: none;
    animation: mg-cube-in 650ms cubic-bezier(.22, .61, .36, 1);
    transition: opacity 650ms cubic-bezier(.22, .61, .36, 1), visibility 0s linear 0s;
}

@keyframes mg-cube-in {
    from {
        transform: rotateY(var(--mg-cube-from)) scale(.94);
        opacity: 0;
    }

    to {
        transform: rotateY(0deg) scale(1);
        opacity: 1;
    }
}

/* phones: a flatter perspective so the turn stays inside the card's column,
   and a slightly quicker step */
@media (max-width: 620px) {
    .mg-cube-stage {
        perspective: 1600px;
        -webkit-clip-path: inset(-32px 0 -32px 0);
        clip-path: inset(-32px 0 -32px 0);
    }

    .mg-cube .mg-cube-face {
        transition:
            transform 450ms cubic-bezier(.22, .61, .36, 1),
            opacity 450ms cubic-bezier(.22, .61, .36, 1),
            visibility 0s linear 450ms;
    }

    .mg-cube .mg-cube-face.on {
        animation-duration: 450ms;
        transition: opacity 450ms cubic-bezier(.22, .61, .36, 1), visibility 0s linear 0s;
    }
}

/* motion turned down: a plain quick fade, no rotation and no mask */
@media (prefers-reduced-motion: reduce) {
    .mg-cube-stage {
        perspective: none;
        -webkit-clip-path: none;
        clip-path: none;
    }

    .mg-cube .mg-cube-face {
        animation: none !important;
        transform: none !important;
        transition: opacity .2s linear, visibility 0s linear .2s !important;
    }

    .mg-cube .mg-cube-face.on {
        animation: none !important;
        transform: none !important;
        transition: opacity .2s linear, visibility 0s linear 0s !important;
    }
}

/* =========================================================================
   SPLASH · full-screen overlay in front of the app on a full page load
   The real white logo file (the same asset as the header) alone on the site's
   dark background: no plate, no text, no spinner, no progress bar. It is fixed
   and inset, so it never moves the layout or adds a scrollbar. The script in
   index.html holds it for a fixed 5s, then fades it out and removes the node,
   so it runs once per page load and internal navigation never shows it again.
   ========================================================================= */

.mg-splash {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--mg-bg-0);
    opacity: 1;
    transition: opacity .35s var(--mg-ease);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* fading out: stop catching clicks immediately, the node goes right after */
.mg-splash--out {
    opacity: 0;
    pointer-events: none;
}

/* the mark: gentle fade-in, then the slow breathing scale (1 → 1.04) */
.mg-splash-mark {
    position: relative;
    width: 120px;
    max-width: 60vw;
    line-height: 0;
    animation: mgSplashIn .7s var(--mg-ease) both,
        mgSplashBreath 1.6s ease-in-out .7s infinite alternate;
}

/* very soft warm halo under the wordmark — light only, never a box or plate */
.mg-splash-mark::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 210px;
    height: 210px;
    margin: -105px 0 0 -105px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%,
            rgba(255, 122, 24, .24) 0%,
            rgba(255, 122, 24, .09) 40%,
            rgba(255, 122, 24, 0) 70%);
    pointer-events: none;
}

.mg-splash-img {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    padding: 0;
    border: 0;
    background: none;
    object-fit: contain;
}

@keyframes mgSplashIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes mgSplashBreath {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.04);
    }
}

@media (max-width: 620px) {
    .mg-splash-mark {
        width: 96px;
    }

    .mg-splash-mark::before {
        width: 168px;
        height: 168px;
        margin: -84px 0 0 -84px;
    }
}

@media (prefers-reduced-motion: reduce) {

    /* a static centred logo: no fade-in, no scaling, no glow — the fade-out
       below stays, because it is a transition, not an animation */
    .mg-splash-mark {
        animation: none;
        opacity: 1;
    }

    .mg-splash-mark::before {
        display: none;
    }
}

/* =========================================================================
   QUOTATION · /quotation — the service picker with its quantity steppers and
   the customer details sit beside each other as two glass cards of equal
   height, the submit button sits centred under both, and a popup confirms a
   request Base has saved. Same glass, radius, borders and inputs as contact.
   ========================================================================= */

.mg-quote-shell {
    width: 100%;
    max-width: 1120px;
}

/* the two cards: equal columns, one top line, stretched to the same height,
   with a decorative 1px rule centred in the wider gap between them */
.mg-quote-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    column-gap: 32px;
    row-gap: 0;
    align-items: stretch;
}

.mg-quote-div {
    align-self: stretch;
    justify-self: center;
    width: 1px;
    background: rgba(255, 255, 255, .14);
    pointer-events: none;
}

.mg-quote-block {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: var(--mg-card-pad);
    border-radius: var(--mg-radius);
    border: 1px solid var(--mg-line);
    background: var(--mg-glass);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.mg-quote-block .mg-h2 {
    margin-bottom: 6px;
}

.mg-quote-hint {
    margin: 0 0 4px;
    max-width: 66ch;
    font-size: 15.5px;
    line-height: 1.7;
    color: var(--mg-text);
}

/* ------------------------------------------------------------ the services */

.mg-quote-services {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 18px;
}

/* the list scrolls inside its own card, so a long catalogue never makes the
   services card taller than the details card beside it */
.mg-quote-scroll {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 18px;
    max-height: 420px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 122, 24, .5) rgba(255, 255, 255, .07);
}

.mg-quote-scroll .mg-quote-services {
    margin-top: 0;
    padding-right: 2px;
}

.mg-quote-scroll::-webkit-scrollbar {
    width: 8px;
}

.mg-quote-scroll::-webkit-scrollbar-track {
    border-radius: 8px;
    background: rgba(255, 255, 255, .07);
}

.mg-quote-scroll::-webkit-scrollbar-thumb {
    border-radius: 8px;
    background: rgba(255, 122, 24, .5);
}

.mg-quote-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--mg-orange);
}

.mg-quote-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 22px;
    padding: 15px 18px;
    border-radius: var(--mg-radius-btn);
    border: 1px solid var(--mg-line);
    background: rgba(255, 255, 255, .035);
    transition: border-color var(--mg-t), background var(--mg-t);
}

.mg-quote-row:hover,
.mg-quote-row:focus-within {
    border-color: var(--mg-line-strong);
    background: rgba(255, 255, 255, .055);
}

.mg-quote-row-main {
    min-width: 0;
    flex: 1 1 220px;
}

.mg-quote-type {
    display: block;
    margin-bottom: 3px;
    font-family: var(--mg-display);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--mg-orange);
}

.mg-quote-name {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--mg-head);
}

.mg-quote-skel {
    height: 74px;
    border-radius: var(--mg-radius-btn);
}

.mg-quote-empty {
    margin-top: 18px;
}

.mg-quote-block>.mg-field-error {
    margin-top: 10px;
}

/* quantity control: label, − , number input, + */
.mg-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.mg-qty-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--mg-muted);
}

.mg-qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid var(--mg-line-strong);
    background: rgba(255, 255, 255, .05);
    font-family: var(--mg-body);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    color: #FFFFFF;
    cursor: pointer;
    transition: border-color var(--mg-t), color var(--mg-t), background var(--mg-t);
}

.mg-qty-btn:hover,
.mg-qty-btn:active {
    border-color: var(--mg-orange);
    color: var(--mg-orange);
    background: rgba(255, 122, 24, .12);
}

.mg-input.mg-qty-input {
    width: 68px;
    min-height: 38px;
    padding: 6px 8px;
    text-align: center;
    font-size: 15px;
    -moz-appearance: textfield;
    appearance: textfield;
}

.mg-qty-input::-webkit-outer-spin-button,
.mg-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ------------------------------------------------------------- the details */

.mg-quote-fields {
    margin-top: 20px;
}

/* the optional notes box: last in the card, across both field columns */
.mg-quote-notes {
    grid-column: 1 / -1;
}

.mg-quote-notes .mg-input.mg-textarea {
    min-height: 130px;
    max-height: 260px;
    resize: vertical;
}

/* ------------------------------------------------------------- the submit
   under both cards, centred on its own line */

.mg-quote-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
}

.mg-quote-submit {
    min-width: 240px;
}

/* -------------------------------------------------- success popup (saved) */

.mg-qpop {
    position: fixed;
    inset: 0;
    z-index: 320;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(0, 0, 0, .72);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s var(--mg-ease), visibility 0s linear .2s;
}

.mg-qpop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity .2s var(--mg-ease), visibility 0s;
}

.mg-qpop-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 44px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 32px;
    text-align: center;
    border-radius: var(--mg-radius);
    border: 1px solid var(--mg-line-strong);
    background: linear-gradient(180deg, #150C2B 0%, #0B0618 100%);
    box-shadow: var(--mg-shadow-lg);
    opacity: 0;
    transform: scale(.94) translateY(8px);
    transition: opacity .2s var(--mg-ease), transform .2s var(--mg-ease);
}

.mg-qpop.is-open .mg-qpop-card {
    opacity: 1;
    transform: none;
}

.mg-qpop-card:focus {
    outline: none;
}

.mg-qpop-card:focus-visible {
    outline: 2px solid var(--mg-orange);
    outline-offset: 4px;
}

.mg-qpop-x {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--mg-radius-sm);
    background: transparent;
    font-family: var(--mg-body);
    font-size: 22px;
    line-height: 1;
    color: var(--mg-muted);
    cursor: pointer;
    transition: color var(--mg-t), background var(--mg-t), border-color var(--mg-t);
}

.mg-qpop-x:hover,
.mg-qpop-x:focus-visible {
    color: var(--mg-head);
    background: rgba(255, 255, 255, .06);
    border-color: var(--mg-line);
}

.mg-qpop-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    margin-bottom: 18px;
    border-radius: 50%;
    border: 1px solid rgba(255, 122, 24, .45);
    background: rgba(255, 122, 24, .12);
    color: var(--mg-orange);
}

.mg-qpop-mark svg {
    width: 30px;
    height: 30px;
}

.mg-qpop-msg {
    margin: 0 0 26px;
    font-family: var(--mg-arabic);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.9;
    text-align: center;
    color: var(--mg-head);
    direction: rtl;
    unicode-bidi: isolate;
}

.mg-qpop-close {
    min-width: 160px;
}

/* stacked on tablet portrait and phone; the list then shows in full and the
   divider turns into a short horizontal rule inside the 36px gap */
@media (max-width: 979px) {
    .mg-quote-grid {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 18px;
    }

    .mg-quote-div {
        width: 90%;
        height: 1px;
        justify-self: center;
    }

    .mg-quote-scroll {
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }
}

@media (max-width: 760px) {
    .mg-quote-fields {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 620px) {
    /* the quantity control drops to its own line under the service name */
    .mg-quote-row {
        align-items: flex-start;
        padding: 14px 15px;
    }

    .mg-quote-row-main {
        flex: 1 1 100%;
    }

    .mg-qty {
        width: 100%;
        justify-content: flex-start;
        padding-top: 4px;
    }

    .mg-quote-actions {
        margin-top: 24px;
    }

    .mg-quote-submit {
        width: 100%;
    }

    .mg-qpop {
        padding: 14px;
    }

    .mg-qpop-card {
        padding: 26px 20px;
    }

    .mg-qpop-close {
        width: 100%;
    }
}

/* ============================================================ footer: desktop
   Declared last so it wins over the narrow-screen stack at the 900px boundary.
   Only the first line is split: the white logo at the left edge, the newsletter
   block at the right edge. In that block the label is centred over the box and
   the box + Submit sit on one line, flush with the footer's right edge. The
   link row and the copyright below stay centred exactly as before. */

@media (min-width: 900px) {
    /* two columns: the brand block on the left, the newsletter + links +
       copyright stacked in the right column. The single row is only as tall
       as the taller column, so the footer keeps its height. */
    .mg-footer-row {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: stretch;
        gap: 0 32px;
    }

    /* logo block at the left edge and vertically centred in the footer: the
       mark sits level with the middle of the right column */
    .mg-foot-ident {
        align-items: flex-start;
        justify-self: start;
        align-self: center;
        flex: 0 0 auto;
        margin-top: 0;
    }

    .mg-foot-brand {
        justify-content: flex-start;
        flex: 0 0 auto;
    }

    .mg-foot-brand .mg-logo-img {
        width: 82px;
        max-width: 60vw;
    }

    /* newsletter: its own block at the right edge of the right column, only
       the message sits right; no bottom margin, the links row keeps its usual
       13px gap under it */
    .mg-foot-news {
        align-items: flex-end;
        align-self: flex-end;
        width: auto;
        max-width: 100%;
        margin-bottom: 0;
        text-align: right;
        flex: 0 1 auto;
    }

    .mg-news-form {
        align-items: flex-start;
        width: auto;
        max-width: 100%;
    }

    /* email box then Submit on the same line, neither stretched nor wrapped,
       the pair flush with the right edge of the footer */
    .mg-news-row {
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
        width: auto;
        max-width: none;
    }

    /* the label box is exactly as wide as the input, so its centre is the
       input's centre */
    .mg-news-label {
        align-self: flex-start;
        width: 260px;
        max-width: none;
        text-align: center;
    }

    .mg-news-input {
        width: 260px;
        max-width: 260px;
        flex: 0 0 260px;
        align-self: center;
    }

    .mg-news-form .mg-btn {
        align-self: center;
        flex: 0 0 auto;
    }

    .mg-foot-news .mg-alert {
        align-self: flex-end;
        text-align: right;
    }
}

/* narrow phones: the box and Submit no longer fit side by side, so the button
   drops under the box — both centred, the label centred over the box */
@media (max-width: 380px) {
    .mg-news-row {
        flex-wrap: wrap;
        justify-content: center;
        width: auto;
    }

    .mg-news-label {
        align-self: center;
        width: 260px;
        max-width: 100%;
    }
}

/* =========================================================================
   HOME · "OUR SERVICES" · three cards side by side from 900px up
   Same records in the same Base order — only the grouping changes: the stage
   becomes a three-column grid and three faces are on at a time, so a group of
   three is replaced by the next group of three (wrapping at the end). The turn
   is the site's own cube: the same .mg-cube / .mg-cube-face mechanics and the
   same keyframe the "Our values" slider uses, only wider — the leaving group
   rotates away to -90deg while the arriving group rotates in from +90deg on a
   stage with perspective. Every face sits in row 1, so the row is as tall as
   the tallest card for the whole loop and the section never jumps. Below 900px
   none of this applies: one card at a time and the phone cube turn stay as they
   are.
   ========================================================================= */
@media (min-width: 900px) {
    /* perspective lives on the stage so the depth is obvious; no clip path at
       all, so the turn and the cards' shadows are never cut */
    .mg-svcs .mg-cube-stage {
        perspective: 1100px;
        perspective-origin: 50% 50%;
        -webkit-clip-path: none;
        clip-path: none;
    }

    .mg-svcs-viewport {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
        align-items: stretch;
    }

    /* a face that is off the stage waits where a leaving face ends up; the 80ms
       delay on the way out lets the arriving group start turning while the old
       group is still flat, so there is never a blank moment. The rotation is
       about X, so the three cards turn as one wide cube face (the axis the
       "Our values" cube drives through the same --mg-cube-from/to variables) */
    .mg-svcs .mg-svcs-slide {
        grid-row: 1;
        width: 100%;
        max-width: none;
        margin: 0;
        transform-origin: 50% 50%;
        transform-style: preserve-3d;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        opacity: 0;
        visibility: hidden;
        transform: rotateX(var(--mg-cube-to)) scale(.92);
        transition:
            transform 750ms cubic-bezier(.4, 0, .2, 1) 80ms,
            opacity 750ms cubic-bezier(.4, 0, .2, 1) 80ms,
            visibility 0s linear 830ms;
    }

    /* the shown group: it turns in from the opposite side, then rests flat */
    .mg-svcs .mg-svcs-slide.on {
        opacity: 1;
        visibility: visible;
        z-index: 2;
        transform: none;
        animation: mg-svcs-cube-in 750ms cubic-bezier(.4, 0, .2, 1);
        transition: opacity 750ms cubic-bezier(.4, 0, .2, 1), visibility 0s linear 0s;
    }

    /* the "Our values" keyframe (mg-cube-in), scoped here with the 0.92 start
       scale and about the X axis; --mg-cube-from / --mg-cube-to are flipped by
       the script for a backward step, exactly as on the values slider */
    @keyframes mg-svcs-cube-in {
        from {
            transform: rotateX(var(--mg-cube-from)) scale(.92);
            opacity: 0;
        }

        to {
            transform: rotateX(0deg) scale(1);
            opacity: 1;
        }
    }

    /* the three cards of a row share the height of the tallest card */
    .mg-svcs .mg-svcs-slide .mg-card {
        height: 100%;
    }
}

/* set for a moment while the group is re-laid out (a window resize crossing the
   900px line): the cards jump to their new places without a turn */
.mg-svcs.mg-svcs-noanim .mg-svcs-slide,
.mg-svcs.mg-svcs-noanim .mg-svcs-slide.on {
    transition: none !important;
    animation: none !important;
}

/* =========================================================================
   HOME · "OUR SERVICES" · first paint, before the script takes over
   The cards themselves come from Base and are rendered by the app script,
   which then places the live group (and adds .mg-svcs-live to the section).
   Until that happens — script still loading, blocked, cached from another
   build, or failed — the markup alone must not leave an empty section: the
   first card, and on desktop the first three, one per column, are shown and
   placed by CSS. The moment the script paints its first group it adds
   .mg-svcs-live and every rule below stops applying, so the script's own
   placement is the only thing in charge from then on.
   ========================================================================= */
.mg-svcs:not(.mg-svcs-live) .mg-svcs-slide:nth-child(1) {
    animation: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    z-index: 2;
}

@media (min-width: 900px) {
    .mg-svcs:not(.mg-svcs-live) .mg-svcs-slide:nth-child(-n+3) {
        animation: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        grid-row: 1;
        z-index: 2;
        transition: none;
    }

    .mg-svcs:not(.mg-svcs-live) .mg-svcs-slide:nth-child(1) {
        grid-column: 1;
    }

    .mg-svcs:not(.mg-svcs-live) .mg-svcs-slide:nth-child(2) {
        grid-column: 2;
    }

    .mg-svcs:not(.mg-svcs-live) .mg-svcs-slide:nth-child(3) {
        grid-column: 3;
    }
}

/* =========================================================================
   HOME · "OUR VALUES" · three cards side by side from 900px up
   Same records in the same Base order — only the grouping changes: the stage
   becomes a three-column grid and three faces are on at a time, so 1-2-3 is
   replaced by 4-5-6 and the last step wraps back to the start. The turn is the
   site's own cube (the same --mg-cube-from/to variables and the same keyframe
   shape as "Our values" has always used, here about X so the three cards turn
   as one wide face) on a stage with perspective. Every face sits in row 1, so
   the row is as tall as the tallest card and the section never jumps. Below
   900px none of this applies: one card at a time, exactly as before.
   ========================================================================= */
@media (min-width: 900px) {
    /* perspective on the stage, no clip path at all, so the turn and the card
       shadows are never cut */
    .mg-vals .mg-cube-stage {
        perspective: 1100px;
        perspective-origin: 50% 50%;
        -webkit-clip-path: none;
        clip-path: none;
    }

    .mg-vals-viewport {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
        align-items: stretch;
    }

    /* a face that is off the stage waits where a leaving face ends up; the 80ms
       delay on the way out lets the arriving group start turning while the old
       group is still flat, so there is never a blank moment */
    .mg-vals .mg-vals-slide {
        grid-row: 1;
        width: 100%;
        max-width: none;
        margin: 0;
        transform-origin: 50% 50%;
        transform-style: preserve-3d;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        opacity: 0;
        visibility: hidden;
        transform: rotateX(var(--mg-cube-to)) scale(.92);
        transition:
            transform 750ms cubic-bezier(.4, 0, .2, 1) 80ms,
            opacity 750ms cubic-bezier(.4, 0, .2, 1) 80ms,
            visibility 0s linear 830ms;
    }

    /* the shown group: it turns in from the opposite side, then rests flat */
    .mg-vals .mg-vals-slide.on {
        opacity: 1;
        visibility: visible;
        z-index: 2;
        transform: none;
        animation: mg-vals-cube-in 750ms cubic-bezier(.4, 0, .2, 1);
        transition: opacity 750ms cubic-bezier(.4, 0, .2, 1), visibility 0s linear 0s;
    }

    @keyframes mg-vals-cube-in {
        from {
            transform: rotateX(var(--mg-cube-from)) scale(.92);
            opacity: 0;
        }

        to {
            transform: rotateX(0deg) scale(1);
            opacity: 1;
        }
    }

    /* the three cards of a row share the height of the tallest card */
    .mg-vals .mg-vals-slide .mg-value-item {
        height: 100%;
    }
}

/* set for a moment while the group is re-laid out (a window resize crossing the
   900px line): the cards jump to their new places without a turn */
.mg-vals.mg-vals-noanim .mg-vals-slide,
.mg-vals.mg-vals-noanim .mg-vals-slide.on {
    transition: none !important;
    animation: none !important;
}

/* =========================================================================
   HOME · "OUR VALUES" · first paint, before the script takes over
   Same guard as "Our services": until the script has placed a group (class
   mg-vals-live), the first card — on desktop the first three, one per column —
   is shown and placed by CSS alone, so a slow, blocked or failed script leaves
   three cards on screen instead of an empty section.
   ========================================================================= */
.mg-vals:not(.mg-vals-live) .mg-vals-slide:nth-child(1) {
    animation: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    z-index: 2;
}

@media (min-width: 900px) {
    .mg-vals:not(.mg-vals-live) .mg-vals-slide:nth-child(-n+3) {
        animation: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        grid-row: 1;
        z-index: 2;
        transition: none;
    }

    .mg-vals:not(.mg-vals-live) .mg-vals-slide:nth-child(1) {
        grid-column: 1;
    }

    .mg-vals:not(.mg-vals-live) .mg-vals-slide:nth-child(2) {
        grid-column: 2;
    }

    .mg-vals:not(.mg-vals-live) .mg-vals-slide:nth-child(3) {
        grid-column: 3;
    }
}

/* ======================================== solution mock-up micro-motion
   Each "Our Solutions" illustration carries a slow, very small loop on one or
   two details inside its own screen — a route pulse, a rising product tile, a
   feeding receipt, a glowing stamp, a booking slot. Only transform and opacity
   move (plus a pulsing stroke ring), every loop is 4–9s ease-in-out and
   infinite, parts sit on different delays so the seven cards never march in
   step, and each drawing's own 0% frame is exactly the still artwork: the loops
   that reveal something (a pulse ring, a sheen) start from an overlay whose
   resting opacity is 0. Nothing is added outside the SVG viewBox, so no card
   grows, shifts or introduces horizontal scroll.
   The device shells, laptop lids and card frames stay still: the motion is
   detail inside the screen, not the whole card floating.
   Off screen the loops cost nothing: the carousel marks its current slide
   (mg-slide-live) and its viewport (mg-slider-asleep when out of view), and
   every other drawing is held with animation-play-state. */

.mg-art-svg [class*="mg-an-"] {
    transform-box: fill-box;
    transform-origin: 50% 50%;
}

/* overlays the loops reveal are invisible at rest, so the first frame is the
   artwork exactly as it is drawn today */
.mg-an-wasel-ring,
.mg-an-store-cta,
.mg-an-menu-glide,
.mg-an-clinic-ring {
    opacity: 0;
}

@keyframes mgAnRoute {

    0%,
    100% {
        opacity: 1;
    }

    42% {
        opacity: .45;
    }

    72% {
        opacity: .82;
    }
}

@keyframes mgAnBreath {

    0%,
    100% {
        transform: translateY(0);
        opacity: 1;
    }

    50% {
        transform: translateY(-1.5px);
        opacity: .92;
    }
}

@keyframes mgAnRing {
    0% {
        transform: scale(.55);
        opacity: 0;
    }

    35% {
        opacity: .42;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

@keyframes mgAnRise {

    0%,
    100% {
        transform: translateY(0);
    }

    45% {
        transform: translateY(-2px);
    }
}

@keyframes mgAnSheen {

    0%,
    100% {
        opacity: 0;
    }

    45% {
        opacity: .2;
    }
}

@keyframes mgAnGlide {
    0% {
        transform: translateX(0);
        opacity: 0;
    }

    22% {
        opacity: .28;
    }

    52% {
        transform: translateX(30px);
        opacity: .24;
    }

    80% {
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 0;
    }
}

@keyframes mgAnLift {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-1.6px);
    }
}

@keyframes mgAnFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-2px);
    }
}

@keyframes mgAnFade {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .62;
    }
}

@keyframes mgAnFeed {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(2px);
    }
}

@keyframes mgAnBar {

    0%,
    100% {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(1.1);
    }
}

/* Wasel: route pulses, the pin halo rings out, the arrival card breathes */
.mg-an-wasel-route {
    animation: mgAnRoute 6.4s ease-in-out infinite;
}

.mg-an-wasel-route-glow {
    animation: mgAnRoute 6.4s ease-in-out infinite 3.2s;
}

.mg-an-wasel-ring {
    animation: mgAnRing 4.6s ease-in-out infinite;
}

.mg-an-wasel-card {
    animation: mgAnBreath 6.8s ease-in-out infinite 1.2s;
}

/* Store: product tiles rise in a stagger, the cart button catches the light */
.mg-an-store-tile {
    animation: mgAnRise 6s ease-in-out infinite;
}

.mg-an-store-cta {
    animation: mgAnSheen 5.2s ease-in-out infinite .8s;
}

/* Menu: the active chip highlight glides to a neighbour, the order bar lifts */
.mg-an-menu-glide {
    animation: mgAnGlide 7.4s ease-in-out infinite;
}

.mg-an-menu-cart {
    animation: mgAnLift 5.6s ease-in-out infinite 1.6s;
}

/* Invoices: the sheet floats, the total fades back and forward, PAID glows */
.mg-an-inv-sheet {
    animation: mgAnFloat 7.2s ease-in-out infinite;
}

.mg-an-inv-total {
    animation: mgAnFade 5.4s ease-in-out infinite 2s;
}

.mg-an-inv-stamp {
    animation: mgAnFade 4.4s ease-in-out infinite .4s;
}

/* POS System: the printed lines feed down, the Pay key pulses */
.mg-an-pos-feed {
    animation: mgAnFeed 5.8s ease-in-out infinite;
}

.mg-an-pos-pay {
    animation: mgAnSheen 4.8s ease-in-out infinite 1.4s;
}

/* Dashboard: bars grow from their base in a stagger, the range chip breathes */
.mg-an-dash-bar {
    transform-origin: 50% 100%;
    animation: mgAnBar 6.6s ease-in-out infinite;
}

.mg-an-dash-chip {
    animation: mgAnFade 5s ease-in-out infinite .6s;
}

/* Clinics: the chosen slot pulses, the grid breathes in a stagger,
   the confirmation tick and its ring settle */
.mg-an-clinic-sel {
    animation: mgAnFade 4.8s ease-in-out infinite;
}

.mg-an-clinic-slot {
    animation: mgAnRise 6.2s ease-in-out infinite;
}

.mg-an-clinic-tick {
    animation: mgAnFade 5.6s ease-in-out infinite 1.1s;
}

.mg-an-clinic-ring {
    animation: mgAnRing 5.6s ease-in-out infinite;
}

.mg-an-ats-row {
    animation: mgAnRise 6.2s ease-in-out infinite;
}

.mg-an-ats-badge {
    animation: mgAnFade 5.4s ease-in-out infinite .9s;
}

/* stagger offsets, deliberately uneven: last, so the shorthand above cannot
   reset them */
.mg-an-d1 {
    animation-delay: .15s;
}

.mg-an-d2 {
    animation-delay: .45s;
}

.mg-an-d3 {
    animation-delay: .8s;
}

.mg-an-d4 {
    animation-delay: 1.1s;
}

.mg-an-d5 {
    animation-delay: 1.5s;
}

.mg-an-d6 {
    animation-delay: 1.85s;
}

.mg-an-d7 {
    animation-delay: 2.2s;
}

/* only the drawing on the current slide, and only while the carousel is on
   screen, runs its loop — the other six are held still */
.mg-slide:not(.mg-slide-live) .mg-art-svg,
.mg-slide:not(.mg-slide-live) .mg-art-svg *,
.mg-slide-park .mg-art-svg,
.mg-slide-park .mg-art-svg *,
.mg-slider-asleep .mg-art-svg,
.mg-slider-asleep .mg-art-svg * {
    animation-play-state: paused;
}

/* reduced motion: every loop off, the artwork is its still first frame */
@media (prefers-reduced-motion: reduce) {

    .mg-art-svg [class*="mg-an-"] {
        animation: none !important;
    }
}
