/* ============================================
   TheSign Systems — Visual Enhancement CSS
   SVG Graphics, Charts, Animated Elements
   ============================================ */

/* --- Hero Enhanced --- */
.hero-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: grid-drift 20s linear infinite;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 70%);
}

@keyframes grid-drift {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(60px, 60px);
    }
}

/* --- SVG Visual Containers --- */
.svg-visual {
    width: 100%;
    height: 100%;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.svg-visual svg {
    width: 100%;
    height: auto;
    max-height: 400px;
}

/* --- Animated Neural Network --- */
@keyframes node-pulse {

    0%,
    100% {
        r: 4;
        opacity: 0.8;
    }

    50% {
        r: 6;
        opacity: 1;
    }
}

@keyframes connection-flow {
    0% {
        stroke-dashoffset: 20;
    }

    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes data-flow {
    0% {
        offset-distance: 0%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        offset-distance: 100%;
        opacity: 0;
    }
}

/* --- Chart Animations --- */
@keyframes bar-grow {
    from {
        transform: scaleY(0);
    }

    to {
        transform: scaleY(1);
    }
}

@keyframes line-draw {
    from {
        stroke-dashoffset: 1000;
    }

    to {
        stroke-dashoffset: 0;
    }
}

@keyframes circle-fill {
    from {
        stroke-dashoffset: 314;
    }

    to {
        stroke-dashoffset: var(--target-offset, 100);
    }
}

@keyframes fade-up-stagger {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Metric Gauges --- */
.gauge-container {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
    padding: 40px 0;
}

.gauge {
    text-align: center;
    position: relative;
}

.gauge svg {
    width: 120px;
    height: 120px;
    transform: rotate(-90deg);
}

.gauge-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 6;
}

.gauge-fill {
    fill: none;
    stroke: url(#gaugeGradient);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 314;
    animation: circle-fill 2s ease-out forwards;
}

.gauge-label {
    margin-top: 12px;
}

.gauge-value {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-accent);
}

.gauge-text {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* --- Visual Cards with Graphics --- */
.visual-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

.visual-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-4px);
}

.visual-card-graphic {
    height: 200px;
    background: var(--bg-tertiary);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.visual-card-graphic svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.visual-card-body {
    padding: 24px;
}

/* --- Architecture Diagram Styles --- */
.arch-diagram {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    margin: 40px 0;
    overflow-x: auto;
}

.arch-diagram svg {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Data Chart Container --- */
.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 32px;
}

.chart-container h4 {
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.chart-container svg {
    width: 100%;
    height: auto;
}

/* --- Enhanced Feature Visual --- */
.feature-visual-enhanced {
    aspect-ratio: 4/3;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    overflow: hidden;
    position: relative;
}

.feature-visual-enhanced svg {
    width: 100%;
    height: 100%;
}

/* --- Blog Card with generated thumbnails --- */
.blog-thumbnail {
    width: 100%;
    height: 100%;
    position: relative;
}

.blog-thumbnail svg {
    width: 100%;
    height: 100%;
}

/* --- Process flow visualization --- */
.process-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 40px 0;
    overflow-x: auto;
}

.process-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 160px;
    position: relative;
}

.process-step-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent-dim);
    border: 2px solid var(--border-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    position: relative;
    z-index: 2;
}

.process-step-icon svg {
    width: 28px;
    height: 28px;
}

.process-step h5 {
    font-size: var(--text-sm);
    font-weight: 600;
    margin-bottom: 4px;
}

.process-step p {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    max-width: 140px;
}

.process-arrow {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--border-accent), transparent);
    margin-bottom: 40px;
    position: relative;
}

.process-arrow::after {
    content: '';
    position: absolute;
    right: 0;
    top: -3px;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-accent);
    border-top: 2px solid var(--text-accent);
    transform: rotate(45deg);
}

/* --- Tech Stack Icons Row --- */
.tech-stack {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 32px 0;
    flex-wrap: wrap;
}

.tech-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.5;
    transition: var(--transition);
}

.tech-item:hover {
    opacity: 1;
}

.tech-item svg {
    width: 40px;
    height: 40px;
}

.tech-item span {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

/* --- Orbit Animation for Labs --- */
.orbit-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto;
}

.orbit-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    box-shadow: 0 0 40px var(--accent-glow);
}

.orbit-ring {
    position: absolute;
    border: 1px solid rgba(0, 229, 255, 0.1);
    border-radius: 50%;
    top: 50%;
    left: 50%;
}

.orbit-ring-1 {
    width: 160px;
    height: 160px;
    margin: -80px 0 0 -80px;
    animation: orbit-spin 12s linear infinite;
}

.orbit-ring-2 {
    width: 240px;
    height: 240px;
    margin: -120px 0 0 -120px;
    animation: orbit-spin 18s linear infinite reverse;
}

.orbit-ring-3 {
    width: 300px;
    height: 300px;
    margin: -150px 0 0 -150px;
    animation: orbit-spin 24s linear infinite;
}

.orbit-node {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

.orbit-ring-1 .orbit-node {
    top: -5px;
    left: 50%;
    margin-left: -5px;
}

.orbit-ring-2 .orbit-node {
    top: 50%;
    right: -5px;
    margin-top: -5px;
}

.orbit-ring-3 .orbit-node {
    bottom: -5px;
    left: 50%;
    margin-left: -5px;
}

@keyframes orbit-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* --- Horizontal Scroll Showcase --- */
.showcase-scroll {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding: 24px 0;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.showcase-scroll::-webkit-scrollbar {
    display: none;
}

.showcase-item {
    min-width: 320px;
    scroll-snap-align: start;
    flex-shrink: 0;
}

/* --- Logo Grid (Partners/Tech) --- */
.logo-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.logo-grid-item {
    background: var(--bg-card);
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.logo-grid-item:hover {
    background: var(--bg-card-hover);
}

.logo-grid-item svg {
    width: 80px;
    height: 40px;
    opacity: 0.4;
    transition: var(--transition);
}

.logo-grid-item:hover svg {
    opacity: 0.7;
}

/* --- Responsive adjustments for visuals --- */
@media (max-width: 768px) {
    .gauge-container {
        gap: 24px;
    }

    .process-flow {
        flex-direction: column;
        gap: 16px;
    }

    .process-arrow {
        width: 2px;
        height: 30px;
        margin-bottom: 0;
        background: linear-gradient(180deg, var(--border-accent), transparent);
    }

    .process-arrow::after {
        right: -3px;
        top: auto;
        bottom: 0;
        transform: rotate(135deg);
    }

    .logo-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .orbit-container {
        width: 220px;
        height: 220px;
    }

    .orbit-ring-3 {
        width: 220px;
        height: 220px;
        margin: -110px 0 0 -110px;
    }
}

@media (max-width: 480px) {
    .logo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Animated counter --- */
.counter {
    font-variant-numeric: tabular-nums;
}

/* --- Dotted connector line --- */
.connector-line {
    border-left: 2px dashed rgba(0, 229, 255, 0.15);
    height: 60px;
    margin: 0 auto;
    width: 0;
}