/* ---------- NOSOTROS (cubos) ---------- */

.nosotros-premium {
    --n-bg: #070506;               /* igualalo al fondo de tu sitio si es otro */
    --n-line: rgba(255, 255, 255, .12);
    --n-accent: var(--accent, #ff3b52);
    --n-accent-rgb: 255, 59, 82;
    --n-muted: rgba(255, 255, 255, .64);

    position: relative;
    isolation: isolate;
    max-width: none;
    padding-block: clamp(4rem, 9vw, 7.5rem);
}

/* ---------- Fondo: nebulosa + estrellas + grano (sin cambios) ---------- */
.n-bg-fx {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: var(--n-bg);
}
.n-nebula {
    position: absolute;
    inset: -10%;
    background:
        radial-gradient(ellipse 55% 60% at 86% 8%, rgba(var(--n-accent-rgb), .17), transparent 70%),
        radial-gradient(ellipse 50% 55% at 6% 96%, rgba(var(--n-accent-rgb), .09), transparent 70%);
    animation: n-breathe 12s ease-in-out infinite alternate;
}
@keyframes n-breathe {
    from { opacity: .55; transform: scale(1); }
    to   { opacity: 1;   transform: scale(1.08); }
}

.n-stars { position: absolute; inset: 0; }
.n-depth {
    position: absolute;
    inset: -30px;
    transform: translate3d(0, 0, 0);
    transition: transform .9s cubic-bezier(.16, 1, .3, 1);
    animation: n-drift var(--dur) ease-in-out infinite alternate,
               n-field var(--fb) ease-in-out infinite alternate;
}
@keyframes n-drift { from { translate: 0 0; } to { translate: var(--ax) var(--ay); } }
@keyframes n-field { from { opacity: .7; } to { opacity: 1; } }

.n-depth i {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--sz);
    height: var(--sz);
    border-radius: 50%;
    background: var(--c);
    opacity: .1;
    animation: n-twinkle var(--d) ease-in-out var(--delay) infinite;
}
.n-depth i.big {
    box-shadow: 0 0 8px 1px var(--c);
    animation: n-breath-star var(--d) ease-in-out var(--delay) infinite;
}
@keyframes n-twinkle {
    0%, 100% { opacity: .08; scale: .7; translate: 0 0; }
    50%      { opacity: 1;   scale: 1.2; translate: var(--fx) var(--fy); }
}
@keyframes n-breath-star {
    0%, 100% { opacity: .35; scale: .9; translate: 0 0; }
    50%      { opacity: 1;   scale: 1.6; translate: var(--fx) var(--fy); }
}

.n-shoot {
    position: absolute;
    left: var(--sx);
    top: var(--sy);
    width: 130px;
    height: 1.5px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .95));
    rotate: 25deg;
    opacity: 0;
    animation: n-shoot 1.4s ease-out forwards;
}
@keyframes n-shoot {
    0%   { opacity: 0; translate: 0 0; }
    12%  { opacity: 1; }
    100% { opacity: 0; translate: 420px 196px; }
}

.n-bg-fx.is-paused * { animation-play-state: paused !important; }

.n-grain {
    position: absolute;
    inset: -80px;
    opacity: .07;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 180px 180px;
    animation: n-grain 1s steps(1) infinite;
}
@keyframes n-grain {
    0%   { transform: translate(0, 0); }
    20%  { transform: translate(-30px, 18px); }
    40%  { transform: translate(24px, -26px); }
    60%  { transform: translate(-18px, -34px); }
    80%  { transform: translate(34px, 22px); }
}

.n-fade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, var(--n-bg) 0%, transparent 14%, transparent 86%, var(--n-bg) 100%);
}

/* ---------- Aparición (una sola, para toda la sección) ---------- */
.nosotros-premium .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .8s cubic-bezier(.16, 1, .3, 1), transform .8s cubic-bezier(.16, 1, .3, 1);
}
.nosotros-premium .reveal.visible { opacity: 1; transform: none; }

/* ---------- Composición ---------- */
.n-layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    grid-template-areas:
        "intro stage"
        "lista stage"
        "cta   cta";
    column-gap: clamp(2rem, 6vw, 5rem);
    row-gap: 2.5rem;
    width: 100%;
    max-width: 1190px;
    margin-inline: auto;
}
.n-intro { grid-area: intro; align-self: end; }
.n-lista { grid-area: lista; align-self: start; }
.n-stage { grid-area: stage; align-self: center; justify-self: center; }
.n-cta   { grid-area: cta; }

.n-intro h2 {
    margin: 0 0 1.15rem;
    color: #fff;
    font-size: clamp(2rem, 3.9vw, 3.3rem);
    line-height: 1.06;
    letter-spacing: -.03em;
    text-wrap: balance;
}
.n-intro p {
    max-width: 52ch;
    margin: 0;
    color: var(--n-muted);
    font-size: clamp(.95rem, 1.2vw, 1.04rem);
    line-height: 1.7;
}

/* ---------- Lista (cada fila enciende un cubo) ---------- */
.n-lista {
    margin: 0;
    padding: 0;
    list-style: none;
}
.n-fila {
    padding: 1.15rem 0 1.15rem 1.1rem;
    border-top: 1px solid var(--n-line);
    border-left: 2px solid transparent;
    transition: border-color .25s ease, background-color .25s ease;
    -webkit-tap-highlight-color: transparent;
}
.n-fila:last-child { border-bottom: 1px solid var(--n-line); }
.n-fila h3 {
    margin: 0 0 .3rem;
    color: #fff;
    font-size: 1.08rem;
    letter-spacing: -.01em;
}
.n-fila p {
    max-width: 52ch;
    margin: 0;
    color: var(--n-muted);
    font-size: .92rem;
    line-height: 1.6;
}
@media (hover: hover) {
    .n-fila:hover {
        border-left-color: var(--n-accent);
        background: linear-gradient(90deg, rgba(var(--n-accent-rgb), .06), transparent 70%);
    }
}

/* ---------- Cubos (basado en Uiverse.io de csemszepp) ----------
   --u escala todo el dibujo: en celular se achica sin tocar la geometría. */
.n-stage {
    --u: 1px;
    --f-front: #2f2c35;   /* cara frontal */
    --f-top:   #3f3b47;   /* cara de arriba */
    --f-left:  #4d4856;   /* cara izquierda (la más clara, como en el original) */
    --o-front: var(--n-accent);
    --o-top:   #ff6b7d;
    --o-left:  #ff8a98;

    position: relative;
    width: calc(370 * var(--u));
    height: calc(440 * var(--u));

    /* Táctil */
    touch-action: manipulation;          /* sin zoom por doble toque */
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.n-cubos {
    position: absolute;
    left: calc(185 * var(--u));
    top: calc(165 * var(--u));
    transform: skewY(-20deg);
}
.n-cubo { position: relative; z-index: 2; }
.n-cubo:nth-child(2) { z-index: 1; translate: calc(-60 * var(--u)) calc(-60 * var(--u)); }
.n-cubo:nth-child(3) { z-index: 3; translate: calc(60 * var(--u)) calc(60 * var(--u)); }

.n-cubo > div {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: calc(30 * var(--u));
    translate: calc(-70 * var(--u) * var(--x)) calc(-60 * var(--u) * var(--y));
}
.n-cubo span {
    position: relative;
    display: inline-block;
    width: calc(50 * var(--u));
    height: calc(50 * var(--u));
    background: var(--f-front);
    z-index: var(--i);
    transition: background 1.5s;
}
.n-cubo span::before {
    content: "";
    position: absolute;
    left: calc(-40 * var(--u));
    width: calc(40 * var(--u));
    height: 100%;
    background: var(--f-left);
    transform-origin: right;
    transform: skewY(45deg);
    transition: background 1.5s;
}
.n-cubo span::after {
    content: "";
    position: absolute;
    top: calc(-40 * var(--u));
    left: 0;
    width: 100%;
    height: calc(40 * var(--u));
    background: var(--f-top);
    transform-origin: bottom;
    transform: skewX(45deg);
    transition: background 1.5s;
}

/* Encendido: instantáneo, y se apaga despacio (queda la estela) */
.n-cubo.is-on span,
.n-cubo span.lit { transition: 0s; background: var(--o-front); }
.n-cubo.is-on span::before,
.n-cubo span.lit::before { transition: 0s; background: var(--o-left); }
.n-cubo.is-on span::after,
.n-cubo span.lit::after { transition: 0s; background: var(--o-top); }

@media (hover: hover) {
    .n-cubo span:hover { transition: 0s; background: var(--o-front); }
    .n-cubo span:hover::before { transition: 0s; background: var(--o-left); }
    .n-cubo span:hover::after { transition: 0s; background: var(--o-top); }
}

/* Supernova (5 toques rápidos en celular) */
.n-stage.nova { animation: n-nova .9s cubic-bezier(.16, 1, .3, 1); }
@keyframes n-nova {
    0%   { scale: 1; filter: none; }
    30%  { scale: 1.07; filter: brightness(1.5) drop-shadow(0 0 28px rgba(var(--n-accent-rgb), .75)); }
    100% { scale: 1; filter: none; }
}

/* ---------- CTA ---------- */
.n-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--n-line);
}
.n-cta h3 {
    margin: 0 0 .4rem;
    color: #fff;
    font-size: clamp(1.4rem, 2.8vw, 2.1rem);
    line-height: 1.12;
    letter-spacing: -.02em;
    text-wrap: balance;
}
.n-cta p { margin: 0; color: var(--n-muted); font-size: 1rem; line-height: 1.6; }

.n-btn {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: .95rem 1.7rem;
    border-radius: 10px;
    background: var(--n-accent);
    color: #fff;
    font-weight: 600;
    font-size: .95rem;
    text-decoration: none;
    white-space: nowrap;
    transition: filter .2s ease, transform .2s ease;
}
.n-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.n-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .n-stage { --u: .85px; }
}
@media (max-width: 900px) {
    .nosotros-premium { padding-block: 3.5rem; }
    .n-layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "intro"
            "stage"
            "lista"
            "cta";
        row-gap: 2rem;
    }
    .n-stage { --u: .8px; }
    .n-intro h2 { font-size: clamp(1.85rem, 8.4vw, 2.4rem); }
    .n-cta { flex-direction: column; align-items: stretch; gap: 1.4rem; }
}
@media (max-width: 380px) {
    .n-stage { --u: .68px; }
}

@media (prefers-reduced-motion: reduce) {
    .n-nebula, .n-depth, .n-depth i, .n-grain { animation: none; }
    .n-depth { transition: none; transform: none !important; }
    .n-depth i { opacity: .6; }
    .n-shoot { display: none; }
    .n-stage.nova { animation: none; }
    .nosotros-premium .reveal { opacity: 1; transform: none; transition: none; }
}