@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Orbitron:wght@400;500;600;700&display=swap');
        
body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(to bottom, #020617, #0f172a);
    color: #e2e8f0;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* Neon cube palette */
:root{
  --neon-core: #a78bfa;           /* bright core */
  --neon-strong: #8b5cf6;         /* vivid line */
  --neon-halo: rgba(124,58,237,0.32);
  --panel: #0b0f16;               /* matte body */
  /* Texture controls for cube faces */
  /* Path is relative to this CSS file in styles/ */
  --cubeTexture: url('../assets/cube-tile7.png');
  --tileSize: 720px; /* size of one tile on a face */
  --tileOpacity: 0.5; /* texture opacity 0..1 */
  --cubeFont: 'Orbitron', 'Inter', sans-serif;
}




/* Scroll reveal base */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 600ms ease, transform 600ms ease;
    will-change: opacity, transform;
}




.reveal.visible {
    opacity: 1;
    transform: none;
}




@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal.visible {
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }



}




#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.5;
}




.gradient-border {
    position: relative;
    background: rgba(15, 23, 42, 0.7);
    border-radius: 0.75rem;
    padding: 1px;
    transition: background 0.2s ease;
}




.gradient-border::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0.75rem;
    padding: 2px;
    background: linear-gradient(45deg, 
        #7c3aed 0%,     /* насыщенный фиолетовый в начале */
        #9333ea 20%,    /* более глубокий фиолетовый */
        #3b82f6 90%     /* мягкий синий раньше конца */
    );
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: -1;
}




.glow {
    box-shadow: none;
}




.glow:hover {
    box-shadow: none;
}




.neural-path {
    position: relative;
}




.neural-path::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #7c3aed, #3b82f6);
    transition: width 0.3s ease;
}




.neural-path:hover::after {
    width: 100%;
}




.service-card {
    transition: all 0.3s ease;
}




.service-card:hover {
    transform: translateY(-5px);
}




.portfolio-item {
    overflow: hidden;
    border-radius: 0.5rem;
}




.portfolio-item img {
    transition: transform 0.5s ease;
}




.portfolio-item:hover img {
    transform: scale(1.05);
}




/* Portfolio specific styles (using existing purple→blue gradients and dark palette) */
.portfolio-filter-btn {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(124, 58, 237, 0.3);
    transition: all 0.3s ease;
}




.portfolio-filter-btn:hover,
.portfolio-filter-btn.active {
    background: linear-gradient(45deg, #7c3aed, #3b82f6);
    color: #ffffff;
    border-color: transparent;
}




.portfolio-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 1rem;
}




.portfolio-detail-overlay.active {
    opacity: 1;
    visibility: visible;
}




.portfolio-detail-content {
    background: #0f172a;
    border-radius: 0.75rem;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}




.portfolio-detail-overlay.active .portfolio-detail-content {
    transform: scale(1);
}




.close-detail {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #e2e8f0;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
}




.portfolio-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}




.tech-pill {
    background: rgba(124, 58, 237, 0.2);
    color: #93c5fd; /* light blue text for contrast */
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
}




.portfolio-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}




.stat-item {
    background: rgba(15, 23, 42, 0.5);
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
}




.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(45deg, #7c3aed, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}




.stat-label {
    font-size: 0.875rem;
    color: #94a3b8;
}




.portfolio-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}




.gallery-item {
    border-radius: 0.5rem;
    overflow: hidden;
    height: 150px;
}




.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}




.gallery-item:hover img {
    transform: scale(1.05);
}




.portfolio-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}




.nav-btn {
    display: flex;
    align-items: center;
    background: rgba(124, 58, 237, 0.2);
    border: none;
    color: #e2e8f0;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.3s ease;
}




.nav-btn:hover {
    background: rgba(124, 58, 237, 0.4);
}




/* Toolbar for portfolio iframe */
.portfolio-toolbar {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: saturate(140%) blur(6px);
    background: linear-gradient(180deg, rgba(2,6,23,0.85), rgba(2,6,23,0.65));
    border-bottom: 1px solid rgba(124, 58, 237, 0.25);
}




/* Hover overlay for portfolio cards */
.portfolio-card {
    position: relative;
}




.portfolio-hover-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to top,
        rgba(2, 6, 23, 0.78),
        rgba(2, 6, 23, 0.45) 40%,
        rgba(2, 6, 23, 0.00)
    );
    opacity: 0;
    transition: opacity 0.25s ease;
}




.portfolio-card:hover .portfolio-hover-overlay {
    opacity: 1;
}




.portfolio-hover-text {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    border-radius: 9999px;
    background: rgba(124, 58, 237, 0.75);
    border: 1px solid rgba(124, 58, 237, 0.85);
    color: #e2e8f0;
    font-weight: 500;
}




.portfolio-item:hover {
    transform: translate(0px);
}




.chip {
    border: 1px solid rgba(124, 58, 237, 0.35);
    background: rgba(15, 23, 42, 0.6);
    transition: all 0.2s ease;
}




.chip.active,
.chip:hover {
    background: linear-gradient(45deg, #7c3aed, #3b82f6);
    color: #fff;
    border-color: transparent;
}




.search-input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(124, 58, 237, 0.35);
    color: #e2e8f0;
}




.search-input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: none;
}




.count-badge {
    background: rgba(124, 58, 237, 0.25);
    color: #cbd5e1;
}




@media (max-width: 768px) {
    .portfolio-gallery {
        grid-template-columns: 1fr;
    }



    
    .portfolio-stats {
        grid-template-columns: 1fr;
    }



    
    .portfolio-detail-content {
        padding: 1.5rem;
    }



}




.testimonial-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}




.testimonial-card:hover {
    transform: translateY(-6px);
}




.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}




.no-scrollbar::-webkit-scrollbar {
    display: none;
}




.review-dot {
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    background: rgba(148, 163, 184, 0.4);
    border: 1px solid rgba(71, 85, 105, 0.6);
    transition: background 0.2s ease, transform 0.2s ease;
}




.review-dot.active {
    background: linear-gradient(90deg, #7c3aed, #3b82f6);
    transform: scale(1.1);
}




#reviews-track {
    overflow-y: visible;
    padding-top: 12px;
    padding-bottom: 12px;
    padding-left: 26px;
    padding-right: 26px;
}




.reviews-inner {
    overflow: visible;
}




#reviews,
#reviews .container,
#reviews .relative {
    overflow: visible;
}




.gradient-text {
    background: linear-gradient(45deg, 
        #7c3aed 0%, 
        #9333ea 20%, 
        #3b82f6 90%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}




input, textarea {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(124, 58, 237, 0.3);
    transition: all 0.3s ease;
}




input:focus, textarea:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: none;
}




@media (max-width: 768px) {
    .hero-content {
        padding-top: 6rem;
    }



}




/* Scroll-driven sequence */
#capabilities-sequence {
    position: relative;
}




.sequence-pin {
    position: relative;
}




.sequence-stage {
    position: relative;
    min-height: 100vh;
}




.sequence-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    pointer-events: none;
}




/* WebGL layer (disabled; using CSS cube) */
.sequence-card .cube-webgl { display: none !important; }
/* fallback cube layer (only shown when settled) */
.sequence-card .cube { z-index: 1; }




.sequence-title {
    font-size: clamp(2rem, 8vw, 6rem);
    font-weight: 800;
    text-align: center;
    line-height: 1.1;
}




.sequence-row {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 16px;
    z-index: 6;
    pointer-events: none;
    opacity: 0; /* revealed during animation */
}




.row-slot {
    height: 112px;
}




@media (max-width: 768px) {
    .row-slot { height: 88px; }



}




/* 3D cube */
.sequence-card { perspective: 1600px; }
.cube {
    position: relative;
    --cubeSize: min(44vw, 520px);
    width: var(--cubeSize);
    height: var(--cubeSize);
    transform-style: preserve-3d;
    will-change: transform;
}
@keyframes cube-spin-ref {
  0%   { transform: rotateX(0turn) rotateY(0turn); }
  50%  { transform: rotateX(1turn) rotateY(0.5turn); }
  100% { transform: rotateX(2turn) rotateY(1turn); }
}
/* по умолчанию анимацию выключаем — будем крутить через GSAP */
.sequence-card .cube { animation: none; }
.cube-face {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    backface-visibility: hidden;
    text-align: center;
    padding: 14px;
    background: var(--panel);
    /* dark sci‑fi body with subtle bevel + neon bloom */
    box-shadow:
      inset 0 0 0 1px #0f172a,
      inset 0 10px 26px rgba(0,0,0,0.55),
      inset 0 -8px 22px rgba(0,0,0,0.35),
      0 0 26px var(--neon-halo);
}



.cube-face-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 3vw, 2rem);
    box-shadow: none;
}
/* Keep rich copy + icon blocks constrained inside the illuminated panel */
.cube-face-inner > .flex.flex-col.items-start {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "icon title"
        "desc desc";
    align-items: center;
    justify-items: start;
    width: min(260px, 66%);
    margin: 0 auto;
    text-align: left;
    column-gap: clamp(0.45rem, 1.6vw, 0.8rem);
    row-gap: clamp(0.35rem, 1.4vw, 0.55rem);
}
.cube-face-inner > .flex.flex-col.items-start > .text-primary-500 {
    grid-area: icon;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    margin: 0;
    line-height: 1;
}
.cube-face-inner > .flex.flex-col.items-start > h3 {
    grid-area: title;
    margin: 0;
    font-size: clamp(0.92rem, 1.8vw, 1.18rem);
    min-width: 0;
    align-self: center;
    width: 100%;
    text-align: justify;
    text-justify: inter-word;
    text-align-last: justify;
    font-family: var(--cubeFont);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 600;
}
.cube-face-inner > .flex.flex-col.items-start > p {
    grid-area: desc;
    margin: 0;
    font-size: clamp(0.72rem, 1.4vw, 0.88rem);
    color: #94a3b8;
    line-height: 1.45;
    align-self: start;
    width: 100%;
    text-align: justify;
    text-justify: inter-word;
    text-align-last: justify;
    font-family: var(--cubeFont);
    letter-spacing: 0.06em;
    text-transform: none;
}

/* Detached cube face copies (left stack tiles) */
.left-stack .cube-face-inner > .flex.flex-col.items-start,
.stack-clone .cube-face-inner > .flex.flex-col.items-start {
    width: 100%;
    margin: 0;
}
.left-stack .cube-face-inner > .flex.flex-col.items-start > h3,
.left-stack .cube-face-inner > .flex.flex-col.items-start > p,
.stack-clone .cube-face-inner > .flex.flex-col.items-start > h3,
.stack-clone .cube-face-inner > .flex.flex-col.items-start > p {
    text-align: left;
    text-justify: auto;
    text-align-last: left;
}

@media (max-width: 900px) {
    .cube-face-inner {
        padding: clamp(0.9rem, 3.6vw, 1.4rem);
    }
}

@media (max-width: 768px) {
    .cube-face-inner {
        padding: clamp(0.8rem, 3.4vw, 1.2rem);
    }
    .cube-face-inner > .flex.flex-col.items-start {
        width: min(220px, 70%);
    }
    .cube-face-inner > .flex.flex-col.items-start > .text-primary-500 {
        font-size: clamp(1.45rem, 6vw, 1.8rem);
    }
    .cube-face-inner > .flex.flex-col.items-start > h3 {
        font-size: clamp(0.85rem, 2.5vw, 1.05rem);
    }
    .cube-face-inner > .flex.flex-col.items-start > p {
        font-size: clamp(0.65rem, 2vw, 0.78rem);
        line-height: 1.4;
    }
    .left-stack .cube-face-inner > .flex.flex-col.items-start,
    .stack-clone .cube-face-inner > .flex.flex-col.items-start {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .cube-face-inner {
        padding: clamp(0.65rem, 4vw, 0.9rem);
    }
    .cube-face-inner > .flex.flex-col.items-start {
        width: min(180px, 74%);
    }
    .cube-face-inner > .flex.flex-col.items-start > .text-primary-500 {
        font-size: clamp(1.3rem, 8.5vw, 1.6rem);
    }
    .cube-face-inner > .flex.flex-col.items-start > h3 {
        font-size: clamp(0.78rem, 3.2vw, 0.95rem);
    }
    .cube-face-inner > .flex.flex-col.items-start > p {
        font-size: clamp(0.6rem, 2.4vw, 0.74rem);
    }
    .left-stack .cube-face-inner > .flex.flex-col.items-start,
    .stack-clone .cube-face-inner > .flex.flex-col.items-start {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .cube-face-inner {
        padding: clamp(0.55rem, 4.6vw, 0.85rem);
    }
    .cube-face-inner > .flex.flex-col.items-start {
        width: min(160px, 78%);
    }
    .cube-face-inner > .flex.flex-col.items-start > .text-primary-500 {
        font-size: clamp(1.15rem, 10vw, 1.4rem);
    }
    .cube-face-inner > .flex.flex-col.items-start > h3 {
        font-size: clamp(0.7rem, 3.8vw, 0.88rem);
    }
    .cube-face-inner > .flex.flex-col.items-start > p {
        font-size: clamp(0.55rem, 3.2vw, 0.7rem);
    }
    .left-stack .cube-face-inner > .flex.flex-col.items-start,
    .stack-clone .cube-face-inner > .flex.flex-col.items-start {
        width: 100%;
    }
}

/* .cube {
    filter: drop-shadow(0 6px 20px rgba(124, 58, 237, 0.18)) drop-shadow(0 0 8px rgba(59, 130, 246, 0.18));
} */



.cube-face-inner::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: none;
    pointer-events: none;
}

/* Hi‑tech circuit pattern — CSS only, no JS */
.cube-face-inner.tech-bg { position: relative; overflow: hidden; }
.cube-face-inner.tech-bg::before {
  content: '';
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  /* Variable-driven layered pattern for organic look */
  background-image:
    /* vertical layer A */
    repeating-linear-gradient(var(--vAng1, 90deg),
      rgba(16,185,129,0.50) 0px,
      rgba(16,185,129,0.50) var(--vW1, 2px),
      transparent var(--vW1, 2px),
      transparent var(--vSp1, 28px)
    ),
    /* vertical layer B (different spacing/width) */
    repeating-linear-gradient(var(--vAng2, 90deg),
      rgba(16,185,129,0.35) 0px,
      rgba(16,185,129,0.35) var(--vW2, 1px),
      transparent var(--vW2, 1px),
      transparent var(--vSp2, 34px)
    ),
    /* occasional wider power traces */
    repeating-linear-gradient(var(--vAng3, 90deg),
      rgba(16,185,129,0.28) 0px,
      rgba(16,185,129,0.28) var(--vWw, 3px),
      transparent var(--vWw, 3px),
      transparent var(--vSpw, 64px)
    ),
    /* horizontal layer A */
    repeating-linear-gradient(var(--hAng1, 0deg),
      rgba(16,185,129,0.18) 0px,
      rgba(16,185,129,0.18) var(--hW1, 1px),
      transparent var(--hW1, 1px),
      transparent var(--hSp1, 22px)
    ),
    /* horizontal layer B */
    repeating-linear-gradient(var(--hAng2, 0deg),
      rgba(16,185,129,0.14) 0px,
      rgba(16,185,129,0.14) var(--hW2, 1px),
      transparent var(--hW2, 1px),
      transparent var(--hSp2, 28px)
    ),
    /* diagonal jogs */
    repeating-linear-gradient(var(--dAng, 135deg),
      rgba(5,150,105,0.18) 0px,
      rgba(5,150,105,0.18) var(--dW, 1px),
      transparent var(--dW, 1px),
      transparent var(--dSp, 26px)
    ),
    /* vias (dots grid) */
    radial-gradient(circle at var(--viaX, 13px) var(--viaY, 11px), rgba(16,185,129,0.70) 0 var(--viaR, 1.3px), transparent calc(var(--viaR, 1.3px) + 0.05px));
  background-size:
    var(--vSp1, 28px) 100%, /* vertical A */
    var(--vSp2, 34px) 100%, /* vertical B */
    var(--vSpw, 64px) 100%, /* power */
    100% var(--hSp1, 22px), /* horizontal A */
    100% var(--hSp2, 28px), /* horizontal B */
    var(--dSp, 26px) var(--dSp, 26px), /* diagonals */
    var(--vSp1, 28px) var(--hSp1, 22px); /* vias grid */
  background-position:
    var(--offX1, 0) var(--offY1, 0),
    var(--offX2, 0) var(--offY2, 0),
    var(--offX3, 0) var(--offY3, 0),
    var(--offX4, 0) var(--offY4, 0),
    var(--offX5, 0) var(--offY5, 0),
    var(--offX6, 0) var(--offY6, 0),
    var(--offX7, 0) var(--offY7, 0);
  mix-blend-mode: screen;
  opacity: 0.95;
  transform: translate(var(--shiftX, 0px), var(--shiftY, 0px)) rotate(var(--rot, 0deg));
  transform-origin: center;
  /* Break lines into segments to avoid perfect continuity */
  -webkit-mask-image:
    repeating-linear-gradient(0deg,
      #000 calc(var(--mOff1, 0px)),
      #000 calc(var(--mOff1, 0px) + var(--seg1, 22px)),
      transparent calc(var(--mOff1, 0px) + var(--seg1, 22px)),
      transparent calc(var(--mOff1, 0px) + var(--seg1, 22px) + var(--gap1, 7px))
    ),
    repeating-linear-gradient(90deg,
      #000 calc(var(--mOff2, 0px)),
      #000 calc(var(--mOff2, 0px) + var(--seg2, 26px)),
      transparent calc(var(--mOff2, 0px) + var(--seg2, 26px)),
      transparent calc(var(--mOff2, 0px) + var(--seg2, 26px) + var(--gap2, 8px))
    );
  mask-image:
    repeating-linear-gradient(0deg,
      #000 calc(var(--mOff1, 0px)),
      #000 calc(var(--mOff1, 0px) + var(--seg1, 22px)),
      transparent calc(var(--mOff1, 0px) + var(--seg1, 22px)),
      transparent calc(var(--mOff1, 0px) + var(--seg1, 22px) + var(--gap1, 7px))
    ),
    repeating-linear-gradient(90deg,
      #000 calc(var(--mOff2, 0px)),
      #000 calc(var(--mOff2, 0px) + var(--seg2, 26px)),
      transparent calc(var(--mOff2, 0px) + var(--seg2, 26px)),
      transparent calc(var(--mOff2, 0px) + var(--seg2, 26px) + var(--gap2, 8px))
    );
}
@keyframes circuit-shift {
  0%   { background-position: var(--offX1,0) var(--offY1,0), var(--offX2,0) var(--offY2,0), var(--offX3,0) var(--offY3,0), var(--offX4,0) var(--offY4,0), var(--offX5,0) var(--offY5,0), var(--offX6,0) var(--offY6,0), var(--offX7,0) var(--offY7,0); }
  100% { background-position: calc(var(--offX1,0) - var(--vSp1,28px)) var(--offY1,0), var(--offX2,0) calc(var(--offY2,0) - var(--hSp2,28px)), var(--offX3,0) var(--offY3,0), var(--offX4,0) calc(var(--offY4,0) - var(--hSp1,22px)), calc(var(--offX5,0) - var(--vSp2,34px)) var(--offY5,0), var(--offX6,0) var(--offY6,0), calc(var(--offX7,0) - var(--vSp1,28px)) calc(var(--offY7,0) - var(--hSp1,22px)); }
}
.cube-face-inner.tech-bg::before { animation: circuit-shift var(--animDur, 16s) linear infinite; }
/* keep face content above the pattern */
.cube-face-inner.tech-bg > * { position: relative; z-index: 1; }
/* static curated svg traces */
.cube-face-inner.tech-bg svg.face-traces {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0; border-radius: inherit;
}
/* If an SVG overlay is present, hide the fallback pattern */
.cube-face-inner.tech-bg.has-svg::before { display: none !important; }
/* When SVG is attached to the face, make sure it still sits under text but above background */
/* no need to set new stacking context on face; keep 3D look intact */
/* .cube-face { position: relative; } */
/* SVG overlay styling */
svg.tech-svg {
  position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important;
  pointer-events: none; border-radius: inherit; z-index: 0;
  flex: none !important; /* never treated as flex item visually */
}

/* Robust approach: paint neon pattern as a background on inner (no extra DOM) */
.cube-face-inner.tech-bg {
  /* Base transparent layer; texture drawn on ::after so we can control opacity */
  background: transparent;
}
.cube-face-inner.tech-bg::after {
  content: '';
  position: absolute; 
  inset: 0; 
  border-radius: inherit; 
  pointer-events: none;
  background-image: var(--cubeTexture, none);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: var(--tileOpacity, 1);
  z-index: 0;
}
/* Disable legacy patterned ::before to avoid double textures (also hides green traces on detached faces) */
.cube-face-inner.tech-bg::before { display: none !important; }
.cube-face-inner.tech-bg > :not(svg.tech-svg) { position: relative; z-index: 1; }



.cube-face span {
    font-size: clamp(1.1rem, 3.8vw, 2rem);
    font-weight: 700;
    font-family: var(--cubeFont);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* TensorAlix dual-layer label (black base + gradient reveal) */
.tensor-label { position: relative; display: inline-block; }
.tensor-label { font: inherit; line-height: inherit; }
.tensor-label .t-black { color: #0b0f1c; } /* almost black for dark theme */
.tensor-label .t-grad {
  position: absolute; inset: 0; color: transparent;
  background: linear-gradient(45deg, #7c3aed, #3b82f6);
  -webkit-background-clip: text; background-clip: text;
  /* reveal from left to right */
  --fill-pct: 0%;
  clip-path: inset(0 calc(100% - var(--fill-pct)) 0 0);
}




/* depth variable controls side translation */
.cube { --depth: calc(var(--cubeSize) / 2); }

/* Removed global filter on .cube — it flattened 3D. */



.cube-front { transform: translateZ(var(--depth)); }



.cube-back { transform: rotateY(180deg) translateZ(var(--depth)); }



.cube-right { transform: rotateY(90deg) translateZ(var(--depth)); }



.cube-left { transform: rotateY(-90deg) translateZ(var(--depth)); }



.cube-top { transform: rotateX(90deg) translateZ(var(--depth)); }



.cube-bottom { transform: rotateX(-90deg) translateZ(var(--depth)); }

/* Левая колонка для «отстыкованных» граней */
.left-stack {
  position: absolute;
  inset: 0;
  left: max(24px, 6vw);
  right: max(24px, 6vw);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, var(--stackSize, 140px)));
  grid-template-rows: repeat(2, var(--stackSize, 140px));
  row-gap: var(--stackGap, 18px);
  column-gap: var(--stackGap, 18px);
  align-content: center;
  justify-content: space-between;
  pointer-events: none;
  z-index: 7;
}
.left-stack .stack-item{
  position: relative;
  width: 100%;
  height: 100%;
  max-width: var(--stackSize, 140px);
  max-height: var(--stackSize, 140px);
  overflow: visible; /* allow tilted clones to extend naturally without cropping */
  border-radius: 12px;
  perspective: 1200px;
  transform-style: preserve-3d;
  will-change: transform;
  transform-origin: center;
}
.left-stack .stack-item:nth-child(odd){ justify-self: start; }
.left-stack .stack-item:nth-child(even){ justify-self: end; }
.left-stack .stack-item:nth-child(1),
.left-stack .stack-item:nth-child(2){ align-self: end; }
.left-stack .stack-item:nth-child(3),
.left-stack .stack-item:nth-child(4){ align-self: start; }
/* inherit size of the main cube to compute stack size proportionally */
.sequence-card .left-stack{ --stackGap: clamp(16px, 3vh, 28px); --stackSize: clamp(200px, 32vw, 280px); }
@media (max-width: 1024px) {
  .sequence-card .left-stack{
    --stackGap: clamp(12px, 2.6vw, 22px);
    --stackSize: clamp(150px, 28vw, 210px);
  }
}
@media (max-width: 820px) {
  .sequence-card .left-stack{
    --stackGap: clamp(10px, 2.8vw, 18px);
    --stackSize: clamp(120px, 30vw, 180px);
    left: max(20px, 5vw);
    right: max(20px, 5vw);
  }
  .left-stack{ align-content: space-between; }
}
@media (max-width: 640px) {
  .sequence-card .left-stack{
    --stackGap: clamp(8px, 3vw, 16px);
    --stackSize: clamp(110px, 32vw, 160px);
    top: clamp(32px, 8vh, 96px);
    bottom: clamp(32px, 8vh, 96px);
  }
  .left-stack{ column-gap: var(--stackGap, 12px); }
  .stack-clone-inner > .flex.flex-col.items-start > p{ display: none; }
}
@media (max-width: 480px) {
  .sequence-card .left-stack{
    --stackGap: clamp(6px, 4vw, 12px);
    --stackSize: clamp(90px, 30vw, 130px);
    left: max(12px, 6vw);
    right: max(12px, 6vw);
    top: clamp(24px, 10vh, 80px);
    bottom: clamp(24px, 10vh, 80px);
  }
  .left-stack{
    grid-template-columns: repeat(2, minmax(0, var(--stackSize)));
    row-gap: var(--stackGap, 10px);
    column-gap: var(--stackGap, 10px);
    justify-content: center;
  }
  .stack-clone-inner > .flex.flex-col.items-start > h3{ display: none; }
  .stack-clone-inner > .flex.flex-col.items-start{
    grid-template-columns: auto;
    justify-items: center;
    row-gap: clamp(0.25rem, 2vw, 0.4rem);
    text-align: center;
  }
}
@media (max-width: 420px) {
  .left-stack{
    grid-template-columns: minmax(0, var(--stackSize));
    grid-template-rows: repeat(4, var(--stackSize));
    justify-content: center;
    align-content: space-between;
  }
}
/* Normalize detached faces inside the left stack */
.left-stack .stack-item .cube-face{
  position: absolute !important;
  inset: 0 !important;
  backface-visibility: visible !important;
}
.left-stack .stack-item .cube-face:not(.stack-clone){
  transform: none !important;
}
.stack-clone {
  pointer-events: none;
  filter: none !important;
  transform-style: preserve-3d;
}
.stack-clone.gradient-border {
  background: rgba(12, 19, 33, 0.88);
  padding: 0;
  box-shadow:
    inset 0 0 0 1px rgba(148, 163, 184, 0.14),
    inset 0 -6px 16px rgba(2, 6, 23, 0.55),
    0 20px 32px rgba(2, 6, 23, 0.45);
}
.stack-clone.gradient-border::before { display: none !important; }
.stack-clone-inner {
  background: linear-gradient(140deg, rgba(11, 17, 30, 0.96), rgba(6, 11, 21, 0.78));
  box-shadow:
    inset 0 0 0 1px rgba(59, 130, 246, 0.14),
    inset 0 12px 24px rgba(15, 23, 42, 0.45);
}
.stack-clone-inner::after,
.stack-clone-inner::before { display: none !important; }
.stack-clone-inner > * { position: relative; z-index: 1; }

/* Settled service style (when in row) */
.sequence-card.settled .cube {
    width: 100%;
    height: 100%;
}



.sequence-card.settled .cube-face {
    padding: 0;
}


/* Ensure all faces render for the CSS cube */
.sequence-card .cube-face { display: flex !important; }


/* CSS cube performance tweaks when animating (no WebGL) */
.cube-face { will-change: transform, opacity; }
.cube.animating { filter: none; }
.cube.animating .gradient-border::before { display: none !important; }
.cube.animating .cube-face-inner { background: transparent; box-shadow: none; }
.cube.animating .cube-face-inner:not(.tech-bg)::after { display: none; }

/* Disable old gradient borders on cube faces */
.cube .gradient-border::before{ display: none !important; }
.cube .gradient-border{ background: transparent !important; padding: 0; }
