/* ==========================================================
   MG Sistemas Informaticos
   Paleta: tinta azul profundo + cian eléctrico + violeta
   Tipografías: Unbounded (títulos) / Manrope (texto)
   ========================================================== */

:root {
    --ink: #050816;
    --line: rgba(150, 175, 255, .16);
    --line-strong: rgba(150, 175, 255, .32);
    --glass: rgba(14, 22, 56, .55);
    --text: #e8edff;
    --muted: #9aa7cf;
    --cyan: #35dbff;
    --violet: #8a6bff;
    --ok: #3cf2a8;
    --radius-lg: 28px;
    --radius-md: 18px;
    --font-display: 'Unbounded', system-ui, sans-serif;
    --font-body: 'Manrope', system-ui, sans-serif;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 84px;
}

body {
    background: var(--ink);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.65;
    overflow-x: hidden;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { color: #fff; }

:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
    border-radius: 6px;
}

.skip-link {
    position: fixed;
    top: .75rem;
    left: .75rem;
    z-index: 2000;
    background: var(--cyan);
    color: var(--ink);
    padding: .5rem 1rem;
    border-radius: 10px;
}

/* ---------- Fondo animado ---------- */

.aurora, .grid-overlay, #bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.aurora { overflow: hidden; }
.aurora span {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
}
.aurora .a1 {
    width: 46vw; height: 46vw; left: -12vw; top: -14vw;
    background: #2a5bff; opacity: .32;
    animation: drift-a 26s ease-in-out infinite alternate;
}
.aurora .a2 {
    width: 40vw; height: 40vw; right: -10vw; top: 22vh;
    background: #7a4dff; opacity: .28;
    animation: drift-b 32s ease-in-out infinite alternate;
}
.aurora .a3 {
    width: 34vw; height: 34vw; left: 30vw; bottom: -18vw;
    background: #06b6d4; opacity: .2;
    animation: drift-a 38s ease-in-out infinite alternate-reverse;
}

@keyframes drift-a { to { transform: translate(8vw, 10vh) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-9vw, -8vh) scale(.9); } }

.grid-overlay {
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 64px 64px;
    opacity: .3;
    -webkit-mask-image: radial-gradient(ellipse at 50% 25%, #000 15%, transparent 75%);
            mask-image: radial-gradient(ellipse at 50% 25%, #000 15%, transparent 75%);
}

main, .site-footer { position: relative; z-index: 1; }

/* ---------- Menú ---------- */

.navbar-mg {
    z-index: 1030;
    padding: .9rem 0;
    transition: background .3s ease, padding .3s ease, border-color .3s ease;
    border-bottom: 1px solid transparent;
}
.navbar-mg.is-scrolled {
    background: rgba(5, 8, 22, .75);
    -webkit-backdrop-filter: blur(14px);
            backdrop-filter: blur(14px);
    border-bottom-color: var(--line);
    padding: .55rem 0;
}

.brand-logo {
    height: 52px;
    width: auto;
    display: block;
    filter: drop-shadow(0 0 14px rgba(53, 219, 255, .22));
    transition: height .3s ease;
}
.navbar-mg.is-scrolled .brand-logo { height: 42px; }
.footer-logo { height: 40px; width: auto; opacity: .9; }
.brand-text {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: .95rem;
    letter-spacing: -.01em;
    color: var(--text);
}

.navbar-mg .nav-link {
    color: var(--muted);
    font-weight: 600;
    font-size: .98rem;
    padding: .5rem .9rem;
    transition: color .2s ease;
}
.navbar-mg .nav-link:hover,
.navbar-mg .nav-link.active { color: #fff; }

.navbar-toggler { border-color: var(--line-strong); }
.navbar-toggler:focus { box-shadow: 0 0 0 .2rem rgba(53, 219, 255, .35); }

@media (max-width: 991.98px) {
    .navbar-mg .navbar-collapse {
        margin-top: .8rem;
        padding: 1rem;
        background: rgba(8, 13, 36, .92);
        border: 1px solid var(--line);
        border-radius: var(--radius-md);
    }
}

/* ---------- Botones ---------- */

.btn-acceder {
    color: var(--cyan);
    border: 1px solid var(--cyan);
    border-radius: 999px;
    padding: .45rem 1.2rem;
    font-weight: 700;
    transition: background .25s ease, color .25s ease, box-shadow .25s ease;
}
.btn-acceder:hover {
    background: var(--cyan);
    color: var(--ink);
    box-shadow: 0 0 24px rgba(53, 219, 255, .45);
}

.btn-mg {
    background: linear-gradient(120deg, #35dbff, #7e9bff);
    color: var(--ink);
    border: 0;
    border-radius: 999px;
    font-weight: 700;
    padding: .75rem 1.8rem;
    transition: transform .2s ease, box-shadow .2s ease;
}
.btn-mg:hover {
    color: var(--ink);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(53, 219, 255, .35);
}

.btn-ghost {
    color: var(--text);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-weight: 600;
    padding: .75rem 1.8rem;
    transition: border-color .2s ease, background .2s ease;
}
.btn-ghost:hover {
    color: #fff;
    border-color: var(--cyan);
    background: rgba(53, 219, 255, .08);
}

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

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 0 5rem;
}

.hero h1 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(2.1rem, 4.6vw, 3.7rem);
    line-height: 1.12;
    letter-spacing: -.025em;
    margin-bottom: 1.5rem;
}

.hero-lead {
    color: var(--muted);
    max-width: 52ch;
    margin-bottom: 2rem;
}

.hero-place {
    margin-top: 2rem;
    color: var(--muted);
    font-size: .95rem;
}

/* Secuencia de entrada: único momento de movimiento al cargar */
@keyframes rise {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}
.hero-seq > * {
    opacity: 0;
    animation: rise .9s cubic-bezier(.2, .7, .2, 1) forwards;
}
.hero-seq > :nth-child(1) { animation-delay: .1s; }
.hero-seq > :nth-child(2) { animation-delay: .3s; }
.hero-seq > :nth-child(3) { animation-delay: .5s; }
.hero-seq > :nth-child(4) { animation-delay: .7s; }

/* Terminal */

.terminal {
    background: var(--glass);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .45), 0 0 60px rgba(53, 219, 255, .08);
    -webkit-backdrop-filter: blur(16px);
            backdrop-filter: blur(16px);
    overflow: hidden;
    opacity: 0;
    animation: rise 1s cubic-bezier(.2, .7, .2, 1) .5s forwards;
}
.terminal-bar {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .85rem 1.1rem;
    border-bottom: 1px solid var(--line);
}
.terminal-bar i {
    width: 10px; height: 10px; border-radius: 50%;
    background: rgba(150, 175, 255, .3);
}
.terminal-bar span {
    margin-left: .6rem;
    color: var(--muted);
    font-size: .85rem;
}
.terminal-body { padding: 1.4rem 1.5rem 1.6rem; font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: .95rem; }
.terminal-body p { margin: 0 0 .7rem; }
.terminal-body p:last-child { margin-bottom: 0; }
.t-dim { color: var(--muted); }
.t-ok { color: var(--ok); margin-right: .4rem; }
.t-live { color: var(--ok); margin-right: .4rem; animation: pulse 1.8s ease-in-out infinite; }

@keyframes line-in { from { opacity: 0; } to { opacity: 1; } }
.term-line {
    opacity: 0;
    animation: line-in .4s ease forwards;
    animation-delay: calc(1.1s + var(--i) * .55s);
}
.cursor { animation: blink 1s steps(2) infinite; color: var(--cyan); }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- Secciones ---------- */

.section { padding: 6rem 0; }

.section-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    line-height: 1.2;
    letter-spacing: -.02em;
    max-width: 20ch;
    margin-bottom: 3rem;
}
#contacto .section-title { margin-bottom: 1.2rem; }
.text-muted-mg { color: var(--muted); }

/* ---------- Bento de servicios ---------- */

.bento {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
}

.tile {
    background: var(--glass);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 1.8rem;
    -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
    transition: border-color .25s ease;
}
.tile:hover { border-color: var(--line-strong); }
.tile h3 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.1rem;
    letter-spacing: -.01em;
    margin-bottom: .7rem;
}
.tile p { color: var(--muted); margin-bottom: 0; }
.tile-icon { font-size: 1.6rem; color: var(--cyan); display: block; margin-bottom: 1rem; }

.tile-main {
    grid-column: span 7;
    grid-row: span 2;
    border-radius: var(--radius-lg);
    padding: 2.2rem;
    display: flex;
    flex-direction: column;
}
.tile-main h3 { font-size: 1.5rem; }
.tile-art { margin-top: auto; padding-top: 2rem; width: 100%; max-width: 420px; }

.tile-rubros { grid-column: span 5; }

.tile-soporte {
    grid-column: span 5;
    border-color: rgba(60, 242, 168, .28);
}
.tile-status {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-size: .9rem;
    color: var(--ok) !important;
    margin-bottom: .4rem !important;
}
.live-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 0 rgba(60, 242, 168, .6);
    animation: ping 2s ease-out infinite;
}
@keyframes ping {
    70%  { box-shadow: 0 0 0 10px rgba(60, 242, 168, 0); }
    100% { box-shadow: 0 0 0 0 rgba(60, 242, 168, 0); }
}
.tile-big {
    font-size: 2.6rem !important;
    line-height: 1.1;
    margin-bottom: .6rem !important;
}

.tile-wide {
    grid-column: span 12;
    display: flex;
    align-items: center;
    gap: 1.4rem;
}
.tile-wide .tile-icon { margin: 0; font-size: 2.2rem; }
.tile-wide h3 { margin-bottom: .3rem; }

@media (max-width: 991.98px) {
    .tile-main, .tile-rubros, .tile-soporte, .tile-wide { grid-column: span 12; grid-row: auto; }
}

/* ---------- Proceso ---------- */

.steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    position: relative;
}
.steps::before {
    content: '';
    position: absolute;
    top: 28px;
    left: 28px;
    right: 28px;
    height: 1px;
    background: linear-gradient(90deg, var(--cyan), var(--violet));
    opacity: .5;
}
.steps li { position: relative; }
.step-node {
    position: relative;
    display: grid;
    place-items: center;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--ink);
    border: 1px solid var(--cyan);
    color: var(--cyan);
    font-size: 1.3rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 0 24px rgba(53, 219, 255, .2);
}
.steps h3 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.05rem;
    margin-bottom: .4rem;
}
.steps p { color: var(--muted); margin: 0; max-width: 28ch; }

@media (max-width: 991.98px) {
    .steps { grid-template-columns: 1fr; gap: 2rem; }
    .steps::before {
        top: 28px; bottom: 28px; left: 28px; right: auto;
        width: 1px; height: auto;
    }
    .steps li { padding-left: 5rem; }
    .step-node { position: absolute; left: 0; top: 0; margin: 0; }
}

/* ---------- Contacto ---------- */

.contact-list { margin-top: 2rem; }
.contact-list li {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .7rem 0;
    word-break: break-word;
}
.contact-list i { color: var(--cyan); font-size: 1.2rem; }

.contact-form {
    background: var(--glass);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    padding: 2rem;
    -webkit-backdrop-filter: blur(14px);
            backdrop-filter: blur(14px);
}
.form-label { color: var(--muted); font-weight: 600; font-size: .95rem; }
.contact-form .form-control {
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 12px;
    padding: .75rem 1rem;
}
.contact-form .form-control:focus {
    background: rgba(255, 255, 255, .06);
    border-color: var(--cyan);
    box-shadow: 0 0 0 .2rem rgba(53, 219, 255, .2);
}
.trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------- Footer ---------- */

.site-footer {
    border-top: 1px solid var(--line);
    padding: 2rem 0;
    color: var(--muted);
    font-size: .95rem;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--cyan); }

/* ---------- Movimiento reducido ---------- */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
    .hero-seq > *, .terminal, .term-line { opacity: 1; }
}
