/* assets/css/landing.css
 * Landing pública de MEGAN — dirección "dossier técnico".
 *
 * Decisiones de diseño deliberadas (para NO parecerse a una landing SaaS
 * genérica de fondo blanco y hero centrado):
 *   - Portada oscura verdeazul a sangre, no una cabecera blanca.
 *   - Composición asimétrica y alineada a la izquierda, nunca centrada.
 *   - Secciones numeradas con etiquetas monoespaciadas, sin píldoras.
 *   - Contenido en filas con reglas de un pixel (ficha técnica), sin rejilla
 *     de tarjetas con iconos redondeados.
 *
 * Todo va bajo el prefijo .mg- : style.css define reglas globales con
 * !important sobre .card, .badge, .text-muted, .bg-white y .lead para el panel.
 * De Bootstrap solo se usan grid y utilidades.
 */

/* ---------------------------------------------------------------- tokens --
 * Se declaran en el <body> de la landing y también en .mg-landing, para que la
 * misma página se vea igual cuando un usuario con sesión la abre desde el
 * panel ("Acerca del proyecto"), donde el body es el del panel.
 */
.mg-landing-body,
.mg-landing {
    /* Paleta verdeazul: el punto medio entre los dos tonos de marca de
       style.css (--primary #2E7D32 y --blue #1976D2). */
    --mg-teal: #0f766e;
    --mg-teal-strong: #115e59;
    --mg-teal-bright: #14b8a6;
    --mg-teal-subtle: rgba(15, 118, 110, 0.08);
    --mg-deep: #042f2e;
    --mg-deep-2: #06403c;
    --mg-on-deep: #d7f2ec;
    --mg-on-deep-muted: #8fc0b8;

    --mg-bg: #f6f8f8;
    --mg-surface: #ffffff;
    --mg-ink: #062522;
    --mg-ink-muted: #4c625f;
    --mg-line: #dce5e3;

    --mg-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
    --mg-radius: .375rem;   /* radios pequeños: menos "app", más documento */
}

/* El toggle de tema añade .dark-theme en <html> (assets/js/app.js). */
.dark-theme .mg-landing-body,
.dark-theme .mg-landing {
    --mg-teal: #2dd4bf;
    --mg-teal-strong: #5eead4;
    --mg-teal-bright: #5eead4;
    --mg-teal-subtle: rgba(45, 212, 191, 0.12);
    --mg-deep: #03100f;
    --mg-deep-2: #072220;
    --mg-on-deep: #d7f2ec;
    --mg-on-deep-muted: #7ea9a3;

    --mg-bg: #04100f;
    --mg-surface: #071a18;
    --mg-ink: #e8f5f3;
    --mg-ink-muted: #93aeaa;
    --mg-line: #133330;
}

/* ------------------------------------------------------------------ base -- */
/* Gana por especificidad sobre `body { background-image: ... }` de style.css. */
body.mg-landing-body {
    background: var(--mg-bg);
    background-image: none;
    color: var(--mg-ink);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;              /* ningún elemento debe desbordar en móvil */
}

.mg-landing {
    color: var(--mg-ink);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.mg-shell {
    width: 100%;
    max-width: 1240px;
    margin-inline: auto;
    padding-inline: clamp(1.15rem, 5vw, 3rem);
}
/* Solo dentro del panel el contenido ya vive en un contenedor con padding.
   El :not() es imprescindible: .mg-landing envuelve también a la landing
   pública, y sin él se anularía el padding lateral en móvil. */
body:not(.mg-landing-body) .mg-landing .mg-shell { padding-inline: 0; }

.mg-landing-body :focus-visible,
.mg-landing :focus-visible {
    outline: 2px solid var(--mg-teal-bright);
    outline-offset: 3px;
}

.mg-skip {
    position: absolute;
    left: -9999px;
    top: .5rem;
    z-index: 100;
    padding: .65rem 1rem;
    background: var(--mg-surface);
    color: var(--mg-ink);
    border: 1px solid var(--mg-line);
}
.mg-skip:focus { left: .75rem; }

/* Etiqueta monoespaciada: el sistema de rotulado de toda la landing. */
.mg-label {
    display: block;
    font-family: var(--mg-mono);
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--mg-teal);
}
.mg-label--onDeep { color: var(--mg-teal-bright); }

/* ------------------------------------------------------------------- nav -- */
.mg-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--mg-deep);
    color: var(--mg-on-deep);
    transition: box-shadow .2s ease;
}
.mg-nav.is-stuck { box-shadow: 0 1px 0 rgba(255, 255, 255, .09); }

.mg-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 62px;
}

.mg-brand {
    display: inline-flex;
    align-items: baseline;
    gap: .6rem;
    text-decoration: none;
    color: var(--mg-on-deep);
    flex-shrink: 0;
}
.mg-brand__name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: .01em;
}
.mg-brand__tag {
    font-family: var(--mg-mono);
    font-size: .68rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--mg-on-deep-muted);
}

.mg-nav__menu {
    display: flex;
    align-items: center;
    gap: .35rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.mg-nav__link {
    display: block;
    padding: .45rem .7rem;
    font-family: var(--mg-mono);
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--mg-on-deep-muted);
    text-decoration: none;
    transition: color .18s ease;
}
.mg-nav__link:hover { color: var(--mg-teal-bright); }

.mg-nav__actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
}

.mg-nav__toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .18);
    color: var(--mg-on-deep);
    font-size: 1.1rem;
}

/* --------------------------------------------------------------- botones -- */
.mg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .6rem 1.15rem;
    border: 1px solid transparent;
    border-radius: var(--mg-radius);
    font-size: .85rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.mg-btn--solid {
    background: var(--mg-teal-bright);
    color: #04231f;
}
.mg-btn--solid:hover { background: #5eead4; color: #04231f; }

.mg-btn--outline {
    background: transparent;
    color: var(--mg-on-deep);
    border-color: rgba(255, 255, 255, .25);
}
.mg-btn--outline:hover { border-color: var(--mg-teal-bright); color: var(--mg-teal-bright); }

.mg-btn--onLight {
    background: var(--mg-deep);
    color: var(--mg-on-deep);
}
.mg-btn--onLight:hover { background: var(--mg-teal-strong); color: #ffffff; }

.mg-btn--lg { padding: .85rem 1.6rem; font-size: .92rem; }

.mg-btn--icon {
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    color: var(--mg-on-deep);
    border-color: rgba(255, 255, 255, .18);
    font-size: .95rem;
}
.mg-btn--icon:hover { border-color: var(--mg-teal-bright); }

/* Enlace con subrayado que se extiende: sustituye al segundo botón. */
.mg-link-arrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .3rem 0;
    color: var(--mg-on-deep);
    text-decoration: none;
    font-size: .92rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, .3);
    transition: border-color .2s ease, color .2s ease, gap .2s ease;
}
.mg-link-arrow:hover {
    color: var(--mg-teal-bright);
    border-bottom-color: var(--mg-teal-bright);
    gap: .8rem;
}

/* ---------------------------------------------------------------- portada -- */
.mg-cover {
    position: relative;
    background: var(--mg-deep);
    color: var(--mg-on-deep);
    overflow: hidden;
}
/* Resplandor verdeazul descentrado; no captura clics ni genera scroll. */
.mg-cover::before {
    content: "";
    position: absolute;
    top: -45%;
    right: -15%;
    width: min(900px, 115vw);
    aspect-ratio: 1;
    background: radial-gradient(circle, rgba(20, 184, 166, .22) 0%, transparent 62%);
    pointer-events: none;
    z-index: 1;
}
/* El contenido siempre por encima del fondo y del resplandor. */
.mg-cover > .mg-shell { position: relative; z-index: 2; }

/* --- fondo de la portada (vídeo o imagen) --- */
.mg-cover__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}
.mg-cover__media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* La gallina está en el tercio derecho: al recortar en pantallas anchas
       conviene conservar ese lado. */
    object-position: 62% 55%;
    display: block;
    /* Sin desenfoque: la foto es de 2400px y debe verse nítida. El velo se
       encarga del contraste, no un oscurecido del propio archivo. */
    filter: saturate(.92) contrast(1.04);
}
/* Velo verdeazul: denso donde va el texto, abierto sobre la gallina. */
.mg-cover__veil {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(95deg,
            rgba(4, 47, 46, .95) 0%,
            rgba(4, 47, 46, .88) 30%,
            rgba(4, 47, 46, .62) 58%,
            rgba(4, 47, 46, .42) 100%),
        linear-gradient(180deg, rgba(4, 47, 46, .30) 0%, rgba(4, 47, 46, .20) 45%, rgba(4, 47, 46, .72) 100%);
}
.dark-theme .mg-cover__veil {
    background:
        linear-gradient(95deg,
            rgba(3, 16, 15, .96) 0%,
            rgba(3, 16, 15, .90) 30%,
            rgba(3, 16, 15, .68) 58%,
            rgba(3, 16, 15, .48) 100%),
        linear-gradient(180deg, rgba(3, 16, 15, .35) 0%, rgba(3, 16, 15, .25) 45%, rgba(3, 16, 15, .78) 100%);
}

/* En móvil el texto ocupa todo el ancho: hace falta un velo parejo y más denso. */
@media (max-width: 991.98px) {
    .mg-cover__veil {
        background: linear-gradient(180deg, rgba(4, 47, 46, .82) 0%, rgba(4, 47, 46, .90) 55%, rgba(4, 47, 46, .96) 100%);
    }
    .dark-theme .mg-cover__veil {
        background: linear-gradient(180deg, rgba(3, 16, 15, .86) 0%, rgba(3, 16, 15, .92) 55%, rgba(3, 16, 15, .97) 100%);
    }
}

/* Con movimiento reducido no se reproduce vídeo: queda solo el degradado. */
@media (prefers-reduced-motion: reduce) {
    .mg-cover__bg video.mg-cover__media { display: none; }
}

.mg-cover__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(2.5rem, 6vw, 4.5rem);
    padding-block: clamp(3rem, 9vw, 6.5rem) clamp(3rem, 8vw, 5.5rem);
    align-items: start;
}

.mg-cover__title {
    font-size: clamp(2.3rem, 6.4vw, 4.35rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.02;
    margin: 1.5rem 0 0;
    color: #ffffff;
    text-wrap: balance;
}
/* Una sola palabra en verdeazul claro; sin degradados de dos colores. */
.mg-cover__title span { color: var(--mg-teal-bright); }

.mg-cover__lead {
    font-size: clamp(1rem, 1.7vw, 1.13rem);
    line-height: 1.72;
    color: var(--mg-on-deep-muted);
    margin: 1.6rem 0 0;
    max-width: 54ch;
}

.mg-cover__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2.5rem;
}

/* Ficha de estado: filas con reglas. Lleva un velo propio muy sutil porque
   queda sobre la zona más clara de la foto de portada. */
.mg-readout {
    border-top: 1px solid rgba(255, 255, 255, .16);
    padding: .25rem 1.15rem .35rem;
    margin-inline: -1.15rem;
    border-radius: var(--mg-radius);
    background: linear-gradient(180deg, rgba(3, 26, 25, .42), rgba(3, 26, 25, .58));
    backdrop-filter: blur(6px);
}
.mg-readout__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.mg-readout__key {
    font-family: var(--mg-mono);
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--mg-on-deep-muted);
}
.mg-readout__val {
    font-size: .95rem;
    font-weight: 600;
    color: #ffffff;
    text-align: right;
}
.mg-readout__val--live {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: var(--mg-teal-bright);
}
.mg-readout__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: mg-pulse 2.4s ease-in-out infinite;
}
@keyframes mg-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .3; }
}

/* ------------------------------------------------------- secciones ------- */
.mg-section {
    padding-block: clamp(3.5rem, 8vw, 6rem);
    border-bottom: 1px solid var(--mg-line);
}
.mg-section--surface { background: var(--mg-surface); }

/* Rejilla editorial: índice numerado a la izquierda, contenido a la derecha. */
.mg-block {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
.mg-block__index { position: relative; }
.mg-block__num {
    font-family: var(--mg-mono);
    font-size: clamp(2.2rem, 5vw, 3.1rem);
    font-weight: 300;
    line-height: 1;
    color: var(--mg-line);
    display: block;
}
.mg-block__label { margin-top: .5rem; }

.mg-block__title {
    font-size: clamp(1.6rem, 3.6vw, 2.35rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.16;
    margin: 0 0 1rem;
    color: var(--mg-ink);
    text-wrap: balance;
}
.mg-block__lead {
    font-size: 1.02rem;
    line-height: 1.75;
    color: var(--mg-ink-muted);
    margin: 0;
    max-width: 62ch;
}

/* Filas de definición: etiqueta arriba, texto debajo, separadas por reglas. */
.mg-defs { margin: 2.25rem 0 0; }
.mg-def {
    padding: 1.5rem 0;
    border-top: 1px solid var(--mg-line);
}
.mg-def:last-child { border-bottom: 1px solid var(--mg-line); }
.mg-def__title {
    font-size: 1.08rem;
    font-weight: 650;
    letter-spacing: -0.015em;
    margin: .5rem 0 .5rem;
    color: var(--mg-ink);
}
.mg-def__text {
    margin: 0;
    font-size: .975rem;
    line-height: 1.72;
    color: var(--mg-ink-muted);
    max-width: 68ch;
}

/* ---------------------------------------------------- pasos (secuencia) --- */
.mg-steps {
    list-style: none;
    margin: 2.25rem 0 0;
    padding: 0;
    counter-reset: mg-step;
}
.mg-step {
    position: relative;
    counter-increment: mg-step;
    padding: 1.4rem 0 1.4rem 3.5rem;
    border-top: 1px solid var(--mg-line);
}
.mg-steps .mg-step:last-child { border-bottom: 1px solid var(--mg-line); }
.mg-step::before {
    content: counter(mg-step, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 1.45rem;
    font-family: var(--mg-mono);
    font-size: .82rem;
    font-weight: 500;
    letter-spacing: .08em;
    color: var(--mg-teal);
}
.mg-step__title {
    font-size: 1.02rem;
    font-weight: 650;
    margin: 0 0 .35rem;
    color: var(--mg-ink);
}
.mg-step__text {
    margin: 0;
    font-size: .95rem;
    line-height: 1.7;
    color: var(--mg-ink-muted);
    max-width: 62ch;
}

/* ------------------------------------------- componentes (ficha técnica) -- */
.mg-specs {
    width: 100%;
    margin: 2.25rem 0 0;
    border-collapse: collapse;
    text-align: left;
}
.mg-specs caption {
    caption-side: top;
    text-align: left;
    padding-bottom: .85rem;
    font-family: var(--mg-mono);
    font-size: .72rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--mg-ink-muted);
}
.mg-specs th,
.mg-specs td {
    padding: 1.05rem .75rem 1.05rem 0;
    border-top: 1px solid var(--mg-line);
    vertical-align: baseline;
}
.mg-specs tr:last-child th,
.mg-specs tr:last-child td { border-bottom: 1px solid var(--mg-line); }

.mg-specs__num {
    width: 3.25rem;
    font-family: var(--mg-mono);
    font-size: .8rem;
    font-weight: 500;
    color: var(--mg-teal);
    white-space: nowrap;
}
.mg-specs__name {
    width: 34%;
    font-size: 1rem;
    font-weight: 650;
    color: var(--mg-ink);
}
.mg-specs__note {
    font-size: .95rem;
    line-height: 1.65;
    color: var(--mg-ink-muted);
}
.mg-specs__flag {
    display: inline-block;
    margin-left: .5rem;
    padding: .1rem .45rem;
    border: 1px solid var(--mg-line);
    border-radius: var(--mg-radius);
    font-family: var(--mg-mono);
    font-size: .65rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--mg-ink-muted);
    vertical-align: middle;
}

/* ------------------------------------------------------------------ mapa -- */
.mg-map {
    position: relative;
    margin-top: 2.25rem;
    border: 1px solid var(--mg-line);
    border-radius: var(--mg-radius);
    overflow: hidden;
    background: var(--mg-surface);
}
.mg-map__canvas {
    /* Alto fluido: panorámico en escritorio, más alto en móvil para que el
       recorrido del mapa se aprecie sin quedar aplastado. */
    height: clamp(320px, 52vw, 480px);
    width: 100%;
    background: var(--mg-bg);
    z-index: 0;   /* mantiene los paneles de Leaflet bajo el nav sticky */
}
.mg-map__fallback {
    margin: 0;
    padding: 1.5rem;
    font-size: .95rem;
    line-height: 1.7;
    color: var(--mg-ink-muted);
}
.mg-map__fallback a { color: var(--mg-teal); }

.mg-map__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    margin-top: 1.25rem;
}
.mg-map__coords {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem 2.5rem;
    margin: 0;
}
.mg-map__coords dd {
    margin: .35rem 0 0;
    font-size: .95rem;
    font-weight: 600;
    color: var(--mg-ink);
}

/* Marcador propio (L.divIcon): sin imágenes externas. */
.mg-marker { position: relative; }
.mg-marker__dot,
.mg-marker__pulse {
    position: absolute;
    left: 50%;
    top: 50%;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}
.mg-marker__dot {
    width: 14px;
    height: 14px;
    background: #14b8a6;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
}
.mg-marker__pulse {
    width: 22px;
    height: 22px;
    background: rgba(20, 184, 166, .45);
    animation: mg-marker-pulse 2.2s ease-out infinite;
}
@keyframes mg-marker-pulse {
    0%   { transform: translate(-50%, -50%) scale(.6); opacity: .9; }
    70%  { transform: translate(-50%, -50%) scale(2.1); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(2.1); opacity: 0; }
}

/* Ajustes de los controles de Leaflet al lenguaje de la landing. */
.mg-map .leaflet-container {
    font-family: inherit;
    background: var(--mg-bg);
}
.mg-map .leaflet-control-zoom a {
    background: var(--mg-surface);
    color: var(--mg-ink);
    border-color: var(--mg-line);
}
.mg-map .leaflet-control-zoom a:hover { background: var(--mg-bg); }
.mg-map .leaflet-control-attribution {
    background: color-mix(in srgb, var(--mg-surface) 88%, transparent);
    color: var(--mg-ink-muted);
    font-size: .68rem;
}
.mg-map .leaflet-control-attribution a { color: var(--mg-teal); }
.mg-map .leaflet-popup-content-wrapper,
.mg-map .leaflet-popup-tip {
    background: var(--mg-deep);
    color: var(--mg-on-deep);
    border-radius: var(--mg-radius);
}
.mg-map .leaflet-popup-content { margin: .75rem 1rem; line-height: 1.55; }
.mg-map .leaflet-popup-content strong { color: #ffffff; }
.mg-map .leaflet-popup-close-button { color: var(--mg-on-deep-muted); }
.mg-popup__coords {
    font-family: var(--mg-mono);
    font-size: .72rem;
    color: var(--mg-teal-bright);
}

@media (prefers-reduced-motion: reduce) {
    .mg-marker__pulse { animation: none; opacity: .35; }
}

/* ---------------------------------------------------------------- equipo -- */
/* Imagen a sangre con panel de texto superpuesto; no es una tarjeta. */
.mg-team {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    background: var(--mg-deep);
    color: var(--mg-on-deep);
    overflow: hidden;
}
.mg-team__media { position: relative; min-height: 300px; }
.mg-team__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* Velo verdeazul: liga la foto con la portada y mantiene legible el texto. */
.mg-team__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(4, 47, 46, .25) 0%, rgba(4, 47, 46, .85) 100%);
}
.mg-team__body { padding: clamp(1.75rem, 4.5vw, 3.25rem); }
.mg-team__title {
    font-size: clamp(1.5rem, 3.4vw, 2.15rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.16;
    margin: 1rem 0 0;
    color: #ffffff;
    text-wrap: balance;
}
.mg-team__text {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--mg-on-deep-muted);
    margin: 1.1rem 0 0;
    max-width: 58ch;
}
.mg-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 1.75rem 0 0;
    padding: 0;
    list-style: none;
}
.mg-tag {
    padding: .38rem .7rem;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: var(--mg-radius);
    font-family: var(--mg-mono);
    font-size: .7rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mg-on-deep);
}

/* ------------------------------------------------- institución + cierre -- */
.mg-closing {
    background: var(--mg-deep-2);
    color: var(--mg-on-deep);
    padding-block: clamp(3rem, 7vw, 4.75rem);
}
.mg-closing__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    align-items: end;
}
.mg-closing__title {
    font-size: clamp(1.5rem, 3.4vw, 2.1rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.18;
    margin: 1rem 0 0;
    color: #ffffff;
    text-wrap: balance;
}
.mg-closing__text {
    font-size: 1rem;
    line-height: 1.72;
    color: var(--mg-on-deep-muted);
    margin: 1rem 0 0;
    max-width: 52ch;
}

/* ---------------------------------------------------------------- footer -- */
.mg-footer {
    background: var(--mg-deep);
    color: var(--mg-on-deep-muted);
    padding-block: 2.25rem;
    border-top: 1px solid rgba(255, 255, 255, .09);
}
.mg-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}
.mg-footer__text {
    margin: 0;
    font-size: .84rem;
    line-height: 1.7;
}
.mg-footer__text strong { color: var(--mg-on-deep); }
.mg-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.mg-footer__links a {
    display: block;
    padding: .3rem .6rem;
    font-family: var(--mg-mono);
    font-size: .7rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--mg-on-deep-muted);
    text-decoration: none;
}
.mg-footer__links a:hover { color: var(--mg-teal-bright); }

/* ------------------------------------------------------------ responsive -- */
@media (min-width: 768px) {
    .mg-closing__grid { grid-template-columns: minmax(0, 1fr) auto; }
}

@media (min-width: 992px) {
    /* Portada asimétrica: el texto pesa más que la ficha de estado. */
    .mg-cover__grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
    .mg-block { grid-template-columns: minmax(0, 210px) minmax(0, 1fr); gap: 3rem; }
    /* El índice acompaña al contenido durante el scroll. */
    .mg-block__index { position: sticky; top: 96px; align-self: start; }
    .mg-team { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .mg-team__media { min-height: 100%; }
    .mg-team__body { display: flex; flex-direction: column; justify-content: center; }
}

/* Debajo de 992px el menú pasa a un panel desplegable a pantalla completa. */
@media (max-width: 991.98px) {
    .mg-nav__toggle { display: inline-flex; }
    .mg-nav__menu {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: .5rem clamp(1.15rem, 5vw, 3rem) 1.25rem;
        background: var(--mg-deep);
        border-top: 1px solid rgba(255, 255, 255, .12);
        box-shadow: 0 18px 40px rgba(0, 0, 0, .4);
    }
    .mg-nav__menu.is-open { display: flex; }
    .mg-nav__link {
        padding: .85rem .25rem;
        font-size: .78rem;
        border-bottom: 1px solid rgba(255, 255, 255, .07);
    }
    .mg-nav__menu .mg-btn { width: 100%; margin-top: .85rem; }
    .mg-brand__tag { display: none; }
}

/* Teléfonos: la tabla de componentes se reordena en bloques legibles. */
@media (max-width: 639.98px) {
    .mg-specs,
    .mg-specs tbody,
    .mg-specs tr,
    .mg-specs th,
    .mg-specs td { display: block; width: auto; }
    .mg-specs tr {
        padding: 1.15rem 0;
        border-top: 1px solid var(--mg-line);
    }
    .mg-specs tr:last-child { border-bottom: 1px solid var(--mg-line); }
    /* El :last-child de la vista de tabla tiene más especificidad, hay que
       anularlo explícitamente o la última fila muestra reglas dobles. */
    .mg-specs th,
    .mg-specs td,
    .mg-specs tr:last-child th,
    .mg-specs tr:last-child td {
        padding: 0;
        border: 0;
    }
    .mg-specs__num { margin-bottom: .3rem; }
    .mg-specs__name { margin-bottom: .35rem; }

    .mg-cover__actions { flex-direction: column; align-items: stretch; gap: 1.15rem; }
    .mg-cover__actions .mg-btn { width: 100%; }
    .mg-link-arrow { justify-content: center; }
    .mg-footer__inner { justify-content: flex-start; }
}

/* ------------------------------------------------------- gallina 3D ------ */
.mg-hen3d {
    margin: 2.25rem 0 0;
}
.mg-hen3d__stage {
    position: relative;
    height: clamp(280px, 34vw, 420px);
    border: 1px solid var(--mg-line);
    border-radius: var(--mg-radius);
    overflow: hidden;
    /* El degradado sostiene la escena mientras Three.js arranca, y hace de
       fondo definitivo (el lienzo es transparente). */
    background:
        radial-gradient(120% 90% at 72% 12%, rgba(20, 184, 166, .16) 0%, transparent 62%),
        linear-gradient(170deg, var(--mg-deep) 0%, var(--mg-deep-2) 100%);
}
/* El lienzo aparece cuando el módulo confirma que hay WebGL. */
.mg-hen3d__canvas {
    display: block;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity .6s ease;
}
.mg-hen3d__stage.is-ready .mg-hen3d__canvas { opacity: 1; }

.mg-hen3d__fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mg-teal-bright);
    opacity: .5;
}
.mg-hen3d__fallback .mg-hen { width: min(240px, 55%); height: auto; }

/* --- variante hero ---
 * Sobre la portada no lleva panel ni borde: la gallina flota sobre la foto.
 * Un viñeteado suave la despega del fondo sin recortarla con una caja. */
.mg-hen3d--hero { margin: 0 0 1.75rem; }
.mg-hen3d--hero .mg-hen3d__stage {
    height: clamp(210px, 26vw, 320px);
    border: 0;
    border-radius: 0;
    background: radial-gradient(58% 58% at 52% 62%, rgba(3, 26, 25, .55) 0%, transparent 72%);
}

.mg-hen3d__caption {
    margin: .9rem 0 0;
    font-size: .9rem;
    line-height: 1.65;
    color: var(--mg-ink-muted);
    max-width: 62ch;
}
.mg-hen3d__caption .mg-label { margin-bottom: .3rem; }

/* En táctil no hay puntero al que seguir: se ajusta el texto. */
@media (hover: none) {
    .mg-hen3d__caption .mg-hen3d__hint { display: none; }
}

/* ------------------------------------------------- adornos: aves y huevos --
 * Decorativos y no interactivos. Se colocan dentro de secciones con
 * position:relative y nunca deben provocar scroll horizontal, por eso van
 * siempre con inset holgado y el body mantiene overflow-x:hidden.
 */
.mg-ornament {
    position: absolute;
    pointer-events: none;
    user-select: none;
    z-index: 0;
    color: var(--mg-teal);
    opacity: .09;
}
.dark-theme .mg-ornament { opacity: .13; }

/* El contenido de las secciones va por encima de los adornos. */
.mg-section { position: relative; }
.mg-section > .mg-shell { position: relative; z-index: 1; }

.mg-ornament--tl { top: 6%;  left: 2%; }
.mg-ornament--tr { top: 8%;  right: 3%; }
.mg-ornament--bl { bottom: 6%; left: 3%; }
.mg-ornament--br { bottom: 5%; right: 4%; }

/* --- gallina --- */
.mg-ornament--hen { width: clamp(120px, 15vw, 210px); }
.mg-hen { width: 100%; height: auto; display: block; }
.mg-hen__body-group {
    transform-origin: 60px 60px;
    animation: mg-hen-breath 4.2s ease-in-out infinite;
}
/* El picoteo gira la cabeza sobre el cuello, no sobre el centro del dibujo. */
.mg-hen__head {
    transform-origin: 78px 44px;
    animation: mg-hen-peck 3.4s ease-in-out infinite;
}
.mg-hen__wing {
    transform-origin: 57px 56px;
    animation: mg-hen-wing 3.8s ease-in-out infinite;
}

@keyframes mg-hen-breath {
    0%, 100% { transform: scale(1)      translateY(0); }
    50%      { transform: scale(1.015)  translateY(-2px); }
}
@keyframes mg-hen-peck {
    0%, 55%, 100% { transform: rotate(0deg); }
    68%           { transform: rotate(20deg); }
    80%           { transform: rotate(4deg); }
}
@keyframes mg-hen-wing {
    0%, 100% { transform: rotate(0deg)   translateY(0); }
    50%      { transform: rotate(-6deg)  translateY(-2px); }
}

/* --- huevos --- */
.mg-ornament--eggs,
.mg-ornament--egg {
    width: clamp(90px, 11vw, 150px);
    height: clamp(110px, 13vw, 180px);
}
.mg-egg {
    position: absolute;
    display: block;
    width: calc(26px * var(--s, 1));
    animation: mg-egg-drift 9s ease-in-out infinite;
    animation-delay: calc(var(--i, 0) * -2.1s);
}
.mg-egg:nth-child(1) { left: 4%;  top: 12%; }
.mg-egg:nth-child(2) { left: 52%; top: 0%; }
.mg-egg:nth-child(3) { left: 26%; top: 46%; }
.mg-egg:nth-child(4) { left: 66%; top: 58%; }
.mg-egg__svg { width: 100%; height: auto; display: block; }

@keyframes mg-egg-drift {
    0%, 100% { transform: translateY(0)     rotate(-8deg); }
    50%      { transform: translateY(-16px) rotate(8deg); }
}

/* En pantallas pequeñas los adornos grandes estorban al texto. */
@media (max-width: 767.98px) {
    .mg-ornament--hen { width: 96px; opacity: .07; }
    .mg-ornament--eggs { display: none; }
}

/* Sin movimiento: los adornos se quedan quietos, no desaparecen. */
@media (prefers-reduced-motion: reduce) {
    .mg-hen__body-group,
    .mg-hen__head,
    .mg-hen__wing,
    .mg-egg { animation: none; }
}

/* --------------------------------------------------------- animación in --- */
.mg-reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .55s cubic-bezier(.16, 1, .3, 1), transform .55s cubic-bezier(.16, 1, .3, 1);
}
.mg-reveal.is-visible { opacity: 1; transform: none; }

/* Sin animaciones si el sistema las desactiva; el contenido queda visible. */
@media (prefers-reduced-motion: reduce) {
    .mg-landing-body *,
    .mg-landing-body *::before,
    .mg-landing-body *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
    .mg-reveal { opacity: 1; transform: none; }
}

/* Fallback: si el JS no corre, nada debe quedar invisible. */
.no-js .mg-reveal { opacity: 1; transform: none; }
