.name-box {
    position: relative;
    border: none;
    padding: 0;
    text-align: center;
    background-color: var(--border-color);
    clip-path: var(--large-oct-clip);
    height: var(--name-box-height);
    overflow: hidden;
    width: fit-content;
    min-width: 325px; /* Increased minimum width to accommodate longer text */
    margin-left: auto;
    margin-right: auto;
}

/* Pseudo-element for border effect */
.name-box::before {
    content: '';
    position: absolute;
    top: var(--border-width);
    left: var(--border-width);
    right: var(--border-width);
    bottom: var(--border-width);
    background-color: var(--bg-color);
    z-index: -1;
    /* Calculate inset octagonal shape */
    clip-path: var(--large-inset-oct-clip);
}

/* Scrolling text items */
.text-item {
    height: var(--item-height);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap; /* Prevent text wrapping */
    padding: 0 20px; /* Add some padding to prevent text from touching edges */
}

@keyframes scrollText {
    0% {
        transform: translateY(calc(var(--item-height) * -1));
    }
    100% {
        transform: translateY(calc(var(--item-height) * -3)); /* Scroll through both names */
    }
}

.name-box-mobile {
    font-size: 0.8em;
    position: relative;
    height: 40px;
    overflow: hidden;
    width: 170px;
}

/* Mobile text items */
.text-item-mobile {
    height: var(--mobile-item-height);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-size: 1rem;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-weight: 600;
    color: var(--text-color);
}

@keyframes scrollTextMobile {
    0% {
        transform: translateY(calc(var(--mobile-item-height) * -1));
    }
    100% {
        transform: translateY(calc(var(--mobile-item-height) * -3)); /* Scroll through both names */
    }
}

@media (max-width: 768px) {
    .name-box {
        display: none; /* Hide desktop name box on mobile */
    }
}