/**
 * TECHTIVITY Logo — portable stylesheet
 *
 * Pair with: resources/views/components/techtivity-logo.blade.php
 * Font: Sora (--font-display) via Bunny Fonts or Google Fonts
 *
 * Usage (Laravel + Vite):
 *   @import './techtivity-logo.css';  // in app.css
 *   <x-techtivity-logo compact class="site-header__logo" />
 */

:root {
    --font-display: 'Sora', ui-sans-serif, system-ui, sans-serif;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ─── Core logo ─────────────────────────────────────────────────────────── */

.techtivity-logo {
    position: relative;
    display: inline-grid;
    width: min(100%, 44rem);
    place-items: center;
    isolation: isolate;
    padding: clamp(1rem, 2.8vw, 2rem);
}

.techtivity-logo--compact {
    width: 100%;
    padding: 0;
}

.techtivity-logo__ambient {
    position: absolute;
    inset: auto;
    border-radius: 9999px;
    filter: blur(34px);
    opacity: 0.38;
    animation: tech-breathe 6s ease-in-out infinite;
    pointer-events: none;
}

.techtivity-logo__ambient--cyan {
    left: 14%;
    top: 16%;
    height: 28%;
    width: 34%;
    background: rgba(34, 211, 238, 0.32);
}

.techtivity-logo__ambient--violet {
    right: 12%;
    bottom: 16%;
    height: 24%;
    width: 30%;
    background: rgba(77, 226, 255, 0.14);
    animation-delay: 2.8s;
}

.techtivity-logo__brain {
    position: relative;
    width: min(100%, 56rem);
    transform: translateZ(0);
    animation: logo-float 8s ease-in-out infinite;
    filter: drop-shadow(0 28px 56px rgba(2, 8, 23, 0.24)) drop-shadow(0 0 28px rgba(77, 226, 255, 0.08));
}

.techtivity-logo--compact .techtivity-logo__brain {
    width: 100%;
    max-width: 14rem;
    justify-self: start;
    opacity: 0.95;
}

.techtivity-logo__svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.tech-line {
    stroke: url(#tech-line-gradient);
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: none;
    animation: data-flow 6.2s linear infinite;
    opacity: 0.72;
    fill: none;
}

.tech-line--primary {
    stroke-width: 2.05;
    opacity: 0.88;
}

.tech-line--heavy {
    stroke-width: 2.55;
    opacity: 0.94;
}

.tech-line--secondary {
    stroke-width: 1.28;
    opacity: 0.52;
}

.tech-line--micro {
    stroke-width: 0.9;
    opacity: 0.24;
    animation-duration: 8.4s;
}

.tech-line--soft {
    stroke: url(#tech-line-gradient-soft);
    stroke-width: 1.08;
    stroke-dasharray: none;
    opacity: 0.34;
}

.tech-line--back {
    opacity: 0.24;
}

.tech-line--front {
    stroke-width: 1.24;
    stroke-dasharray: none;
    opacity: 0.28;
}

.techtivity-logo__brain-geometry {
    transform-origin: center;
    animation: brain-breathe 9s ease-in-out infinite;
    opacity: 0.985;
}

.techtivity-logo__brain-shell {
    opacity: 0.98;
}

.techtivity-logo__network {
    opacity: 0.8;
    mix-blend-mode: screen;
}

.techtivity-logo__network--back {
    opacity: 0.32;
}

.techtivity-logo__network--core {
    opacity: 0.88;
}

.techtivity-logo__network--front {
    opacity: 0.32;
}

.techtivity-logo__node-layer--back {
    opacity: 0.46;
}

.techtivity-logo__node-layer--core {
    opacity: 1;
}

.techtivity-logo__node-layer--micro {
    opacity: 0.7;
}

.techtivity-logo__depth {
    opacity: 0.44;
}

.tech-node {
    transform-box: fill-box;
    transform-origin: center;
    animation: node-glint 3.6s ease-in-out infinite;
    opacity: 0.98;
    filter: drop-shadow(0 0 6px rgba(77, 226, 255, 0.14));
}

.tech-node--1,
.tech-node--4,
.tech-node--9,
.tech-node--12,
.tech-node--19,
.tech-node--28,
.tech-node--39,
.tech-node--54,
.tech-node--60 {
    filter: drop-shadow(0 0 12px rgba(126, 231, 255, 0.3));
}

.tech-node--soft {
    opacity: 0.32;
}

.tech-node--micro {
    opacity: 0.5;
}

.tech-node--2,
.tech-node--7,
.tech-node--11,
.tech-node--15,
.tech-node--21,
.tech-node--26,
.tech-node--30 {
    animation-delay: 0.6s;
}

.tech-node--4,
.tech-node--8,
.tech-node--12,
.tech-node--17,
.tech-node--20,
.tech-node--24,
.tech-node--28 {
    animation-delay: 1.2s;
}

.techtivity-logo__particles circle {
    animation: particle-shift 5s ease-in-out infinite;
    opacity: 0.48;
}

.techtivity-logo__particles circle:nth-child(2n) {
    animation-delay: 1.1s;
}

.techtivity-logo__particles circle:nth-child(3n) {
    animation-delay: 2.2s;
}

.techtivity-logo__content {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    display: grid;
    justify-items: end;
    transform: translate(-50%, -50%);
    width: min(88%, 58rem);
    text-align: right;
    pointer-events: none;
}

.techtivity-logo--compact .techtivity-logo__content {
    left: 50%;
    top: 50%;
    width: 100%;
    transform: translate(-50%, -50%) scale(0.76);
}

.techtivity-logo__svg-wordmark {
    font-family: var(--font-display);
    font-size: 158px;
    font-weight: 700;
    letter-spacing: 0.11em;
    fill: url(#tech-wordmark-fill);
    stroke: rgba(245, 247, 250, 0.96);
    stroke-width: 2.8;
    paint-order: stroke fill;
    filter: drop-shadow(0 0 16px rgba(245, 247, 250, 0.18));
}

.techtivity-logo__svg-wordmark--shine {
    fill: rgba(255, 255, 255, 0.16);
    stroke: rgba(255, 255, 255, 0);
    opacity: 0.72;
    animation: svg-shine 7s ease-in-out infinite;
}

.techtivity-logo__svg-subtitle {
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 600;
    letter-spacing: 0.34em;
    fill: rgba(245, 247, 250, 0.94);
    filter: drop-shadow(0 0 10px rgba(5, 8, 22, 0.6));
}

.techtivity-logo__metal {
    transform-origin: center;
}

.techtivity-logo__focus-plate {
    opacity: 1;
    pointer-events: none;
}

.techtivity-logo__signals {
    opacity: 0.68;
}

.techtivity-logo__particle {
    position: absolute;
    z-index: 1;
    height: 0.42rem;
    width: 0.42rem;
    border-radius: 9999px;
    background: radial-gradient(circle, rgba(248, 250, 252, 1), rgba(34, 211, 238, 0.75));
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.45);
    animation: orbit-speck 9s linear infinite;
}

.techtivity-logo__particle--1 { left: 12%; top: 22%; }
.techtivity-logo__particle--2 { right: 10%; top: 16%; animation-delay: 2s; }
.techtivity-logo__particle--3 { left: 16%; bottom: 20%; animation-delay: 4s; }
.techtivity-logo__particle--4 { right: 18%; bottom: 18%; animation-delay: 6s; }

.techtivity-logo--compact .techtivity-logo__particle,
.techtivity-logo--compact .techtivity-logo__ambient {
    opacity: 0.2;
}

.techtivity-logo--mark-only .techtivity-logo__brain {
    max-width: 15rem;
}

.techtivity-logo--minimal .techtivity-logo__ambient,
.techtivity-logo--minimal .techtivity-logo__particle {
    display: none;
}

/* ─── Context: top bar ────────────────────────────────────────────────── */

.site-header {
    position: relative;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: rgba(5, 8, 22, 0.72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.site-header::before {
    content: '';
    position: absolute;
    left: 8%;
    top: 50%;
    width: 18rem;
    height: 4rem;
    transform: translateY(-50%);
    background: radial-gradient(circle, rgba(34, 211, 238, 0.22), transparent 70%);
    filter: blur(42px);
    pointer-events: none;
}

.site-header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(77, 226, 255, 0.35), transparent);
    animation: header-energy 8s ease-in-out infinite;
}

.site-header__brand {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
}

.site-header__brand-link {
    display: inline-flex;
    text-decoration: none;
    color: inherit;
}

.site-header__status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-display);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(217, 247, 255, 0.82);
    white-space: nowrap;
}

.site-header__status-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: #4de2ff;
    box-shadow: 0 0 12px rgba(77, 226, 255, 0.65);
    animation: status-pulse 3.6s ease-in-out infinite;
}

@keyframes header-energy {
    0% { transform: translateX(-100%); opacity: 0.2; }
    50% { opacity: 1; }
    100% { transform: translateX(100%); opacity: 0.2; }
}

@keyframes status-pulse {
    0%, 100% { transform: scale(0.94); opacity: 0.72; }
    50% { transform: scale(1.08); opacity: 1; }
}

.site-header__logo {
    width: 13.5rem;
}

.site-header__brand .techtivity-logo--compact .techtivity-logo__ambient {
    opacity: 0.36;
}

.site-header__brand .techtivity-logo--compact .techtivity-logo__particle {
    opacity: 0.54;
}

.site-header__brand .techtivity-logo--compact .techtivity-logo__brain {
    max-width: 15rem;
    filter: drop-shadow(0 12px 26px rgba(0, 191, 255, 0.12));
}

.site-header__brand .techtivity-logo--compact .techtivity-logo__svg-wordmark {
    stroke-width: 2.4;
    filter: drop-shadow(0 0 10px rgba(245, 247, 250, 0.18));
}

.site-header__brand .techtivity-logo--compact .techtivity-logo__svg-subtitle {
    opacity: 0.86;
}

/* ─── Context: hero ───────────────────────────────────────────────────── */

.hero-stage__logo {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 14px 34px rgba(0, 191, 255, 0.08));
    animation: hero-logo-drift 8.4s ease-in-out infinite;
    transform-origin: center;
}

.hero-stage__logo .techtivity-logo__brain {
    animation-duration: 6.8s;
    filter:
        drop-shadow(0 22px 40px rgba(2, 8, 23, 0.18))
        drop-shadow(0 0 20px rgba(77, 226, 255, 0.08));
}

.hero-stage__logo .techtivity-logo__brain-geometry {
    animation-duration: 7.4s;
}

.hero-stage__logo .techtivity-logo__ambient {
    opacity: 0.34;
    filter: blur(28px);
}

.hero-stage__logo .techtivity-logo__particles circle {
    opacity: 0.68;
    animation-duration: 4.4s;
}

.hero-stage__logo .techtivity-logo__particle {
    opacity: 0.76;
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.36);
    animation-duration: 6.4s;
}

.hero-stage__logo .techtivity-logo__svg-wordmark--shine {
    animation-duration: 5.2s;
}

.hero-stage__logo .tech-line--primary,
.hero-stage__logo .tech-line--heavy {
    opacity: 0.96;
}

.hero-stage__logo .tech-node {
    filter: drop-shadow(0 0 7px rgba(77, 226, 255, 0.16));
}

/* ─── Context: footer ─────────────────────────────────────────────────── */

.footer-core__brand-logo {
    width: 15.2rem;
}

.footer-core__brand-logo.techtivity-logo--compact .techtivity-logo__brain,
.footer-core__brand-logo.techtivity-logo--compact .techtivity-logo__ambient,
.footer-core__brand-logo.techtivity-logo--compact .techtivity-logo__particle {
    display: none;
}

.footer-core__brand-logo.techtivity-logo--compact .techtivity-logo__content {
    padding: 0;
    filter: drop-shadow(0 10px 22px rgba(0, 191, 255, 0.08));
}

.footer-core__brain {
    position: absolute;
    right: -8%;
    top: -18%;
    width: min(72rem, 92vw);
    opacity: 0.12;
    filter: saturate(0.9) blur(0.2px);
    transform: rotate(-4deg);
}

/* ─── Context: galaxy watermark ─────────────────────────────────────────── */

.tb-galaxy-watermark .techtivity-logo {
    opacity: 0.95;
}

.tb-galaxy-watermark .techtivity-logo__brain {
    filter: drop-shadow(0 0 28px rgba(77, 226, 255, 0.12));
}

/* ─── Context: CTA panel ────────────────────────────────────────────────── */

.cta-panel__brain {
    position: absolute;
    pointer-events: none;
    right: -6%;
    bottom: -24%;
    width: min(52rem, 88vw);
    opacity: 0.16;
    transform: rotate(-6deg);
}

/* ─── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 1280px) {
    /* 1. Apagado y ocultación absoluta de AMBOS sistemas de partículas */
    .techtivity-logo__particles,
    .techtivity-logo__particles circle,
    .techtivity-logo__particle,
    [class*="techtivity-logo__particle--"],
    g.techtivity-logo__particles,
    svg[class*="particles"] {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transform: none !important;
        animation: none !important;
    }

    /* 2. Optimizar el fondo difuminado (ambient glows) para evitar retrasos de GPU */
    .techtivity-logo__ambient {
        filter: none !important;
        background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, rgba(0,0,0,0) 70%);
        animation: none !important;
    }

    /* 3. Desactivar animaciones infinitas en los vectores del cerebro, líneas y nodos */
    .techtivity-logo__brain,
    .techtivity-logo__brain-geometry,
    .techtivity-logo__network,
    .tech-line,
    .tech-node {
        animation: none !important;
        transform: none !important;
        filter: none !important;
    }

    /* 4. Mantener la mezcla de color normal para evitar sobrecarga de renderizado de píxeles */
    .techtivity-logo__network {
        mix-blend-mode: normal !important;
    }

    /* 5. Optimizar las letras y el brillo del Wordmark principal */
    .techtivity-logo__svg-wordmark--shine {
        animation: none !important;
        opacity: 0.8;
    }

    .techtivity-logo__focus-plate ellipse {
        filter: none !important;
        opacity: 0.4;
    }

    /* 6. Optimizar contenedores de cabeceras e interfaces externas si existen */
    .site-header {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .site-header__logo {
        width: 12.2rem;
    }

    .site-header::before {
        filter: none !important;
    }

    .site-header::after,
    .site-header__status-dot,
    .hero-stage__logo,
    .hero-stage__logo .techtivity-logo__brain,
    .hero-stage__logo .techtivity-logo__brain-geometry {
        animation: none !important;
        transform: none !important;
    }
}

@media (max-width: 640px) {
    .site-header__logo {
        width: 10.4rem;
    }

    .cta-panel__brain {
        right: -18%;
        width: min(34rem, 110vw);
    }

    .techtivity-logo__svg-wordmark {
        font-size: 144px;
    }

    .techtivity-logo__svg-subtitle {
        font-size: 26px;
        letter-spacing: 0.24em;
    }
}

/* ─── Keyframes ─────────────────────────────────────────────────────────── */

@keyframes data-flow {
    from {
        stroke-dashoffset: 0;
    }

    to {
        stroke-dashoffset: -104;
    }
}

@keyframes node-glint {
    0%,
    100% {
        opacity: 0.72;
        transform: scale(0.9);
    }

    40% {
        opacity: 1;
        transform: scale(1.18);
    }

    60% {
        opacity: 0.84;
        transform: scale(0.98);
    }
}

@keyframes particle-shift {
    0%,
    100% {
        opacity: 0.28;
        transform: translate3d(0, 0, 0) scale(0.92);
    }

    50% {
        opacity: 1;
        transform: translate3d(0, -8px, 0) scale(1.2);
    }
}

@keyframes svg-shine {
    0%,
    100% {
        opacity: 0.2;
        transform: translateX(26px);
    }

    40%,
    60% {
        opacity: 1;
        transform: translateX(-18px);
    }
}

@keyframes brain-breathe {
    0%,
    100% {
        transform: translateY(0) scale(0.992, 1);
    }

    50% {
        transform: translateY(-4px) scale(1.006, 1.018);
    }
}

@keyframes tech-breathe {
    0%,
    100% {
        transform: scale(0.92);
        opacity: 0.24;
    }

    50% {
        transform: scale(1.12);
        opacity: 0.46;
    }
}

@keyframes logo-float {
    0%,
    100% {
        transform: translate3d(0, 0, 0);
    }

    50% {
        transform: translate3d(0, -8px, 0);
    }
}

@keyframes hero-logo-drift {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(0, -7px, 0) scale(1.012);
    }
}

@keyframes orbit-speck {
    0% {
        transform: translate3d(0, 0, 0) scale(0.9);
        opacity: 0.3;
    }

    25% {
        transform: translate3d(8px, -12px, 0) scale(1.15);
        opacity: 0.8;
    }

    50% {
        transform: translate3d(0, -20px, 0) scale(0.95);
        opacity: 0.4;
    }

    75% {
        transform: translate3d(-10px, -8px, 0) scale(1.12);
        opacity: 0.9;
    }

    100% {
        transform: translate3d(0, 0, 0) scale(0.9);
        opacity: 0.3;
    }
}

/* ─── Mobile performance (≤768px): sin estrellas fugaces implícitas, −40% animación ─── */

@keyframes logo-float-mobile {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -4.8px, 0); }
}

@keyframes tech-breathe-mobile {
    0%, 100% { transform: scale(0.952); opacity: 0.288; }
    50% { transform: scale(1.072); opacity: 0.376; }
}

@keyframes brain-breathe-mobile {
    0%, 100% { transform: translateY(0) scale(0.995, 1); }
    50% { transform: translateY(-2.4px) scale(1.004, 1.011); }
}

@keyframes hero-logo-drift-mobile {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(0, -4.2px, 0) scale(1.007); }
}

@media (max-width: 768px) {
    .site-header__logo {
        width: 10.4rem;
    }
}

/* ─── Reduced motion ────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .techtivity-logo__ambient,
    .techtivity-logo__brain,
    .techtivity-logo__brain-geometry,
    .tech-line,
    .tech-node,
    .techtivity-logo__particles circle,
    .techtivity-logo__particle,
    .techtivity-logo__svg-wordmark--shine,
    .hero-stage__logo,
    .site-header::after,
    .site-header__status-dot {
        animation: none !important;
        opacity: 1;
        transform: none !important;
        transition: none !important;
    }
}
