/* 
// ===================================================================================================
// ## scroll-driven robotic arm
// =================================================================================================== 
*/

#robot-arm-stage {
    --flow-offset: 220px;
    --core-x: 0px;
    --core-y: 0px;
    --core-scale: 1;
    --orbit-rotate: 0deg;
    --orbit-rotate-alt: 0deg;
    --orbit-rotate-soft: 0deg;
    --node-left-x: 0px;
    --node-right-x: 0px;
    --node-top-y: 0px;
    --node-bottom-y: 0px;
    --packet-a-x: 0px;
    --packet-a-y: 0px;
    --packet-b-x: 0px;
    --packet-b-y: 0px;
    --packet-c-x: 0px;
    --packet-c-y: 0px;
    --status-x: 0px;
    --status-y: 0px;
    --scan-x: 0px;
    --scan-y: 0px;
    --network-glow: 0.52;
    --pointer-x: 50%;
    --pointer-y: 52%;

    width: clamp(420px, 42vw, 560px);
    min-width: min(420px, 100%);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.robot-panel {
    position: relative;
    overflow: hidden;
    min-height: clamp(400px, 38vw, 470px);
    border: 1px solid rgba(28, 28, 30, 0.08);
    border-radius: 8px;
    background:
        radial-gradient(circle at 50% 48%, rgba(255, 79, 1, 0.12), transparent 28%),
        radial-gradient(circle at 74% 28%, rgba(29, 29, 31, 0.08), transparent 22%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(245, 245, 247, 0.84)),
        linear-gradient(180deg, rgba(255, 79, 1, 0.035), transparent 46%),
        repeating-linear-gradient(90deg, rgba(29, 29, 31, 0.035) 0 1px, transparent 1px 42px),
        repeating-linear-gradient(0deg, rgba(29, 29, 31, 0.03) 0 1px, transparent 1px 42px);
    box-shadow: 0 28px 80px rgba(17, 17, 17, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.75);
    box-sizing: border-box;
}

.robot-panel::before {
    content: "";
    position: absolute;
    inset: 70px 24px 70px;
    pointer-events: none;
    border: 1px solid rgba(29, 29, 31, 0.06);
    border-radius: 8px;
    background:
        linear-gradient(90deg, transparent, rgba(255, 79, 1, 0.08), transparent),
        linear-gradient(180deg, transparent, rgba(29, 29, 31, 0.025));
    opacity: 0.7;
}

.robot-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.52), transparent 34%);
}

.robot-status-row {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    border: 1px solid rgba(28, 28, 30, 0.08);
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.78);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.robot-pointer-target {
    position: absolute;
    left: var(--pointer-x);
    top: var(--pointer-y);
    z-index: 3;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 79, 1, 0.24);
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.42);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.86);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.robot-pointer-target span,
.robot-pointer-target::before,
.robot-pointer-target::after {
    content: "";
    position: absolute;
    background-color: var(--horizon);
}

.robot-pointer-target span {
    width: 6px;
    height: 6px;
    border-radius: 999px;
}

.robot-pointer-target::before {
    width: 16px;
    height: 1px;
}

.robot-pointer-target::after {
    width: 1px;
    height: 16px;
}

#robot-arm-stage.is-pointer-driving .robot-pointer-target {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.robot-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background-color: var(--horizon);
    box-shadow: 0 0 0 5px rgba(255, 79, 1, 0.14);
    animation: robot-live 1.8s ease-in-out infinite;
}

.robot-arm-svg {
    position: absolute;
    inset: 18px 0 0;
    width: 100%;
    height: calc(100% - 18px);
    overflow: visible;
}

.console-backdrop rect {
    fill: rgba(255, 255, 255, 0.5);
    stroke: rgba(29, 29, 31, 0.08);
    stroke-width: 1;
}

.console-backdrop path {
    fill: none;
    stroke: rgba(29, 29, 31, 0.045);
    stroke-width: 1;
}

.console-links,
.control-beam,
.tech-core,
.tech-node,
.tech-status-panel,
.tech-packet {
    transform-box: view-box;
    transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.16s ease;
    will-change: transform;
}

.console-link {
    fill: none;
    stroke: url(#consoleLineGradient);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 10 12;
    stroke-dashoffset: var(--flow-offset);
    opacity: var(--network-glow);
    animation: tech-data-flow 6s linear infinite;
}

.control-beam {
    opacity: 0.96;
}

.beam-main {
    fill: none;
    stroke: rgba(29, 29, 31, 0.12);
    stroke-width: 1.2;
    stroke-linecap: round;
}

.beam-window {
    fill: url(#consoleBeamGradient);
    transform: translate(var(--scan-x), var(--scan-y));
    opacity: var(--network-glow);
    filter: url(#techGlow);
}

.beam-dot {
    fill: url(#consoleAccent);
    transform: translate(var(--scan-x), var(--scan-y));
    filter: url(#techGlow);
}

.tech-core {
    transform-origin: 260px 202px;
    transform: translate(var(--core-x), var(--core-y)) scale(var(--core-scale));
}

.core-shell {
    fill: url(#consoleSurface);
    stroke: rgba(255, 255, 255, 0.18);
    stroke-width: 1.2;
}

.core-screen {
    fill: rgba(255, 255, 255, 0.08);
    stroke: rgba(255, 255, 255, 0.16);
    stroke-width: 1;
}

.core-mark {
    fill: none;
    stroke: rgba(255, 255, 255, 0.58);
    stroke-width: 4;
    stroke-linecap: round;
}

.core-mark.small {
    stroke: var(--horizon);
    stroke-width: 3;
}

.core-pulse {
    fill: var(--horizon);
    filter: url(#techGlow);
    animation: console-pulse 2.4s ease-in-out infinite;
}

.tech-core text,
.tech-node text,
.tech-status-panel text {
    font-family: var(--redhat);
    pointer-events: none;
}

.tech-core-title {
    font-size: 13px;
    font-weight: var(--bold);
    text-anchor: middle;
    fill: var(--terra);
}

.tech-core-subtitle {
    font-size: 8px;
    font-weight: var(--semibold);
    letter-spacing: 0.06em;
    text-anchor: middle;
    text-transform: uppercase;
    fill: rgba(29, 29, 31, 0.48);
}

.tech-packet {
    fill: var(--horizon);
    opacity: 0.92;
    filter: drop-shadow(0 0 10px rgba(255, 79, 1, 0.52));
}

.packet-a {
    transform: translate(var(--packet-a-x), var(--packet-a-y));
}

.packet-b {
    transform: translate(var(--packet-b-x), var(--packet-b-y));
}

.packet-c {
    transform: translate(var(--packet-c-x), var(--packet-c-y));
}

.node-robot { transform: translate(var(--node-left-x), var(--node-top-y)); }
.node-print { transform: translate(var(--node-right-x), var(--node-top-y)); }
.node-web { transform: translate(var(--node-left-x), var(--node-bottom-y)); }
.node-video { transform: translate(var(--node-right-x), var(--node-bottom-y)); }

.module-card {
    fill: rgba(255, 255, 255, 0.82);
    stroke: rgba(29, 29, 31, 0.08);
    stroke-width: 1;
}

.module-device {
    fill: rgba(255, 255, 255, 0.78);
    stroke: rgba(29, 29, 31, 0.1);
    stroke-width: 1;
}

.module-icon,
.module-bar {
    fill: none;
    stroke: rgba(29, 29, 31, 0.38);
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.module-bar {
    stroke: var(--horizon);
    stroke-width: 2;
    opacity: 0.56;
}

.module-title {
    font-size: 13px;
    font-weight: var(--bold);
    text-anchor: start;
    fill: var(--terra);
}

.module-meta {
    font-size: 8px;
    font-weight: var(--semibold);
    letter-spacing: 0.06em;
    text-anchor: start;
    fill: rgba(29, 29, 31, 0.46);
}

.tech-status-panel {
    transform: translate(0, var(--status-y));
}

.tech-status-panel rect {
    fill: rgba(255, 255, 255, 0.76);
    stroke: rgba(29, 29, 31, 0.08);
    stroke-width: 1;
}

.tech-status-panel path {
    fill: none;
    stroke: rgba(29, 29, 31, 0.16);
    stroke-width: 2.6;
    stroke-linecap: round;
}

.tech-status-panel .tech-scan {
    stroke: var(--horizon);
    stroke-width: 2;
    transform: translate(var(--status-x), 0);
    opacity: 0.72;
}

.tech-status-panel text {
    font-size: 8px;
    font-weight: var(--bold);
    text-anchor: middle;
    fill: rgba(29, 29, 31, 0.46);
}

.tech-panel-dot {
    fill: var(--horizon);
    transform: translate(var(--status-x), 0);
    animation: robot-live 1.9s ease-in-out infinite;
}

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

.robot-grid path {
    fill: none;
    stroke: rgba(29, 29, 31, 0.045);
    stroke-width: 1;
}

.robot-rail path {
    fill: none;
    stroke: rgba(29, 29, 31, 0.2);
    stroke-width: 5;
    stroke-linecap: round;
}

.robot-rail path + path {
    stroke-width: 1.4;
    stroke: rgba(29, 29, 31, 0.1);
}

.robot-rail circle {
    fill: rgba(29, 29, 31, 0.22);
}

.robot-motion-path {
    fill: none;
    stroke: rgba(255, 79, 1, 0.44);
    stroke-width: 2.5;
    stroke-dasharray: 420;
    stroke-dashoffset: var(--path-offset);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.16s ease;
}

.robot-pulse {
    fill: var(--horizon);
    opacity: 0.9;
    transform: translate(var(--pulse-x), var(--pulse-y));
    filter: drop-shadow(0 0 10px rgba(255, 79, 1, 0.46));
}

.robot-base ellipse,
.robot-base rect,
.robot-base circle,
.robot-base path,
.robot-link-primary,
.robot-tool {
    fill: url(#armMetal);
    stroke: rgba(29, 29, 31, 0.18);
    stroke-width: 1.35;
    filter: drop-shadow(0 10px 16px rgba(29, 29, 31, 0.12));
}

.robot-base-shadow {
    fill: rgba(29, 29, 31, 0.16);
    stroke: none;
    filter: blur(0.2px);
}

.robot-base-plate,
.robot-base-block {
    fill: url(#armBase);
    stroke: rgba(29, 29, 31, 0.18);
}

.robot-base-ring,
.robot-joint-ring {
    fill: rgba(255, 255, 255, 0.78);
    stroke: rgba(29, 29, 31, 0.12);
    stroke-width: 1.2;
}

.robot-base-detail,
.robot-cable {
    fill: none;
    stroke: rgba(29, 29, 31, 0.28);
    stroke-width: 4;
    stroke-linecap: round;
}

.robot-cable {
    stroke-width: 3;
    stroke: rgba(29, 29, 31, 0.18);
}

.robot-link-secondary {
    fill: rgba(29, 29, 31, 0.12);
    stroke: rgba(255, 255, 255, 0.44);
    stroke-width: 0.8;
}

.robot-link-primary {
    fill: url(#armMetal);
}

.robot-link-slot {
    fill: rgba(29, 29, 31, 0.12);
    stroke: rgba(255, 255, 255, 0.5);
    stroke-width: 0.8;
}

.robot-link-highlight {
    fill: rgba(255, 255, 255, 0.72);
}

.robot-joint {
    fill: rgba(255, 255, 255, 0.96);
    stroke: rgba(29, 29, 31, 0.2);
    stroke-width: 1.55;
    filter: drop-shadow(0 10px 14px rgba(29, 29, 31, 0.12));
}

.robot-joint-core,
.robot-root-joint + .robot-joint-core {
    fill: url(#armAccent);
}

.robot-bolt {
    fill: rgba(29, 29, 31, 0.24);
    stroke: rgba(255, 255, 255, 0.58);
    stroke-width: 0.7;
}

.robot-tool {
    fill: url(#armCarbon);
    stroke: rgba(255, 255, 255, 0.18);
}

.robot-tool-panel {
    fill: rgba(255, 255, 255, 0.08);
    stroke: rgba(255, 255, 255, 0.12);
    stroke-width: 0.8;
}

.robot-tool-light {
    fill: var(--horizon);
    opacity: var(--tool-glow);
}

.robot-gripper-neck {
    fill: url(#armCarbon);
    stroke: rgba(255, 255, 255, 0.18);
    stroke-width: 1;
}

.robot-gripper-pivot {
    fill: rgba(255, 255, 255, 0.94);
    stroke: rgba(29, 29, 31, 0.2);
    stroke-width: 1.3;
    filter: drop-shadow(0 7px 10px rgba(29, 29, 31, 0.16));
}

.robot-gripper-core,
.robot-claw-rivet {
    fill: var(--horizon);
}

.robot-claw-link {
    fill: none;
    stroke: #151619;
    stroke-width: 6.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 5px 8px rgba(29, 29, 31, 0.18));
}

.robot-claw-pad {
    fill: none;
    stroke: #111216;
    stroke-width: 7.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.robot-claw-rivet {
    stroke: rgba(255, 255, 255, 0.5);
    stroke-width: 0.8;
}

.robot-claw-upper {
    transform-origin: 474px 146px;
    transform: rotate(var(--finger-upper));
}

.robot-claw-lower {
    transform-origin: 474px 146px;
    transform: rotate(var(--finger-lower));
}

.robot-arm,
.robot-shoulder,
.robot-elbow,
.robot-wrist,
.robot-claw,
.robot-target,
.robot-pulse,
.robot-scan,
.robot-claw-upper,
.robot-claw-lower {
    transform-box: view-box;
    transition: transform 0.14s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.14s ease;
    will-change: transform;
}

.robot-shoulder {
    transform-origin: 172px 278px;
    transform: rotate(var(--shoulder));
}

.robot-elbow {
    transform-origin: 176px 131px;
    transform: rotate(var(--elbow));
}

.robot-wrist {
    transform-origin: 324px 140px;
    transform: rotate(var(--wrist));
}

.robot-claw {
    transform-origin: 466px 146px;
    transform: rotate(var(--claw));
}

.robot-target {
    transform: translateY(var(--target-lift));
}

.robot-target rect {
    fill: #ffffff;
    stroke: rgba(29, 29, 31, 0.12);
}

.robot-target path {
    stroke: rgba(29, 29, 31, 0.24);
    stroke-width: 4;
    stroke-linecap: round;
}

.robot-target .robot-scan {
    stroke: var(--horizon);
    stroke-width: 2;
    opacity: 0.58;
    transform: translateY(var(--scan-y));
}

.robot-target circle {
    fill: var(--horizon);
}

.robot-target-dot {
    animation: robot-live 2s ease-in-out infinite;
}

.robot-metrics {
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 2;
    display: flex;
    gap: 10px;
}

.robot-metrics > div {
    min-width: 92px;
    padding: 10px 12px;
    border: 1px solid rgba(28, 28, 30, 0.08);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.78);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.robot-metric-label,
.robot-metric-value {
    display: block;
    font-family: var(--redhat);
}

.robot-metric-label {
    font-size: var(--h5);
    color: var(--gray);
}

.robot-metric-value {
    margin-top: 2px;
    font-size: var(--h4o3);
    font-weight: var(--bold);
    color: var(--terra);
}

.robot-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.robot-steps span {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 36px;
    border: 1px solid rgba(28, 28, 30, 0.08);
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.7);
    font-family: var(--redhat);
    font-size: var(--h5);
    font-weight: var(--semibold);
    color: var(--gray);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.robot-steps span.active {
    border-color: rgba(255, 79, 1, 0.34);
    background-color: rgba(255, 79, 1, 0.1);
    color: var(--horizon);
}

.process-strip {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin-top: 40px;
    border: 1px solid var(--white-2);
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--white-2);
}

.process-item {
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    background-color: rgba(255, 255, 255, 0.84);
}

.process-item .lucide {
    width: 30px;
    height: 30px;
    color: var(--horizon);
}

.process-item span {
    font-family: var(--redhat);
    font-size: var(--h4o3);
    font-weight: var(--bold);
    color: var(--terra);
}

@media (prefers-reduced-motion: reduce) {
    .robot-arm,
    .robot-shoulder,
    .robot-elbow,
    .robot-wrist,
    .robot-claw,
    .robot-target,
    .robot-pulse,
    .robot-scan,
    .robot-claw-upper,
    .robot-claw-lower,
    .tech-link,
    .tech-core-halo,
    .tech-panel-dot {
        transition: none;
        animation: none;
    }
}

@keyframes tech-data-flow {
    to {
        stroke-dashoffset: calc(var(--flow-offset) - 208px);
    }
}

@keyframes tech-orbit-spin {
    to {
        stroke-dashoffset: -96;
    }
}

@keyframes robot-live {
    0%, 100% {
        opacity: 0.55;
    }
    50% {
        opacity: 1;
    }
}
