/* =========================================================
   MS Electrical — capa visual 2026
   Se carga después de site.css y solo ajusta apariencia:
   tipografía, colores, portada nueva (clases hm-*),
   transiciones y efectos. Si se quita este archivo, el
   sitio vuelve a verse como antes.
   ========================================================= */

:root {
    --blue: #1f6feb;
    --blue-dark: #1858c4;

    --ink: #0a0f1a;
    --ink-2: #0f1626;
    --surface: #111a2c;
    --line: rgba(255, 255, 255, 0.09);
    --text-on-dark: #e8edf6;
    --muted-on-dark: #a3aec2;
    --quiet-on-dark: #8b97ad;
    --sky: #6aaeff;
    --amber: #f2a93b;
    --paper: #f3f5f9;
    --paper-line: #e2e7ef;
    --ink-text: #3b4558;
    --ink-quiet: #5a6578;
    --link-on-light: #1f5fd1;

    --font-display:
        "Space Grotesk",
        Inter,
        "Segoe UI",
        sans-serif;

    --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Tipografía ---------- */

body {
    font-family:
        Inter,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
.brand-copy strong {
    font-family: var(--font-display);
}

h1,
h2 {
    font-weight: 700;
}

/* ---------- Marca: el logo es un cuadrado oscuro; se enmarca
   para que se distinga sobre el encabezado oscuro ---------- */

.brand-logo {
    width: 46px;
    max-width: none;
    height: 46px;
    object-fit: cover;
    border-radius: 12px;
    background: #0b1530;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.16),
        0 6px 18px rgba(31, 111, 235, 0.28);
    transition: transform 0.35s var(--ease-out);
}

.brand:hover .brand-logo {
    transform: rotate(-6deg) scale(1.05);
}

.brand-logo-footer {
    width: 52px;
    height: 52px;
}

@media (max-width: 780px) {
    .brand-logo {
        width: 42px;
        max-width: none;
        height: 42px;
    }

    .brand-logo-footer {
        width: 48px;
        height: 48px;
    }
}

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

.button {
    gap: 10px;
    font-weight: 650;
    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease;
}

.button:hover,
.button:focus-visible {
    box-shadow: 0 12px 30px rgba(31, 111, 235, 0.35);
}

.button-secondary:hover,
.button-secondary:focus-visible {
    box-shadow: none;
}

.button svg {
    transition: transform 0.25s ease;
}

.button:hover svg {
    transform: translateX(4px);
}

/* ---------- Pie de página ---------- */

.site-footer {
    background: var(--ink);
}

/* =========================================================
   Portada (templates/core/home.html)
   ========================================================= */

.hm-hero {
    min-height: 0;
    padding: 150px 0 72px;
    background:
        radial-gradient(
            circle at 82% 30%,
            rgba(31, 111, 235, 0.22),
            transparent 38%
        ),
        radial-gradient(
            circle at 10% 90%,
            rgba(242, 169, 59, 0.07),
            transparent 30%
        ),
        var(--ink);
}

.hm-hero-row {
    position: relative;
    z-index: 1;
    display: grid;
    align-items: center;
    gap: 56px;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

.hm-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 22px;
    padding: 6px 14px 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    color: #c9d2e3;
    font-size: 0.8rem;
    font-weight: 500;
}

.hm-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--amber);
    animation: fxPulse 2.2s infinite;
}

.hm-hero h1 {
    max-width: 640px;
    font-size: clamp(2.4rem, 4.4vw, 3.6rem);
    letter-spacing: -0.035em;
    line-height: 1.03;
}

.hm-hero h1 span {
    display: inline;
}

.hm-shine {
    color: var(--sky);
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
    .hm-shine {
        background:
            linear-gradient(
                90deg,
                var(--sky) 0%,
                #bfdcff 25%,
                var(--sky) 50%,
                var(--sky) 100%
            );
        background-size: 200% 100%;
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        animation: fxShine 6s linear infinite;
    }
}

.hm-hero .hero-description {
    max-width: 520px;
    margin-top: 24px;
    color: #b4bfd2;
    font-size: 1.12rem;
}

.hm-hero .hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 34px;
}

.hm-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    margin: 32px 0 0;
    padding: 0;
    color: var(--muted-on-dark);
    font-size: 0.88rem;
    list-style: none;
}

.hm-checks li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hm-checks li::before {
    color: var(--sky);
    font-weight: 700;
    content: "✓";
}

/* Collage de proyectos */

.hm-collage {
    display: grid;
    gap: 14px;
    grid-template-columns: 1.35fr 1fr;
    grid-template-rows: 230px 230px;
}

.hm-collage.hm-count-1 {
    grid-template-columns: 1fr;
}

.hm-collage .is-big,
.hm-collage.hm-count-2 .hm-tile {
    grid-row: 1 / span 2;
}

.hm-tile {
    position: relative;
    display: block;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 18px;
    background: var(--surface);
    animation: fxZoom 1s var(--ease-out) both;
    transition: box-shadow 0.5s ease;
}

.hm-tile:nth-child(2) {
    animation-delay: 0.2s;
}

.hm-tile:nth-child(3) {
    animation-delay: 0.35s;
}

.hm-tile img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.9s var(--ease-out);
}

.hm-tile:hover img {
    transform: scale(1.07);
}

.hm-tile:hover {
    box-shadow: 0 24px 60px rgba(31, 111, 235, 0.35);
}

.hm-tile-card {
    position: absolute;
    right: 14px;
    bottom: 14px;
    left: 14px;
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(10, 15, 26, 0.86);
    color: #ffffff;
    backdrop-filter: blur(6px);
}

.hm-tile-kicker {
    color: var(--amber);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hm-tile-card strong {
    margin-top: 2px;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
}

.hm-tile-card small {
    color: var(--muted-on-dark);
    font-size: 0.8rem;
}

.hm-tile-tag {
    position: absolute;
    right: 10px;
    bottom: 10px;
    left: 10px;
    overflow: hidden;
    width: fit-content;
    max-width: calc(100% - 20px);
    padding: 5px 10px;
    border-radius: 8px;
    background: rgba(10, 15, 26, 0.86);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Franja de confianza */

.hm-trust {
    padding: 0 0 8px;
    background: var(--ink);
}

.hm-trust-grid {
    display: grid;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 18px;
    background: var(--ink-2);
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.hm-trust-grid article {
    display: flex;
    flex-direction: column;
    padding: 24px 28px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.hm-trust-grid article:last-child {
    border-right: 0;
}

.hm-trust-grid strong {
    color: #ffffff;
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.hm-trust-grid span {
    margin-top: 2px;
    color: var(--muted-on-dark);
    font-size: 0.88rem;
}

/* Secciones oscuras */

.hm-section {
    color: var(--text-on-dark);
    background: var(--ink);
}

.hm-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 48px;
}

.hm-heading h2,
.hm-h2 {
    max-width: 680px;
    margin: 0;
    color: #ffffff;
    font-size: clamp(2rem, 4vw, 2.9rem);
    letter-spacing: -0.03em;
    line-height: 1.08;
}

.hm-more {
    color: var(--sky);
    font-size: 0.95rem;
    font-weight: 600;
}

.hm-more span {
    display: inline-block;
    transition: transform 0.25s ease;
}

.hm-more:hover span {
    transform: translateX(4px);
}

/* Tarjetas de servicio */

.hm-services {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 980px) {
    .hm-services {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .hm-services {
        grid-template-columns: 1fr;
    }
}

.hm-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    color: var(--text-on-dark);
    background: var(--surface);
    transition:
        transform 0.35s var(--ease-out),
        box-shadow 0.35s ease,
        border-color 0.35s ease;
}

.hm-card:hover,
.hm-card:focus-visible {
    border-color: rgba(106, 174, 255, 0.45);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.28);
    transform: translateY(-6px);
}

.hm-ico {
    display: flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: var(--sky);
    background: rgba(46, 139, 255, 0.14);
    transition: transform 0.35s ease;
}

.hm-ico.is-warm {
    color: var(--amber);
    background: rgba(242, 169, 59, 0.14);
}

.hm-card:hover .hm-ico {
    transform: rotate(-8deg) scale(1.1);
}

.hm-card-kicker {
    color: var(--quiet-on-dark);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hm-card-title {
    color: #ffffff;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.2;
}

.hm-card-text {
    color: var(--muted-on-dark);
    font-size: 0.94rem;
}

.hm-card-link {
    margin-top: auto;
    padding-top: 6px;
    color: var(--sky);
    font-size: 0.88rem;
    font-weight: 600;
}

.hm-card-link span {
    display: inline-block;
    transition: transform 0.25s ease;
}

.hm-card:hover .hm-card-link span {
    transform: translateX(4px);
}

/* Proyectos (sección clara) */

.hm-projects {
    padding: 110px 0;
    color: var(--ink);
    background: var(--paper);
}

.hm-projects .eyebrow-dark,
.hm-projects .hm-more {
    color: var(--link-on-light);
}

.hm-projects .hm-heading h2 {
    color: var(--ink);
}

.hm-case {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--paper-line);
    border-radius: 22px;
    background: #ffffff;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

.hm-case-img {
    position: relative;
    display: block;
    overflow: hidden;
    min-height: 420px;
    background: var(--paper-line);
}

.hm-case-img img,
.hm-pcard-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1s var(--ease-out);
}

.hm-case:hover .hm-case-img img,
.hm-pcard:hover .hm-pcard-img img {
    transform: scale(1.05);
}

.hm-case-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 44px 44px 40px;
}

.hm-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hm-chips span {
    padding: 4px 12px;
    border-radius: 999px;
    color: var(--ink-text);
    background: #eef1f5;
    font-size: 0.75rem;
    font-weight: 600;
}

.hm-chips .is-amber {
    color: #8a5300;
    background: #fff3df;
}

.hm-chips .is-blue {
    color: var(--link-on-light);
    background: #eaf1fe;
}

.hm-case h3 {
    margin: 0;
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    letter-spacing: -0.02em;
    line-height: 1.12;
}

.hm-facts {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 4px 0 0;
}

.hm-facts div {
    display: flex;
    gap: 14px;
}

.hm-facts dt {
    flex: 0 0 96px;
    padding-top: 3px;
    color: var(--ink-quiet);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hm-facts dd,
.hm-case-text {
    margin: 0;
    color: var(--ink-text);
    font-size: 0.94rem;
}

.hm-btn-dark {
    align-self: flex-start;
    margin-top: auto;
    border-color: var(--ink);
    background: var(--ink);
}

.hm-btn-dark:hover,
.hm-btn-dark:focus-visible {
    border-color: #1c2740;
    background: #1c2740;
    box-shadow: 0 12px 30px rgba(10, 15, 26, 0.25);
}

.hm-pgrid {
    display: grid;
    gap: 20px;
    margin-top: 20px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.hm-pcard {
    display: flex;
    overflow: hidden;
    flex-direction: column;
    border: 1px solid var(--paper-line);
    border-radius: 22px;
    color: var(--ink);
    background: #ffffff;
    transition:
        transform 0.35s var(--ease-out),
        box-shadow 0.35s ease;
}

.hm-pcard:hover,
.hm-pcard:focus-visible {
    box-shadow: 0 26px 60px rgba(10, 15, 26, 0.16);
    transform: translateY(-6px);
}

.hm-pcard-img {
    position: relative;
    display: block;
    overflow: hidden;
    height: 280px;
    background: var(--paper-line);
}

.hm-pcard-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px 28px 28px;
}

.hm-pcard-meta {
    color: var(--ink-quiet);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hm-pcard-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.hm-pcard-text {
    color: var(--ink-text);
    font-size: 0.94rem;
}

/* Proceso */

.hm-steps {
    display: grid;
    gap: 16px;
    margin: 52px 0 0;
    padding: 0;
    list-style: none;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.hm-steps li {
    padding: 28px;
    border-top: 2px solid rgba(255, 255, 255, 0.18);
    border-radius: 0 0 16px 16px;
    background: var(--ink-2);
    transition:
        border-color 0.4s ease,
        transform 0.35s ease;
}

.hm-steps li:first-child {
    border-top-color: var(--blue);
}

.hm-steps li:hover {
    border-top-color: var(--sky);
    transform: translateY(-4px);
}

.hm-steps span {
    color: var(--sky);
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
}

.hm-steps h3 {
    margin: 10px 0 6px;
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 600;
}

.hm-steps p {
    margin: 0;
    color: var(--muted-on-dark);
    font-size: 0.94rem;
}

/* Llamado final */

.hm-cta-wrap {
    padding: 0 0 110px;
    background: var(--warm-white);
}

.hm-faq + .hm-cta-wrap,
.hm-clarity + .hm-cta-wrap {
    padding-top: 0;
}

.hm-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 32px 40px;
    padding: 56px;
    border-radius: 26px;
    color: #ffffff;
    background:
        radial-gradient(
            circle at 90% 10%,
            rgba(255, 255, 255, 0.16),
            transparent 40%
        ),
        linear-gradient(135deg, var(--blue), var(--blue-dark));
}

.hm-cta > div:first-child {
    flex: 1 1 440px;
    min-width: 0;
}

.hm-cta h2 {
    margin: 0;
    font-size: clamp(1.9rem, 3.6vw, 2.75rem);
    letter-spacing: -0.03em;
    line-height: 1.08;
}

.hm-cta p {
    max-width: 540px;
    margin: 16px 0 0;
    color: #e4eeff;
    font-size: 1.05rem;
}

.hm-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hm-btn-light {
    border-color: #ffffff;
    color: var(--ink);
    background: #ffffff;
    font-weight: 700;
}

.hm-btn-light:hover,
.hm-btn-light:focus-visible {
    border-color: #ffffff;
    color: var(--ink);
    background: #eaf1fe;
    box-shadow: 0 12px 30px rgba(10, 15, 26, 0.25);
}

.hm-cta .button-secondary {
    border-color: rgba(255, 255, 255, 0.7);
}

/* Portada en tableta y móvil */

@media (max-width: 980px) {
    .hm-hero {
        padding-top: 128px;
    }

    .hm-hero-row {
        gap: 44px;
        grid-template-columns: 1fr;
    }

    .hm-case {
        grid-template-columns: 1fr;
    }

    .hm-case-img {
        min-height: 300px;
    }
}

@media (max-width: 720px) {
    .hm-collage {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 240px 150px;
    }

    .hm-collage .is-big {
        grid-column: 1 / span 2;
        grid-row: auto;
    }

    .hm-collage.hm-count-1 {
        grid-template-columns: 1fr;
        grid-template-rows: 280px;
    }

    .hm-collage.hm-count-2 {
        grid-template-rows: 240px 160px;
    }

    .hm-collage.hm-count-2 .hm-tile {
        grid-row: auto;
    }

    .hm-trust-grid {
        grid-template-columns: 1fr 1fr;
    }

    .hm-trust-grid article {
        padding: 18px 16px;
        border-right: 1px solid rgba(255, 255, 255, 0.08);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .hm-trust-grid article:nth-child(2n) {
        border-right: 0;
    }

    .hm-trust-grid article:nth-last-child(-n + 2) {
        border-bottom: 0;
    }

    .hm-trust-grid strong {
        font-size: 1.25rem;
    }

    .hm-trust-grid span {
        font-size: 0.8rem;
    }

    .hm-case-body {
        padding: 28px 24px 30px;
    }

    .hm-facts div {
        flex-direction: column;
        gap: 2px;
    }

    .hm-facts dt {
        flex-basis: auto;
    }

    .hm-pcard-img {
        height: 220px;
    }

    .hm-projects {
        padding: 80px 0;
    }

    .hm-cta {
        padding: 36px 24px;
    }

    .hm-cta-actions,
    .hm-cta-actions .button,
    .hm-hero .hero-actions .button {
        width: 100%;
    }
}

/* =========================================================
   Efectos y transiciones (todo el sitio)
   ========================================================= */

@keyframes fxUp {
    from {
        opacity: 0;
        transform: translateY(28px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes fxZoom {
    from {
        opacity: 0;
        transform: scale(1.06);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes fxPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(242, 169, 59, 0.6);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(242, 169, 59, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(242, 169, 59, 0);
    }
}

@keyframes fxShine {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

/* Entrada escalonada del texto de portada */

.fx-up {
    animation: fxUp 0.8s var(--ease-out) both;
}

.d1 { animation-delay: 0.08s; }
.d2 { animation-delay: 0.18s; }
.d3 { animation-delay: 0.3s; }
.d4 { animation-delay: 0.42s; }
.d5 { animation-delay: 0.55s; }

/* Aparición al hacer scroll. La clase js-reveal la pone un script
   en <head>; sin JavaScript todo queda visible. */

.js-reveal .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition:
        opacity 0.8s var(--ease-out),
        transform 0.8s var(--ease-out);
    transition-delay: var(--reveal-delay, 0s);
}

.js-reveal .reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* Las tarjetas que ya se mueven al pasar el mouse conservan
   esa transición una vez visibles. */
.js-reveal .hm-card.reveal.is-visible,
.js-reveal .hm-pcard.reveal.is-visible,
.js-reveal .hm-steps li.reveal.is-visible {
    transition:
        opacity 0.8s var(--ease-out),
        transform 0.35s var(--ease-out),
        box-shadow 0.35s ease,
        border-color 0.35s ease;
    transition-delay: 0s;
}

/* Zoom suave de fotos en páginas internas */

.project-card-media,
.project-card {
    overflow: hidden;
}

.project-card-media img {
    transition: transform 0.9s var(--ease-out);
}

.project-card:hover .project-card-media img {
    transform: scale(1.05);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    .js-reveal .reveal {
        opacity: 1;
        transform: none;
    }
}
